Skip to content

Instantly share code, notes, and snippets.

@dewmal
Created May 31, 2017 04:13
Show Gist options
  • Save dewmal/648a52abd6fef1a3c700f2ae6bf1ad10 to your computer and use it in GitHub Desktop.
Save dewmal/648a52abd6fef1a3c700f2ae6bf1ad10 to your computer and use it in GitHub Desktop.
Android Annotation Kotlin Gradle file
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "io.egreen.myapplication"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
arguments = ['resourcePackageName': android.defaultConfig.applicationId]
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main.java.srcDirs += "src/main/kotlin"
}
}
android.applicationVariants.all { variant ->
variant.variantData.variantConfiguration.javaCompileOptions.annotationProcessorOptions.arguments =
['androidManifestFile': variant.outputs[0]?.processResources?.manifestFile?.absolutePath,
'resourcePackageName': android.defaultConfig.applicationId]
}
kapt {
// correctErrorTypes = true
generateStubs = true
arguments {
arg("androidManifestFile", variant.outputs[0]?.processResources.manifestFile)
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
compile 'com.android.support:appcompat-v7:25.2.0'
testCompile 'junit:junit:4.12'
compile 'com.android.support.constraint:constraint-layout:1.0.1'
kapt "org.androidannotations:androidannotations:$AAVersion"
compile "org.androidannotations:androidannotations-api:$AAVersion"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment