-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
150 lines (133 loc) · 3.48 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
150
plugins {
id 'java-library'
id 'io.toolebox.git-versioner' version '1.6.7'
id 'com.diffplug.spotless' version '7.0.2'
id 'maven-publish'
id 'org.jreleaser' version '1.17.0'
}
group = 'dev.jbang'
def javaVersion = System.getProperty('java.version')
def majorVersion = javaVersion.split('\\.')[0].toInteger()
if (majorVersion < 11) {
throw new GradleException("""
⚠️ This build requires Java 11 or newer but you're using Java ${javaVersion}
Please use JAVA_HOME with Java 11 or newer to run this build.
Current JAVA_HOME: ${System.getProperty('java.home')}.
If you have jbang installed, you can run it with:
eval \$(jbang jdk java-env 11+)
""".stripIndent())
}
javadoc {
options.encoding = 'UTF-8'
//remove this to see all the missing tags/parameters.
options.addStringOption('Xdoclint:none', '-quiet')
}
repositories {
mavenCentral()
}
java {
withJavadocJar()
withSourcesJar()
}
compileJava {
options.encoding = 'UTF-8'
options.release = 8;
}
versioner {
pattern {
pattern = "%M.%m.%p(.%c-SNAPSHOT)"
}
git {
authentication {
https {
token = project.hasProperty('github_token') ? getProperty('github_token') : "unknown_github_token"
}
}
}
}
dependencies {
implementation 'org.apache.commons:commons-compress:1.27.1'
implementation 'org.apache.httpcomponents:httpclient:4.5.14'
implementation 'org.apache.httpcomponents:httpclient-cache:4.5.14'
implementation 'com.google.code.gson:gson:2.12.1'
implementation 'org.jspecify:jspecify:1.0.0'
testImplementation platform('org.junit:junit-bom:5.10.1')
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation "org.hamcrest:hamcrest-library:3.0"
testImplementation "uk.org.webcompere:system-stubs-jupiter:2.1.7"
testImplementation "uk.org.webcompere:system-stubs-core:2.1.7"
}
tasks.withType(AbstractArchiveTask) {
preserveFileTimestamps = false
reproducibleFileOrder = true
}
spotless {
format 'misc', {
target '**/*.gradle', '**/*.md', '**/.gitignore'
targetExclude 'build/**/*', 'out/**/*'
trimTrailingWhitespace()
leadingSpacesToTabs()
endWithNewline()
}
java {
importOrder 'java', 'javax', 'org', 'com', 'dev.jbang', ''
removeUnusedImports()
eclipse().configFile "misc/eclipse_formatting_nowrap.xml"
targetExclude 'build/**/*'
}
format 'xml', {
targetExclude 'build/test-results', fileTree('.idea')
target '**/*.xml', '**/*.nuspec'
}
}
test {
useJUnitPlatform()
jvmArgs = [
"--add-opens", "java.base/java.lang=ALL-UNNAMED",
"--add-opens", "java.base/java.util=ALL-UNNAMED"
]
}
publishing {
publications {
maven(MavenPublication) {
groupId = 'dev.jbang'
artifactId = 'devkitman'
from components.java
pom {
name = 'JBang JDK Manager'
description = 'Library for managing JDK installations'
url = 'https://github.com/jbangdev/jbang-devkitman'
inceptionYear = '2025'
licenses {
license {
name = 'MIT'
url = 'https://github.com/jbangdev/jbang-devkitman/blob/main/LICENSE'
}
}
developers {
developer {
id = 'maxandersen'
name = 'Max Rydahl Andersen'
}
developer {
id = 'quintesse'
name = 'Tako Schotanus'
}
}
scm {
connection = 'scm:git:https://github.com/jbangdev/jbang-devkitman'
developerConnection = 'scm:git:https://github.com/jbangdev/jbang-devkitman'
url = 'http://github.com/jbangdev/jbang-devkitman'
}
}
}
}
repositories {
maven {
url = layout.buildDirectory.dir('staging-deploy')
}
}
}
jreleaser {
configFile = file('jreleaser.yml')
}