-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathbuild.gradle
127 lines (104 loc) · 3.31 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id 'java-library'
id 'eclipse'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'net.minecraftforge.licenser' version '1.0.1'
id 'net.minecraftforge.gradleutils' version '[2.3,2.4)'
}
group = 'net.minecraftforge'
version = gradleutils.getTagOffsetBranchVersion(null, 'master', 'HEAD')
println "Version: $version"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
withSourcesJar()
}
repositories {
mavenCentral()
maven gradleutils.forgeMaven
}
dependencies {
implementation(libs.jopt.simple)
api(libs.srgutils)
implementation(libs.bundles.asm)
testImplementation(libs.junit.api)
testRuntimeOnly(libs.bundles.junit.runtime)
testImplementation(libs.powermock)
compileOnly(libs.nulls)
}
tasks.named('test', Test).configure {
useJUnitPlatform()
testLogging {
events 'passed', 'skipped', 'failed'
}
}
tasks.named('jar', Jar).configure {
manifest {
attributes('Main-Class': 'net.minecraftforge.fart.Main')
attributes([
'Specification-Title': 'ForgeAutoRenamingTool',
'Specification-Vendor': 'Forge Development LLC',
'Specification-Version': gradleutils.gitInfo.tag,
'Implementation-Title': 'ForgeAutoRenamingTool',
'Implementation-Version': project.version,
'Implementation-Vendor': 'Forge Development LLC'
], 'net/minecraftforge/fart/')
}
}
tasks.named('shadowJar', ShadowJar).configure {
manifest {
attributes('Main-Class': 'net.minecraftforge.fart.Main')
attributes([
'Specification-Title': 'ForgeAutoRenamingTool',
'Specification-Vendor': 'Forge Development LLC',
'Specification-Version': gradleutils.gitInfo.tag,
'Implementation-Title': 'ForgeAutoRenamingTool',
'Implementation-Version': project.version,
'Implementation-Vendor': 'Forge Development LLC'
], 'net/minecraftforge/fart/')
}
minimize()
final List<String> relocations = [
'org.objectweb.asm',
'net.minecraftforge.srgutils',
'joptsimple'
]
relocations.each {
relocate it, "net.minecraftforge.fart.relocated.$it"
}
}
tasks.named('assemble').configure {
dependsOn 'shadowJar'
}
tasks.named('compileJava', JavaCompile).configure {
options.encoding = 'UTF-8'
}
changelog {
from '0.1'
}
license {
header = file('LICENSE-header.txt')
newLine = false
exclude '**/*.properties'
}
publishing {
publications.register('mavenJava', MavenPublication) {
from components.java
pom {
name = 'Forge Auto Renaming Tool'
description = 'A tool that renames java bytecode elements.'
url = 'https://github.com/MinecraftForge/ForgeAutoRenamingTool'
gradleutils.pom.setGitHubDetails(pom, 'ForgeAutoRenamingTool')
license gradleutils.pom.Licenses.LGPLv2_1
developers {
developer gradleutils.pom.Developers.LexManos
}
}
}
repositories {
maven gradleutils.publishingForgeMaven
}
}