Skip to content
This repository has been archived by the owner on Aug 17, 2020. It is now read-only.

Commit

Permalink
Update to architecture components 1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeWharton committed Nov 21, 2017
1 parent 0f4318b commit 2d1db48
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
23 changes: 11 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
buildscript {
ext.versions = [
'minSdk': 14,
'compileSdk': 26,
'buildTools': '26.0.1',
'kotlin': '1.1.4-3',
'compileSdk': 27,
'kotlin': '1.1.60',
]

repositories {
Expand All @@ -13,7 +12,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta5'
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
}
}
Expand All @@ -30,27 +29,27 @@ allprojects {

ext {
// Android dependencies.
supportV4 = 'com.android.support:support-v4:26.1.0'
supportAnnotations = 'com.android.support:support-annotations:26.1.0'
supportV4 = 'com.android.support:support-v4:27.0.0'
supportAnnotations = 'com.android.support:support-annotations:27.0.0'
supportTestRunner = 'com.android.support.test:runner:0.5'

supportSqlite = 'android.arch.persistence.room:db:1.0.0-alpha9-1'
supportSqliteFramework = 'android.arch.persistence.room:db-impl:1.0.0-alpha9-1'
supportSqlite = 'android.arch.persistence:db:1.0.0'
supportSqliteFramework = 'android.arch.persistence:db-framework:1.0.0'

// Third-party dependencies.
kotlinStdLib = "org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlin}"
dagger = 'com.google.dagger:dagger:2.11'
daggerCompiler = 'com.google.dagger:dagger-compiler:2.11'
dagger = 'com.google.dagger:dagger:2.13'
daggerCompiler = 'com.google.dagger:dagger-compiler:2.13'
butterKnifeRuntime = 'com.jakewharton:butterknife:8.8.1'
butterKnifeCompiler = 'com.jakewharton:butterknife-compiler:8.8.1'
timber = 'com.jakewharton.timber:timber:4.5.1'
timber = 'com.jakewharton.timber:timber:4.6.0'
autoValue = 'com.google.auto.value:auto-value:1.5'
autoValueParcel = 'com.ryanharter.auto.value:auto-value-parcel:0.2.5'
rxJava = 'io.reactivex.rxjava2:rxjava:2.1.3'
rxAndroid = 'io.reactivex.rxjava2:rxandroid:2.0.1'
rxBinding = 'com.jakewharton.rxbinding2:rxbinding:2.0.0'
junit = 'junit:junit:4.12'
truth = 'com.google.truth:truth:0.35'
truth = 'com.google.truth:truth:0.36'
}

configurations {
Expand Down
1 change: 0 additions & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ dependencies {

android {
compileSdkVersion versions.compileSdk
buildToolsVersion versions.buildTools

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import static android.database.sqlite.SQLiteDatabase.CONFLICT_FAIL;

final class DbCallback extends SupportSQLiteOpenHelper.Callback {
static final int VERSION = 1;
private static final int VERSION = 1;

private static final String CREATE_LIST = ""
+ "CREATE TABLE " + TodoList.TABLE + "("
Expand All @@ -42,6 +42,10 @@ final class DbCallback extends SupportSQLiteOpenHelper.Callback {
private static final String CREATE_ITEM_LIST_ID_INDEX =
"CREATE INDEX item_list_id ON " + TodoItem.TABLE + " (" + TodoItem.LIST_ID + ")";

DbCallback() {
super(VERSION);
}

@Override public void onCreate(SupportSQLiteDatabase db) {
db.execSQL(CREATE_LIST);
db.execSQL(CREATE_ITEM);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public final class DbModule {
Configuration configuration = Configuration.builder(application)
.name("todo.db")
.callback(new DbCallback())
.version(DbCallback.VERSION)
.build();
Factory factory = new FrameworkSQLiteOpenHelperFactory();
SupportSQLiteOpenHelper helper = factory.create(configuration);
Expand Down
1 change: 0 additions & 1 deletion sqlbrite-kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ dependencies {

android {
compileSdkVersion versions.compileSdk
buildToolsVersion versions.buildTools

defaultConfig {
minSdkVersion versions.minSdk
Expand Down
1 change: 0 additions & 1 deletion sqlbrite/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ dependencies {

android {
compileSdkVersion versions.compileSdk
buildToolsVersion versions.buildTools

defaultConfig {
minSdkVersion versions.minSdk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ public final class BriteDatabaseTest {
@Before public void setUp() throws IOException {
Configuration configuration = Configuration.builder(InstrumentationRegistry.getContext())
.callback(testDb)
.version(1)
.name(dbFolder.newFile().getPath())
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package com.squareup.sqlbrite3;

import android.annotation.TargetApi;
import android.arch.persistence.db.SupportSQLiteOpenHelper;
import android.arch.persistence.db.SupportSQLiteOpenHelper.Configuration;
import android.arch.persistence.db.SupportSQLiteOpenHelper.Factory;
Expand Down Expand Up @@ -48,7 +47,6 @@ public final class QueryTest {
@Before public void setUp() {
Configuration configuration = Configuration.builder(InstrumentationRegistry.getContext())
.callback(new TestDb())
.version(1)
.build();

Factory factory = new FrameworkSQLiteOpenHelperFactory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ interface ManagerTable {
long bobId;
long eveId;

TestDb() {
super(1);
}

@Override public void onCreate(@NonNull SupportSQLiteDatabase db) {
db.execSQL("PRAGMA foreign_keys=ON");

Expand Down

0 comments on commit 2d1db48

Please sign in to comment.