diff options
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | build.gradle | 40 |
2 files changed, 41 insertions, 2 deletions
@@ -5,4 +5,5 @@ target/ .settings/ .project .classpath -ardorSettings.properties
\ No newline at end of file +ardorSettings.properties +gradle.properties diff --git a/build.gradle b/build.gradle index a5a7e52..465194d 100644 --- a/build.gradle +++ b/build.gradle @@ -89,6 +89,44 @@ artifacts.archives packageSources dependencies { 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 +} + +repositories { + mavenCentral() +} + +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" + + 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', + classpath: configurations.sshAntTask.asPath) + + doLast { + // Invokes the scp Ant task. (Use gradle -i to see the output of the Ant task.) + ant.scp(todir: '[email protected]:/srv/www/jogamp.org/deployment/maven-ardor3d/org/jogamp/', + keyfile: '${user.home}/.ssh/id_rsa', + passphrase: passphrase as String, // Use phassphrase entered by the user. + sftp: 'false', + trust: 'true', + verbose: 'true') { + fileset(dir: '${user.home}/.m2/repository/org/jogamp/ardor3d') { + include(name: '**/**') + } + } + } +} |