summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Pimenta <fpimenta@google.com>2016-04-07 18:52:03 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-04-07 18:52:03 +0000
commit6d4e97ac098bb1ba72203cb6e786d7cabb78aa0c (patch)
tree868dc7737c6c9b32a17c22af9df6c72648349653
parent8708c1f6ad935420bceb6feb8d4915cd325eecf3 (diff)
parent398b1f3c56e89b82933e3ee4f01323f9a6596ab7 (diff)
downloadchips-6d4e97ac098bb1ba72203cb6e786d7cabb78aa0c.tar.gz
Removed gradle reference to sdk and build tools
am: 398b1f3 * commit '398b1f3c56e89b82933e3ee4f01323f9a6596ab7': Removed gradle reference to sdk and build tools Change-Id: I8b80c4cd463c2bd3f3d9e50d69789b20435e643a
-rw-r--r--build.gradle24
-rw-r--r--rules.gradle22
-rw-r--r--standalone.gradle38
3 files changed, 20 insertions, 64 deletions
diff --git a/build.gradle b/build.gradle
index c2fdf17..b0e1708 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,7 +1,23 @@
-apply plugin: 'dist'
+import org.gradle.api.artifacts.Dependency;
-ext {
- deps = ['support-v4': project(':support-v4')]
+apply plugin: 'com.android.library'
+
+android {
+ sourceSets.main {
+ manifest.srcFile 'AndroidManifest.xml'
+ java.srcDirs = ['src']
+ res.srcDirs = ['res']
+ }
+}
+
+dependencies {
+ compile findDependency(':support-v4', 'com.android.support:support-v4:23.3.+')
}
-apply from: 'rules.gradle'
+Dependency findDependency(String projectName, String moduleName) {
+ if (findProject(projectName) != null) {
+ return project(projectName);
+ }
+
+ return dependencies.create(moduleName)
+}
diff --git a/rules.gradle b/rules.gradle
deleted file mode 100644
index f5f0239..0000000
--- a/rules.gradle
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Base rules for building chips. This build file is not used directly but rather
- * included in scripts like build.gradle or standalone.gradle using 'apply from'.
- *
- * This allows the dependencies to be configured so that for builds in the Android tree, the
- * dependencies like support library is built directly from source, while for standalone builds they
- * will be fetched from maven central.
- */
-
-apply plugin: 'com.android.library'
-
-android {
- sourceSets.main {
- manifest.srcFile 'AndroidManifest.xml'
- java.srcDirs = ['src']
- res.srcDirs = ['res']
- }
-}
-
-dependencies {
- compile deps['support-v4']
-}
diff --git a/standalone.gradle b/standalone.gradle
deleted file mode 100644
index cc4acfd..0000000
--- a/standalone.gradle
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Include this gradle file if you are building against this as a standalone gradle library project,
- * as opposed to building it as part of the git-tree. This is typically the file you want to include
- * if you create a new project in Android Studio.
- *
- * For example, you can include the following in your settings.gradle file:
- * include ':chips'
- * project(':chips').projectDir = new File(PATH_TO_THIS_DIRECTORY)
- * project(':chips').buildFileName = 'standalone.gradle'
- *
- * And then you can include the :chips project as one of your dependencies
- * dependencies {
- * compile project(path: ':chips')
- * }
- */
-
-apply plugin: 'com.android.library'
-
-android.compileSdkVersion 23
-android.buildToolsVersion '23.0.2'
-
-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-v4': 'com.android.support:support-v4:23.1.+']
-}
-
-apply from: 'rules.gradle'
-