forked from liaohuqiu/cube-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
96 lines (81 loc) · 2.34 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
95
96
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.+'
}
}
allprojects {
repositories {
jcenter()
mavenCentral();
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots'
}
}
}
apply plugin: 'com.android.library'
android {
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION
defaultConfig {
minSdkVersion 8
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['resources']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
// aidl.srcDirs = ['src']
// renderscript.srcDirs = ['src']
}
androidTest.setRoot('tests')
}
lintOptions {
abortOnError false
}
}
task copyLibs << {
// copy jars
copy {
from configurations.compile
into "libs"
// exclude: apkilib, aar, support-v*
eachFile { file ->
if (file.name.contains("apklib") || file.name.contains("aar")) {
file.exclude()
}
}
}
// copy source
copy {
def sourceList = configurations.compile.incoming.dependencies.collect { dependency ->
dependency.artifact { artifact ->
artifact.name = dependency.name
artifact.type = 'source'
artifact.extension = 'jar'
artifact.classifier = 'sources'
}
dependency
}
from(configurations.detachedConfiguration(sourceList as Dependency[]).resolvedConfiguration.
resolvedConfiguration.lenientConfiguration.getFiles(Specs.SATISFIES_ALL)) {
}
into("libs")
// exclude: apkilib, aar, support-v*
eachFile { file ->
if (file.name.contains("apklib") || file.name.contains("aar") || file.name.contains("support-v4")) {
file.exclude()
}
}
}
}
dependencies {
compile 'com.google.android:support-v4:r7'
compile 'in.srain.cube:clog:1.0.2'
}
apply from: './gradle-mvn-push.gradle'