forked from liaohuqiu/android-Ultra-Pull-To-Refresh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
99 lines (83 loc) · 2.54 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
97
98
99
apply plugin: 'com.android.application'
android {
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION
defaultConfig {
applicationId "in.srain.cube.views.ptr.demo"
minSdkVersion 8
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
}
lintOptions {
abortOnError false
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
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')
}
dexOptions {
preDexLibraries = false
}
}
def EXCLUDE_JAR_LIST = ['cube-sdk', 'support-v4-r7-source', 'ultra-ptr', 'support-annotation', 'ptr-lib']
task copyLibs << {
// copy jars
copy {
from configurations.compile
into "libs"
eachFile { file ->
println file.name
for (name in EXCLUDE_JAR_LIST) {
if (file.name.contains(name)) {
file.exclude()
return
}
}
}
}
// 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")
eachFile { file ->
println file.name
for (name in EXCLUDE_JAR_LIST) {
if (file.name.contains(name)) {
file.exclude()
return
}
}
}
}
}
dependencies {
compile(project(':ptr-lib')) {
}
compile 'in.srain.cube:clog:1.0.2'
compile 'in.srain.cube:cube-sdk:{cube_sdk_version}@aar'
compile 'com.google.android:support-v4:r7'
}