Skip to content
This repository was archived by the owner on Feb 11, 2022. It is now read-only.

Commit ee3b4bb

Browse files
author
Xavi Rigau
committed
Merge pull request #10 from novoda/update_to_buildtools_0.13.0
Update to buildtools 0.14.2
2 parents a02cf5b + 6c84e90 commit ee3b4bb

12 files changed

Lines changed: 82 additions & 22 deletions

File tree

.gitignore

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,38 @@
1+
# built application files
2+
*.apk
3+
*.ap_
4+
5+
# files for the dex VM
6+
*.dex
7+
8+
# Java class files
9+
*.class
10+
11+
# generated files
12+
bin/
13+
gen/
14+
out/
15+
build.log
16+
build-log.xml
17+
18+
# Local configuration file (sdk path, etc)
19+
local.properties
20+
21+
.project
22+
.classpath
123
.settings
2-
.gradle
3-
/local.properties
4-
/.idea
5-
*/build
6-
/classes
7-
.DS_Store
24+
target/
25+
build/
26+
classes/
27+
gen-external-apklibs/
28+
tmp/
29+
30+
# IDEA Ignores
831
*.iml
32+
*.ipr
33+
*.iws
34+
.idea/
35+
.gradle/
36+
37+
# MAC
38+
*.DS_Store

analyzer/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ apply plugin: 'maven'
1111
apply plugin: 'signing'
1212

1313
dependencies {
14-
compile 'org.xerial:sqlite-jdbc:3.7.15-SNAPSHOT'
14+
compile 'org.xerial:sqlite-jdbc:3.8.7'
1515

1616
compile gradleApi()
1717
compile localGroovy()
1818

19-
testCompile 'junit:junit:4.+'
19+
testCompile 'junit:junit:4.11'
2020
}
2121

2222
group = 'com.novoda'

analyzer/src/main/groovy/com/novoda/sqlite/generator/GetAutoTableCreateGenerator.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static $returnType create(\
3131

3232
private createColumns() {
3333
def columns = []
34-
table.columns.each {
34+
table.noIdColumns.each {
3535
Column column -> columns << ['type': column.dataType, 'name': column.camelizedSmallName, 'access': column.getterPrefix + column.camelizedName]
3636
}
3737
return columns

analyzer/src/main/groovy/com/novoda/sqlite/generator/TableJavaCategory.groovy

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ import com.novoda.sqlite.model.Table
44

55
class TableJavaCategory {
66

7-
private static orgColumns = Table.metaClass.getMetaMethod('getColumns', [] as Class[])
8-
9-
static Column[] getColumns(Table table) {
10-
orgColumns.invoke(table).grep({it.name != '_id'})
7+
static Column[] getNoIdColumns(Table table) {
8+
table.columns.grep({it.name != '_id'})
119
}
1210
}
1311

analyzer/src/main/java/com/novoda/sqlite/FileConnector.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ public FileConnector(File dbFile) {
1515

1616
@Override
1717
public Connection connect() throws SQLException {
18+
try {
19+
// Dynamically load the class in order to correctly initialise JDBC drivers, as described in
20+
// http://stackoverflow.com/questions/6740601/what-does-class-fornameorg-sqlite-jdbc-do/6740632#6740632
21+
Class.forName("org.sqlite.JDBC");
22+
} catch (ClassNotFoundException e) {
23+
e.printStackTrace();
24+
}
1825
String dbPath = "jdbc:sqlite:" + dbFile.getAbsolutePath();
1926
return DriverManager.getConnection(dbPath);
2027
}

analyzer/src/main/java/com/novoda/sqlite/MigrationsConnector.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ public MigrationsConnector(Migrations migrations) {
2020

2121
@Override
2222
public Connection connect() throws SQLException {
23+
try {
24+
// Dynamically load the class in order to correctly initialise JDBC drivers, as described in
25+
// http://stackoverflow.com/questions/6740601/what-does-class-fornameorg-sqlite-jdbc-do/6740632#6740632
26+
Class.forName("org.sqlite.JDBC");
27+
} catch (ClassNotFoundException e) {
28+
e.printStackTrace();
29+
}
30+
2331
Connection connection = DriverManager.getConnection("jdbc:sqlite::memory:");
2432
executeMigrations(connection);
2533
return connection;

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
}
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:0.9.+'
9+
classpath 'com.android.tools.build:gradle:0.14.2'
1010
classpath 'com.novoda:gradle-android-command-plugin:1.1.0-SNAPSHOT'
1111
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.2'
1212
}
@@ -22,10 +22,10 @@ allprojects {
2222
}
2323

2424
ext {
25-
buildToolsVersion = '19.0.1'
25+
buildToolsVersion = '19.1.0'
2626
compileSdkVersion = 19
2727
}
2828

2929
task wrapper(type: Wrapper) {
30-
gradleVersion = '1.10'
30+
gradleVersion = '2.1'
3131
}

demo-auto/build.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apply plugin: 'android'
1+
apply plugin: 'com.android.application'
22
apply plugin: 'android-apt'
33
apply plugin: 'android-command'
44
apply plugin: 'sqlite-access'
@@ -18,7 +18,7 @@ android {
1818
}
1919

2020
dependencies {
21-
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:2.0.+'
21+
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:2.0.1'
2222
compile 'javax.annotation:jsr250-api:1.0'
2323
compile 'com.google.auto.value:auto-value:1.0-rc1'
2424
}
@@ -27,4 +27,6 @@ sqliteAccess {
2727
databaseFile 'src/main/assets/databases/northwind.db'
2828
packageName 'com.example.sqlite'
2929
generateAuto true
30-
}
30+
}
31+
32+
apply from: "$rootDir/team-props/lint.gradle"

demo-sqliteprovider/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apply plugin: 'android'
1+
apply plugin: 'com.android.application'
22
apply plugin: 'android-command'
33
apply plugin: 'sqlite-access'
44

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Mon Jan 27 13:37:31 CET 2014
1+
#Tue Sep 23 14:33:42 CEST 2014
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=http\://services.gradle.org/distributions/gradle-1.11-all.zip
6+
distributionUrl=http\://services.gradle.org/distributions/gradle-2.1-all.zip

0 commit comments

Comments
 (0)