-
Notifications
You must be signed in to change notification settings - Fork 50
/
build.gradle
155 lines (134 loc) · 4.85 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
buildscript {
ext {
kotlin_version = '1.4.10'
kotlin_coroutines_version = '1.3.9'
ktor_version = '1.3.1'
jvm_target = JavaVersion.VERSION_1_8
}
repositories {
gradlePluginPortal()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
group = 'com.hiczp'
version = '0.2.1'
description = 'Bilibili Android client API library for Kotlin'
apply plugin: 'kotlin'
apply plugin: 'maven-publish'
apply plugin: 'signing'
repositories {
mavenCentral()
jcenter()
mavenLocal()
}
//kotlin
dependencies {
// https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-stdlib-jdk8
compile group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8'
// https://mvnrepository.com/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core
compile group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: kotlin_coroutines_version
}
compileKotlin {
kotlinOptions {
jvmTarget = jvm_target
freeCompilerArgs = ["-Xjvm-default=enable", "-Xopt-in=kotlin.RequiresOptIn", "-XXLanguage:+InlineClasses"]
}
}
compileTestKotlin {
kotlinOptions.jvmTarget = jvm_target
}
//logging
dependencies {
// https://mvnrepository.com/artifact/io.github.microutils/kotlin-logging
compile group: 'io.github.microutils', name: 'kotlin-logging', version: '1.7.9'
// https://mvnrepository.com/artifact/org.slf4j/slf4j-simple
testCompile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.30'
}
//http
dependencies {
// https://mvnrepository.com/artifact/com.squareup.retrofit2/retrofit
compile group: 'com.squareup.retrofit2', name: 'retrofit', version: '2.8.1'
// https://mvnrepository.com/artifact/com.squareup.retrofit2/converter-gson
compile group: 'com.squareup.retrofit2', name: 'converter-gson', version: '2.8.1'
// https://mvnrepository.com/artifact/com.github.salomonbrys.kotson/kotson
compile group: 'com.github.salomonbrys.kotson', name: 'kotson', version: '2.5.0'
// https://mvnrepository.com/artifact/com.jakewharton.retrofit/retrofit2-kotlin-coroutines-adapter
compile group: 'com.jakewharton.retrofit', name: 'retrofit2-kotlin-coroutines-adapter', version: '0.9.2'
// https://mvnrepository.com/artifact/com.squareup.okhttp3/logging-interceptor
compile group: 'com.squareup.okhttp3', name: 'logging-interceptor', version: '4.5.0'
}
//ktor
dependencies {
// https://mvnrepository.com/artifact/io.ktor/ktor-client-websockets
compile group: 'io.ktor', name: 'ktor-client-websockets', version: ktor_version
// https://mvnrepository.com/artifact/io.ktor/ktor-client-cio
compile group: 'io.ktor', name: 'ktor-client-cio', version: ktor_version
}
//checksum
dependencies {
// https://mvnrepository.com/artifact/com.hiczp/crc32-crack
compile group: 'com.hiczp', name: 'crc32-crack', version: '1.0'
}
//unit test
dependencies {
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter', version: '5.6.1'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
archiveClassifier = 'sources'
}
task javadocJar(type: Jar) {
from javadoc
archiveClassifier = 'javadoc'
}
publishing {
repositories {
maven {
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = project.properties.ossUsername
password = project.properties.ossPassword
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = project.name
description = project.description
url = 'https://github.com/czp3009/bilibili-api'
licenses {
license {
name = 'GNU GENERAL PUBLIC LICENSE Version 3'
url = 'https://www.gnu.org/licenses/gpl-3.0.txt'
}
}
developers {
developer {
id = 'czp3009'
name = 'czp3009'
email = '[email protected]'
url = 'https://www.hiczp.com'
}
}
scm {
connection = 'scm:git:git://github.com/czp3009/bilibili-api.git'
developerConnection = 'scm:git:ssh://github.com/czp3009/bilibili-api.git'
url = 'https://github.com/czp3009/bilibili-api'
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
gradle.taskGraph.whenReady { taskGraph ->
tasks.signMavenJavaPublication.onlyIf { taskGraph.hasTask tasks.publish }
}