]> nv-tegra.nvidia Code Review - android/platform/tools/build.git/commitdiff
Merge "Add support for build-tools."
authorXavier Ducrohet <xav@android.com>
Fri, 22 Mar 2013 21:56:14 +0000 (21:56 +0000)
committerGerrit Code Review <noreply-gerritcodereview@google.com>
Fri, 22 Mar 2013 21:56:14 +0000 (21:56 +0000)
54 files changed:
builder/src/main/java/com/android/builder/AndroidBuilder.java
builder/src/main/java/com/android/builder/DefaultSdkParser.java
builder/src/main/java/com/android/builder/PlatformSdkParser.java
builder/src/main/java/com/android/builder/SdkParser.java
builder/src/main/java/com/android/builder/internal/FakeAndroidTarget.java
gradle/src/main/groovy/com/android/build/gradle/AppPlugin.groovy
gradle/src/main/groovy/com/android/build/gradle/BaseExtension.groovy
gradle/src/main/groovy/com/android/build/gradle/BasePlugin.groovy
gradle/src/main/groovy/com/android/build/gradle/LibraryPlugin.groovy
gradle/src/main/groovy/com/android/build/gradle/internal/ApplicationVariant.groovy
gradle/src/main/groovy/com/android/build/gradle/internal/ProductionAppVariant.groovy
gradle/src/main/groovy/com/android/build/gradle/internal/TestAppVariant.groovy
tests/aidl/build.gradle
tests/api/app/build.gradle
tests/api/lib/build.gradle
tests/applibtest/app/build.gradle
tests/applibtest/lib/build.gradle
tests/assets/app/build.gradle
tests/assets/lib/build.gradle
tests/basic/build.gradle
tests/dependencies/build.gradle
tests/flavored/build.gradle
tests/flavorlib/app/build.gradle
tests/flavorlib/lib1/build.gradle
tests/flavorlib/lib2/build.gradle
tests/flavorlibWithFailedTests/app/build.gradle
tests/flavorlibWithFailedTests/lib1/build.gradle
tests/flavorlibWithFailedTests/lib2/build.gradle
tests/flavors/build.gradle
tests/libsTest/app/build.gradle
tests/libsTest/lib1/build.gradle
tests/libsTest/lib2/build.gradle
tests/libsTest/lib2b/build.gradle
tests/libsTest/libapp/build.gradle
tests/localJars/app/build.gradle
tests/localJars/baseLibrary/build.gradle
tests/localJars/library/build.gradle
tests/migrated/build.gradle
tests/multiproject/app/build.gradle
tests/multiproject/baseLibrary/build.gradle
tests/multiproject/library/build.gradle
tests/multires/build.gradle
tests/overlay1/build.gradle
tests/overlay2/build.gradle
tests/pkgOverride/build.gradle
tests/renderscript/build.gradle
tests/renderscriptInLib/app/build.gradle
tests/renderscriptInLib/lib/build.gradle
tests/renderscriptMultiSrc/build.gradle
tests/repo/app/build.gradle
tests/repo/baseLibrary/build.gradle
tests/repo/library/build.gradle
tests/tictactoe/app/build.gradle
tests/tictactoe/lib/build.gradle

index a3574f0513c71156de3f49aeddd856f02d5bae77..7545c175820812e068f874b26d2d83e35c758fa1 100644 (file)
@@ -44,6 +44,7 @@ import com.android.builder.signing.KeytoolException;
 import com.android.builder.signing.SigningConfig;
 import com.android.manifmerger.ManifestMerger;
 import com.android.manifmerger.MergerLog;
+import com.android.sdklib.BuildToolInfo;
 import com.android.sdklib.IAndroidTarget;
 import com.android.sdklib.IAndroidTarget.IOptionalLibrary;
 import com.android.sdklib.repository.FullRevision;
@@ -66,7 +67,6 @@ import java.util.concurrent.ExecutionException;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
 
 /**
  * This is the main builder class. It is given all the data to process the build (such as
@@ -74,8 +74,7 @@ import static com.google.common.base.Preconditions.checkState;
  * build steps.
  *
  * To use:
- * create a builder with {@link #AndroidBuilder(SdkParser, ILogger, boolean)},
- * configure compile target with {@link #setTarget(String)}
+ * create a builder with {@link #AndroidBuilder(SdkParser, ILogger, boolean)}
  *
  * then build steps can be done with
  * {@link #generateBuildConfig(String, boolean, java.util.List, String)}
@@ -105,7 +104,10 @@ public class AndroidBuilder {
     private final CommandLineRunner mCmdLineRunner;
     private final boolean mVerboseExec;
 
-    private IAndroidTarget mTarget;
+    @NonNull
+    private final IAndroidTarget mTarget;
+    @NonNull
+    private final BuildToolInfo mBuildTools;
 
     /**
      * Creates an AndroidBuilder
@@ -140,6 +142,9 @@ public class AndroidBuilder {
                     platformToolsRevision, MIN_PLATFORM_TOOLS_REV));
 
         }
+
+        mTarget = mSdkParser.getTarget();
+        mBuildTools = mSdkParser.getBuildTools();
     }
 
     @VisibleForTesting
@@ -152,36 +157,15 @@ public class AndroidBuilder {
         mCmdLineRunner = checkNotNull(cmdLineRunner);
         mLogger = checkNotNull(logger);
         mVerboseExec = verboseExec;
-    }
-
-    /**
-     * Sets the compilation target hash string.
-     *
-     * @param target the compilation target
-     *
-     * @see IAndroidTarget#hashString()
-     */
-    public void setTarget(@NonNull String target) {
-        checkNotNull(target, "target cannot be null.");
 
-        mTarget = mSdkParser.resolveTarget(target, mLogger);
-
-        if (mTarget == null) {
-            throw new RuntimeException("Unknown target: " + target);
-        }
-    }
-
-    public int getTargetApiLevel() {
-        checkState(mTarget != null, "Target not set.");
-
-        return mTarget.getVersion().getApiLevel();
+        mTarget = mSdkParser.getTarget();
+        mBuildTools = mSdkParser.getBuildTools();
     }
 
     /**
      * Returns the runtime classpath to be used during compilation.
      */
     public List<String> getRuntimeClasspath() {
-        checkState(mTarget != null, "Target not set.");
 
         List<String> classpath = Lists.newArrayList();
 
@@ -208,7 +192,9 @@ public class AndroidBuilder {
      * @return an AaptRunner object
      */
     public AaptRunner getAaptRunner() {
-        return new AaptRunner(mSdkParser.getAapt().getAbsolutePath(), mCmdLineRunner);
+        return new AaptRunner(
+                mBuildTools.getPath(BuildToolInfo.PathId.AAPT),
+                mCmdLineRunner);
     }
 
     /**
@@ -225,7 +211,6 @@ public class AndroidBuilder {
                      boolean debuggable,
             @NonNull List<String> javaLines,
             @NonNull String sourceOutputDir) throws IOException {
-        checkState(mTarget != null, "Target not set.");
 
         BuildConfigGenerator generator = new BuildConfigGenerator(
                 sourceOutputDir, packageName, debuggable);
@@ -264,7 +249,6 @@ public class AndroidBuilder {
                      int minSdkVersion,
                      int targetSdkVersion,
             @NonNull String outManifestLocation) {
-        checkState(mTarget != null, "Target not set.");
         checkNotNull(mainManifest, "mainManifest cannot be null.");
         checkNotNull(manifestOverlays, "manifestOverlays cannot be null.");
         checkNotNull(libraries, "libraries cannot be null.");
@@ -344,7 +328,6 @@ public class AndroidBuilder {
             @NonNull String instrumentationRunner,
             @NonNull List<? extends ManifestDependency> libraries,
             @NonNull String outManifestLocation) {
-        checkState(mTarget != null, "Target not set.");
         checkNotNull(testPackageName, "testPackageName cannot be null.");
         checkNotNull(testedPackageName, "testedPackageName cannot be null.");
         checkNotNull(instrumentationRunner, "instrumentationRunner cannot be null.");
@@ -518,7 +501,6 @@ public class AndroidBuilder {
             @NonNull  AaptOptions options)
             throws IOException, InterruptedException {
 
-        checkState(mTarget != null, "Target not set.");
         checkNotNull(manifestFile, "manifestFile cannot be null.");
         checkNotNull(resFolder, "resFolder cannot be null.");
         checkNotNull(libraries, "libraries cannot be null.");
@@ -530,12 +512,12 @@ public class AndroidBuilder {
         // launch aapt: create the command line
         ArrayList<String> command = Lists.newArrayList();
 
-        File aapt = mSdkParser.getAapt();
-        if (aapt == null || !aapt.isFile()) {
+        String aapt = mBuildTools.getPath(BuildToolInfo.PathId.AAPT);
+        if (aapt == null || !new File(aapt).isFile()) {
             throw new IllegalStateException("aapt is missing");
         }
 
-        command.add(aapt.getAbsolutePath());
+        command.add(aapt);
         command.add("package");
 
         if (mVerboseExec) {
@@ -698,13 +680,12 @@ public class AndroidBuilder {
                                     @NonNull List<File> importFolders,
                                     @Nullable DependencyFileProcessor dependencyFileProcessor)
             throws IOException, InterruptedException, ExecutionException {
-        checkState(mTarget != null, "Target not set.");
         checkNotNull(sourceFolders, "sourceFolders cannot be null.");
         checkNotNull(sourceOutputDir, "sourceOutputDir cannot be null.");
         checkNotNull(importFolders, "importFolders cannot be null.");
 
-        File aidl = mSdkParser.getAidlCompiler();
-        if (aidl == null || !aidl.isFile()) {
+        String aidl = mBuildTools.getPath(BuildToolInfo.PathId.AIDL);
+        if (aidl == null || !new File(aidl).isFile()) {
             throw new IllegalStateException("aidl is missing");
         }
 
@@ -714,7 +695,7 @@ public class AndroidBuilder {
         fullImportList.addAll(importFolders);
 
         AidlProcessor processor = new AidlProcessor(
-                aidl.getAbsolutePath(),
+                aidl,
                 mTarget.getPath(IAndroidTarget.ANDROID_AIDL),
                 fullImportList,
                 sourceOutputDir,
@@ -743,18 +724,17 @@ public class AndroidBuilder {
                                 @NonNull List<File> importFolders,
                                 @Nullable DependencyFileProcessor dependencyFileProcessor)
             throws IOException, InterruptedException {
-        checkState(mTarget != null, "Target not set.");
         checkNotNull(aidlFile, "aidlFile cannot be null.");
         checkNotNull(sourceOutputDir, "sourceOutputDir cannot be null.");
         checkNotNull(importFolders, "importFolders cannot be null.");
 
-        File aidl = mSdkParser.getAidlCompiler();
-        if (aidl == null || !aidl.isFile()) {
+        String aidl = mBuildTools.getPath(BuildToolInfo.PathId.AIDL);
+        if (aidl == null || !new File(aidl).isFile()) {
             throw new IllegalStateException("aidl is missing");
         }
 
         AidlProcessor processor = new AidlProcessor(
-                aidl.getAbsolutePath(),
+                aidl,
                 mTarget.getPath(IAndroidTarget.ANDROID_AIDL),
                 importFolders,
                 sourceOutputDir,
@@ -791,14 +771,13 @@ public class AndroidBuilder {
                                             boolean debugBuild,
                                             int optimLevel)
             throws IOException, InterruptedException, ExecutionException {
-        checkState(mTarget != null, "Target not set.");
         checkNotNull(sourceFolders, "sourceFolders cannot be null.");
         checkNotNull(importFolders, "importFolders cannot be null.");
         checkNotNull(sourceOutputDir, "sourceOutputDir cannot be null.");
         checkNotNull(resOutputDir, "resOutputDir cannot be null.");
 
-        File renderscript = mSdkParser.getRenderscriptCompiler();
-        if (renderscript == null || !renderscript.isFile()) {
+        String renderscript = mBuildTools.getPath(BuildToolInfo.PathId.LLVM_RS_CC);
+        if (renderscript == null || !new File(renderscript).isFile()) {
             throw new IllegalStateException("llvm-rs-cc is missing");
         }
 
@@ -814,21 +793,17 @@ public class AndroidBuilder {
             return;
         }
 
-        @SuppressWarnings("deprecation")
-        String rsPath = mTarget.getPath(IAndroidTarget.ANDROID_RS);
-
-        @SuppressWarnings("deprecation")
-        String rsClangPath = mTarget.getPath(IAndroidTarget.ANDROID_RS_CLANG);
+        String rsPath = mBuildTools.getPath(BuildToolInfo.PathId.ANDROID_RS);
+        String rsClangPath = mBuildTools.getPath(BuildToolInfo.PathId.ANDROID_RS_CLANG);
 
         // the renderscript compiler doesn't expect the top res folder,
         // but the raw folder directly.
         File rawFolder = new File(resOutputDir, SdkConstants.FD_RES_RAW);
 
-
         // compile all the files in a single pass
         ArrayList<String> command = Lists.newArrayList();
 
-        command.add(renderscript.getAbsolutePath());
+        command.add(renderscript);
 
         if (debugBuild) {
             command.add("-g");
@@ -925,7 +900,6 @@ public class AndroidBuilder {
             @NonNull String outDexFile,
             @NonNull DexOptions dexOptions,
             boolean incremental) throws IOException, InterruptedException {
-        checkState(mTarget != null, "Target not set.");
         checkNotNull(classesLocation, "classesLocation cannot be null.");
         checkNotNull(libraries, "libraries cannot be null.");
         checkNotNull(outDexFile, "outDexFile cannot be null.");
@@ -934,12 +908,12 @@ public class AndroidBuilder {
         // launch dx: create the command line
         ArrayList<String> command = Lists.newArrayList();
 
-        File dx = mSdkParser.getDx();
-        if (dx == null || !dx.isFile()) {
+        String dx = mBuildTools.getPath(BuildToolInfo.PathId.DX);
+        if (dx == null || !new File(dx).isFile()) {
             throw new IllegalStateException("dx is missing");
         }
 
-        command.add(dx.getAbsolutePath());
+        command.add(dx);
 
         command.add("--dex");
 
@@ -1016,7 +990,6 @@ public class AndroidBuilder {
             @Nullable SigningConfig signingConfig,
             @NonNull String outApkLocation) throws DuplicateFileException, FileNotFoundException,
             KeytoolException, PackagerException, SigningException {
-        checkState(mTarget != null, "Target not set.");
         checkNotNull(androidResPkgLocation, "androidResPkgLocation cannot be null.");
         checkNotNull(classesDexLocation, "classesDexLocation cannot be null.");
         checkNotNull(outApkLocation, "outApkLocation cannot be null.");
index fbc28967652edad1ccc71649dbb8deb0f6b182b6..5ac41508711bc7cd7f05ec75770b36f96a0fbf80 100644 (file)
@@ -18,13 +18,13 @@ package com.android.builder;
 
 import com.android.SdkConstants;
 import com.android.annotations.NonNull;
+import com.android.sdklib.BuildToolInfo;
 import com.android.sdklib.IAndroidTarget;
 import com.android.sdklib.SdkManager;
 import com.android.sdklib.repository.FullRevision;
 import com.android.sdklib.repository.PkgProps;
 import com.android.utils.ILogger;
 import com.google.common.base.Charsets;
-import com.google.common.collect.Maps;
 import com.google.common.io.Closeables;
 
 import java.io.File;
@@ -33,7 +33,6 @@ import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.Reader;
-import java.util.Map;
 import java.util.Properties;
 
 import static com.android.SdkConstants.FD_PLATFORM_TOOLS;
@@ -50,9 +49,13 @@ public class DefaultSdkParser implements SdkParser {
     private final String mSdkLocation;
     private SdkManager mManager;
 
+    private IAndroidTarget mTarget;
+    private BuildToolInfo mBuildToolInfo;
+
     private File mTools;
     private File mPlatformTools;
-    private final Map<String, File> mToolsMap = Maps.newHashMapWithExpectedSize(6);
+    private File mAdb;
+    private File mZipAlign;
 
     public DefaultSdkParser(@NonNull String sdkLocation) {
         if (!sdkLocation.endsWith(File.separator)) {
@@ -63,15 +66,44 @@ public class DefaultSdkParser implements SdkParser {
     }
 
     @Override
-    public IAndroidTarget resolveTarget(@NonNull String target, @NonNull ILogger logger) {
+    public void initParser(@NonNull String target,
+                           @NonNull FullRevision buildToolRevision,
+                           @NonNull ILogger logger) {
         if (mManager == null) {
             mManager = SdkManager.createManager(mSdkLocation, logger);
             if (mManager == null) {
-                throw new RuntimeException("failed to parse SDK!");
+                throw new IllegalStateException("failed to parse SDK!");
+            }
+
+            mTarget = mManager.getTargetFromHashString(target);
+            if (mTarget == null) {
+                throw new IllegalStateException("failed to find target " + target);
+            }
+
+            mBuildToolInfo = mManager.getBuildTool(buildToolRevision);
+            if (mBuildToolInfo == null) {
+                throw new IllegalStateException("failed to find Build Tools revision "
+                        + buildToolRevision.toString());
             }
         }
+    }
+
+    @NonNull
+    @Override
+    public IAndroidTarget getTarget() {
+        if (mManager == null) {
+            throw new IllegalStateException("SdkParser was not initialized.");
+        }
+        return mTarget;
+    }
 
-        return mManager.getTargetFromHashString(target);
+    @NonNull
+    @Override
+    public BuildToolInfo getBuildTools() {
+        if (mManager == null) {
+            throw new IllegalStateException("SdkParser was not initialized.");
+        }
+        return mBuildToolInfo;
     }
 
     @Override
@@ -113,77 +145,43 @@ public class DefaultSdkParser implements SdkParser {
         return null;
     }
 
-    @Override
-    public File getAapt() {
-        return getPlatformTool(SdkConstants.FN_AAPT);
-    }
-
-    @Override
-    public File getAidlCompiler() {
-        return getPlatformTool(SdkConstants.FN_AIDL);
-    }
-
-    @Override
-    public File getRenderscriptCompiler() {
-        return getPlatformTool(SdkConstants.FN_RENDERSCRIPT);
-    }
-
-    @Override
-    public File getDx() {
-        return getPlatformTool(SdkConstants.FN_DX);
-    }
-
     @Override
     public File getZipAlign() {
-        return getTool(SdkConstants.FN_ZIPALIGN);
+        if (mZipAlign == null) {
+            mZipAlign = new File(getToolsFolder(), SdkConstants.FN_ZIPALIGN);
+        }
+        return mZipAlign;
     }
 
     @Override
     public File getAdb() {
-        return getPlatformTool(SdkConstants.FN_ADB);
-    }
-
-    private File getPlatformTool(String filename) {
-        File f = mToolsMap.get(filename);
-        if (f == null) {
-            File platformTools = getPlatformToolsFolder();
-            if (!platformTools.isDirectory()) {
-                return null;
-            }
-
-            f = new File(platformTools, filename);
-            mToolsMap.put(filename, f);
-        }
-
-        return f;
-    }
-
-    private File getTool(String filename) {
-        File f = mToolsMap.get(filename);
-        if (f == null) {
-            File platformTools = getToolsFolder();
-            if (!platformTools.isDirectory()) {
-                return null;
-            }
-
-            f = new File(platformTools, filename);
-            mToolsMap.put(filename, f);
+        if (mAdb == null) {
+            mAdb = new File(getPlatformToolsFolder(), SdkConstants.FN_ADB);
         }
-
-        return f;
+        return mAdb;
     }
 
+    @NonNull
     private File getPlatformToolsFolder() {
         if (mPlatformTools == null) {
             mPlatformTools = new File(mSdkLocation, FD_PLATFORM_TOOLS);
+            if (!mPlatformTools.isDirectory()) {
+                throw new IllegalStateException("Platform-tools folder missing: " +
+                        mPlatformTools.getAbsolutePath());
+            }
         }
 
         return mPlatformTools;
     }
 
+    @NonNull
     private File getToolsFolder() {
         if (mTools == null) {
             mTools = new File(mSdkLocation, FD_TOOLS);
+            if (!mTools.isDirectory()) {
+                throw new IllegalStateException("Platform-tools folder missing: " +
+                        mTools.getAbsolutePath());
+            }
         }
 
         return mTools;
index 5cfb1f46d517741487257cc9b205ac5f0ab6beed..7cd8eb83bc1aefb3df8c16e6c0736bec9f5fd288 100644 (file)
@@ -19,13 +19,12 @@ package com.android.builder;
 import com.android.SdkConstants;
 import com.android.annotations.NonNull;
 import com.android.builder.internal.FakeAndroidTarget;
+import com.android.sdklib.BuildToolInfo;
 import com.android.sdklib.IAndroidTarget;
 import com.android.sdklib.repository.FullRevision;
 import com.android.utils.ILogger;
-import com.google.common.collect.Maps;
 
 import java.io.File;
-import java.util.Map;
 
 /**
  * Implementation of {@link SdkParser} for the SDK prebuilds in the Android source tree.
@@ -33,9 +32,12 @@ import java.util.Map;
 public class PlatformSdkParser implements SdkParser {
     private final String mPlatformRootFolder;
 
+    private boolean mInitialized = false;
+    private IAndroidTarget mTarget;
+    private BuildToolInfo mBuildToolInfo;
+
     private File mHostTools;
-    private final Map<String, File> mToolsMap = Maps.newHashMapWithExpectedSize(6);
-    private File mDx;
+    private File mZipAlign;
     private File mAdb;
 
     PlatformSdkParser(@NonNull String sdkLocation) {
@@ -43,8 +45,39 @@ public class PlatformSdkParser implements SdkParser {
     }
 
     @Override
-    public IAndroidTarget resolveTarget(String target, ILogger logger) {
-        return new FakeAndroidTarget(mPlatformRootFolder, target);
+    public void initParser(@NonNull String target,
+                           @NonNull FullRevision buildToolRevision,
+                           @NonNull ILogger logger) {
+        if (!mInitialized) {
+            mTarget = new FakeAndroidTarget(mPlatformRootFolder, target);
+
+            mBuildToolInfo = new BuildToolInfo(buildToolRevision, new File(mPlatformRootFolder),
+                    new File(getHostToolsFolder(), SdkConstants.FN_AAPT),
+                    new File(getHostToolsFolder(), SdkConstants.FN_AIDL),
+                    new File(mPlatformRootFolder, "prebuilts/sdk/tools/dx"),
+                    new File(mPlatformRootFolder, "prebuilts/sdk/tools/lib/dx.jar"),
+                    new File(getHostToolsFolder(), SdkConstants.FN_RENDERSCRIPT),
+                    new File(mPlatformRootFolder, "prebuilts/sdk/renderscript/include"),
+                    new File(mPlatformRootFolder, "prebuilts/sdk/renderscript/clang-include"));
+        }
+    }
+
+    @NonNull
+    @Override
+    public IAndroidTarget getTarget() {
+        if (!mInitialized) {
+            throw new IllegalStateException("SdkParser was not initialized.");
+        }
+        return mTarget;
+    }
+
+    @NonNull
+    @Override
+    public BuildToolInfo getBuildTools() {
+        if (!mInitialized) {
+            throw new IllegalStateException("SdkParser was not initialized.");
+        }
+        return mBuildToolInfo;
     }
 
     @Override
@@ -67,32 +100,12 @@ public class PlatformSdkParser implements SdkParser {
     }
 
     @Override
-    public File getAapt() {
-        return getTool(SdkConstants.FN_AAPT);
-    }
-
-    @Override
-    public File getAidlCompiler() {
-        return getTool(SdkConstants.FN_AIDL);
-    }
-
-    @Override
-    public File getRenderscriptCompiler() {
-        return getTool(SdkConstants.FN_RENDERSCRIPT);
-    }
-
-    @Override
-    public File getDx() {
-        if (mDx == null) {
-            mDx =  new File(mPlatformRootFolder, "prebuilts/sdk/tools/dx");
+    public File getZipAlign() {
+        if (mZipAlign == null) {
+            mZipAlign = new File(getHostToolsFolder(), SdkConstants.FN_ZIPALIGN);
         }
 
-        return mDx;
-    }
-
-    @Override
-    public File getZipAlign() {
-        return getTool(SdkConstants.FN_ZIPALIGN);
+        return mZipAlign;
     }
 
     @Override
@@ -104,28 +117,15 @@ public class PlatformSdkParser implements SdkParser {
             } else if (SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_LINUX) {
                 mAdb = new File(mPlatformRootFolder, "out/host/linux-x86/bin/adb");
             } else {
-                throw new IllegalStateException("Windows is not supported for platform development");
+                throw new IllegalStateException(
+                        "Windows is not supported for platform development");
             }
         }
 
         return mAdb;
     }
 
-    private File getTool(String filename) {
-        File f = mToolsMap.get(filename);
-        if (f == null) {
-            File platformTools = getHostToolsFolder();
-            if (!platformTools.isDirectory()) {
-                return null;
-            }
-
-            f = new File(platformTools, filename);
-            mToolsMap.put(filename, f);
-        }
-
-        return f;
-    }
-
+    @NonNull
     private File getHostToolsFolder() {
         if (mHostTools == null) {
             File tools = new File(mPlatformRootFolder, "prebuilts/sdk/tools");
@@ -134,7 +134,13 @@ public class PlatformSdkParser implements SdkParser {
             } else if (SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_LINUX) {
                 mHostTools = new File(tools, "linux");
             } else {
-                throw new IllegalStateException("Windows is not supported for platform development");
+                throw new IllegalStateException(
+                        "Windows is not supported for platform development");
+            }
+
+            if (!mHostTools.isDirectory()) {
+                throw new IllegalStateException("Host tools folder missing: " +
+                        mHostTools.getAbsolutePath());
             }
         }
         return mHostTools;
index efabc48eaf9a4cd9ee02590b3e63f0ee79054dd8..4e07593e8a021c4067b2c84de029fdf4e839c63a 100644 (file)
@@ -17,6 +17,7 @@
 package com.android.builder;
 
 import com.android.annotations.NonNull;
+import com.android.sdklib.BuildToolInfo;
 import com.android.sdklib.IAndroidTarget;
 import com.android.sdklib.repository.FullRevision;
 import com.android.utils.ILogger;
@@ -30,48 +31,52 @@ import java.io.File;
 public interface SdkParser {
 
     /**
-     * Resolves a target hash string and returns the corresponding {@link IAndroidTarget}
+     * Inits the parser with a target hash string and a build tools FullRevision.
+     *
+     * Note that this may be called several times on the same object, though it will always
+     * be with the same values. Extra calls can be ignored.
+     *
      * @param target the target hash string.
+     * @param buildToolRevision the build tools revision
      * @param logger a logger object.
-     * @return the target or null if no match is found.
      *
-     * @throws RuntimeException if the SDK cannot parsed.
+     * @throws IllegalStateException if the SDK cannot parsed.
      *
      * @see IAndroidTarget#hashString()
      */
-    IAndroidTarget resolveTarget(@NonNull String target, @NonNull ILogger logger);
-
-    /**
-     * Returns the location of the annotations jar for compilation targets that are <= 15.
-     */
-    String getAnnotationsJar();
+    public void initParser(@NonNull String target,
+                           @NonNull FullRevision buildToolRevision,
+                           @NonNull ILogger logger);
 
     /**
-     * Returns the revision of the installed platform tools component.
+     * Returns the compilation target
+     * @return the target.
      *
-     * @return the FullRevision or null if the revision couldn't not be found
+     * @throws IllegalStateException if the sdk was not initialized.
      */
-    FullRevision getPlatformToolsRevision();
+    @NonNull
+    IAndroidTarget getTarget();
 
     /**
-     * Returns the location of the aapt tool.
-     */
-    File getAapt();
-
-    /**
-     * Returns the location of the aidl compiler.
+     * Returns the BuildToolInfo
+     * @return the build tool info
+     *
+     * @throws IllegalStateException if the sdk was not initialized.
      */
-    File getAidlCompiler();
+    @NonNull
+    BuildToolInfo getBuildTools();
 
     /**
-     * Returns the location of the renderscript compiler.
-     */
-    File getRenderscriptCompiler();
+      * Returns the location of the annotations jar for compilation targets that are <= 15.
+      */
+    String getAnnotationsJar();
 
     /**
-     * Returns the location of the dx tool.
+     * Returns the revision of the installed platform tools component.
+     *
+     * @return the FullRevision or null if the revision couldn't not be found
      */
-    File getDx();
+    FullRevision getPlatformToolsRevision();
 
     /**
      * Returns the location of the zip align tool.
index 6a67e89955a8a67f93e51b82e77c40cf4bbba5d5..ff8acb4472ba04d650249efc3ca677402be334f4 100644 (file)
@@ -66,11 +66,6 @@ public class FakeAndroidTarget implements IAndroidTarget {
             mPaths.put(ANDROID_JAR, apiPrebuilts + SdkConstants.FN_FRAMEWORK_LIBRARY);
             mPaths.put(ANDROID_AIDL, apiPrebuilts + SdkConstants.FN_FRAMEWORK_AIDL);
         }
-
-        // location of the renderscript imports.
-        String rsPrebuilts = mSdkLocation + "/prebuilts/sdk/renderscript/";
-        mPaths.put(ANDROID_RS, rsPrebuilts + SdkConstants.OS_FRAMEWORK_RS);
-        mPaths.put(ANDROID_RS_CLANG, rsPrebuilts + SdkConstants.OS_FRAMEWORK_RS_CLANG);
     }
 
     private int getApiLevel(String target) {
index 71a0f0482b3c92100400b2ed2c12c2467923641e..0f7618e1892cc52176308616b12bbb02bececba2 100644 (file)
@@ -72,6 +72,11 @@ class AppPlugin extends com.android.build.gradle.BasePlugin implements org.gradl
         super(instantiator)
     }
 
+    @Override
+    protected BaseExtension getAndroidExtension() {
+        return extension;
+    }
+
     @Override
     void apply(Project project) {
         super.apply(project)
@@ -530,9 +535,4 @@ class AppPlugin extends com.android.build.gradle.BasePlugin implements org.gradl
 
         return variant;
     }
-
-    @Override
-    protected String getTarget() {
-        return extension.compileSdkVersion;
-    }
 }
index 0230396e8b4ef40f9ad4b64405fc23a91fbbd350..7d376025a9d7e4e25e99fe67c9bfec77e749052c 100644 (file)
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 package com.android.build.gradle
+
 import com.android.build.gradle.internal.CompileOptions
 import com.android.build.gradle.internal.dsl.AaptOptionsImpl
 import com.android.build.gradle.internal.dsl.AndroidSourceSetFactory
@@ -22,6 +23,7 @@ import com.android.build.gradle.internal.dsl.ProductFlavorDsl
 import com.android.build.gradle.internal.test.TestOptions
 import com.android.builder.BuilderConstants
 import com.android.builder.ProductFlavor
+import com.android.sdklib.repository.FullRevision
 import org.gradle.api.Action
 import org.gradle.api.NamedDomainObjectContainer
 import org.gradle.api.artifacts.Configuration
@@ -35,6 +37,7 @@ import org.gradle.internal.reflect.Instantiator
 public abstract class BaseExtension {
 
     private String target
+    private FullRevision buildToolsRevision
 
     final ProductFlavor defaultConfig
     final AaptOptionsImpl aaptOptions
@@ -110,6 +113,14 @@ public abstract class BaseExtension {
         compileSdkVersion(target)
     }
 
+    void buildToolsVersion(String version) {
+        buildToolsRevision = FullRevision.parseRevision(version)
+    }
+
+    void setBuildToolsVersion(String version) {
+        buildToolsVersion(version)
+    }
+
     void sourceSets(Action<NamedDomainObjectContainer<AndroidSourceSet>> action) {
         action.execute(sourceSetsContainer)
     }
@@ -147,4 +158,8 @@ public abstract class BaseExtension {
     public String getCompileSdkVersion() {
         return target
     }
+
+    public FullRevision getBuildToolsRevision() {
+        return buildToolsRevision
+    }
 }
index d6defef04713f9e3677a9873545c922bf2b41c26..c1f6d75dd56ba22d47b4c66017637a2cc57dc6f5 100644 (file)
@@ -59,6 +59,7 @@ import com.android.builder.VariantConfiguration
 import com.android.builder.dependency.AndroidDependency
 import com.android.builder.dependency.JarDependency
 import com.android.builder.signing.SigningConfig
+import com.android.sdklib.repository.FullRevision
 import com.android.utils.ILogger
 import com.google.common.collect.ArrayListMultimap
 import com.google.common.collect.Lists
@@ -123,7 +124,7 @@ public abstract class BasePlugin {
     protected Task assembleTest
     protected Task deviceCheck
 
-    protected abstract String getTarget()
+    protected abstract BaseExtension getAndroidExtension()
 
     protected BasePlugin(Instantiator instantiator) {
         this.instantiator = instantiator
@@ -224,7 +225,20 @@ public abstract class BasePlugin {
         AndroidBuilder androidBuilder = builders.get(variant)
 
         if (androidBuilder == null) {
-            androidBuilder = variant.createBuilder(this)
+            String target = androidExtension.getCompileSdkVersion()
+            if (target == null) {
+                throw new IllegalArgumentException("android.compileSdkVersion is missing!")
+            }
+
+            FullRevision buildToolsRevision = androidExtension.buildToolsRevision
+            if (buildToolsRevision == null) {
+                throw new IllegalArgumentException("android.buildToolsVersion is missing!")
+
+            }
+
+            sdkParser.initParser(target, buildToolsRevision, logger)
+            androidBuilder = new AndroidBuilder(sdkParser, logger, verbose)
+
             builders.put(variant, androidBuilder)
         }
 
index 3be6c08d1c872403c3c0d73c75e616a9f29f8864..fa1de5985aad94728bf27dee503d7e35345d3d67 100644 (file)
@@ -56,6 +56,11 @@ public class LibraryPlugin extends BasePlugin implements Plugin<Project> {
         super(instantiator)
     }
 
+    @Override
+    protected BaseExtension getAndroidExtension() {
+        return extension;
+    }
+
     @Override
     void apply(Project project) {
         super.apply(project)
@@ -293,9 +298,4 @@ public class LibraryPlugin extends BasePlugin implements Plugin<Project> {
 
         return testVariant
     }
-
-    @Override
-    protected String getTarget() {
-        return extension.compileSdkVersion
-    }
 }
index d90221105ff19f88a0f4ca5898531ac40fd42000..4b520df74ff83102f2d56fb386262c489ea2f2f9 100644 (file)
@@ -114,8 +114,6 @@ public abstract class ApplicationVariant {
         return config.getPackageName()
     }
 
-    abstract AndroidBuilder createBuilder(BasePlugin androidBasePlugin)
-
     protected String getFlavoredName(boolean capitalized) {
         StringBuilder builder = new StringBuilder()
         for (ProductFlavor flavor : config.flavorConfigs) {
index fa366064deebf03f8b093768f6470f4b93b8b5cc..9e75822de60656ec9c859d101364c208c4bba777 100644 (file)
@@ -15,8 +15,6 @@
  */
 package com.android.build.gradle.internal
 
-import com.android.build.gradle.BasePlugin
-import com.android.builder.AndroidBuilder
 import com.android.builder.VariantConfiguration
 
 class ProductionAppVariant extends ApplicationVariant {
@@ -64,16 +62,4 @@ class ProductionAppVariant extends ApplicationVariant {
     boolean getRunProguard() {
         return config.buildType.runProguard
     }
-
-    @Override
-    AndroidBuilder createBuilder(BasePlugin androidBasePlugin) {
-        AndroidBuilder androidBuilder = new AndroidBuilder(
-                androidBasePlugin.sdkParser,
-                androidBasePlugin.logger,
-                androidBasePlugin.verbose)
-
-        androidBuilder.setTarget(androidBasePlugin.target)
-
-        return androidBuilder
-    }
 }
index dc8cf8ea1163af9cf73ff8c50159ca5095578d94..ce7ece6e3f5ad37911899bcd82f9ba857f050e36 100644 (file)
@@ -15,8 +15,6 @@
  */
 package com.android.build.gradle.internal
 
-import com.android.build.gradle.BasePlugin
-import com.android.builder.AndroidBuilder
 import com.android.builder.VariantConfiguration
 
 class TestAppVariant extends ApplicationVariant {
@@ -65,16 +63,4 @@ class TestAppVariant extends ApplicationVariant {
     boolean getRunProguard() {
         return false
     }
-
-    @Override
-    AndroidBuilder createBuilder(BasePlugin androidBasePlugin) {
-        AndroidBuilder androidBuilder = new AndroidBuilder(
-                androidBasePlugin.sdkParser,
-                androidBasePlugin.logger,
-                androidBasePlugin.verbose)
-
-        androidBuilder.setTarget(androidBasePlugin.target)
-
-        return androidBuilder
-    }
 }
index c9c927599054baafb4efb8eaaf161c405e8debd9..be67004edceff240beac2f1dd4fffc53828851fd 100644 (file)
@@ -11,5 +11,6 @@ apply plugin: 'android'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 
 }
\ No newline at end of file
index 85e4c9db7b369d0a19f846dbe75a4b45d908ee0a..1a67ff4a0af068c96a21a3f53e1ca793cc7a89ed 100644 (file)
@@ -2,6 +2,7 @@ apply plugin: 'android'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 }
 
 // query for all (non-test) variants and inject a new step in the builds
index 50837f76479eaa0b1d6251d360d3a4ec7f64d309..72889e4200562849c47d5a773aee64545f8d6709 100644 (file)
@@ -2,6 +2,7 @@ apply plugin: 'android-library'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 }
 
 // query for all (non-test) variants and inject a new step in the builds
index 8d1c513d1e7829db0f33c0e430322559a5c519a8..5b76f9b4f62476b582889eced59083d9e46f86b7 100644 (file)
@@ -2,6 +2,7 @@ apply plugin: 'android'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 }
 
 //
index 99ff711c9356e84245a214d4f9b98e5bb43d8061..6aca68e706cde39f2219e6686981d75d66f90148 100644 (file)
@@ -2,8 +2,9 @@ apply plugin: 'android-library'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 
-       defaultConfig {
-               testPackageName = "com.android.tests.testprojecttest.testlib"
-       }
+    defaultConfig {
+        testPackageName = "com.android.tests.testprojecttest.testlib"
+    }
 }
\ No newline at end of file
index f71301e4804c399961cc5c315a3d8d762adb7144..d078f0c49aaebc3600ef6e13872209f322153c45 100644 (file)
@@ -2,6 +2,7 @@ apply plugin: 'android'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 }
 
 dependencies {
index 182f8454def85ece8a27e8449d9e57699c96f55b..f63ed4d5f148e278ada7c4a43d694f5957729aab 100644 (file)
@@ -2,4 +2,5 @@ apply plugin: 'android-library'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 }
\ No newline at end of file
index 4b355f35e4805352373b6a2ec70f35be56255e1e..3b1a5597596934e6568814d7b8ed93e9db79a014 100644 (file)
@@ -14,6 +14,8 @@ apply plugin: 'android'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
+
     testBuildType "debug"
 
     signingConfigs {
index dd2281c3b9ee2099a61ab4a63ca8040f8580d375..c6ba30d101aaf81c1c170a6b8e39f47957b0557d 100644 (file)
@@ -24,6 +24,8 @@ dependencies {
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
+
     testBuildType "blah"
 
     defaultConfig {
index 891d191e95621c507e82b31813ae29c3a41f173c..724d786a0b1a623267670f298c6eb7e1bfe3f90d 100644 (file)
@@ -14,6 +14,8 @@ apply plugin: 'android'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
+
     testBuildType = "staging"
 
     defaultConfig {
index c3111bf22ace409f8158ff05f4df91edd6a271be..727cf151d28bb437959b9c3c3fe7ae2b524f7145 100644 (file)
@@ -2,6 +2,7 @@ apply plugin: 'android'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 
     productFlavors {
         flavor1 {
index 182f8454def85ece8a27e8449d9e57699c96f55b..f63ed4d5f148e278ada7c4a43d694f5957729aab 100644 (file)
@@ -2,4 +2,5 @@ apply plugin: 'android-library'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 }
\ No newline at end of file
index 182f8454def85ece8a27e8449d9e57699c96f55b..f63ed4d5f148e278ada7c4a43d694f5957729aab 100644 (file)
@@ -2,4 +2,5 @@ apply plugin: 'android-library'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 }
\ No newline at end of file
index 485c953ac0508a94b603f4a8c867a558623a2089..00ff3fe305cc4b26f75e036f56fa0905b3326146 100644 (file)
@@ -2,6 +2,7 @@ apply plugin: 'android'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 
     productFlavors {
         flavor1 {
index 182f8454def85ece8a27e8449d9e57699c96f55b..f63ed4d5f148e278ada7c4a43d694f5957729aab 100644 (file)
@@ -2,4 +2,5 @@ apply plugin: 'android-library'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 }
\ No newline at end of file
index 182f8454def85ece8a27e8449d9e57699c96f55b..f63ed4d5f148e278ada7c4a43d694f5957729aab 100644 (file)
@@ -2,4 +2,5 @@ apply plugin: 'android-library'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 }
\ No newline at end of file
index 8e91be9c13e5a28b4d5fbe1f17c395b88632ddcf..65fbfc37692f50362468508f5e253f13c6f13339 100644 (file)
@@ -11,6 +11,8 @@ apply plugin: 'android'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
+
     flavorGroups   "group1", "group2"
 
     productFlavors {
index 2506b097f7cb27d4e382775803adadd6a7ead016..4da2f268e1c6ceea88c7acfb40469265b2ef58d3 100644 (file)
@@ -2,6 +2,7 @@ apply plugin: 'android'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 }
 
 //
index f1e1e87217acb1b2cce69b07ed5373769d316c61..d404df3678bc5a21729e776951614bf756ec4da2 100644 (file)
@@ -6,4 +6,5 @@ dependencies {
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 }
\ No newline at end of file
index 182f8454def85ece8a27e8449d9e57699c96f55b..f63ed4d5f148e278ada7c4a43d694f5957729aab 100644 (file)
@@ -2,4 +2,5 @@ apply plugin: 'android-library'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 }
\ No newline at end of file
index 182f8454def85ece8a27e8449d9e57699c96f55b..f63ed4d5f148e278ada7c4a43d694f5957729aab 100644 (file)
@@ -2,4 +2,5 @@ apply plugin: 'android-library'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 }
\ No newline at end of file
index 182f8454def85ece8a27e8449d9e57699c96f55b..f63ed4d5f148e278ada7c4a43d694f5957729aab 100644 (file)
@@ -2,4 +2,5 @@ apply plugin: 'android-library'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 }
\ No newline at end of file
index 362924ad3f01a695e54a91d060a11ff87e0ef867..ca47c8c2359f994b70e93298c28d00e8220af46e 100644 (file)
@@ -2,7 +2,7 @@ apply plugin: 'android'
 
 android {
     compileSdkVersion 15
-//    buildToolsVersion "1.0"
+    buildToolsVersion "1.0"
 }
 
 dependencies {
index 4700d90fc9416d60d0c4a8887d2b8db9b15e5f92..b21571af3367d3542905705f2e8d4db3277679f7 100644 (file)
@@ -2,7 +2,7 @@ apply plugin: 'android-library'
 
 android {
     compileSdkVersion 15
-//    buildToolsVersion "1.0"
+    buildToolsVersion "1.0"
 }
 
 dependencies {
index 6d07c6a2fb0b6380e0c4a61628bd3da5828c82dc..e569164957a69944102beffa813e157bc8338e08 100644 (file)
@@ -2,7 +2,7 @@ apply plugin: 'android-library'
 
 android {
     compileSdkVersion 15
-//    buildToolsVersion "1.0"
+    buildToolsVersion "1.0"
 }
 
 dependencies {
index 61206134d15d72a8a28a3af29bdca81608f368c5..9ae056cdcb75e63dcf540e410ee3ec49fb485a83 100644 (file)
@@ -12,6 +12,7 @@ apply plugin: 'android'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 
     sourceSets {
         main {
index d6f81763f69783c9751986bd80a72aeda5e617fd..ca47c8c2359f994b70e93298c28d00e8220af46e 100644 (file)
@@ -2,6 +2,7 @@ apply plugin: 'android'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 }
 
 dependencies {
index 6c5b6a5f3d24b9878b0e7e6a0a5682764a916df9..56600588aee5a0927df88dbd980e29e5de499863 100644 (file)
@@ -2,6 +2,7 @@ apply plugin: 'android-library'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 }
 
 dependencies {
index bcce608088bd5c757803f2631193c9063c5d75e1..50bcb3bf7c1b3444ea139224ad42bf8ba4da82f3 100644 (file)
@@ -2,6 +2,7 @@ apply plugin: 'android-library'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 }
 
 dependencies {
index 1d688e8f7af54e2cf3d88d92716018fdf183b49d..351ada4e26675beddc4fbdfa09b633cee4319a6c 100644 (file)
@@ -11,6 +11,7 @@ apply plugin: 'android'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 
     sourceSets {
         main {
index 93160af3bffa2968d0f4a303a65d95e369c01d9a..a24fa6ff939caaf988a2ee1d75348b68c8ef24d5 100644 (file)
@@ -12,4 +12,5 @@ apply plugin: 'android'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 }
\ No newline at end of file
index e46b210fe31b8bdeafc4cb10dd188ed9aff715b0..58a72c8fb03bbdc02216b0dfe463a6e54d6819e2 100644 (file)
@@ -12,6 +12,7 @@ apply plugin: 'android'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 
     productFlavors {
         one {}
index 19ec8b6f6bbe70f3f0f4a2243367d6154ae90c0a..dc7dcbc8b4a5b85b88759ad16c93e460bbb14aae 100644 (file)
@@ -11,6 +11,7 @@ apply plugin: 'android'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 
     defaultConfig {
         packageName "com.android.tests.basic.foo"
index 5ecec55d1c9690072413c48129998b3fc3e1c2a1..b16d4ca856572370d4d8697d8e3bb17edb8fcaf2 100644 (file)
@@ -11,6 +11,7 @@ apply plugin: 'android'
 
 android {
     compileSdkVersion 17
+    buildToolsVersion "1.0"
 
     defaultConfig {
         renderscriptTargetApi = 17
index 982c831ea3d4b6f95bc748557325b8f4a51d8290..e2cddb55c3741d932d9f22c03d92b188734d7f7c 100644 (file)
@@ -2,6 +2,7 @@ apply plugin: 'android'
 
 android {
     compileSdkVersion 17
+    buildToolsVersion "1.0"
 
     defaultConfig {
         renderscriptTargetApi = 11
index 7b79c44ec3aa927a94116f74e0ec5a8960aa3929..b64d513465513773245bd1564c7535710bb2e0bf 100644 (file)
@@ -2,4 +2,5 @@ apply plugin: 'android-library'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 }
index d707102bed8643175f22197f54bbdb3c21357846..4566e47e1d8a7f6ef2940053ce5f2e734837c210 100644 (file)
@@ -11,6 +11,7 @@ apply plugin: 'android'
 
 android {
     compileSdkVersion 17
+    buildToolsVersion "1.0"
 
     defaultConfig {
         renderscriptTargetApi = 11
index ac7ff81eeeb3fba30749f05dac66164d27650648..eda0a7dbbd07b1d0b8ff484704e96ffc0f24cc86 100644 (file)
@@ -22,5 +22,6 @@ dependencies {
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 }
 
index 07f40ab45404e44bb9c7f6c4e68ed1e3b621a223..34cb341ef4bb26ae99fe37f0ffda3ee5b9593459 100644 (file)
@@ -23,6 +23,7 @@ dependencies {
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 }
 
 group = 'com.example.android.multiproject'
index 48dd92041e38448fa040fef491976e0ff3725a1e..a545df9e422bf0284b2ac6efbbd08216220121d0 100644 (file)
@@ -22,6 +22,7 @@ dependencies {
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 }
 
 group = 'com.example.android.multiproject'
index 3566ad13a83374924b58ce0979f63f705b325925..9a5c70397628b7577b7c718fc921187b25f57183 100644 (file)
@@ -6,4 +6,5 @@ dependencies {
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 }
index 182f8454def85ece8a27e8449d9e57699c96f55b..f63ed4d5f148e278ada7c4a43d694f5957729aab 100644 (file)
@@ -2,4 +2,5 @@ apply plugin: 'android-library'
 
 android {
     compileSdkVersion 15
+    buildToolsVersion "1.0"
 }
\ No newline at end of file