From c38dad605a64465f26ad35bfddb5fbaf7e67336d Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Thu, 30 Oct 2014 00:42:23 -0400 Subject: [PATCH] Remove the build flavors This is actually a pretty big accomplishment, should be a blog post shortly. --- app/build.gradle | 14 +---- .../minimalbible/MinimalBibleTest.java} | 8 +-- .../test/activity/viewer/BibleViewerTest.java | 15 ++---- .../{testConfig => debug}/AndroidManifest.xml | 9 ++-- .../test/activity/FragmentTestActivity.java | 1 + .../res/layout/activity_fragment_test.xml | 0 .../res/menu/fragment_test.xml | 7 +-- .../res/values-w820dp/dimens.xml | 0 .../res/values/dimens.xml | 0 .../res/values/strings.xml | 2 +- .../bspeice/minimalbible/MinimalBible.java | 0 .../org/bspeice/minimalbible/Modules.java | 8 ++- .../org/bspeice/minimalbible/Modules.java | 14 ----- .../org/bspeice/minimalbible/TestModules.java | 54 ------------------- gradle/wrapper/gradle-wrapper.properties | 4 +- 15 files changed, 24 insertions(+), 112 deletions(-) rename app/src/{testConfig/java/org/bspeice/minimalbible/MinimalBible.java => androidTest/java/org/bspeice/minimalbible/MinimalBibleTest.java} (88%) rename app/src/{testConfig => debug}/AndroidManifest.xml (57%) rename app/src/{testConfig => debug}/java/org/bspeice/minimalbible/test/activity/FragmentTestActivity.java (97%) rename app/src/{testConfig => debug}/res/layout/activity_fragment_test.xml (100%) rename app/src/{testConfig => debug}/res/menu/fragment_test.xml (84%) rename app/src/{testConfig => debug}/res/values-w820dp/dimens.xml (100%) rename app/src/{testConfig => debug}/res/values/dimens.xml (100%) rename app/src/{testConfig => debug}/res/values/strings.xml (61%) rename app/src/{mainConfig => main}/java/org/bspeice/minimalbible/MinimalBible.java (100%) rename app/src/{testConfig => main}/java/org/bspeice/minimalbible/Modules.java (67%) delete mode 100644 app/src/mainConfig/java/org/bspeice/minimalbible/Modules.java delete mode 100644 app/src/testConfig/java/org/bspeice/minimalbible/TestModules.java diff --git a/app/build.gradle b/app/build.gradle index dae9bfd..2e74189 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -42,18 +42,6 @@ android { exclude 'NOTICE' exclude 'asm-license.txt' } - productFlavors { - testConfig { - minSdkVersion 8 - applicationId 'org.bspeice.minimalbible' - targetSdkVersion 20 - } - mainConfig { - minSdkVersion 8 - applicationId 'org.bspeice.minimalbible' - targetSdkVersion 20 - } - } sourceSets { main.java.srcDirs += 'src/main/kotlin' } @@ -83,7 +71,7 @@ dependencies { androidTestCompile 'com.google.dexmaker:dexmaker-mockito:+' // Email debug reports if I crash... - testConfigCompile('ch.acra:acra:+') { + debugCompile('ch.acra:acra:+') { exclude module: 'json' } } \ No newline at end of file diff --git a/app/src/testConfig/java/org/bspeice/minimalbible/MinimalBible.java b/app/src/androidTest/java/org/bspeice/minimalbible/MinimalBibleTest.java similarity index 88% rename from app/src/testConfig/java/org/bspeice/minimalbible/MinimalBible.java rename to app/src/androidTest/java/org/bspeice/minimalbible/MinimalBibleTest.java index 21f701b..5e55c19 100644 --- a/app/src/testConfig/java/org/bspeice/minimalbible/MinimalBible.java +++ b/app/src/androidTest/java/org/bspeice/minimalbible/MinimalBibleTest.java @@ -1,6 +1,5 @@ package org.bspeice.minimalbible; -import android.app.Application; import android.content.Context; import android.util.Log; @@ -20,12 +19,13 @@ import dagger.ObjectGraph; mailTo = "bspeice.nc@gmail.com", mode = ReportingInteractionMode.SILENT ) -public class MinimalBible extends Application implements Injector { +@SuppressWarnings("unused") +public class MinimalBibleTest extends MinimalBible implements Injector { private String TAG = "MinimalBible"; private ObjectGraph mObjectGraph; - public static MinimalBible get(Context ctx) { - return (MinimalBible) ctx.getApplicationContext(); + public static MinimalBibleTest get(Context ctx) { + return (MinimalBibleTest) ctx.getApplicationContext(); } @Override diff --git a/app/src/androidTest/java/org/bspeice/minimalbible/test/activity/viewer/BibleViewerTest.java b/app/src/androidTest/java/org/bspeice/minimalbible/test/activity/viewer/BibleViewerTest.java index 1fffb70..e33ecb9 100644 --- a/app/src/androidTest/java/org/bspeice/minimalbible/test/activity/viewer/BibleViewerTest.java +++ b/app/src/androidTest/java/org/bspeice/minimalbible/test/activity/viewer/BibleViewerTest.java @@ -2,17 +2,7 @@ package org.bspeice.minimalbible.test.activity.viewer; import android.test.ActivityInstrumentationTestCase2; -import org.bspeice.minimalbible.Modules; import org.bspeice.minimalbible.activity.viewer.BibleViewer; -import org.bspeice.minimalbible.service.manager.BookManager; -import org.crosswire.jsword.book.Book; - -import java.util.ArrayList; - -import rx.Observable; - -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; public class BibleViewerTest extends ActivityInstrumentationTestCase2 { @@ -29,7 +19,10 @@ public class BibleViewerTest extends ActivityInstrumentationTestCase2 + - - + diff --git a/app/src/testConfig/java/org/bspeice/minimalbible/test/activity/FragmentTestActivity.java b/app/src/debug/java/org/bspeice/minimalbible/test/activity/FragmentTestActivity.java similarity index 97% rename from app/src/testConfig/java/org/bspeice/minimalbible/test/activity/FragmentTestActivity.java rename to app/src/debug/java/org/bspeice/minimalbible/test/activity/FragmentTestActivity.java index 2a46a63..5c2873e 100644 --- a/app/src/testConfig/java/org/bspeice/minimalbible/test/activity/FragmentTestActivity.java +++ b/app/src/debug/java/org/bspeice/minimalbible/test/activity/FragmentTestActivity.java @@ -30,6 +30,7 @@ public class FragmentTestActivity extends ActionBarActivity { } @Override + @SuppressWarnings("all") // Leave the if-statement verbose public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long diff --git a/app/src/testConfig/res/layout/activity_fragment_test.xml b/app/src/debug/res/layout/activity_fragment_test.xml similarity index 100% rename from app/src/testConfig/res/layout/activity_fragment_test.xml rename to app/src/debug/res/layout/activity_fragment_test.xml diff --git a/app/src/testConfig/res/menu/fragment_test.xml b/app/src/debug/res/menu/fragment_test.xml similarity index 84% rename from app/src/testConfig/res/menu/fragment_test.xml rename to app/src/debug/res/menu/fragment_test.xml index 9bb73ad..ca8d5fb 100644 --- a/app/src/testConfig/res/menu/fragment_test.xml +++ b/app/src/debug/res/menu/fragment_test.xml @@ -1,9 +1,10 @@ - + diff --git a/app/src/testConfig/res/values-w820dp/dimens.xml b/app/src/debug/res/values-w820dp/dimens.xml similarity index 100% rename from app/src/testConfig/res/values-w820dp/dimens.xml rename to app/src/debug/res/values-w820dp/dimens.xml diff --git a/app/src/testConfig/res/values/dimens.xml b/app/src/debug/res/values/dimens.xml similarity index 100% rename from app/src/testConfig/res/values/dimens.xml rename to app/src/debug/res/values/dimens.xml diff --git a/app/src/testConfig/res/values/strings.xml b/app/src/debug/res/values/strings.xml similarity index 61% rename from app/src/testConfig/res/values/strings.xml rename to app/src/debug/res/values/strings.xml index 981e6a3..e19613e 100644 --- a/app/src/testConfig/res/values/strings.xml +++ b/app/src/debug/res/values/strings.xml @@ -1,5 +1,5 @@ - FragmentTestActivity + FragmentTestActivity Hello world! Settings diff --git a/app/src/mainConfig/java/org/bspeice/minimalbible/MinimalBible.java b/app/src/main/java/org/bspeice/minimalbible/MinimalBible.java similarity index 100% rename from app/src/mainConfig/java/org/bspeice/minimalbible/MinimalBible.java rename to app/src/main/java/org/bspeice/minimalbible/MinimalBible.java diff --git a/app/src/testConfig/java/org/bspeice/minimalbible/Modules.java b/app/src/main/java/org/bspeice/minimalbible/Modules.java similarity index 67% rename from app/src/testConfig/java/org/bspeice/minimalbible/Modules.java rename to app/src/main/java/org/bspeice/minimalbible/Modules.java index 0879293..1068286 100644 --- a/app/src/testConfig/java/org/bspeice/minimalbible/Modules.java +++ b/app/src/main/java/org/bspeice/minimalbible/Modules.java @@ -6,14 +6,12 @@ package org.bspeice.minimalbible; */ public class Modules { - public static TestModules testModules = new TestModules(); - - private Modules() {} + private Modules() { + } public static Object[] list(MinimalBible app) { - return new Object[] { + return new Object[]{ new MinimalBibleModules(app), - testModules }; } } diff --git a/app/src/mainConfig/java/org/bspeice/minimalbible/Modules.java b/app/src/mainConfig/java/org/bspeice/minimalbible/Modules.java deleted file mode 100644 index 2e6f518..0000000 --- a/app/src/mainConfig/java/org/bspeice/minimalbible/Modules.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.bspeice.minimalbible; - -/** - * List modules used by default MinimalBible configuration - */ -public class Modules { - private Modules() {} - - public static Object[] list(MinimalBible app) { - return new Object[] { - new MinimalBibleModules(app) - }; - } -} diff --git a/app/src/testConfig/java/org/bspeice/minimalbible/TestModules.java b/app/src/testConfig/java/org/bspeice/minimalbible/TestModules.java deleted file mode 100644 index ed03d46..0000000 --- a/app/src/testConfig/java/org/bspeice/minimalbible/TestModules.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.bspeice.minimalbible; - - -import org.bspeice.minimalbible.activity.downloader.DownloadActivity; -import org.bspeice.minimalbible.service.manager.BookManager; -import org.crosswire.jsword.book.BookCategory; - -import java.util.ArrayList; -import java.util.List; - -import javax.inject.Named; -import javax.inject.Singleton; - -import dagger.Module; -import dagger.Provides; - -/** - * Created by Bradlee Speice on 7/5/2014. - */ -@Module(injects = DownloadActivity.class, - overrides = true, - library = true) -public class TestModules { - - public static CharSequence testActivityTitle = "Test"; - private BookManager bookManager; - - @Provides - CharSequence provideString() { - return testActivityTitle; - } - - @Provides - @Singleton - @Named("ValidCategories") - List provideValidCategories() { - return new ArrayList() {{ - add(BookCategory.BIBLE); - add(BookCategory.COMMENTARY); - add(BookCategory.DICTIONARY); - add(BookCategory.MAPS); - }}; - } - - public void setBookManager(BookManager bookManager) { - this.bookManager = bookManager; - } - - @Provides - @Singleton - BookManager provideBookManager() { - return bookManager; - } -} diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5ace921..40568e2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Oct 22 20:42:04 EDT 2014 +#Thu Oct 30 00:28:22 EDT 2014 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-1.12-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-1.12-all.zip