2 days ago i asked about building android apps from cli, someone recomended Gradle for building it and it worked.
Now i was trying to do same thing in Blackberry, Is there a tool as Gradle in BlackBerry? where i could build,change package name and sign the files with a predifined build without using the common java gui for signing etc...
Im trying to compile same java files with different resources files everytime making an app customizable by them.
I tryed:
- compiled an app for blackberry using the codes that eclipse show on console with rpc, this worked but i cant change package name before building.
- tryed to signing applications using :
Java -jar SignatureTool.jar [ [-a [-p password] ] [-c] [-C] [-s] [-f [-d] inputFile ][-r directory ][-help] codFile codfile... | csiFile
But no lucks this didnt work for me, and i dont really want to use the Java UI for signing apps, i want to acomplish everything executing it from command line so i can make a script that do this for me later.
Is there a way of using Ant or Maven to do this?
Thank you for reading !
EDIT (Added the code)
Im using bb-ant-tools , i used different ways to import the third party jar files but no luck. Also de the signing isn't working.
build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="smspremiumtemplateBB" default="build">
<property name="jde.home" location="C:\Users\Amir\Desktop\eclipse\plugins\net.rim.ejde.componentpack5.0.0_5.0.0.36\components"/>
<property name="bb-ant-tools.home" location="C:\Users\Amir\Desktop/eclipse/plugins/org.apache.ant_1.8.4.v201303080030\lib" />
<taskdef resource="bb-ant-defs.xml" classpath="${bb-ant-tools.home}/bb-ant-tools.jar" />
<property file="common.properties" />
<property prefix="project" file="project.properties" />
<property name="dest.dir" location="build" />
<path id="import.jars">
<fileset dir="../MySDK/build" includes="*.jar" />
<fileset dir="../regex/build" includes="*.jar" />
</path>
<path id="src.files">
<fileset dir="src" includes="**/*" />
<fileset dir="res" includes="**/*" />
</path>
<target name="build" depends="">
<mkdir dir="${dest.dir}" />
<copy file="${basedir}/res/img/icon.png" tofile="${dest.dir}/icon.png" />
<rapc
jdehome="${jde.home}"
output="${project.output}"
destdir="${dest.dir}" >
<import refid="import.jars" />
<src refid="src.files" />
<jdp file="${basedir}/project.properties" />
<import location="C:/Users/Amir/Desktop/eclipse/plugins/net.rim.ejde.componentpack5.0.0_5.0.0.36/components/bin/output/regex2.jar" />
<import>
<fileset dir="C:/Users/Amir/Desktop/eclipse/plugins/net.rim.ejde.componentpack5.0.0_5.0.0.36/components/bin/output/" includes="*.jar" />
</import>
</rapc>
</target>
<target name="sign" depends="build">
<sigtool
codfile="${dest.dir}/${project.output}.cod"
jdehome="${sigtool.jde}"
password="${sigtool.password}" />
</target>
<target name="clean">
<delete dir="${dest.dir}" />
</target>
</project>
common.properties file
jde.home=C:/Users/Amir/Desktop/eclipse/plugins/net.rim.ejde.componentpack5.0.0_5.0.0.36/
sigtool.jde = C:/Users/Amir/Desktop/eclipse/plugins/net.rim.ejde.componentpack5.0.0_5.0.0.36/components
sigtool.password = ********
project.properties file
output=MySDK
type=midlet
output=regex
type=midlet
output=MyApp
title=App
type=cldc
vendor=Richard
version=1.0.7
description=A nice app
icon=img/icon.png
EDIT (Solved the signing issue)
Signing is now working just including the .jar files left. My problem was that my SignatureTool.jar was from rimBB_5.0 and i just changed it for the 7.1 one.
EDIT(added output and rapc task for 3rd party libraries)
<rapc
jdehome="${jde.home}"
output="${project.output}_library"
destdir="${dest.dir}"
>
<src>
<fileset dir="./lib/" includes="*.jar"/>
</src>
<jdp type= "midlet" title="${app.name}_library" vendor="my vendor" version="@{buildversion}" runonstartup="true" startuptier="6"/>
</rapc>
output
C:\Users\Amir\Desktop\cliTest\antBB>ant build
Buildfile: C:\Users\Amir\Desktop\cliTest\antBB\build.xml
build:
[rapc] Compiling 30 source files to MyApp.cod
[rapc] C:\Users\Amir\Desktop\cliTest\antBB\src\mypackage\ValidationManager.
java:20: error: package me.regexp does not exist
[rapc] import me.regexp.RE;
[rapc] ^
[rapc] C:\Users\Amir\Desktop\cliTest\antBB\src\mypackage\ValidationManager.
java:39: error: cannot find symbol
[rapc] RE regular_expresion = new RE("^"+pattern+"$");
[rapc] ^
[rapc] symbol: class RE
[rapc] location: class ValidationManager
[rapc] C:\Users\Amir\Desktop\cliTest\antBB\src\mypackage\ValidationManager.
java:39: error: cannot find symbol
[rapc] RE regular_expresion = new RE("^"+pattern+"$");
[rapc] ^
[rapc] symbol: class RE
[rapc] location: class ValidationManager
[rapc] 3 errors
[rapc] Error!: Error: java compiler failed: javac -source 1.3 -target 1.3 -
g -O -d C:\Users\Amir\AppData\Local\Temp\rapc_63ff2f31.dir -bootclas ...
BUILD FAILED
C:\Users\Amir\Desktop\cliTest\antBB\build.xml:35: Java returned: 97
Total time: 2 seconds