Created
February 23, 2016 01:44
-
-
Save luizmarcus/67d04d882feaccf9266e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
apply plugin: 'com.android.application' | |
apply plugin: 'android-apt'//plugin que auxilia no processamento das annotations | |
android { | |
compileSdkVersion 23 | |
buildToolsVersion "23.0.2" | |
defaultConfig { | |
applicationId "br.com.luizmarcus.exemploannotations" | |
minSdkVersion 15 | |
targetSdkVersion 23 | |
versionCode 1 | |
versionName "1.0" | |
} | |
buildTypes { | |
release { | |
minifyEnabled false | |
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | |
} | |
} | |
} | |
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' | |
} | |
} | |
apt { | |
arguments { | |
resourcePackageName android.defaultConfig.applicationId | |
androidManifestFile variant.outputs[0]?.processResources?.manifestFile | |
logLevel 'INFO' | |
} | |
} | |
//Pasta onde as annotations gerarão as classes | |
android.applicationVariants.each { variant -> | |
aptOutput = file("${project.buildDir}/source/apt_generated/${variant.dirName}") | |
variant.javaCompile.doFrist { | |
aptOutput.mkdirs() | |
variant.javaCompile.options.compilerArgs += [ | |
'-processorpath', configurations.apt.getAsPath(), | |
'-AandroidManifestFile=' + variant.processResources.manifestFile, | |
'-s', aptOutput | |
] | |
} | |
} | |
def AAVersion = '3.3.2'//versão da Android Annotations | |
dependencies { | |
//compila jars externos | |
compile fileTree(dir: 'libs', include: ['*.jar']) | |
testCompile 'junit:junit:4.12' | |
//biblioteca de suporte | |
compile 'com.android.support:appcompat-v7:23.1.1' | |
// Android Annotations | |
apt "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