/
southernquiet.gradle
181 lines (145 loc) · 4.59 KB
/
southernquiet.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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
plugins {
id 'java'
id 'java-library'
id 'maven-publish'
id 'signing'
id "org.jetbrains.kotlin.jvm"
id "org.jetbrains.kotlin.plugin.spring"
id 'org.jetbrains.dokka'
id 'org.springframework.boot'
id 'io.spring.dependency-management'
}
group = 'me.insidezhou.southernquiet'
version = '4.7.2'
ext {
jsonpathVersion = '2.4.0'
instepVersion = '3.0.0'
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://maven.aliyun.com/repository/public" }
maven {
url 'https://pkgs.dev.azure.com/insidezhou/_packaging/insidezhou/maven/v1'
name 'azure'
authentication {
basic(BasicAuthentication)
}
credentials {
username = project.findProperty("azureUsername")
password = project.findProperty("azurePassword")
}
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-reflect"
implementation "org.jetbrains.kotlin:kotlin-stdlib"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core'
implementation "com.fasterxml.jackson.module:jackson-module-kotlin"
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
testImplementation "org.springframework.boot:spring-boot-starter-test"
}
compileJava.dependsOn(processResources)
tasks.withType(JavaCompile) {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
options.encoding = "UTF-8"
}
compileKotlin {
kotlinOptions {
useIR = true
jvmTarget = JavaVersion.VERSION_11
}
}
jar {
enabled = true
manifest {
attributes 'Implementation-Version': archiveVersion
}
}
javadoc {
options.encoding = 'UTF-8'
failOnError = false
}
bootJar {
archiveClassifier.set('boot')
manifest {
attributes 'Implementation-Version': archiveVersion
}
}
task sourceJar(type: Jar) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
task docJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}
publishing {
publications {
full(MavenPublication) {
artifactId jar.archiveBaseName.get()
from components.java
artifact sourceJar
artifact docJar
pom {
name = 'SouthernQuiet'
description = '这是一个基于Spring Boot,为了提供一些基础设施抽象,减少重复劳动而存在的库。'
url = 'https://github.com/InsideZhou/southern-quiet'
scm {
connection = 'scm:git:git://github.com/InsideZhou/southern-quiet.git'
developerConnection = 'scm:git:ssh://github.com/InsideZhou/southern-quiet.git'
url = 'https://github.com/InsideZhou/southern-quiet'
}
licenses {
license {
name = 'The 3-Clause BSD License'
url = 'https://opensource.org/licenses/BSD-3-Clause'
}
}
developers {
developer {
name = 'Inside Zhou'
email = 'inside@insidezhou.me'
}
}
}
}
simple(MavenPublication) {
artifactId jar.archiveBaseName.get()
from components.java
artifact sourceJar
}
}
repositories {
maven {
def isSnapshot = version.endsWith("SNAPSHOT")
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
url isSnapshot ? snapshotsRepoUrl : releasesRepoUrl
name 'sonatype'
credentials {
username = project.hasProperty('ossrhUsername') ? ossrhUsername : ''
password = project.hasProperty('ossrhPassword') ? ossrhPassword : ''
}
}
maven {
url 'https://pkgs.dev.azure.com/insidezhou/_packaging/insidezhou/maven/v1'
name 'azure'
authentication {
basic(BasicAuthentication)
}
credentials {
username = project.findProperty("azureUsername")
password = project.findProperty("azurePassword")
}
}
}
}
signing {
useGpgCmd()
sign publishing.publications.full
}