diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index 1f2af51..9a8b7e5 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -1,6 +1,7 @@
+
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 0000000..97626ba
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 1bef656..dc42857 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -5,12 +5,24 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 7b20cba..b1c9936 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,5 +1,8 @@
+
+
+
@@ -32,17 +35,12 @@
- Portability issues
+ Android
- Threading issues
+ Android Lint
-
-
- Abstraction issues
-
-
@@ -66,7 +64,18 @@
- 1.8
+ 1.7
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.idea/modules.xml b/.idea/modules.xml
index b0fad32..6d38b65 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -4,7 +4,10 @@
+
+
+
-
\ No newline at end of file
+
diff --git a/app/app.iml b/app/app.iml
old mode 100644
new mode 100755
index 51b2034..2a1e29f
--- a/app/app.iml
+++ b/app/app.iml
@@ -8,15 +8,12 @@
-
+
-
-
-
-
+
+
- generateDebugAndroidTestSources
- generateDebugSources
+ generateApplibdevDebugSources
@@ -27,22 +24,57 @@
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -50,6 +82,13 @@
+
+
+
+
+
+
+
@@ -57,6 +96,13 @@
+
+
+
+
+
+
+
@@ -64,34 +110,38 @@
+
+
+
+
-
-
+
-
-
-
+
+
+
+
-
-
-
-
-
+
-
+
+
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
old mode 100644
new mode 100755
index 00fb6fa..a67e0c6
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -17,6 +17,24 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
+ productFlavors {
+ dev {
+ // Your dev tweaks here
+ minSdkVersion 21
+ }
+ prod {
+ // Your prod tweaks here
+ minSdkVersion 16
+ }
+ applibdev {
+ // Your dev tweaks here
+ minSdkVersion 21
+ }
+ applibprod {
+ // Your prod tweaks here
+ minSdkVersion 16
+ }
+ }
}
configurations {
@@ -24,15 +42,33 @@ configurations {
prodDebugCompile
devReleaseCompile
prodReleaseCompile
+
+ applibdevDebugCompile
+ applibdevReleaseCompile
+ applibprodDebugCompile
+ applibprodReleaseCompile
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
- devDebugCompile project(path: ':mylib', configuration: 'devDebug')
- prodDebugCompile project(path: ':mylib', configuration: 'prodDebug')
+ Map customDeps = new HashMap()
+
+ customDeps.put("devDebugCompile", dependencies.project(path: ":mylib", configuration: "devDebug"))
+ customDeps.put("prodDebugCompile", dependencies.project(path: ":mylib", configuration: "prodDebug"))
+ customDeps.put("devReleaseCompile", dependencies.project(path: ":mylib", configuration: "devRelease"))
+ customDeps.put("prodReleaseCompile", dependencies.project(path: ":mylib", configuration: "prodRelease"))
- devReleaseCompile project(path: ':mylib', configuration: 'devRelease')
- prodReleaseCompile project(path: ':mylib', configuration: 'prodRelease')
+ customDeps.put("applibdevDebugCompile", dependencies.project(path: ":applib", configuration: "devDebug"))
+ customDeps.put("applibdevReleaseCompile", dependencies.project(path: ":applib", configuration: "devRelease"))
+ customDeps.put("applibprodDebugCompile", dependencies.project(path: ":applib", configuration: "prodDebug"))
+ customDeps.put("applibprodReleaseCompile", dependencies.project(path: ":applib", configuration: "prodRelease"))
+
+ configurations.all({ config ->
+ Dependency d = customDeps.get(config.name)
+ if (d != null) {
+ config.dependencies.add(d)
+ }
+ })
}
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
old mode 100644
new mode 100755
index f7158b8..0cc579d
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -1,11 +1,18 @@
-
-
-
+
+
+
+
+
+
-
+
diff --git a/applib/.gitignore b/applib/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/applib/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/applib/applib.iml b/applib/applib.iml
new file mode 100644
index 0000000..936d751
--- /dev/null
+++ b/applib/applib.iml
@@ -0,0 +1,141 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ generateDevDebugSources
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/applib/build.gradle b/applib/build.gradle
new file mode 100644
index 0000000..e68c942
--- /dev/null
+++ b/applib/build.gradle
@@ -0,0 +1,50 @@
+apply plugin: 'com.android.library'
+
+android {
+ compileSdkVersion 24
+ buildToolsVersion "24.0.1"
+ publishNonDefault true
+
+ defaultConfig {
+ minSdkVersion 9
+ targetSdkVersion 24
+ versionCode 1
+ versionName "1.0"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+ productFlavors {
+ dev {
+ // Your dev tweaks here
+ minSdkVersion 21
+ }
+ prod {
+ // Your prod tweaks here
+ minSdkVersion 16
+ }
+ }
+}
+
+dependencies {
+ compile fileTree(dir: 'libs', include: ['*.jar'])
+ testCompile 'junit:junit:4.12'
+ compile 'com.android.support:appcompat-v7:24.1.1'
+
+ Map customDeps = new HashMap()
+
+ customDeps.put("devDebugCompile", dependencies.project(path: ":mylib", configuration: "devDebug"))
+ customDeps.put("prodDebugCompile", dependencies.project(path: ":mylib", configuration: "prodDebug"))
+ customDeps.put("devReleaseCompile", dependencies.project(path: ":mylib", configuration: "devRelease"))
+ customDeps.put("prodReleaseCompile", dependencies.project(path: ":mylib", configuration: "prodRelease"))
+
+ configurations.all({ config ->
+ Dependency d = customDeps.get(config.name)
+ if (d != null) {
+ config.dependencies.add(d)
+ }
+ })
+}
diff --git a/applib/proguard-rules.pro b/applib/proguard-rules.pro
new file mode 100644
index 0000000..537c3f4
--- /dev/null
+++ b/applib/proguard-rules.pro
@@ -0,0 +1,17 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in /DevApps/android-adt/sdk/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
diff --git a/applib/src/androidTest/java/com/example/applib/ApplicationTest.java b/applib/src/androidTest/java/com/example/applib/ApplicationTest.java
new file mode 100644
index 0000000..486967f
--- /dev/null
+++ b/applib/src/androidTest/java/com/example/applib/ApplicationTest.java
@@ -0,0 +1,13 @@
+package com.istresearch.applib;
+
+import android.app.Application;
+import android.test.ApplicationTestCase;
+
+/**
+ * Testing Fundamentals
+ */
+public class ApplicationTest extends ApplicationTestCase {
+ public ApplicationTest() {
+ super(Application.class);
+ }
+}
diff --git a/applib/src/main/AndroidManifest.xml b/applib/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..c453b57
--- /dev/null
+++ b/applib/src/main/AndroidManifest.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
diff --git a/applib/src/main/res/values/strings.xml b/applib/src/main/res/values/strings.xml
new file mode 100644
index 0000000..5bc6c7c
--- /dev/null
+++ b/applib/src/main/res/values/strings.xml
@@ -0,0 +1,4 @@
+
+ AppAsLib
+ App As Lib
+
diff --git a/applib/src/test/java/com/example/applib/ExampleUnitTest.java b/applib/src/test/java/com/example/applib/ExampleUnitTest.java
new file mode 100644
index 0000000..9376f60
--- /dev/null
+++ b/applib/src/test/java/com/example/applib/ExampleUnitTest.java
@@ -0,0 +1,15 @@
+package com.istresearch.applib;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * To work on unit tests, switch the Test Artifact in the Build Variants view.
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() throws Exception {
+ assertEquals(4, 2 + 2);
+ }
+}
diff --git a/mylib/build.gradle b/mylib/build.gradle
old mode 100644
new mode 100755
index d370075..6f5bea0
--- a/mylib/build.gradle
+++ b/mylib/build.gradle
@@ -3,6 +3,7 @@ apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
+ publishNonDefault true
defaultConfig {
minSdkVersion 16
@@ -19,7 +20,7 @@ android {
productFlavors {
dev {
// Your dev tweaks here
- minSdkVersion 23
+ minSdkVersion 21
}
prod {
// Your prod tweaks here
@@ -31,4 +32,16 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
+
+ Map customDeps = new HashMap()
+ customDeps.put("devDebugCompile", dependencies.project(path: ':sublib1'))
+ customDeps.put("prodDebugCompile", dependencies.project(path: ':sublib2'))
+
+ configurations.all({ config ->
+ Dependency d = customDeps.get(config.name)
+ if (d != null) {
+ config.dependencies.add(d)
+ }
+ })
+
}
diff --git a/mylib/mylib.iml b/mylib/mylib.iml
old mode 100644
new mode 100755
index 9a851b3..e6022e0
--- a/mylib/mylib.iml
+++ b/mylib/mylib.iml
@@ -12,16 +12,13 @@
-
-
- generateDevDebugAndroidTestSources
generateDevDebugSources
-
+
@@ -29,7 +26,7 @@
-
+
@@ -45,6 +42,13 @@
+
+
+
+
+
+
+
@@ -58,6 +62,13 @@
+
+
+
+
+
+
+
@@ -72,6 +83,13 @@
+
+
+
+
+
+
+
@@ -86,22 +104,23 @@
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
@@ -110,8 +129,11 @@
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mylib/src/dev/res/values/strings.xml b/mylib/src/dev/res/values/strings.xml
new file mode 100755
index 0000000..89c90ff
--- /dev/null
+++ b/mylib/src/dev/res/values/strings.xml
@@ -0,0 +1,4 @@
+
+ My Lib
+ dev Lib
+
\ No newline at end of file
diff --git a/mylib/src/main/res/values/strings.xml b/mylib/src/main/res/values/strings.xml
old mode 100644
new mode 100755
index 5b6f3ee..400881b
--- a/mylib/src/main/res/values/strings.xml
+++ b/mylib/src/main/res/values/strings.xml
@@ -1,3 +1,5 @@
My Lib
+ My Lib
+ prod Lib
diff --git a/settings.gradle b/settings.gradle
old mode 100644
new mode 100755
index 266da6f..1b4583a
--- a/settings.gradle
+++ b/settings.gradle
@@ -1 +1 @@
-include ':app', ':mylib'
+include ':app', ':mylib', ':sublib1', ':sublib2', ':applib'
diff --git a/sublib1/.gitignore b/sublib1/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/sublib1/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/sublib1/build.gradle b/sublib1/build.gradle
new file mode 100644
index 0000000..b4b2445
--- /dev/null
+++ b/sublib1/build.gradle
@@ -0,0 +1,25 @@
+apply plugin: 'com.android.library'
+
+android {
+ compileSdkVersion 24
+ buildToolsVersion "24.0.1"
+
+ defaultConfig {
+ minSdkVersion 9
+ targetSdkVersion 24
+ versionCode 1
+ versionName "1.0"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ compile fileTree(dir: 'libs', include: ['*.jar'])
+ testCompile 'junit:junit:4.12'
+ compile 'com.android.support:appcompat-v7:24.1.1'
+}
diff --git a/sublib1/proguard-rules.pro b/sublib1/proguard-rules.pro
new file mode 100644
index 0000000..537c3f4
--- /dev/null
+++ b/sublib1/proguard-rules.pro
@@ -0,0 +1,17 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in /DevApps/android-adt/sdk/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
diff --git a/sublib1/src/androidTest/java/com/example/library1/ApplicationTest.java b/sublib1/src/androidTest/java/com/example/library1/ApplicationTest.java
new file mode 100644
index 0000000..7b00e18
--- /dev/null
+++ b/sublib1/src/androidTest/java/com/example/library1/ApplicationTest.java
@@ -0,0 +1,13 @@
+package com.istresearch.library2;
+
+import android.app.Application;
+import android.test.ApplicationTestCase;
+
+/**
+ * Testing Fundamentals
+ */
+public class ApplicationTest extends ApplicationTestCase {
+ public ApplicationTest() {
+ super(Application.class);
+ }
+}
diff --git a/sublib1/src/main/AndroidManifest.xml b/sublib1/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..22c95a9
--- /dev/null
+++ b/sublib1/src/main/AndroidManifest.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
diff --git a/sublib1/src/main/java/com/example/library1/MySubLib1Class.java b/sublib1/src/main/java/com/example/library1/MySubLib1Class.java
new file mode 100644
index 0000000..4403f37
--- /dev/null
+++ b/sublib1/src/main/java/com/example/library1/MySubLib1Class.java
@@ -0,0 +1,9 @@
+package com.example.library1;
+
+public class MySubLib1Class {
+
+ @Override
+ public String toString() {
+ return "MySubLib1Class";
+ }
+}
diff --git a/sublib1/src/main/res/values/strings.xml b/sublib1/src/main/res/values/strings.xml
new file mode 100644
index 0000000..d2f06ab
--- /dev/null
+++ b/sublib1/src/main/res/values/strings.xml
@@ -0,0 +1,4 @@
+
+ Sub Library 1
+ SubLib1
+
diff --git a/sublib1/src/test/java/com/example/library1/ExampleUnitTest.java b/sublib1/src/test/java/com/example/library1/ExampleUnitTest.java
new file mode 100644
index 0000000..2e1e7b8
--- /dev/null
+++ b/sublib1/src/test/java/com/example/library1/ExampleUnitTest.java
@@ -0,0 +1,15 @@
+package com.istresearch.library2;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * To work on unit tests, switch the Test Artifact in the Build Variants view.
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() throws Exception {
+ assertEquals(4, 2 + 2);
+ }
+}
diff --git a/sublib1/sublib1.iml b/sublib1/sublib1.iml
new file mode 100644
index 0000000..b58c777
--- /dev/null
+++ b/sublib1/sublib1.iml
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ generateDebugSources
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sublib2/.gitignore b/sublib2/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/sublib2/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/sublib2/build.gradle b/sublib2/build.gradle
new file mode 100644
index 0000000..b4b2445
--- /dev/null
+++ b/sublib2/build.gradle
@@ -0,0 +1,25 @@
+apply plugin: 'com.android.library'
+
+android {
+ compileSdkVersion 24
+ buildToolsVersion "24.0.1"
+
+ defaultConfig {
+ minSdkVersion 9
+ targetSdkVersion 24
+ versionCode 1
+ versionName "1.0"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ compile fileTree(dir: 'libs', include: ['*.jar'])
+ testCompile 'junit:junit:4.12'
+ compile 'com.android.support:appcompat-v7:24.1.1'
+}
diff --git a/sublib2/proguard-rules.pro b/sublib2/proguard-rules.pro
new file mode 100644
index 0000000..537c3f4
--- /dev/null
+++ b/sublib2/proguard-rules.pro
@@ -0,0 +1,17 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in /DevApps/android-adt/sdk/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
diff --git a/sublib2/src/androidTest/java/com/example/library2/ApplicationTest.java b/sublib2/src/androidTest/java/com/example/library2/ApplicationTest.java
new file mode 100644
index 0000000..bf4161d
--- /dev/null
+++ b/sublib2/src/androidTest/java/com/example/library2/ApplicationTest.java
@@ -0,0 +1,13 @@
+package com.istresearch.library3;
+
+import android.app.Application;
+import android.test.ApplicationTestCase;
+
+/**
+ * Testing Fundamentals
+ */
+public class ApplicationTest extends ApplicationTestCase {
+ public ApplicationTest() {
+ super(Application.class);
+ }
+}
diff --git a/sublib2/src/main/AndroidManifest.xml b/sublib2/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..a8c4b80
--- /dev/null
+++ b/sublib2/src/main/AndroidManifest.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
diff --git a/sublib2/src/main/res/values/strings.xml b/sublib2/src/main/res/values/strings.xml
new file mode 100644
index 0000000..dc76580
--- /dev/null
+++ b/sublib2/src/main/res/values/strings.xml
@@ -0,0 +1,4 @@
+
+ Sub Library 2
+ SubLib2
+
diff --git a/sublib2/src/test/java/com/example/library2/ExampleUnitTest.java b/sublib2/src/test/java/com/example/library2/ExampleUnitTest.java
new file mode 100644
index 0000000..9d03ba0
--- /dev/null
+++ b/sublib2/src/test/java/com/example/library2/ExampleUnitTest.java
@@ -0,0 +1,15 @@
+package com.istresearch.library3;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * To work on unit tests, switch the Test Artifact in the Build Variants view.
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() throws Exception {
+ assertEquals(4, 2 + 2);
+ }
+}
diff --git a/sublib2/sublib2.iml b/sublib2/sublib2.iml
new file mode 100644
index 0000000..0d5449b
--- /dev/null
+++ b/sublib2/sublib2.iml
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ generateDebugSources
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file