Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[jack] add test project to ensure jack can compile. Fix bug that prev…
…ented compilation.
- Loading branch information
Showing
17 changed files
with
263 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 25 | ||
buildToolsVersion "25.0.2" | ||
|
||
defaultConfig { | ||
applicationId "com.grosner.dbflow.jack.tests" | ||
minSdkVersion 9 | ||
targetSdkVersion 25 | ||
versionCode 1 | ||
versionName "1.0" | ||
|
||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
|
||
jackOptions { | ||
enabled true | ||
} | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
annotationProcessor project("${dbflow_project_prefix}dbflow-processor") | ||
compile project("${dbflow_project_prefix}dbflow-core") | ||
compile project("${dbflow_project_prefix}dbflow") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in /Users/andrewgrosner/Library/Android/sdk/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<manifest package="com.grosner.dbflow.jack.tests"> | ||
|
||
<application/> | ||
|
||
</manifest> |
33 changes: 33 additions & 0 deletions
33
dbflow-jack-tests/src/main/java/com/grosner/dbflow/jack/tests/AModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.grosner.dbflow.jack.tests; | ||
|
||
import com.raizlabs.android.dbflow.annotation.Column; | ||
import com.raizlabs.android.dbflow.annotation.ForeignKey; | ||
import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; | ||
import com.raizlabs.android.dbflow.annotation.PrimaryKey; | ||
import com.raizlabs.android.dbflow.annotation.Table; | ||
import com.raizlabs.android.dbflow.structure.BaseModel; | ||
|
||
import java.util.Date; | ||
|
||
/** | ||
* Description: | ||
*/ | ||
@Table(database = AppDatabase.class) | ||
public class AModel extends BaseModel { | ||
|
||
@Column | ||
@PrimaryKey | ||
String name; | ||
|
||
@Column | ||
long time; | ||
|
||
@ForeignKey(references = | ||
{@ForeignKeyReference(columnName = "otherModel", | ||
foreignKeyColumnName = "name")}) | ||
OtherModel model; | ||
|
||
@Column | ||
Date date; | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
dbflow-jack-tests/src/main/java/com/grosner/dbflow/jack/tests/AModelView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.grosner.dbflow.jack.tests; | ||
|
||
import com.raizlabs.android.dbflow.annotation.Column; | ||
import com.raizlabs.android.dbflow.annotation.ModelView; | ||
import com.raizlabs.android.dbflow.annotation.ModelViewQuery; | ||
import com.raizlabs.android.dbflow.sql.Query; | ||
import com.raizlabs.android.dbflow.sql.language.Select; | ||
import com.raizlabs.android.dbflow.structure.BaseModelView; | ||
|
||
/** | ||
* Description: | ||
*/ | ||
@ModelView(database = AppDatabase.class) | ||
public class AModelView extends BaseModelView { | ||
|
||
@ModelViewQuery | ||
public static final Query QUERY = new Select(AModel_Table.time) | ||
.from(AModel.class).where(AModel_Table.time.greaterThan(0l)); | ||
|
||
@Column | ||
long time; | ||
} |
14 changes: 14 additions & 0 deletions
14
dbflow-jack-tests/src/main/java/com/grosner/dbflow/jack/tests/AppDatabase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.grosner.dbflow.jack.tests; | ||
|
||
import com.raizlabs.android.dbflow.annotation.Database; | ||
|
||
/** | ||
* Description: | ||
*/ | ||
@Database(name = AppDatabase.NAME, version = AppDatabase.VERSION, foreignKeyConstraintsEnforced = true) | ||
public class AppDatabase { | ||
|
||
public static final String NAME = "App"; | ||
|
||
public static final int VERSION = 1; | ||
} |
43 changes: 43 additions & 0 deletions
43
dbflow-jack-tests/src/main/java/com/grosner/dbflow/jack/tests/DemoActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.grosner.dbflow.jack.tests; | ||
|
||
import android.app.Activity; | ||
import android.os.Bundle; | ||
import android.view.Menu; | ||
import android.view.MenuItem; | ||
|
||
import com.raizlabs.android.dbflow.config.FlowConfig; | ||
import com.raizlabs.android.dbflow.config.FlowManager; | ||
|
||
|
||
public class DemoActivity extends Activity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
//setContentView(R.layout.activity_demo); | ||
|
||
FlowManager.init(new FlowConfig.Builder(getApplicationContext()).build()); | ||
} | ||
|
||
@Override | ||
public boolean onCreateOptionsMenu(Menu menu) { | ||
// Inflate the menu; this adds items to the action bar if it is present. | ||
//getMenuInflater().inflate(R.menu.menu_demo, menu); | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean onOptionsItemSelected(MenuItem item) { | ||
// Handle action bar item clicks here. The action bar will | ||
// automatically handle clicks on the Home/Up button, so long | ||
// as you specify a parent activity in AndroidManifest.xml. | ||
int id = item.getItemId(); | ||
|
||
//noinspection SimplifiableIfStatement | ||
//if (id == R.id.action_settings) { | ||
// return true; | ||
//} | ||
|
||
return super.onOptionsItemSelected(item); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
dbflow-jack-tests/src/main/java/com/grosner/dbflow/jack/tests/Migration1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.grosner.dbflow.jack.tests; | ||
|
||
import com.raizlabs.android.dbflow.annotation.Migration; | ||
import com.raizlabs.android.dbflow.sql.SQLiteType; | ||
import com.raizlabs.android.dbflow.sql.migration.AlterTableMigration; | ||
|
||
/** | ||
* Description: | ||
*/ | ||
@Migration(version = 2, database = AppDatabase.class) | ||
public class Migration1 extends AlterTableMigration<AModel> { | ||
|
||
public Migration1(Class<AModel> table) { | ||
super(table); | ||
} | ||
|
||
@Override | ||
public void onPreMigrate() { | ||
addColumn(SQLiteType.TEXT, "myColumn"); | ||
addColumn(SQLiteType.REAL, "anotherColumn"); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
dbflow-jack-tests/src/main/java/com/grosner/dbflow/jack/tests/Migration2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.grosner.dbflow.jack.tests; | ||
|
||
import com.raizlabs.android.dbflow.annotation.Migration; | ||
import com.raizlabs.android.dbflow.sql.migration.BaseMigration; | ||
import com.raizlabs.android.dbflow.structure.database.DatabaseWrapper; | ||
|
||
/** | ||
* Description: | ||
*/ | ||
@Migration(version = 3, database = AppDatabase.class) | ||
public class Migration2 extends BaseMigration { | ||
@Override | ||
public void migrate(DatabaseWrapper database) { | ||
|
||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
dbflow-jack-tests/src/main/java/com/grosner/dbflow/jack/tests/OtherModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.grosner.dbflow.jack.tests; | ||
|
||
import com.raizlabs.android.dbflow.annotation.Column; | ||
import com.raizlabs.android.dbflow.annotation.PrimaryKey; | ||
import com.raizlabs.android.dbflow.annotation.Table; | ||
import com.raizlabs.android.dbflow.structure.BaseModel; | ||
|
||
/** | ||
* Description: | ||
*/ | ||
@Table(name = "OtherModel", database = AppDatabase.class) | ||
public class OtherModel extends BaseModel { | ||
|
||
@Column | ||
@PrimaryKey | ||
String name; | ||
} |
10 changes: 10 additions & 0 deletions
10
dbflow-jack-tests/src/main/java/com/grosner/dbflow/jack/tests/SecondAppDatabase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.grosner.dbflow.jack.tests; | ||
|
||
import com.raizlabs.android.dbflow.annotation.Database; | ||
|
||
/** | ||
* Description: | ||
*/ | ||
@Database(version = 1, name = "SecondApp", foreignKeyConstraintsEnforced = true) | ||
public class SecondAppDatabase { | ||
} |
17 changes: 17 additions & 0 deletions
17
dbflow-jack-tests/src/main/java/com/grosner/dbflow/jack/tests/SecondModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.grosner.dbflow.jack.tests; | ||
|
||
import com.raizlabs.android.dbflow.annotation.Column; | ||
import com.raizlabs.android.dbflow.annotation.PrimaryKey; | ||
import com.raizlabs.android.dbflow.annotation.Table; | ||
import com.raizlabs.android.dbflow.structure.BaseModel; | ||
|
||
/** | ||
* Description: | ||
*/ | ||
@Table(database = SecondAppDatabase.class) | ||
public class SecondModel extends BaseModel { | ||
|
||
@Column | ||
@PrimaryKey | ||
String name; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
include ':dbflow', ':dbflow-processor', ':dbflow-core', ':dbflow-sqlcipher', ':dbflow-tests', ':dbflow-kotlinextensions' | ||
include ':dbflow', ':dbflow-processor', ':dbflow-core', ':dbflow-sqlcipher', ':dbflow-tests', ':dbflow-kotlinextensions', ':dbflow-jack-tests' |