Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid Ant build on a project with two source folders
    primarykey
    data
    text
    <p>I have a project with a linked source folder. This project depends on another (remote service) project, so the <strong>aidl files</strong> and the classes passed across the remote interface are in a <code>common_src</code> linked folder shared between the two projects. This work just fine with Eclipse builds, (one source file, two projects, changes in one project are reflected in the other, just as it should be).</p> <p>I'd now like to do an Ant build from the command line. I managed to get another project with a single src directory building across all targets using the example <code>build.xml</code> from the SDK tools. It imports <code>ant_rules_r3.xml</code> automatically and once the <code>source.dir</code> and <code>out.dir</code> are defined in the <code>build.properties</code> it's all fairly painless.</p> <p>Turning to the project with the <code>src</code> and <code>common_src</code> folders, I can't get it to build. Firstly I cut and pasted the compile target and all those it depends upon into the <code>build.xml</code> above the setup task. I added and defined the element <code>common_src</code> to the <code>build.properties</code> and added the last line shown below to the <code>-compile target</code> (copied from <code>ant_rules_r3.xml</code>) into the <code>build xml</code>:</p> <pre><code> &lt;src path="${source.absolute.dir}" /&gt; &lt;src path="${gen.absolute.dir}" /&gt; &lt;src path="${common_src}" /&gt;&lt;!--ADDED--&gt; </code></pre> <p>which got it further on in the build process - it could find the .java files in common_src but not the .aidl files. No surprise I realised as the aidl is a separate target. I then added</p> <pre><code>&lt;src path="${common_src}" /&gt; </code></pre> <p>to the -aidl target in the build xml, and it failed with:</p> <pre><code>BUILD FAILED C:\dev\projects\Eclipse\AndroidWorkspace\MapProject\build.xml:77: aidl doesn't support the nested "src" element. </code></pre> <p>So that's got me well and truly stuck. <strong>Ideally I'd like to modify just the build.properties file to include the common_src and pass it to the ant_rules_r3.xml but I can't think of a way of doing it. I'd be most grateful if anyone can suggest how it can be done.</strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload