summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Davidson <jpd@google.com>2015-08-09 16:31:47 -0700
committerJeff Davidson <jpd@google.com>2015-08-09 16:31:47 -0700
commit3354831fb1ba4c7c1e55218906c8e532d0520bcd (patch)
treeb899bc0e2cd30cf76f2c87d3ec53c30e3562c477
parent74a2813e8f4867ef32b05c3f275d0a7e887c36dd (diff)
downloadandroid_frameworks_opt_setupwizard-3354831fb1ba4c7c1e55218906c8e532d0520bcd.tar.gz
android_frameworks_opt_setupwizard-3354831fb1ba4c7c1e55218906c8e532d0520bcd.tar.bz2
android_frameworks_opt_setupwizard-3354831fb1ba4c7c1e55218906c8e532d0520bcd.zip
Create a standalone gradle file without SDK/build-tools.
Currently, setup-wizard-lib has two gradle files - build.gradle, which is used when building from inside the Android tree, where all dependencies are built from source, and standalone.gradle, where all dependencies are prebuilts. Unbundled apps generally want the latter, but this gradle file defines a specific build tools and SDK version, which is undesirable if we want to build everything with the same build tools and SDK. So, introduce a third gradle file, standalone-rules.gradle, which uses prebuilt support lib dependencies, but which does not define the SDK and build tools so that another gradle file can define these at the top level. Since this doesn't affect existing gradle files, this should be a safe change. Bug: 22670848 Change-Id: I95f4294105b54c5d978f6632bd98e2492a6d983c
-rw-r--r--library/standalone-rules.gradle31
-rw-r--r--library/standalone.gradle17
2 files changed, 32 insertions, 16 deletions
diff --git a/library/standalone-rules.gradle b/library/standalone-rules.gradle
new file mode 100644
index 0000000..692eb96
--- /dev/null
+++ b/library/standalone-rules.gradle
@@ -0,0 +1,31 @@
+/**
+ * Include this gradle file if you are building against this as a standalone gradle library project,
+ * but are defining the compile SDK version and build tools version at the top-level.
+ *
+ * For example, you can include the following in your settings.gradle file:
+ * include ':setup-wizard-lib'
+ * project(':setup-wizard-lib').projectDir = new File(PATH_TO_THIS_DIRECTORY)
+ * project(':setup-wizard-lib').buildFileName = 'standalone-rules.gradle'
+ *
+ * And then you can include the :setup-wizard-lib project as one of your dependencies
+ * dependencies {
+ * compile project(path: ':setup-wizard-lib', configuration: 'icsCompatRelease')
+ * }
+ */
+
+ext {
+ // For standalone project clients, since the source may not be available, we fetch the
+ // dependencies from maven. To add a dependency, you want to specify something like this:
+ // ext {
+ // deps = ['project-name': 'com.example.group:project-name:1.0.0']
+ // }
+ //
+ // And then in rules.gradle you can reference the dependency by
+ // dependencies {
+ // compile deps['project-name']
+ // }
+ //
+ deps = ['support-appcompat-v7': 'com.android.support:appcompat-v7:21.0.0']
+}
+
+apply from: 'rules.gradle'
diff --git a/library/standalone.gradle b/library/standalone.gradle
index 3d9e50f..2bdfe22 100644
--- a/library/standalone.gradle
+++ b/library/standalone.gradle
@@ -14,22 +14,7 @@
* }
*/
-ext {
- // For standalone project clients, since the source may not be available, we fetch the
- // dependencies from maven. To add a dependency, you want to specify something like this:
- // ext {
- // deps = ['project-name': 'com.example.group:project-name:1.0.0']
- // }
- //
- // And then in rules.gradle you can reference the dependency by
- // dependencies {
- // compile deps['project-name']
- // }
- //
- deps = ['support-appcompat-v7': 'com.android.support:appcompat-v7:21.0.0']
-}
-
-apply from: 'rules.gradle'
+apply from: 'standalone-rules.gradle'
android.compileSdkVersion 21
android.buildToolsVersion '21.1.0'