forked from xiyouMc/AppDynamicFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
127 lines (107 loc) · 3.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
apply plugin: 'com.android.library'
android {
compileSdkVersion 22
buildToolsVersion "19.1.0"
defaultConfig {
minSdkVersion 8
targetSdkVersion 22
}
//签名
signingConfigs {
release {
storeFile file('bundle.keystore')
storePassword 'sheng.han'
keyAlias 'bundle'
keyPassword 'sheng.han'
}
}
buildTypes {
debug {
signingConfig signingConfigs.release
}
release {
signingConfig signingConfigs.release
minifyEnabled false
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
apply plugin: 'maven'
apply plugin: 'signing'
//定义GroupID和Version,ArtefactID会自动使用Project名
group = 'com.dynamicload.framework'
version = '4.2.160721'
artifacts {
archives file('build/libs/' + project.name + '.jar')
}
signing {
required { has("release") && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
uploadArchives {
configuration = configurations.archives
repositories.mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: 'http://192.168.1.3:8081/nexus/content/repositories/VivaVideo/') {//仓库地址
authentication(userName: "admin",//用户名
password: "admin123")//密码
}
pom.project {
name project.name
packaging 'jar'
description 'none'
url 'http://192.168.1.3:8081/nexus/content/repositories/VivaVideo/'//仓库地址
developers {
developer {
id 'mc'
name 'ma machao'
email '[email protected]'
}
}
}
}
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
//dependsOn 可根据实际需要增加或更改 dependsOn: ['compileReleaseJava'],
task buildJar(type: Jar) {
appendix = project.name
baseName = project.name
version = "4.2.16074"
classifier = "release"
//后缀名
extension = "jar"
//最终的 Jar 包名,如果没设置,默认为 [baseName]-[appendix]-[version]-[classifier].[extension]
archiveName = project.name + ".jar"
//需打包的资源所在的路径集
def srcClassDir = [project.buildDir.absolutePath + "/intermediates/classes/release"];
//初始化资源路径集
from srcClassDir
//去除路径集下部分的资源
// exclude "org/chaos/demo/jar/MainActivity.class"
// exclude "org/chaos/demo/jar/MainActivity\$*.class"
exclude "com/dynamicload/framework/BuildConfig.class"
exclude "com/dynamicload/framework/BuildConfig\$*.class"
exclude "**/R.class"
exclude "**/R\$*.class"
//只导入资源路径集下的部分资源
include "com/dynamicload/framework/**/*.class"
//注: exclude include 支持可变长参数
}
android {
lintOptions {
abortOnError false
}
}
dependencies {
provided fileTree(dir: 'libs', include: ['*.jar'])
}