Skip to content

Commit b922c38

Browse files
committed
added no-op module which can be used in release builds
1 parent 23a5314 commit b922c38

File tree

8 files changed

+216
-2
lines changed

8 files changed

+216
-2
lines changed

app/build.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,7 @@ dependencies {
2323
compile fileTree(dir: 'libs', include: ['*.jar'])
2424
compile 'com.android.support:appcompat-v7:23.2.0'
2525
compile 'io.realm:realm-android:0.87.5'
26-
compile project(':realm-browser')
26+
debugCompile project(':realm-browser')
27+
testCompile project(':realm-browser-no-op')
28+
releaseCompile project(':realm-browser-no-op')
2729
}

realm-browser-no-op/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

realm-browser-no-op/build.gradle

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
buildscript {
2+
repositories {
3+
jcenter()
4+
}
5+
dependencies {
6+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
7+
}
8+
}
9+
10+
apply plugin: 'com.jfrog.bintray'
11+
apply plugin: 'com.android.library'
12+
apply plugin: 'com.github.dcendents.android-maven'
13+
14+
android {
15+
compileSdkVersion 23
16+
buildToolsVersion "23.0.2"
17+
resourcePrefix 'realm_browser_'
18+
19+
defaultConfig {
20+
minSdkVersion 14
21+
targetSdkVersion 23
22+
versionCode Integer.parseInt(project.VERSION_CODE)
23+
versionName project.VERSION_NAME
24+
}
25+
buildTypes {
26+
release {
27+
minifyEnabled false
28+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
29+
}
30+
}
31+
}
32+
33+
// Open local.properties
34+
Properties properties = new Properties()
35+
properties.load(project.rootProject.file('local.properties').newDataInputStream())
36+
37+
dependencies {
38+
compile fileTree(dir: 'libs', include: ['*.jar'])
39+
testCompile 'junit:junit:4.12'
40+
compile 'com.android.support:appcompat-v7:23.2.0'
41+
compile 'io.realm:realm-android:0.87.5'
42+
}
43+
44+
/*
45+
* PUBLISHING
46+
*/
47+
def siteUrl = 'https://github.com/jonasrottmann/realm-browser' // Homepage URL of the library
48+
def gitUrl = siteUrl + ".git" // Git repository URL
49+
group = "de.jonasrottmann"
50+
51+
install {
52+
repositories.mavenInstaller {
53+
// This generates POM.xml with proper parameters
54+
pom {
55+
project {
56+
packaging 'aar'
57+
58+
// Add your description here
59+
name 'realm-browser-no-op'
60+
url siteUrl
61+
62+
// Set your license
63+
licenses {
64+
license {
65+
name 'The MIT License (MIT)'
66+
url 'https://opensource.org/licenses/MIT'
67+
}
68+
}
69+
developers {
70+
developer {
71+
id 'jonasrottmann'
72+
name 'Jonas Rottmann'
73+
74+
}
75+
}
76+
scm {
77+
connection gitUrl
78+
developerConnection gitUrl
79+
url siteUrl
80+
}
81+
}
82+
}
83+
}
84+
}
85+
86+
task androidJavadocs(type: Javadoc) {
87+
source = 'src/main/java'
88+
}
89+
90+
task androidJavadocsJar(type: Jar) {
91+
classifier = 'javadoc'
92+
//basename = artifact_id
93+
from androidJavadocs.destinationDir
94+
}
95+
96+
task androidSourcesJar(type: Jar) {
97+
classifier = 'sources'
98+
//basename = artifact_id
99+
from 'src/main/java'
100+
}
101+
102+
artifacts {
103+
//archives packageReleaseJar
104+
archives androidSourcesJar
105+
archives androidJavadocsJar
106+
}
107+
108+
bintray {
109+
user = properties.getProperty("bintray.user")
110+
key = properties.getProperty("bintray.apikey")
111+
112+
configurations = ['archives']
113+
114+
dryRun = false // Whether to run this as dry-run, without deploying
115+
116+
// Package configuration. The plugin will use the repo and name properties to check if the package already exists.
117+
// In that case, there's no need to configure the other package properties (like userOrg, desc, etc).
118+
pkg {
119+
repo = 'maven'
120+
name = 'realm-browser-no-op'
121+
desc = 'Android Realm Browser (no-op)'
122+
websiteUrl = siteUrl
123+
issueTrackerUrl = siteUrl + "/issues"
124+
vcsUrl = siteUrl
125+
licenses = ['MIT']
126+
publicDownloadNumbers = true
127+
}
128+
}
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /Users/jonas/.android-sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest
3+
xmlns:android="http://schemas.android.com/apk/res/android"
4+
package="de.jonasrottmann.realm_browser">
5+
6+
<application android:allowBackup="true"/>
7+
8+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
package de.jonasrottmann.realmbrowser;
2+
3+
import android.content.Context;
4+
import android.support.annotation.NonNull;
5+
6+
import java.util.ArrayList;
7+
import java.util.Arrays;
8+
import java.util.List;
9+
10+
import io.realm.RealmObject;
11+
12+
public final class RealmBrowser {
13+
14+
private static final RealmBrowser sInstance = new RealmBrowser();
15+
private final List<Class<? extends RealmObject>> mRealmModelList;
16+
17+
private RealmBrowser() {
18+
mRealmModelList = new ArrayList<>();
19+
}
20+
21+
public static RealmBrowser getInstance() {
22+
return sInstance;
23+
}
24+
25+
26+
public static void startRealmFilesActivity(@NonNull Context context) {
27+
28+
}
29+
30+
31+
public static void startRealmModelsActivity(@NonNull Context context, @NonNull String realmFileName) {
32+
33+
}
34+
35+
36+
public static void showRealmFilesNotification(@NonNull Context context) {
37+
38+
}
39+
40+
41+
private static void showRealmNotification(@NonNull Context context, @NonNull Class activityClass) {
42+
43+
}
44+
45+
46+
public List<Class<? extends RealmObject>> getRealmModelList() {
47+
return mRealmModelList;
48+
}
49+
50+
51+
@SafeVarargs
52+
public final void addRealmModel(Class<? extends RealmObject>... arr) {
53+
54+
}
55+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<resources>
2+
<string name="realm_browser_title">realm-browser-no-op</string>
3+
</resources>

settings.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include ':app', ':realm-browser'
1+
include ':app', ':realm-browser', ':realm-browser-no-op'

0 commit comments

Comments
 (0)