I am trying build and deploy adapters from my ant build.xml on to MobileFirst Server,but when i am trying to access the below lines of code in ant.It throws me an error.
<Deploy application
I believe your resource
value is incorrect.
Try changing:
<taskdef resource="com/worklight/ant/builders/defaults.properties">
To:
<taskdef resource="com/worklight/ant/defaults.properties">
I have tested with the below script and it worked for me:
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="target-name">
<taskdef resource="com/worklight/ant/defaults.properties">
<classpath>
<pathelement location="/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/ant-tools/worklight-ant-builder.jar"/>
</classpath>
</taskdef>
<target name="target-name">
<app-builder
worklightserverhost="http://my-ip-address:10080"
applicationFolder="/Users/idanadar/Documents/MobileFirst/Eclipses/workspaces/6300/my-project-name/apps/my-app-name"
environments="common,iphone"
nativeProjectPrefix="my-project-name"
outputFolder="/Users/idanadar/Desktop"/>
</target>
</project>
Note: The path to the builder .jar file should be as stated in the documentation, however for me at least I received the same error unless using the same path as mentioned in the question.
Deploy adapter
Try with the below template (change the required values with your own):
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="target-name">
<taskdef resource="com/worklight/ant/deployers/antlib.xml">
<classpath>
<!-- Change this to the path of the worklight-ant-deployer.jar available in the
server installation folder -->
<pathelement location="/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/worklight-ant-deployer.jar"/>
</classpath>
</taskdef>
<target name="target-name">
<!-- if your console is secure, remove the 'secure="false"' attribute -->
<wladm url="my-ip-address:10080/worklightadmin" secure="false" user="admin" password="admin">
<deploy-adapter runtime="my-project-name" file="my-adapter-name.adapter"/>
</wladm>
</target>
</project>