bilibili-api/build.gradle

151 lines
4.7 KiB
Groovy
Raw Normal View History

2019-02-15 18:14:27 +08:00
buildscript {
ext {
kotlin_version = '1.3.21'
2019-02-26 14:58:14 +08:00
kotlin_coroutines_version = '1.1.1'
2019-03-13 00:18:36 +08:00
ktor_version = '1.1.3'
2019-02-15 18:15:47 +08:00
jvm_target = JavaVersion.VERSION_1_8
2019-02-15 18:14:27 +08:00
}
2018-01-19 17:23:01 +08:00
2019-02-15 18:14:27 +08:00
repositories {
gradlePluginPortal()
}
2018-02-02 17:35:56 +08:00
2019-02-15 18:14:27 +08:00
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
2018-01-19 17:23:01 +08:00
}
2019-02-15 18:14:27 +08:00
group = 'com.hiczp'
version = '0.1.2'
2019-02-15 18:14:27 +08:00
description = 'Bilibili Android client API library for Kotlin'
2018-01-19 17:23:01 +08:00
2019-02-15 18:14:27 +08:00
apply plugin: 'kotlin'
2019-04-07 19:10:42 +08:00
apply plugin: 'maven-publish'
apply plugin: 'signing'
2018-01-19 17:23:01 +08:00
2019-02-15 18:14:27 +08:00
repositories {
mavenCentral()
2019-03-03 20:09:23 +08:00
mavenLocal()
2018-01-19 17:23:01 +08:00
}
2019-02-15 18:14:27 +08:00
//kotlin
dependencies {
2019-02-18 19:08:16 +08:00
// https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-stdlib-jdk8
2019-02-18 23:54:41 +08:00
compile group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8'
2019-02-18 19:08:16 +08:00
// https://mvnrepository.com/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core
compile group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: kotlin_coroutines_version
2018-01-19 17:23:01 +08:00
}
2019-02-15 18:14:27 +08:00
compileKotlin {
2019-02-18 19:08:16 +08:00
kotlinOptions {
jvmTarget = jvm_target
2019-03-24 23:24:32 +08:00
freeCompilerArgs = ["-Xjvm-default=enable", "-Xuse-experimental=kotlin.Experimental", "-XXLanguage:+InlineClasses"]
2019-02-18 19:08:16 +08:00
}
2018-01-22 10:21:24 +08:00
}
2019-02-15 18:14:27 +08:00
compileTestKotlin {
kotlinOptions.jvmTarget = jvm_target
2018-01-19 17:23:01 +08:00
}
2019-02-18 19:08:16 +08:00
//logging
dependencies {
// https://mvnrepository.com/artifact/io.github.microutils/kotlin-logging
compile group: 'io.github.microutils', name: 'kotlin-logging', version: '1.6.25'
2019-02-18 23:54:41 +08:00
// https://mvnrepository.com/artifact/org.slf4j/slf4j-simple
2019-03-05 11:56:54 +08:00
testCompile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.26'
2019-02-18 19:08:16 +08:00
}
//http
dependencies {
// https://mvnrepository.com/artifact/com.squareup.retrofit2/retrofit
compile group: 'com.squareup.retrofit2', name: 'retrofit', version: '2.5.0'
// https://mvnrepository.com/artifact/com.squareup.retrofit2/converter-gson
compile group: 'com.squareup.retrofit2', name: 'converter-gson', version: '2.5.0'
2019-02-20 14:55:07 +08:00
// https://mvnrepository.com/artifact/com.github.salomonbrys.kotson/kotson
compile group: 'com.github.salomonbrys.kotson', name: 'kotson', version: '2.5.0'
2019-02-18 19:08:16 +08:00
// 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
2019-03-27 12:26:47 +08:00
compile group: 'com.squareup.okhttp3', name: 'logging-interceptor', version: '3.14.0'
2019-02-18 19:08:16 +08:00
}
2019-02-18 23:54:41 +08:00
2019-03-13 00:18:36 +08:00
//ktor
dependencies {
// https://mvnrepository.com/artifact/io.ktor/ktor-client-websocket
compile group: 'io.ktor', name: 'ktor-client-websocket', version: ktor_version
// https://mvnrepository.com/artifact/io.ktor/ktor-client-cio
compile group: 'io.ktor', name: 'ktor-client-cio', version: ktor_version
}
2019-03-03 20:09:23 +08:00
//checksum
dependencies {
// https://mvnrepository.com/artifact/com.hiczp/crc32-crack
compile group: 'com.hiczp', name: 'crc32-crack', version: '1.0'
}
2019-02-18 23:54:41 +08:00
//unit test
dependencies {
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter
2019-03-27 12:26:47 +08:00
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter', version: '5.4.1'
2019-02-18 23:54:41 +08:00
}
2019-04-07 19:10:42 +08:00
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 = 'czp3009@gmail.com'
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
}