Using ANT to build an IntelliJ Android project for using it in a Build Server

Hi,

We have build our first Android project with IntelliJ and it works great.

Now we would like to implement the build (and also create an apk file) in our Build Server.
To start, I've created an ANT build file by using the Build --> Generate Ant Build... menu in IntelliJ.
When running this build file with ANT  (ant -f vms.xml) it gives me errors

BUILD FAILED
d:\Projects\Relitech\VMS\ECH\trunk\software\Mobile\vms.xml:97: taskdef A class needed by class com.intellij.ant.Javac2 cannot be found: org/jetbrains/org/objectweb/asm/ClassWriter using the classloader AntClassLoader
[C:\Program Files (x86)\JetBrains\IntelliJIDEA Community Edition 13.1.5\lib\javac2.jar;
C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 13.1.5\lib\jdom.jar;
C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 13.1.5\lib\asm4-all.jar;
C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 13.1.5\lib\jgoodies-forms.jar]

I've added the following lines to the xml file:

    <pathelement location="${javac2.home}/asm-commons.jar"/>
    <pathelement location="${javac2.home}/asm-all.jar"/>
    <pathelement location="${javac2.home}/asm.jar"/>


When ruinning it now it gives me the following:




    [mkdir] Created dir: d:\Projects\Relitech\VMS\ECH\trunk\software\Mobile\out\production\Mobile
   [javac2] d:\Projects\Relitech\VMS\ECH\trunk\software\Mobile\vms.xml:176: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
   [javac2] Compiling 12 source files to d:\Projects\Relitech\VMS\ECH\trunk\software\Mobile\out\production\Mobile
   [javac2] warning: [options] bootstrap class path not set in conjunction with -source 1.6
   [javac2] d:\Projects\Relitech\VMS\ECH\trunk\software\Mobile\src\com\relitech\vms\CalibrationActivity.java:37: error: cannot find symbol
   [javac2]         setContentView(R.layout.calibration);
   [javac2]                         ^
   [javac2]   symbol:   variable layout
   [javac2]   location: class R
   [javac2] d:\Projects\Relitech\VMS\ECH\trunk\software\Mobile\src\com\relitech\vms\CalibrationActivity.java:116: error: cannot find symbol
   [javac2]                     imageViewGasDetected.setImageResource(R.drawable.error);
   [javac2]                                                            ^
   [javac2]   symbol:   variable drawable
   [javac2]   location: class R
   [javac2] d:\Projects\Relitech\VMS\ECH\trunk\software\Mobile\src\com\relitech\vms\CalibrationActivity.java:121: error: cannot find symbol
   [javac2]                     imageViewResultsValid.setImageResource(R.drawable.error);
   [javac2]                                                             ^
   [javac2]   symbol:   variable drawable
   [javac2]   location: class R
   [javac2] d:\Projects\Relitech\VMS\ECH\trunk\software\Mobile\src\com\relitech\vms\CalibrationActivity.java:138: error: cannot find symbol
   [javac2]         this.buttonStartCalibration = (Button) this.findViewById(R.id.buttonStartCalibration);
   [javac2]                                                                   ^
   [javac2]   symbol:   variable id
   [javac2]   location: class R
   [javac2] d:\Projects\Relitech\VMS\ECH\trunk\software\Mobile\src\com\relitech\vms\CalibrationActivity.java:139: error: cannot find symbol
   [javac2]         this.checkBoxCalStarted = (CheckBox) this.findViewById(R.id.checkBoxCalStarted);

.




Ist's the first time we are trying to use it this way, so maybe we are completely on the wrong way.
.



So is this the right way to do it and if so, how can I fix this.
If not, how can i use ANT or maybe something else to build the project from a command line so we can integrate it into our build environment?



.
Thank you in advance...
2 comments
Comment actions Permalink

what version of Ant are you using


0
Comment actions Permalink

Hi,

I'm using Ant version 1.9.4.
IntelliJ version is 13.1.5

0

Please sign in to leave a comment.