Just a project to try out Android Annotation Processor in the new Java8 and Jack&Jill enviornment. Also check if libraries and testing frameworks work with it.
First of all, make sure you know what is JACK&JILL. Check this talk about The Jack and Jill Build System on Youtube.
android.dataBinding.enabled = true
will fail)release
and set testBuildType 'release'
will fail)classpath 'com.google.guava:guava:19.0'
needed)buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0-alpha4'
}
}
android {
compileSdkVersion 24
buildToolsVersion '24.0.0'
defaultConfig {
targetSdkVersion 24
jackOptions {
enabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
// dagger 2
compile 'com.google.dagger:dagger:2.5'
annotationProcessor 'com.google.dagger:dagger-compiler:2.5'
// auto-value
compile 'com.google.auto.value:auto-value:1.2'
annotationProcessor 'com.google.auto.value:auto-value:1.2'
// butterknife
compile 'com.jakewharton:butterknife:8.1.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.1.0'
// logan square
compile 'com.bluelinelabs:logansquare:1.3.6'
annotationProcessor 'com.bluelinelabs:logansquare-compiler:1.3.6'
}
It is only supported if you set minSdkVersion
to 24
or above.
It is simply not supported now. Notification will be shown whenever you try to use it.
If you put the following, error will be thrown.
android {
dataBinding {
enabled = true // Error: Data Binding does not support Jack builds yet
}
}
If you put the following, error will be thrown.
Error:A problem occurred configuring project ':app'.
> Minifying the variant used for tests is not supported when using Jack.
android {
testBuildType 'release'
buildTypes {
release {
minifyEnabled true
signingConfig signingConfigs.debug
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
2.2.0-alpha4
)Stream api is not working working after upgrading to 2.2.0-alpha3
, follow ticket. It means the following doesn't work:
Arrays.asList(3, 1, 2).stream()
.sorted()
.map(String::valueOf)
.forEach(integer -> view.setText(view.getText() + " => " + integer));
2.2.0-alpha4
)Classes are generated in build/intermediates/classes/
instead of build/generated/source/
, so they are not treated as source by Android Studio. Code referencing them will be displayed red. This issue has a temporary solution
com.android.tools.build:gradle:2.2.0-alpha4
.com.google.guava:guava:18.0
is no longer neededbuild/generated/source/apt
now.compileSdkVersion
is updated to 24
buildToolsVersion
is updated to 24.0.0
targetSdkVersion
is updated to 24
com.android.tools.build:gradle:2.2.0-alpha3
.com.android.tools.build:gradle:2.2.0-alpha2
.com.google.guava:guava:18.0
is still neccessary. Ticket filed.build/intermediates/classes/
com.android.tools.build:gradle:2.2.0-alpha1
.N
must be targeted and latest build tool 24.0.0 rc4
must be used to work.com.google.guava:guava:18.0
.build/intermediates/classes/
instead of build/generated/source/