From 3d12b05477d1ac532be2567bc00eb8ed035efecf Mon Sep 17 00:00:00 2001 From: Julien Gouesse Date: Sat, 15 Apr 2023 18:51:11 +0200 Subject: Moves the task to publish the Maven artifact into the subproject level --- build.gradle | 61 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/build.gradle b/build.gradle index 39085a0..96ab6df 100644 --- a/build.gradle +++ b/build.gradle @@ -91,43 +91,42 @@ artifacts.archives packageSources testImplementation group: 'junit', name: 'junit', version:'4.13.2' testImplementation group: 'org.easymock', name: 'easymock', version:'5.1.0' } - -} -// SSH upload with Ant: https://blog.mrhaki.com/2009/12/gradle-goodness-using-optional-ant-task.html -configurations { - sshAntTask -} + // SSH upload with Ant: https://blog.mrhaki.com/2009/12/gradle-goodness-using-optional-ant-task.html + configurations { + sshAntTask + } -repositories { - mavenCentral() -} + repositories { + mavenCentral() + } -dependencies { - sshAntTask 'org.apache.ant:ant-jsch:1.10.13', 'com.jcraft:jsch:0.1.55' -} + dependencies { + sshAntTask 'org.apache.ant:ant-jsch:1.10.13', 'com.jcraft:jsch:0.1.55' + } -tasks.register('publishToJogAmpMavenArdor3d') { - description = 'Publishes all Maven publications produced by this project to the remote JogAmp Maven repository.' - group = "Publishing" + tasks.register('publishToJogAmpMavenArdor3d') { + description = 'Publishes all Maven publications produced by this project to the remote JogAmp Maven repository.' + group = "Publishing" - def passphrase = project.property('JogAmpScpPassword') + def passphrase = project.property('JogAmpScpPassword') - // Redefines scp Ant task, with the classpath property set to our newly defined sshAntTask configuration classpath. - ant.taskdef(name: 'scp', classname: 'org.apache.tools.ant.taskdefs.optional.ssh.Scp', + // Redefines scp Ant task, with the classpath property set to our newly defined sshAntTask configuration classpath. + ant.taskdef(name: 'scp', classname: 'org.apache.tools.ant.taskdefs.optional.ssh.Scp', classpath: configurations.sshAntTask.asPath) - doLast { - // Invokes the scp Ant task. (Use gradle -i to see the output of the Ant task.) - ant.scp(todir: 'jgouesse@jogamp.org:/srv/www/jogamp.org/deployment/maven-ardor3d/org/jogamp/ardor3d', - keyfile: '${user.home}/.ssh/id_rsa', - passphrase: passphrase as String, - sftp: 'false', - trust: 'true', - verbose: 'true') { - fileset(dir: '${user.home}/.m2/repository/org/jogamp/ardor3d') { - include(name: '**/**') - } - } - } + doLast { + // Invokes the scp Ant task. (Use gradle -i to see the output of the Ant task.) + ant.scp(todir: 'jgouesse@jogamp.org:/srv/www/jogamp.org/deployment/maven-ardor3d/org/jogamp/ardor3d/' + project.getName(), + keyfile: '${user.home}/.ssh/id_rsa', + passphrase: passphrase as String, + sftp: 'false', + trust: 'true', + verbose: 'true') { + fileset(dir: '${user.home}/.m2/repository/org/jogamp/ardor3d/' + project.getName()) { + include(name: '**/**') + } + } + } + } } -- cgit v1.2.3