-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
142 lines (117 loc) · 3.7 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
import org.apache.tools.ant.filters.ReplaceTokens
group 'com.github.slatepowered.slate'
buildscript {
repositories {
maven { url "https://maven.minecraftforge.net" }
maven { url "https://repo.spongepowered.org/repository/maven-public/" }
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://jitpack.io" }
mavenCentral()
}
}
allprojects {
buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net' }
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
maven { url = 'https://plugins.gradle.org/m2/' }
maven { url = 'https://jitpack.io' }
mavenCentral()
}
}
}
afterEvaluate {
task("publishToMavenLocal") {
for (Project proj : subprojects) {
dependsOn(proj.tasks.getByName("publishToMavenLocal"))
}
}
}
subprojects {
apply plugin: "java"
apply plugin: "maven-publish"
apply plugin: "java-library"
ext {
VERU_COMMIT = "94f98d2"
RECO_COMMIT = "9af31c4"
}
group = rootProject.group
/* Java Compile Settings */
compileJava.options.encoding = 'UTF-8'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
tasks.withType(Javadoc) {
options.encoding = 'UTF-8'
}
java {
// By default, build for java 8
sourceCompatibility = 8
targetCompatibility = 8
withSourcesJar()
withJavadocJar()
}
repositories {
mavenCentral()
mavenLocal()
maven { url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url = 'https://oss.sonatype.org/content/repositories/central' }
maven { url = 'https://jitpack.io' }
}
task("install") {
dependsOn(tasks.getByName("publishToMavenLocal"))
}
/* Maven Publications */
publishing {
publications {
maven(MavenPublication) {
groupId = project.group as String
artifactId = project.name
version = project.version as String
from components.java
}
}
}
repositories {
mavenCentral()
maven { url = "https://jitpack.io" }
}
dependencies {
/* Lombok (java 8 is a pain otherwise) */
compileOnly 'org.projectlombok:lombok:1.18.30'
annotationProcessor 'org.projectlombok:lombok:1.18.30'
testCompileOnly 'org.projectlombok:lombok:1.18.30'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.30'
}
/* JUnit */
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.0")
}
tasks.test {
useJUnitPlatform()
}
// Make build task depend on shadowJar
if (plugins.hasPlugin("com.github.johnrengelman.shadow")) {
tasks.getByName("build") {
dependsOn(tasks.getByName("shadowJar"))
}
}
processResources {
duplicatesStrategy = 'include'
from(sourceSets.main.resources.srcDirs) {
filter ReplaceTokens, tokens: [version: project.version]
}
}
// Application Modules
if (project.hasProperty("mainClassName")) {
tasks.withType(Jar) {
manifest {
attributes(
"Main-Class": project.mainClassName
)
}
}
}
}