Created
April 8, 2014 22:23
-
-
Save bgorkowy/10202121 to your computer and use it in GitHub Desktop.
Gradle Setup for use with Android Annotations.
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
apply plugin: 'android' | |
apply plugin: 'android-apt' | |
def AAVersion = 'X.X.X' | |
apt { | |
arguments { | |
androidManifestFile variant.processResources.manifestFile | |
resourcePackageName 'com.package.example.app' | |
// If you're using Android NBS flavors you should use the following line instead of hard-coded packageName | |
// resourcePackageName android.defaultConfig.packageName | |
// You can set optional annotation processing options here, like these commented options: | |
// logLevel 'INFO' | |
// logFile '/var/log/aa.log' | |
} | |
} | |
android { | |
compileSdkVersion 19 | |
buildToolsVersion "19.0.1" | |
defaultConfig { | |
minSdkVersion 14 | |
targetSdkVersion 19 | |
versionName project.VERSION_NAME | |
versionCode Integer.parseInt(project.VERSION_CODE) | |
} | |
buildTypes { | |
release { | |
runProguard false | |
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' | |
} | |
} | |
sourceSets { | |
main { | |
manifest.srcFile 'src/main/AndroidManifest.xml' | |
java.srcDirs = ['src/main/java', 'GENERATED_FOLDER'] | |
resources.srcDirs = ['src/main/resources'] | |
res.srcDirs = ['src/main/res'] | |
assets.srcDirs = ['src/main/assets'] | |
} | |
} | |
} | |
dependencies { | |
compile 'com.android.support:support-v4:19.+' | |
compile fileTree(dir: 'libs', include: ['*.jar']) | |
apt "org.androidannotations:androidannotations:$AAVersion" | |
compile "org.androidannotations:androidannotations-api:$AAVersion" | |
} |
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
# Project-wide Gradle settings. | |
# IDE (e.g. Android Studio) users: | |
# Settings specified in this file will override any Gradle settings | |
# configured through the IDE. | |
# For more details on how to configure your build environment visit | |
# http://www.gradle.org/docs/current/userguide/build_environment.html | |
# Specifies the JVM arguments used for the daemon process. | |
# The setting is particularly useful for tweaking memory settings. | |
# Default value: -Xmx10248m -XX:MaxPermSize=256m | |
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | |
# When configured, Gradle will run in incubating parallel mode. | |
# This option should only be used with decoupled projects. More details, visit | |
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects | |
# org.gradle.parallel=true | |
VERSION_NAME=1.0.0 | |
VERSION_CODE=1 |
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
// Top-level build file where you can add configuration options common to all sub-projects/modules. | |
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:0.9.+' | |
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.2' | |
} | |
} | |
allprojects { | |
repositories { | |
mavenCentral() | |
mavenLocal() | |
version = VERSION_NAME | |
versionCode = VERSION_CODE | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment