Created
January 20, 2014 21:15
-
-
Save sapandiwakar/8529334 to your computer and use it in GitHub Desktop.
Building AndroidAnnotations project with Android Studio: http://wp.me/p1XZcx-lk
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
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
def gradleAndroidAnnotationsPluginVersion = '0.3.0' | |
dependencies { | |
classpath 'com.android.tools.build:gradle:0.6.+' | |
} | |
} | |
apply plugin: 'android' | |
repositories { | |
maven { | |
url 'https://github.com/Goddchen/mvn-repo/raw/master/' | |
} | |
mavenCentral() | |
} | |
ext.daggerVersion = '1.0.0'; | |
ext.androidAnnotationsVersion = '2.7.1'; | |
configurations { | |
apt | |
} | |
dependencies { | |
// Android Annotations. | |
apt "com.googlecode.androidannotations:androidannotations:${androidAnnotationsVersion}" | |
compile "com.googlecode.androidannotations:androidannotations-api:${androidAnnotationsVersion}" | |
apt "com.squareup.dagger:dagger-compiler:${daggerVersion}" | |
compile "com.squareup.dagger:dagger:${daggerVersion}" | |
// ABS | |
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar' | |
compile 'com.android.support:support-v4:18.0.+' | |
// GSON | |
compile 'com.google.code.gson:gson:2.2.4' | |
// Universal Image Loader. | |
compile 'com.nostra13.universalimageloader:universal-image-loader:1.8.6' | |
// Commonsware Endless adapter. | |
compile files('libs/CWAC-AdapterWrapper.jar') | |
compile files('libs/CWAC-EndlessAdapter.jar') | |
} | |
android { | |
compileSdkVersion 18 | |
buildToolsVersion "17.0.0" | |
defaultConfig { | |
minSdkVersion 9 | |
targetSdkVersion 18 | |
} | |
} | |
// Android Annotations. | |
android.applicationVariants.all { variant -> | |
aptOutput = file("${project.buildDir}/source/apt_generated/${variant.dirName}") | |
println "****************************" | |
println "variant: ${variant.name}" | |
println "manifest: ${variant.processResources.manifestFile}" | |
println "aptOutput: ${aptOutput}" | |
println "****************************" | |
variant.javaCompile.doFirst { | |
println "*** compile doFirst ${variant.name}" | |
aptOutput.mkdirs() | |
variant.javaCompile.options.compilerArgs += [ | |
'-processorpath', configurations.apt.getAsPath(), | |
'-AandroidManifestFile=' + variant.processResources.manifestFile, | |
'-s', aptOutput | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment