New Build Script Hiccups

Posted: September 21, 2009 in Android, Java, Mobile
Tags: ,

Under the old system of instrumenting android projects you had the tests/src under the parent project and thus:

${ main-out-folder}

pointed to ../bin/classes in target that would get executed after the parent project compile such as:

<target name="-compile" depends="-clean, -preprocess,  
	    	-resource-src, -aidl">
	        <javac encoding="ascii" target="1.5" debug="true" extdirs="" destdir="${out-classes}" bootclasspathref="android.target.classpath" excludes="**/*.ctl">
	        	
	           <!--  <src path="${source-folder}" ></src> -->
	           <src path="${out-preprocess}">
	           <src path="${gen-folder}">
	            <classpath>
	                <fileset dir="${external-libs-folder}" includes="*.jar">
	                <pathelement path="${main-out-classes}">
	            </pathelement>
	         </fileset>
	    </classpath>

For the compile of tests classes to work you need the pointer to the parent bin/classes as external library or I would imagine it will not compile. In android_rules.xml its still the old way. The only way I can see to correct it the right way is to have a new build.properties property called application.testproject.path than you would have:

${main-out-folder} = ${application.testproject.path}/bin
${main-out-classes} = ${main-out-folder/classes

and right now it will be up to the developer to add it as there right now is not a good way to change SDK or ADT to deal with it at the moment. Take that with a grain of salt as I do not see the hidden sources that are not in public view and some Google Engineer may already be working on a solution. However, with that ‘pain’ we do get an Android test instrumentation as separate project which in most cases makes things easier.

Reblog this post [with Zemanta]
Advertisements
Comments
  1. Xavier Ducrohet says:

    yeah, we’re fixing this 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s