-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
94 lines (78 loc) · 2.48 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.3'
}
}
apply plugin: 'android'
apply plugin: 'idea'
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
repositories {
mavenCentral()
}
configurations {
apt
}
dependencies {
compile 'com.android.support:support-v4:18.0.0'
apt 'com.googlecode.androidannotations:androidannotations:2.7.1'
compile 'com.googlecode.androidannotations:androidannotations-api:2.7.1'
compile 'com.koushikdutta.ion:ion:1.2.0'
compile 'com.github.chrisbanes.actionbarpulltorefresh:library:0.8'
compile 'org.jsoup:jsoup:1.7.3'
compile 'org.apache.commons:commons-lang3:3.1'
}
android {
compileSdkVersion 18
buildToolsVersion "18.0.1"
defaultConfig {
minSdkVersion 15
targetSdkVersion 18
}
// signingConfigs {
// release {
// storeFile file(System.console().readLine("\n\$ Enter keystore path: "))
// storePassword new String(System.console().readPassword("\$ Enter keystore password: "))
// keyAlias System.console().readLine("\$ Enter key alias: ")
// keyPassword new String(System.console().readPassword("\$ Enter key password: "))
// }
// }
//
// buildTypes {
// release {
// signingConfig signingConfigs.release
// }
// }
}
def getSourceSetName(variant) {
return new File(variant.dirName).getName();
}
android.applicationVariants.all { variant ->
def aptOutputDir = project.file("build/source/apt")
def aptOutput = new File(aptOutputDir, variant.dirName)
println "****************************"
println "variant: ${variant.name}"
println "manifest: ${variant.processResources.manifestFile}"
println "aptOutput: ${aptOutput}"
println "****************************"
android.sourceSets[getSourceSetName(variant)].java.srcDirs += aptOutput.getPath()
variant.javaCompile.options.compilerArgs += [
'-processorpath', configurations.apt.getAsPath(),
'-processor', 'com.googlecode.androidannotations.AndroidAnnotationProcessor',
'-AandroidManifestFile=' + variant.processResources.manifestFile,
'-s', aptOutput
]
variant.javaCompile.source = variant.javaCompile.source.filter { p ->
return !p.getPath().startsWith(aptOutputDir.getPath())
}
variant.javaCompile.doFirst {
aptOutput.mkdirs()
}
}