summaryrefslogtreecommitdiff
path: root/build.gradle
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2016-01-27 23:38:13 +0100
committerYves Fischer <yvesf-git@xapek.org>2016-01-27 23:38:13 +0100
commitebd3589490fbb88dd0c259c67ca96400edebea49 (patch)
treea5ab9e39e3fc8198b70cb82be32a621930bf0e92 /build.gradle
parentc51e3b091aa93726534ee1a5ee0df8ad9277b1b9 (diff)
downloaddebian-packages-ebd3589490fbb88dd0c259c67ca96400edebea49.tar.gz
debian-packages-ebd3589490fbb88dd0c259c67ca96400edebea49.zip
update gradle configuration
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle118
1 files changed, 62 insertions, 56 deletions
diff --git a/build.gradle b/build.gradle
index 2fdd2d4..23fd73c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,78 +1,84 @@
buildscript {
- repositories {
- mavenLocal()
- mavenCentral()
- }
- dependencies {
- classpath 'org.xapek.yvesf:gradle-download-task:0.1-SNAPSHOT'
- }
+ repositories {
+ mavenLocal()
+ mavenCentral()
+ }
+ dependencies {
+ classpath 'org.xapek.yvesf:gradle-download-task:0.1-SNAPSHOT'
+ }
}
plugins {
- id "nebula.ospackage" version "3.2.0"
+ id "nebula.ospackage" version "3.2.0"
}
ext {
- sshKeyfile = new File(System.getProperty('user.home'), '.ssh/id_rsa')
- sshKnownHosts = new File(System.getProperty('user.home'), '.ssh/known_hosts')
- sshUser = 'yvesf'
- sshHost = 'xapek.org'
- sshTargetDir = 'public_html/public/debian/files'
- sshRebuildCommand = 'cd public_html/public/debian && make'
+ sshKeyfile = new File(System.getProperty('user.home'), '.ssh/id_rsa')
+ sshKnownHosts = new File(System.getProperty('user.home'), '.ssh/known_hosts')
+ sshUser = 'yvesf'
+ sshHost = 'xapek.org'
+ sshTargetDir = 'public_html/public/debian/files'
+ sshRebuildCommand = 'cd public_html/public/debian && make'
}
allprojects {
- configurations {
- sshAntTask
- }
+ configurations {
+ sshAntTask
+ }
- repositories {
- mavenLocal()
- mavenCentral()
- }
+ repositories {
+ mavenLocal()
+ mavenCentral()
+ }
- dependencies {
- sshAntTask 'org.apache.ant:ant-jsch:1.9.2'
- }
+ dependencies {
+ sshAntTask 'org.apache.ant:ant-jsch:1.9.2'
+ }
}
-task rebuildRepositoryIndex() << {
- ant.taskdef(
- name: 'ssh',
- classname: 'org.apache.tools.ant.taskdefs.optional.ssh.SSHExec',
- classpath: configurations.sshAntTask.asPath)
+def rebuildRepositoryIndex = tasks.create('rebuildRepositoryIndex')
+rebuildRepositoryIndex << {
+ ant.taskdef(
+ name: 'antSsh',
+ classname: 'org.apache.tools.ant.taskdefs.optional.ssh.SSHExec',
+ classpath: configurations.sshAntTask.asPath)
- ant.ssh(host: sshHost,
- username: sshUser,
- keyfile: file(sshKeyfile),
- knownhosts: file(sshKnownHosts),
- command: sshRebuildCommand,
- verbose: true)
+ ant.antSsh(
+ host: sshHost,
+ username: sshUser,
+ keyfile: file(sshKeyfile),
+ knownhosts: file(sshKnownHosts),
+ command: sshRebuildCommand,
+ verbose: true)
}
subprojects {
- group 'org.xapek.yvesf.debian'
- version '1.0-SNAPSHOT'
+ group 'org.xapek.yvesf.debian'
+ version '1.0-SNAPSHOT'
- apply plugin: 'nebula.ospackage'
+ apply plugin: 'nebula.ospackage'
- def buildDeb = project.getTasks().getByName('buildDeb')
- task upload() << {
- ant.taskdef(
- name: 'scp',
- classname: 'org.apache.tools.ant.taskdefs.optional.ssh.Scp',
- classpath: configurations.sshAntTask.asPath)
+ ant.taskdef(
+ name: 'antScp',
+ classname: 'org.apache.tools.ant.taskdefs.optional.ssh.Scp',
+ classpath: configurations.sshAntTask.asPath)
- ant.scp(file: new File(project.buildDir, "distributions/${buildDeb.assembleArchiveName()}"),
- todir: "${sshUser}@${sshHost}:${sshTargetDir}",
- keyfile: file(sshKeyfile),
- knownhosts: file(sshKnownHosts),
- verbose: true)
- }
- upload.dependsOn(buildDeb)
+ ospackage {
+ version = "${project.version}-${new Date().format("yyyyMMdd-HHmmss")}"
+ user = 'root'
+ }
- ospackage {
- release new Date().format("yyyyMMdd-HHmmss")
- user = 'root'
- }
-}
+ def buildDeb = project.getTasks().getByName('buildDeb')
+
+ def upload = tasks.create('upload')
+ upload << {
+ ant.antScp(
+ file: buildDeb.archivePath,
+ todir: "${sshUser}@${sshHost}:${sshTargetDir}",
+ keyfile: file(sshKeyfile),
+ knownhosts: file(sshKnownHosts),
+ verbose: true)
+ }
+ upload.group = 'build'
+ upload.dependsOn(buildDeb)
+} \ No newline at end of file