I'm moving to Android Studio so I'm migrating my existing ANT build process to Gradle. I'm new to Gradle though, so I'm hitting some issues in the process.
My current ANT script deploys my APK to a server using the scp task. I'd like for my Gradle script to do the same, but when I attempt to use the scp task in my Gradle script I receive the following error message:
Error:(58, 0) Problem: failed to create task or type scp Cause: the class org.apache.tools.ant.taskdefs.optional.ssh.Scp was not found. This looks like one of Ant's optional components. Action: Check that the appropriate optional JAR exists in -ANT_HOME/lib -the IDE Ant configuration dialogs
Do not panic, this is a common problem. The commonest cause is a missing JAR.
This is not a bug; it is a configuration problem
When I go to my ANT_HOME/lib directory, ant-jsch.jar is already there.
How can I use the ant scp task in my Gradle build script for Android?
Thanks for your help!
Edit to add existing ANT script
<!-- Deploy to server -->
<target name="deployAPK">
<input
addproperty="userName"
message="Username for ${serverName}: " />
<exec executable="scp" >
<arg value="${out.absolute.dir}/${fileName}" />
<arg value="${userName}@${serverName}:${deployDirectory}" />
</exec>
</target>
ANT Dependency After further research, it seems that Gradle uses its own instance of ANT. This would explain why the ant-jsch.jar in my ANT_HOME isn't used, but I'm still not having any luck adding it to my dependencies.