build.gradle
2.21 KB
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
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'maven'
}
private static String getBuildTime() {
Date date = new Date()
String dateStr = date.format("yyyyMMddHHmm")
return "\"${dateStr}\""
}
android {
compileSdkVersion var.compileSdkVersion
defaultConfig {
minSdkVersion var.minSdkVersion
targetSdkVersion var.targetSdkVersion
versionCode var.versionCode
versionName var.versionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
buildConfigField "String", "API_VERSION", "\"${requestVersion}\""
//添加build 时间
buildConfigField "String", "build_version", getBuildTime()
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: project.getName()]
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// 自定义AAR包名
android.libraryVariants.all { variant ->
variant.outputs.all {
if (outputFileName != null && outputFileName.endsWith(".aar")) {
def fileName = "${project.name}-${buildType.name}-v${var.aar_version}.aar"
outputFileName = fileName
}
}
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.wd:log:1.0.0'
implementation 'com.alibaba:fastjson:1.2.62'
api 'com.alibaba:arouter-api:1.5.2'
}
uploadArchives {
repositories {
mavenDeployer {
repository(url: "https://packages.aliyun.com/6708d221eef79c23d7b02189/maven/repo-higom/") {
authentication(userName: '6708d1cf6f4c940bd257c88d', password: 'Wm51gc4rARyr')
}
pom.project {
artifactId 'wdkitcore'
version '1.0.5'
groupId 'com.wd'
packaging 'aar'
}
}
}
}