generated from Lenni0451/GradleTemplate
-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
134 lines (116 loc) · 4.23 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
plugins {
id "io.freefair.lombok" version "8.11" apply false
}
subprojects {
apply plugin: "java-library"
apply plugin: "maven-publish"
apply plugin: "signing"
apply plugin: "checkstyle"
apply plugin: "io.freefair.lombok"
base {
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
compileJava.options.encoding = compileTestJava.options.encoding = javadoc.options.encoding = "UTF-8"
archivesName = "MCStructs-" + project.maven_name
group = project.maven_group ?: rootProject.maven_group
version = project.maven_version ?: rootProject.maven_version
}
repositories {
mavenCentral()
maven {
name = "lenni0451"
url = "https://maven.lenni0451.net/everything"
}
}
dependencies {
compileOnly "com.google.code.findbugs:jsr305:3.0.2"
testImplementation "com.google.code.findbugs:jsr305:3.0.2"
testImplementation(platform("org.junit:junit-bom:5.11.3"))
testImplementation "org.junit.jupiter:junit-jupiter"
testRuntimeOnly "org.junit.platform:junit-platform-launcher"
}
java {
withSourcesJar()
withJavadocJar()
}
sourcesJar {
from delombok
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
maxParallelForks Runtime.runtime.availableProcessors()
}
artifacts {
archives javadocJar, sourcesJar
}
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
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)
}