-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
149 lines (127 loc) · 4.14 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
buildscript {
repositories {
gradlePluginPortal()
}
dependencies {
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61'
}
}
def ktorVersion = '1.2.6'
def slf4jVersion = '1.7.29'
apply plugin: 'kotlin'
apply plugin: 'maven-publish'
apply plugin: 'signing'
group 'com.hiczp'
version '0.0.1'
description 'Call PicaComic API in Kotlin'
repositories {
mavenCentral()
maven { url('https://dl.bintray.com/kotlin/kotlinx/') }
mavenLocal()
}
//kotlin
dependencies {
api 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
}
//http
dependencies {
// https://mvnrepository.com/artifact/com.hiczp/caeruleum
api group: 'com.hiczp', name: 'caeruleum', version: '1.2.8'
// https://mvnrepository.com/artifact/io.ktor/ktor-client-logging-jvm
api group: 'io.ktor', name: 'ktor-client-logging-jvm', version: ktorVersion
// https://mvnrepository.com/artifact/io.ktor/ktor-client-gson
api group: 'io.ktor', name: 'ktor-client-gson', version: ktorVersion
}
//json
dependencies {
// https://mvnrepository.com/artifact/com.google.code.gson/gson
api group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
// https://mvnrepository.com/artifact/com.github.salomonbrys.kotson/kotson
api group: 'com.github.salomonbrys.kotson', name: 'kotson', version: '2.5.0'
}
//log
dependencies {
// https://mvnrepository.com/artifact/org.slf4j/slf4j-api
api group: 'org.slf4j', name: 'slf4j-api', version: slf4jVersion
}
//test
dependencies {
// https://mvnrepository.com/artifact/io.ktor/ktor-client-cio
testApi group: 'io.ktor', name: 'ktor-client-cio', version: ktorVersion
//use this engine only for Proxy, remove it after ktor 1.3.x
// https://mvnrepository.com/artifact/io.ktor/ktor-client-apache
testApi group: 'io.ktor', name: 'ktor-client-apache', version: ktorVersion
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter
testApi group: 'org.junit.jupiter', name: 'junit-jupiter', version: '5.5.2'
// https://mvnrepository.com/artifact/org.slf4j/slf4j-simple
testApi group: 'org.slf4j', name: 'slf4j-simple', version: slf4jVersion
}
test {
useJUnitPlatform()
}
def javaVersion = JavaVersion.VERSION_1_8
def compilerArgs = ['-Xuse-experimental=kotlin.Experimental', '-XXLanguage:+InlineClasses']
compileKotlin {
kotlinOptions {
jvmTarget = javaVersion
freeCompilerArgs = compilerArgs
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = javaVersion
freeCompilerArgs = compilerArgs
}
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
archiveClassifier = 'sources'
}
task javadocJar(type: Jar) {
from javadoc
archiveClassifier = 'javadoc'
}
publishing {
repositories {
maven {
url = uri('https://oss.sonatype.org/service/local/staging/deploy/maven2/')
credentials {
username = project.properties['ossUsername']
password = project.properties['ossPassword']
}
}
}
publications {
maven(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = project.name
description = project.description
url = 'https://github.com/czp3009/picacomic-api'
licenses {
license {
name = 'APACHE LICENSE, VERSION 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'czp3009'
name = 'czp3009'
email = 'https://www.hiczp.com'
}
}
scm {
connection = 'scm:git:git://github.com/czp3009/picacomic-api.git'
developerConnection = 'scm:git:ssh://github.com/czp3009/picacomic-api.git'
url = 'https://github.com/czp3009/picacomic-api'
}
}
}
}
}
signing {
sign publishing.publications.maven
}