-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
116 lines (100 loc) · 2.78 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
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
}
group 'io.github.WavJaby'
archivesBaseName = "TinyJson"
sourceCompatibility = 1.8 // java 8
targetCompatibility = 1.8
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
archiveClassifier = "sources"
}
jar {
manifest {
attributes('Implementation-Title': project.name,
'Implementation-Version': project.version)
}
}
dependencies {
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.json:json:20220320'
}
artifacts {
archives jar
archives sourcesJar
// archives javadocJar
}
repositories {
mavenCentral()
}
configurations {
archives {
}
}
println "version: " + version
def isReleaseVersion = !version.endsWith("SNAPSHOT")
publishing {
publications {
maven(MavenPublication) {
artifactId = 'tiny-json'
artifact jar
artifact sourcesJar
// artifact javadocJar
pom {
inceptionYear = '2023'
name = project.name
description = 'A simple json library'
url = 'https://github.com/WavJaby/TinyJson'
packaging = 'jar'
description = project.description
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
scm {
connection = 'scm:git:git://github.com/WavJaby/TinyJson.git'
developerConnection = 'scm:git:ssh://github.com/WavJaby/TinyJson.git'
url = 'https://github.com/WavJaby/TinyJson'
}
developers {
developer {
id = 'wavjaby'
email = 'WavJaby@gmail.com'
}
developer {
id = 'bloodnighttw'
email = 'bbeenn1227@gmail.com'
}
}
}
}
}
repositories {
maven {
credentials {
username ossrhUsername
password ossrhPassword
}
if (isReleaseVersion)
url "https://s01.oss.sonatype.org/content/repositories/releases/"
else
url "https://s01.oss.sonatype.org/content/repositories/snapshots/"
}
}
}
wrapper {
gradleVersion = "7.1.1"
distributionType = Wrapper.DistributionType.ALL
}
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("publish") }
sign configurations.archives
}