diff options
author | Xavier Ducrohet <xav@android.com> | 2010-03-10 16:49:38 -0800 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2010-03-11 16:53:11 -0800 |
commit | ed88cf93fbef99a878be3c5e6691615b34f09045 (patch) | |
tree | 258786afa5c5aab20593ef49afa6decbcd86e979 /anttasks | |
parent | f9418b6c19f9e93d0c7b1bba826aaf38ac39c7ec (diff) | |
download | sdk-ed88cf93fbef99a878be3c5e6691615b34f09045.zip sdk-ed88cf93fbef99a878be3c5e6691615b34f09045.tar.gz sdk-ed88cf93fbef99a878be3c5e6691615b34f09045.tar.bz2 |
Move ant.prop to sdk.prop and up a folder.
this file is meant to have general sdk properties, not
just Ant ones.
Also separated the library support from the Ant build version.
It's clearer whether or not libraries are supported, and it's
not just tied to Ant anyway (ADT needs to know as well).
Finally use that new property to do checks on library support
in both the custom Ant tasks and ADT.
Depends on a CL in development.git (sdk.atree change).
Change-Id: I77d229ed3fd60f0468b1d3d31f7cf147b03a32fb
Diffstat (limited to 'anttasks')
-rw-r--r-- | anttasks/src/com/android/ant/SetupTask.java | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/anttasks/src/com/android/ant/SetupTask.java b/anttasks/src/com/android/ant/SetupTask.java index 8facf62..2c0ad53 100644 --- a/anttasks/src/com/android/ant/SetupTask.java +++ b/anttasks/src/com/android/ant/SetupTask.java @@ -171,7 +171,8 @@ public final class SetupTask extends ImportTask { } // check that this version of the custom Ant task can build this target - int antBuildVersion = androidTarget.getAntBuildRevision(); + int antBuildVersion = androidTarget.getProperty(SdkConstants.PROP_SDK_ANT_BUILD_REVISION, + 1); if (antBuildVersion > ANT_RULES_MAX_VERSION) { throw new BuildException(String.format( "The project target (%1$s) requires a more recent version of the tools. Please update.", @@ -200,6 +201,14 @@ public final class SetupTask extends ImportTask { } System.out.println("API level: " + androidTarget.getVersion().getApiString()); + // do a quick check to make sure the target supports library. + if (isLibrary && + androidTarget.getProperty(SdkConstants.PROP_SDK_SUPPORT_LIBRARY, false) == false) { + throw new BuildException(String.format( + "Project target '%1$s' does not support building libraries.", + androidTarget.getFullName())); + } + // always check the manifest minSdkVersion. checkManifest(antProject, androidTarget.getVersion()); @@ -274,7 +283,7 @@ public final class SetupTask extends ImportTask { if (rules.isFile() == false) { throw new BuildException(String.format("Build rules file '%s' is missing.", - templateFolder)); + rules)); } // set the file location to import @@ -390,7 +399,8 @@ public final class SetupTask extends ImportTask { // get the build version for the current target. It'll be tested if there's at least // one library. - int antBuildVersion = androidTarget.getAntBuildRevision(); + boolean supportLibrary = androidTarget.getProperty(SdkConstants.PROP_SDK_SUPPORT_LIBRARY, + false); int index = 1; while (true) { @@ -401,7 +411,7 @@ public final class SetupTask extends ImportTask { break; } - if (antBuildVersion < SdkConstants.ANT_REV_LIBRARY) { + if (supportLibrary == false) { throw new BuildException(String.format( "The build system for this project target (%1$s) does not support libraries", androidTarget.getFullName())); |