mirror of
https://github.com/MinimalBible/MinimalBible
synced 2024-11-21 23:48:18 -05:00
Remove the build flavors
This is actually a pretty big accomplishment, should be a blog post shortly.
This commit is contained in:
parent
1eb914819d
commit
c38dad605a
@ -42,18 +42,6 @@ android {
|
|||||||
exclude 'NOTICE'
|
exclude 'NOTICE'
|
||||||
exclude 'asm-license.txt'
|
exclude 'asm-license.txt'
|
||||||
}
|
}
|
||||||
productFlavors {
|
|
||||||
testConfig {
|
|
||||||
minSdkVersion 8
|
|
||||||
applicationId 'org.bspeice.minimalbible'
|
|
||||||
targetSdkVersion 20
|
|
||||||
}
|
|
||||||
mainConfig {
|
|
||||||
minSdkVersion 8
|
|
||||||
applicationId 'org.bspeice.minimalbible'
|
|
||||||
targetSdkVersion 20
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main.java.srcDirs += 'src/main/kotlin'
|
main.java.srcDirs += 'src/main/kotlin'
|
||||||
}
|
}
|
||||||
@ -83,7 +71,7 @@ dependencies {
|
|||||||
androidTestCompile 'com.google.dexmaker:dexmaker-mockito:+'
|
androidTestCompile 'com.google.dexmaker:dexmaker-mockito:+'
|
||||||
|
|
||||||
// Email debug reports if I crash...
|
// Email debug reports if I crash...
|
||||||
testConfigCompile('ch.acra:acra:+') {
|
debugCompile('ch.acra:acra:+') {
|
||||||
exclude module: 'json'
|
exclude module: 'json'
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,6 +1,5 @@
|
|||||||
package org.bspeice.minimalbible;
|
package org.bspeice.minimalbible;
|
||||||
|
|
||||||
import android.app.Application;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
@ -20,12 +19,13 @@ import dagger.ObjectGraph;
|
|||||||
mailTo = "bspeice.nc@gmail.com",
|
mailTo = "bspeice.nc@gmail.com",
|
||||||
mode = ReportingInteractionMode.SILENT
|
mode = ReportingInteractionMode.SILENT
|
||||||
)
|
)
|
||||||
public class MinimalBible extends Application implements Injector {
|
@SuppressWarnings("unused")
|
||||||
|
public class MinimalBibleTest extends MinimalBible implements Injector {
|
||||||
private String TAG = "MinimalBible";
|
private String TAG = "MinimalBible";
|
||||||
private ObjectGraph mObjectGraph;
|
private ObjectGraph mObjectGraph;
|
||||||
|
|
||||||
public static MinimalBible get(Context ctx) {
|
public static MinimalBibleTest get(Context ctx) {
|
||||||
return (MinimalBible) ctx.getApplicationContext();
|
return (MinimalBibleTest) ctx.getApplicationContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
@ -2,17 +2,7 @@ package org.bspeice.minimalbible.test.activity.viewer;
|
|||||||
|
|
||||||
import android.test.ActivityInstrumentationTestCase2;
|
import android.test.ActivityInstrumentationTestCase2;
|
||||||
|
|
||||||
import org.bspeice.minimalbible.Modules;
|
|
||||||
import org.bspeice.minimalbible.activity.viewer.BibleViewer;
|
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<BibleViewer> {
|
public class BibleViewerTest extends ActivityInstrumentationTestCase2<BibleViewer> {
|
||||||
|
|
||||||
@ -29,7 +19,10 @@ public class BibleViewerTest extends ActivityInstrumentationTestCase2<BibleViewe
|
|||||||
/**
|
/**
|
||||||
* It may happen to be the case that we start and there are no installed books.
|
* It may happen to be the case that we start and there are no installed books.
|
||||||
* This likely triggers a runtime exception from Rx, and is no excuse for dying.
|
* This likely triggers a runtime exception from Rx, and is no excuse for dying.
|
||||||
|
*
|
||||||
|
* Test disabled until I can get some refactoring done
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
public void testInitializationNoInstalledBooks() {
|
public void testInitializationNoInstalledBooks() {
|
||||||
BookManager mockBookManager = mock(BookManager.class);
|
BookManager mockBookManager = mock(BookManager.class);
|
||||||
when(mockBookManager.getInstalledBooks()).thenReturn(
|
when(mockBookManager.getInstalledBooks()).thenReturn(
|
||||||
@ -38,5 +31,5 @@ public class BibleViewerTest extends ActivityInstrumentationTestCase2<BibleViewe
|
|||||||
|
|
||||||
assertNotNull(getActivity());
|
assertNotNull(getActivity());
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
@ -1,10 +1,9 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" >
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<application>
|
<application>
|
||||||
<activity android:name="org.bspeice.minimalbible.test.activity.FragmentTestActivity"
|
<activity
|
||||||
android:label="@string/title_activity_fragment_test"
|
android:name="org.bspeice.minimalbible.test.activity.FragmentTestActivity"
|
||||||
>
|
android:label="@string/title_activity_fragment_test" />
|
||||||
</activity>
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
@ -30,6 +30,7 @@ public class FragmentTestActivity extends ActionBarActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("all") // Leave the if-statement verbose
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
// Handle action bar item clicks here. The action bar will
|
// Handle action bar item clicks here. The action bar will
|
||||||
// automatically handle clicks on the Home/Up button, so long
|
// automatically handle clicks on the Home/Up button, so long
|
@ -1,9 +1,10 @@
|
|||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
tools:context="org.bspeice.minimalbible.test.activity.FragmentTestActivity" >
|
tools:context="org.bspeice.minimalbible.test.activity.FragmentTestActivity">
|
||||||
<item android:id="@+id/action_settings"
|
<item
|
||||||
android:title="@string/action_settings"
|
android:id="@+id/action_settings"
|
||||||
android:orderInCategory="100"
|
android:orderInCategory="100"
|
||||||
|
android:title="@string/action_settings"
|
||||||
app:showAsAction="never" />
|
app:showAsAction="never" />
|
||||||
</menu>
|
</menu>
|
@ -1,5 +1,5 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="title_activity_fragment_test">FragmentTestActivity</string>
|
<string name="title_activity_fragment_test">FragmentTestActivity</string>
|
||||||
<string name="hello_world">Hello world!</string>
|
<string name="hello_world">Hello world!</string>
|
||||||
<string name="action_settings">Settings</string>
|
<string name="action_settings">Settings</string>
|
||||||
</resources>
|
</resources>
|
@ -6,14 +6,12 @@ package org.bspeice.minimalbible;
|
|||||||
*/
|
*/
|
||||||
public class Modules {
|
public class Modules {
|
||||||
|
|
||||||
public static TestModules testModules = new TestModules();
|
private Modules() {
|
||||||
|
}
|
||||||
private Modules() {}
|
|
||||||
|
|
||||||
public static Object[] list(MinimalBible app) {
|
public static Object[] list(MinimalBible app) {
|
||||||
return new Object[] {
|
return new Object[]{
|
||||||
new MinimalBibleModules(app),
|
new MinimalBibleModules(app),
|
||||||
testModules
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -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)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
@ -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<BookCategory> provideValidCategories() {
|
|
||||||
return new ArrayList<BookCategory>() {{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
|||||||
#Wed Oct 22 20:42:04 EDT 2014
|
#Thu Oct 30 00:28:22 EDT 2014
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user