-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
98 lines (82 loc) · 2.66 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
import com.vanniktech.maven.publish.JavaLibrary
import com.vanniktech.maven.publish.JavadocJar
import com.vanniktech.maven.publish.SonatypeHost
plugins {
id 'java-library'
id "com.vanniktech.maven.publish" version "0.28.0"
}
group 'co.nlighten'
version = '0.1.1'
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
testImplementation platform('org.junit:junit-bom:5.9.1')
testImplementation 'org.junit.jupiter:junit-jupiter'
}
jar { archiveClassifier = '' }
ext.genOutputDir = file("$buildDir/generated-resources")
task generateVersionTxt() {
ext.outputFile = file("$genOutputDir/version.txt")
outputs.file(outputFile)
doLast {
outputFile.text = """GroupId: ${project.group}
Name: ${project.name}
Version: $version
Build-time: ${java.time.LocalDateTime.now()}
"""
}
}
sourceSets.main.output.dir genOutputDir, builtBy: generateVersionTxt
test {
useJUnitPlatform()
}
// NOTE: this is done automatically by mavenPublishing.configure
//java {
// withJavadocJar()
// withSourcesJar()
//}
javadoc {
options.showAll()
options.encoding('UTF-8')
options.addStringOption('Xdoclint:none', '-quiet')
(options as StandardJavadocDocletOptions).tags("apiNote:a:API Note:")
}
mavenPublishing {
configure(new JavaLibrary(new JavadocJar.Javadoc(), true))
//publishToMavenCentral(SonatypeHost.DEFAULT, true)
// or when publishing to https://s01.oss.sonatype.org
// publishToMavenCentral(SonatypeHost.S01)
// or when publishing to https://central.sonatype.com/
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
signAllPublications()
coordinates("${project.group}", 'short-uuid', "${version}")
pom {
name = 'short-uuid'
description = 'Short UUID conversion and generation library for Java'
inceptionYear = "2024"
url = 'https://github.com/nlighten-oss/short-uuid'
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "elisherer"
name = "Eli Sherer"
url = "https://github.com/elisherer/"
}
}
scm {
url = 'https://github.com/nlighten-oss/short-uuid'
connection = 'scm:git://github.com/nlighten-oss/short-uuid.git'
developerConnection = 'scm:git://github.com/nlighten-oss/short-uuid.git'
}
}
}