diff options
author | Xavier Ducrohet <xav@android.com> | 2012-02-23 11:07:19 -0800 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2012-02-24 17:24:06 -0800 |
commit | 44a21c237072fba5454732c74d1f7653523c4105 (patch) | |
tree | fd5ea83ab6d2359acf969d231fe5b11a168aa7e1 /testapps/jarCheckTests3/basicLibWithSupport/build.xml | |
parent | 9e36cb7689bf68ceafff3385e95dc24b756c34d5 (diff) | |
download | sdk-44a21c237072fba5454732c74d1f7653523c4105.zip sdk-44a21c237072fba5454732c74d1f7653523c4105.tar.gz sdk-44a21c237072fba5454732c74d1f7653523c4105.tar.bz2 |
Fix issue when a project and its libraries use the same jar files.
This is only an issue in Ant because in Eclipse we don't automatically
pull the jar files from libraries into the main project (we should somehow
now that we have the Library Projects jar container that is dynamic).
Right now we do a simple size/sha1 check on libraries that have the same
name to figure out if they are the same version. If they are we only
use one in the dex step (that notoriously fails to add the same class
twice). If they are different we stop the build as it's an error (having
two library projects depending on two different versions of a jar file
should be an error as we can be sure the two versions are API compatible).
For later: not use the file name only? find a way to version the libraries
and to have them declare whether they are API compatible with older versions?
Also added a hard-coded case for the Android Support Library. If both the v4
and the v13 are detected, use the v13 only as it includes the v4 already.
New test apps. Three cases:
- main and library projects with duplicate jar files that are identical
- main and library projects with duplicate jar files that are NOT identical
- main and library projects with v4 and v13 in the dependency list.
Change-Id: I3a9abdcbec635d7c9d3228bdd105120f77178b27
Diffstat (limited to 'testapps/jarCheckTests3/basicLibWithSupport/build.xml')
-rw-r--r-- | testapps/jarCheckTests3/basicLibWithSupport/build.xml | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/testapps/jarCheckTests3/basicLibWithSupport/build.xml b/testapps/jarCheckTests3/basicLibWithSupport/build.xml new file mode 100644 index 0000000..772f422 --- /dev/null +++ b/testapps/jarCheckTests3/basicLibWithSupport/build.xml @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project name="basicLibWithSupport" default="help"> + + <!-- The local.properties file is created and updated by the 'android' tool. + It contains the path to the SDK. It should *NOT* be checked into + Version Control Systems. --> + <property file="local.properties" /> + + <!-- The ant.properties file can be created by you. It is only edited by the + 'android' tool to add properties to it. + This is the place to change some Ant specific build properties. + Here are some properties you may want to change/update: + + source.dir + The name of the source directory. Default is 'src'. + out.dir + The name of the output directory. Default is 'bin'. + + For other overridable properties, look at the beginning of the rules + files in the SDK, at tools/ant/build.xml + + Properties related to the SDK location or the project target should + be updated using the 'android' tool with the 'update' action. + + This file is an integral part of the build system for your + application and should be checked into Version Control Systems. + + --> + <property file="ant.properties" /> + + <!-- The project.properties file is created and updated by the 'android' + tool, as well as ADT. + + This contains project specific properties such as project target, and library + dependencies. Lower level build properties are stored in ant.properties + (or in .classpath for Eclipse projects). + + This file is an integral part of the build system for your + application and should be checked into Version Control Systems. --> + <loadproperties srcFile="project.properties" /> + + <!-- quick check on sdk.dir --> + <fail + message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var" + unless="sdk.dir" + /> + + +<!-- extension targets. Uncomment the ones where you want to do custom work + in between standard targets --> +<!-- + <target name="-pre-build"> + </target> + <target name="-pre-compile"> + </target> + + /* This is typically used for code obfuscation. + Compiled code location: ${out.classes.absolute.dir} + If this is not done in place, override ${out.dex.input.absolute.dir} */ + <target name="-post-compile"> + </target> +--> + + <!-- Import the actual build file. + + To customize existing targets, there are two options: + - Customize only one target: + - copy/paste the target into this file, *before* the + <import> task. + - customize it to your needs. + - Customize the whole content of build.xml + - copy/paste the content of the rules files (minus the top node) + into this file, replacing the <import> task. + - customize to your needs. + + *********************** + ****** IMPORTANT ****** + *********************** + In all cases you must update the value of version-tag below to read 'custom' instead of an integer, + in order to avoid having your file be overridden by tools such as "android update project" + --> + <!-- version-tag: 1 --> + <import file="${sdk.dir}/tools/ant/build.xml" /> + +</project> |