-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
143 lines (122 loc) · 4 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
plugins {
id "java-library"
id "maven-publish"
id "signing"
id "checkstyle"
id "me.champeau.jmh" version "0.7.2"
id "io.freefair.lombok" version "8.10.2"
}
base {
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
compileJava.options.encoding = compileTestJava.options.encoding = javadoc.options.encoding = "UTF-8"
archivesName = project.maven_name ?: rootProject.maven_name
group = project.maven_group ?: rootProject.maven_group
version = project.maven_version ?: rootProject.maven_version
}
repositories {
mavenCentral()
}
dependencies {
String reflect = "net.lenni0451:Reflect:1.3.4"
compileOnly "com.google.code.findbugs:jsr305:3.0.2"
compileOnly reflect
testImplementation platform("org.junit:junit-bom:5.11.3")
testImplementation "org.junit.jupiter:junit-jupiter"
testImplementation "org.ow2.asm:asm:9.7.1"
testImplementation reflect
jmh "org.openjdk.jmh:jmh-core:1.37"
jmh "org.openjdk.jmh:jmh-generator-annprocess:1.37"
jmhAnnotationProcessor "org.openjdk.jmh:jmh-generator-annprocess:1.37"
}
java {
withSourcesJar()
withJavadocJar()
}
sourcesJar {
from delombok
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
artifacts {
archives javadocJar, sourcesJar
}
sourcesJar {
from delombok
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
maxParallelForks Runtime.runtime.availableProcessors()
}
jmh {
jvm = "C:/Program Files/Java/jdk-17/bin/java.exe"
}
publishing {
repositories {
maven {
name = "reposilite"
def releasesUrl = "https://maven.lenni0451.net/releases"
def snapshotsUrl = "https://maven.lenni0451.net/snapshots"
url = project.maven_version.endsWith("SNAPSHOT") ? snapshotsUrl : releasesUrl
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
}
}
maven {
name = "ossrh"
def releasesUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = project.maven_version.endsWith("SNAPSHOT") ? snapshotsUrl : releasesUrl
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
}
}
}
publications {
maven(MavenPublication) {
artifactId = project.maven_name ?: rootProject.maven_name
groupId = rootProject.maven_group
version = rootProject.maven_version
from components.java
pom {
name = rootProject.name
description = rootProject.maven_description
url = "https://github.com/" + rootProject.github_repo
licenses {
license {
name = "MIT License"
url = "https://github.com/" + rootProject.github_repo + "/blob/main/LICENSE"
}
}
developers {
developer {
id = "Lenni0451"
}
}
scm {
connection = "scm:git:git://github.com/" + rootProject.github_repo + ".git"
developerConnection = "scm:git:ssh://github.com/" + rootProject.github_repo + ".git"
url = "github.com/" + rootProject.github_repo
}
}
}
}
}
checkstyle {
toolVersion = "9.3" //Latest version for Java 8: 9.3
configFile = rootProject.file("config/checkstyle/checkstyle.xml")
}
signing {
setRequired false
sign configurations.archives
sign publishing.publications.maven
}
project.tasks.withType(PublishToMavenRepository).forEach {
it.dependsOn(project.tasks.withType(Sign))
}
build.dependsOn(test)
build.dependsOn(check)