This repository was archived by the owner on Apr 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
127 lines (110 loc) · 3.47 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'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.protobuf'
//帮你发布到jcenter
apply plugin: 'com.github.dcendents.android-maven'
group="com.github.CiyLei"
version = library_version
android {
compileSdkVersion 30
lintOptions {
abortOnError false
}
defaultConfig {
minSdkVersion 14
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles 'consumer-rules.pro'
resValue("string", "HTTP_PORT", "8080")
resValue("string", "WEB_SOCKET_PORT", "8081")
resValue("string", "RESOURCE_PORT", "8082")
resValue("string", "SERVICEHOST", "\"192.168.2.116\"")
resValue("string", "SERVICEPORT", "8083")
resValue("string", "PORT_NUMBER", "7999")
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
defaultPublishConfig "library"
sourceSets {
main {
java {
srcDir 'src/main/java'
}
proto {
srcDir 'src/main/proto'
}
}
}
}
protobuf {
//配置protoc编译器
protoc {
artifact = 'com.google.protobuf:protoc:3.6.1'
}
//这里配置生成目录,编译后会在build的目录下生成对应的java文件
generateProtoTasks {
all().each { task ->
task.builtins {
remove java
}
task.builtins {
java {}
}
}
}
}
task sourcesJar(type: Jar) {
classifier 'sources'
from android.sourceSets.main.javaDirectories
}
artifacts {
archives sourcesJar
}
android.libraryVariants.all { variant ->
if (variant.name.toLowerCase().contains("debug")) {
return
}
def bundleTask = tasks["bundle${variant.name.capitalize()}Aar"]
artifacts {
archives(bundleTask.archivePath) {
classifier variant.flavorName
builtBy bundleTask
name = project.name
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
compileOnly 'androidx.fragment:fragment-ktx:1.2.5'
// compileOnly 'androidx.core:core-ktx:1.3.2'
// testImplementation 'junit:junit:4.13.1'
api 'org.nanohttpd:nanohttpd:2.3.1'
api 'org.nanohttpd:nanohttpd-websocket:2.3.1'
api 'org.nanohttpd:nanohttpd-webserver:2.3.1'
api 'org.nanohttpd:nanohttpd-apache-fileupload:2.3.1'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.squareup.retrofit2:retrofit:2.6.2'
implementation 'com.googlecode.mp4parser:isoparser:1.1.22'
implementation 'com.tencent.mars:mars-core:1.2.3'
implementation 'com.google.protobuf:protobuf-java:3.6.1'
implementation ('androidx.room:room-runtime:2.0.0', {
exclude group: 'com.android.support'
})
kapt ('androidx.room:room-compiler:2.0.0', {
exclude group: 'com.android.support'
})
implementation ('com.amitshekhar.android:debug-db:1.0.6', {
exclude group: 'com.android.support'
})
implementation 'com.github.smarxpan:NotchScreenTool:0.0.1'
implementation 'org.codehaus.janino:janino:3.1.2'
}