Skip to content

Commit d92207e

Browse files
committed
Update realm version, clean up build Gradle
1 parent d89b624 commit d92207e

File tree

18 files changed

+46
-58
lines changed

18 files changed

+46
-58
lines changed

annotationprocessor/build.gradle

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def source_GIT_COMMIT = new File(buildDir, 'generated/source/GIT_COMMIT/main/jav
1818
dependencies {
1919
compile fileTree(dir: 'libs', include: ['*.jar'])
2020
compile project(':annotations')
21-
compile 'io.realm:realm-annotations:1.1.1'
21+
compile "io.realm:realm-annotations:$realm_annotations_version"
2222
kapt "com.google.auto.service:auto-service:1.0-rc2"
2323
compileOnly "com.google.auto.service:auto-service:1.0-rc2"
2424
compile 'com.squareup:javapoet:1.7.0'
@@ -54,7 +54,3 @@ task compileKotlin.doFirst {
5454

5555
}
5656
}
57-
58-
59-
60-

build.gradle

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
ext.kotlin_version = '1.0.5-2'
4+
ext.kotlin_version = '1.1.0'
5+
ext.realm_version = '2.2.0'
6+
ext.realm_annotations_version = "1.1.1"
7+
ext.sdk_version = 25
8+
ext.build_tools_version = '25.0.0'
9+
ext.support_library_version = '25.1.1'
510

611
repositories {
712
jcenter()
813
}
914
dependencies {
10-
classpath 'com.android.tools.build:gradle:2.2.3'
11-
classpath "io.realm:realm-gradle-plugin:2.2.0"
15+
classpath 'com.android.tools.build:gradle:2.3.0'
16+
classpath "io.realm:realm-gradle-plugin:$realm_version"
1217
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1' // jitpack.io
1318
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1419

example/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ apply plugin: 'com.android.application'
22
apply plugin: 'realm-android'
33

44
android {
5-
compileSdkVersion 24
6-
buildToolsVersion "24.0.1"
5+
compileSdkVersion sdk_version
6+
buildToolsVersion build_tools_version
77

88
defaultConfig {
99
applicationId "com.quarkworks.android.realmtypesafequery.example"
1010
minSdkVersion 19
11-
targetSdkVersion 24
11+
targetSdkVersion sdk_version
1212
versionCode 1
1313
versionName "1.0"
1414
}
@@ -25,7 +25,7 @@ android {
2525
dependencies {
2626
compile fileTree(dir: 'libs', include: ['*.jar'])
2727
testCompile 'junit:junit:4.12'
28-
compile 'com.android.support:appcompat-v7:24.1.1'
28+
compile "com.android.support:appcompat-v7:$support_library_version"
2929
compile project(':query')
3030
provided project(':annotationprocessor')
3131
}

example/src/main/java/com/quarkworks/android/realmtypesafequery/example/MainActivity.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
import com.quarkworks.android.realmtypesafequery.RealmTypeSafeQuery;
99
import com.quarkworks.android.realmtypesafequery.generated.TestRecordFieldNames;
1010
import com.quarkworks.android.realmtypesafequery.generated.TestRecordFields;
11-
import com.quarkworks.android.realmtypesafequery.relationships.RealmToManyRelationship;
12-
import com.quarkworks.android.realmtypesafequery.relationships.RealmToOneRelationship;
1311

1412
import java.util.Date;
1513

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Mon Aug 29 12:55:27 CDT 2016
1+
#Tue Mar 07 12:31:13 CST 2017
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

query/build.gradle

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,40 @@
11
apply plugin: 'com.android.library'
2-
apply plugin: 'realm-android'
32
apply plugin: 'com.github.dcendents.android-maven' // jitpack.io
43

54
group='com.github.quarkworks' // jitpack.io
65

76
android {
8-
compileSdkVersion 24
9-
buildToolsVersion "24.0.3"
7+
compileSdkVersion sdk_version
8+
buildToolsVersion build_tools_version
109

1110
defaultConfig {
1211
minSdkVersion 9
13-
targetSdkVersion 24
12+
targetSdkVersion sdk_version
1413
versionCode 1
1514
versionName "1.0"
1615
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1716

1817
}
18+
1919
buildTypes {
2020
release {
2121
minifyEnabled false
2222
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2323
}
2424
}
25-
26-
27-
2825
}
2926

3027
dependencies {
3128
compile fileTree(dir: 'libs', include: ['*.jar'])
32-
compile 'com.android.support:support-annotations:25.0.0'
29+
provided "com.android.support:support-annotations:$support_library_version"
30+
provided "io.realm:realm-android-library:$realm_version"
3331
androidTestProvided project(':annotationprocessor')
3432
androidTestCompile 'com.android.support.test:runner:0.5'
3533

3634
}
35+
36+
// build a jar with source files
37+
task sourcesJar(type: Jar) {
38+
from android.sourceSets.main.java.srcDirs
39+
classifier = 'sources'
40+
}

query/src/androidTest/java/com/quarkworks/android/realmtypesafequery/BaseTest.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@
44
import android.annotation.SuppressLint;
55
import android.support.test.runner.AndroidJUnit4;
66

7-
87
import com.quarkworks.android.realmtypesafequery.generated.BaseTestRecordFields;
98

10-
import org.junit.After;
119
import org.junit.AfterClass;
12-
import org.junit.Before;
1310
import org.junit.BeforeClass;
1411
import org.junit.FixMethodOrder;
1512
import org.junit.Test;
@@ -22,10 +19,11 @@
2219
import io.realm.RealmConfiguration;
2320
import io.realm.RealmResults;
2421

25-
2622
import static android.support.test.InstrumentationRegistry.getTargetContext;
27-
import static org.junit.Assert.*;
28-
import static org.hamcrest.CoreMatchers.*;
23+
import static org.hamcrest.CoreMatchers.is;
24+
import static org.junit.Assert.assertEquals;
25+
import static org.junit.Assert.assertNotEquals;
26+
import static org.junit.Assert.assertThat;
2927

3028
@RunWith(AndroidJUnit4.class)
3129
@FixMethodOrder(MethodSorters.NAME_ASCENDING)

query/src/androidTest/java/com/quarkworks/android/realmtypesafequery/Cat.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
11
package com.quarkworks.android.realmtypesafequery;
22
// from intro examples realm-java
33

4-
import android.support.annotation.NonNull;
5-
import android.support.annotation.Nullable;
6-
74
import com.quarkworks.android.realmtypesafequery.annotations.GenerateRealmFieldNames;
85
import com.quarkworks.android.realmtypesafequery.annotations.GenerateRealmFields;
96

10-
import java.util.Date;
11-
12-
import io.realm.RealmList;
137
import io.realm.RealmModel;
14-
import io.realm.annotations.Ignore;
15-
import io.realm.annotations.Index;
16-
import io.realm.annotations.PrimaryKey;
178
import io.realm.annotations.RealmClass;
18-
import io.realm.annotations.Required;
199

2010
@RealmClass
2111
@GenerateRealmFieldNames

query/src/androidTest/java/com/quarkworks/android/realmtypesafequery/IntroExampleTest.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import android.support.test.runner.AndroidJUnit4;
66

77
import com.quarkworks.android.realmtypesafequery.generated.CatFields;
8-
import com.quarkworks.android.realmtypesafequery.generated.PersonFieldNames;
98
import com.quarkworks.android.realmtypesafequery.generated.PersonFields;
109

1110
import org.junit.AfterClass;
@@ -18,8 +17,8 @@
1817
import io.realm.RealmConfiguration;
1918

2019
import static android.support.test.InstrumentationRegistry.getTargetContext;
21-
import static org.junit.Assert.assertNotNull;
2220
import static org.junit.Assert.assertEquals;
21+
import static org.junit.Assert.assertNotNull;
2322

2423
@RunWith(AndroidJUnit4.class)
2524
public class IntroExampleTest {
@@ -153,8 +152,8 @@ public void execute(Realm realm) {
153152
}
154153
});
155154
// Find the first person (no query conditions) and read a field
156-
final Person person =
157-
RealmTypeSafeQuery.where(defaultInstance, Person.class).findFirst();
155+
final Person person = RealmTypeSafeQuery.where(defaultInstance, Person.class).findFirst();
156+
assert person != null;
158157
Runnable[] cmds = {
159158
new Runnable() {
160159
public void run() {
@@ -163,13 +162,13 @@ public void run() {
163162
},
164163
new Runnable() {
165164
public void run() {
166-
//noinspection ConstantConditions
165+
167166
assertEquals(person.getName(), "Young Person");
168167
}
169168
},
170169
new Runnable() {
171170
public void run() {
172-
//noinspection ConstantConditions
171+
173172
assertEquals(person.getAge(), 14);
174173
}
175174
}

query/src/main/java/com/quarkworks/android/realmtypesafequery/BaseRealmField.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import android.support.annotation.NonNull;
44

5-
import com.quarkworks.android.realmtypesafequery.interfaces.RealmIndexedField;
65
import com.quarkworks.android.realmtypesafequery.interfaces.RealmField;
6+
import com.quarkworks.android.realmtypesafequery.interfaces.RealmIndexedField;
77
import com.quarkworks.android.realmtypesafequery.interfaces.SortableRealmField;
88

99
import io.realm.RealmModel;

0 commit comments

Comments
 (0)