diff options
author | Xavier Ducrohet <xav@android.com> | 2011-10-14 16:46:45 -0700 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2011-10-14 16:46:45 -0700 |
commit | def6f0d2e24d6dd96d6265fcf05fd9a1e10c789c (patch) | |
tree | 4228ac22d8fbd9a342b024805d3980aef1d71261 /files/ant | |
parent | e162064a7b5db1eecec34271bc7e2a4296181ea6 (diff) | |
download | sdk-def6f0d2e24d6dd96d6265fcf05fd9a1e10c789c.zip sdk-def6f0d2e24d6dd96d6265fcf05fd9a1e10c789c.tar.gz sdk-def6f0d2e24d6dd96d6265fcf05fd9a1e10c789c.tar.bz2 |
Improve indirect library dependency support.
Previously with the following setup:
Main app depends on Lib1, Lib2.
Lib1 and Lib2 both depends on Lib3.
Lib3 would be compiled 3 times, as the main app would attempt
to build it and then Libr1, and Lib2 would do it too.
Of course it wasn't actually built 3 times. After the first time it would
do nothing, checking dependencies and do nothing. However, for projects
will a lot of libraries and a lot of indirect dependencies this could
slow down a lot compilations, as the build would spend its time checking
whether to build the same library many times.
This ensure that only the main project attempts to build all of its library
dependencies (direct and indirect), in the right order of course.
When libraries are built they are told (through the "only" target) to not
build their dependencies.
Change-Id: Ie80f32a96e3c473d897aca5d05bf6fe9ea086884
Diffstat (limited to 'files/ant')
-rw-r--r-- | files/ant/build.xml | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/files/ant/build.xml b/files/ant/build.xml index 91dbb1f..57effb2 100644 --- a/files/ant/build.xml +++ b/files/ant/build.xml @@ -365,6 +365,11 @@ <!-- ******************** Build Targets ******************** --> <!-- ******************************************************* --> + <!-- target to disable building dependencies --> + <target name="only"> + <property name="dont.build.deps" value="true" /> + </target> + <!-- this target simply force running -setup making the project info be read. To be used as ant all clean @@ -466,15 +471,19 @@ <!-- compile the libraries if any --> <if> <condition> - <isreference refid="project.libraries" /> + <and> + <isreference refid="project.libraries" /> + <not><isset property="dont.build.deps" /></not> + </and> </condition> <then> <echo>Building Libraries</echo> - <subant + <subant failonerror="true" buildpathref="project.libraries" - antfile="build.xml" - target="${build.target}" - failonerror="true"/> + antfile="build.xml"> + <target name="only" /> + <target name="${build.target}" /> + </subant> <echo></echo> <echo>############################################</echo> <echo>**** Back to project ${ant.project.name} ****</echo> @@ -1263,8 +1272,14 @@ <echo> (tested projects and libraries)at the same time</echo> <echo> using: 'ant all clean'</echo> <echo> debug: Builds the application and signs it with a debug key.</echo> + <echo> The 'only' target can be used to only build the</echo> + <echo> current project and ignore the libraries using:</echo> + <echo> 'ant only debug'</echo> <echo> release: Builds the application. The generated apk file must be</echo> <echo> signed before it is published.</echo> + <echo> The 'only' target can be used to only build the</echo> + <echo> current project and ignore the libraries using:</echo> + <echo> 'ant only release'</echo> <echo> instrument:Builds an instrumented package and signs it with a</echo> <echo> debug key.</echo> <echo> test: Runs the tests. Project must be a test project and</echo> |