Skip to content

Commit

Permalink
Added support for distribution packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
benfortuna committed Jan 28, 2017
1 parent 83573e3 commit a952b32
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build.gradle
Expand Up @@ -5,6 +5,7 @@ buildscript {

dependencies {
classpath group: 'pl.allegro.tech.build', name: 'axion-release-plugin', version: '1.4.0'
classpath 'org.hidetake:gradle-ssh-plugin:1.1.3'
}
}

Expand All @@ -18,6 +19,7 @@ apply plugin: 'jacoco'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'pl.allegro.tech.build.axion-release'
apply from: 'gradle/dist.gradle'

sourceCompatibility = 1.6
targetCompatibility = 1.6
Expand Down
56 changes: 56 additions & 0 deletions gradle/dist.gradle
@@ -0,0 +1,56 @@
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.hidetake:gradle-ssh-plugin:1.1.3'
}
}

apply plugin: 'distribution'
apply plugin: 'org.hidetake.ssh'

distributions {
main {
contents {
from { ['README.md', 'LICENSE', 'AUTHORS', 'CHANGELOG', 'build/docs', 'build/libs'] }
}
}
}

distTar {
compression = Compression.GZIP
}

remotes {
sourceforge {
host = 'frs.sourceforge.net'
user = 'fortuna'
identity = file("${System.getProperty('user.home')}/.ssh/id_rsa")
}
sourceforge_shell {
host = 'shell.sourceforge.net'
user = 'fortuna'
identity = file("${System.getProperty('user.home')}/.ssh/id_rsa")
}
sourceforge_shell_create {
host = 'shell.sourceforge.net'
user = 'fortuna,ical4j'
identity = file("${System.getProperty('user.home')}/.ssh/id_rsa")
}
}

task uploadDist(dependsOn: 'assembleDist') << {
ssh.run {
session(remotes.sourceforge_shell_create) {
execute "create"
}
session(remotes.sourceforge_shell) {
execute "mkdir -p /home/frs/project/ical4j/$project.name/$project.version"
}
session(remotes.sourceforge) {
put "$buildDir/distributions/$project.name-${project.version}.zip", "/home/frs/project/ical4j/$project.name/$project.version"
put "$buildDir/distributions/$project.name-${project.version}.tgz", "/home/frs/project/ical4j/$project.name/$project.version"
}
}
}

0 comments on commit a952b32

Please sign in to comment.