-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.gradle
184 lines (162 loc) · 5.43 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
plugins {
id 'org.ajoberstar.reckon' version '0.11.0'
id 'org.ajoberstar.grgit' version '3.1.1'
id 'com.github.ben-manes.versions' version '0.22.0'
}
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'jacoco'
apply plugin: 'java-library'
group 'cpw.mods.forge'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
mavenLocal()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
}
jacoco {
toolVersion = "0.8.2"
}
reckon {
scopeFromProp()
stageFromProp('ms', 'final')
}
reckonTagCreate.dependsOn check
dependencyUpdates.resolutionStrategy {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm', 'preview'].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
}
if (rejected) {
selection.reject('Release candidate')
}
}
}
}
test {
useJUnitPlatform()
}
ext.forge_version = "28.1.87"
ext.sharedManifest = manifest {
attributes(['Class-Path': 'forge.jar',
'Main-Class': 'net.minecraftforge.server.ServerMain',
'ServerLaunchArgs': "--gameDir . --launchTarget fmlserver --fml.forgeVersion ${forge_version} --fml.mcpVersion 20190829.143755 --fml.mcVersion 1.14.4 --fml.forgeGroup net.minecraftforge"
],
)
attributes(
["Specification-Title" : "serverpacklocator",
"Specification-Vendor" : "cpw",
"Specification-Version" : "1", // Currently version 3 of the forgespi specification
"Implementation-Title" : project.name,
"Implementation-Version" : "${version}+${System.getenv("BUILD_NUMBER") ?: 0}+${grgit.head().abbreviatedId}",
"Implementation-Vendor" : "cpw",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"Git-Commit" : grgit.head().abbreviatedId,
"Git-Branch" : grgit.branch.current().getName()],
"cpw/mods/forge/serverpacklocator/")
}
jar {
manifest = project.manifest {
from sharedManifest
}
}
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
dependencies {
implementation("net.minecraftforge:forgespi:2.1.+")
implementation("cpw.mods:modlauncher:6.1.+")
implementation("com.google.code.gson:gson:2.8.0")
implementation("org.apache.logging.log4j:log4j-api:2.11.2")
implementation("io.netty:netty-all:4.1.25.Final")
implementation("com.electronwill.night-config:core:3.6.0")
implementation("com.electronwill.night-config:toml:3.6.0")
implementation("org.apache.maven:maven-artifact:3.6.3")
testImplementation("org.junit.jupiter:junit-jupiter:5.4.2")
}
task allzips dependsOn('zip', 'serverzip')
task zip(type: Zip, dependsOn: jar) {
archiveClassifier = "bundle"
from (jar.outputs) { into ("libraries/cpw/mods/forge/serverpacklocator/${project.version}/") }
from (file("1.14.4-serverpacklocator.json")) {
filter { line -> line
.replace('@version@', "${project.version}")
.replace('@forgeversion@', "${forge_version}")
}
into ("versions/1.14.4-serverpacklocator/")
}
}
task serverzip(type: Zip, dependsOn: jar) {
archiveClassifier = "serverbundle"
from (jar.outputs) {
into ("/")
}
from (files("signcertificate.sh", "runserver.sh")) {
filter { line -> line
.replace('@version@', "${project.version}")
.replace('@forgeversion@', "${forge_version}")
}
into("/")
}
}
artifacts {
archives zip
archives jar
archives sourcesJar
}
compileJava {
options.compilerArgs << "-XDignore.symbol.file"
options.fork = true
options.forkOptions.executable = 'javac'
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact zip
artifact serverzip
pom {
name = 'Server Pack Mod Locator'
description = 'Server Pack Mod Locator'
url = 'https://github.com/cpw/serverpacklocator'
scm {
url = 'https://github.com/cpw/serverpacklocator'
connection = 'scm:git:git://github.com/cpw/serverpacklocator.git'
developerConnection = 'scm:git:[email protected]:cpw/serverpacklocator.git'
}
issueManagement {
system = 'github'
url = 'https://github.com/cpw/serverpacklocator/issues'
}
licenses {
license {
name = 'LGPLv2.1'
url = 'https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt'
}
}
developers {
developer {
id = 'cpw'
name = 'cpw'
}
}
}
}
}
repositories {
maven {
credentials {
username project.properties.cpwMavenUser?:'fake'
password project.properties.cpwMavenPassword?:'news'
}
url "http://files.minecraftforge.net/maven/manage/upload"
}
}
}