-
-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathbuild.gradle
More file actions
122 lines (100 loc) · 3.08 KB
/
build.gradle
File metadata and controls
122 lines (100 loc) · 3.08 KB
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
import org.gradle.api.plugins.jvm.JvmTestSuite
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import com.github.jengelman.gradle.plugins.shadow.transformers.PropertiesFileTransformer
plugins {
id 'java-library'
id 'jvm-test-suite'
id 'idea'
id 'eclipse'
id 'maven-publish'
alias libs.plugins.gradleutils
alias libs.plugins.gitversion
alias libs.plugins.changelog
alias libs.plugins.licenser
alias libs.plugins.shadow
}
gradleutils.displayName = 'Renamer'
description = 'A command line tool to rename java class files'
group = 'net.minecraftforge'
version = gitversion.tagOffset
println "Version: $version"
java {
toolchain.languageVersion = JavaLanguageVersion.of(8)
withSourcesJar()
}
testing {
suites.named('test', JvmTestSuite) {
useJUnitJupiter(libs.versions.junit)
dependencies {
implementation libs.junit.api
runtimeOnly.bundle libs.bundles.junit.runtime
implementation libs.powermock
}
targets.configureEach {
testTask.configure {
testLogging {
events 'passed', 'skipped', 'failed'
}
}
}
}
}
dependencies {
compileOnly libs.annotations.jetbrains
implementation libs.jopt
api libs.srgutils
implementation libs.bundles.asm
implementation libs.toml
}
tasks.named('jar', Jar) {
manifest {
attributes('Main-Class': 'net.minecraftforge.renamer.Main')
attributes([
'Specification-Title' : 'Renamer',
'Specification-Vendor' : gradleutils.vendor.get(),
'Specification-Version' : gitversion.info.tag,
'Implementation-Title' : 'Renamer',
'Implementation-Version': project.version,
'Implementation-Vendor' : gradleutils.vendor.get()
], 'net/minecraftforge/renamer/')
}
}
tasks.named('shadowJar', ShadowJar) {
enableAutoRelocation = true
relocationPrefix = 'net.minecraftforge.renamer.relocated'
minimize()
// Rewrite JOpt's message files, so that help text is displayed nicely.
transform(PropertiesFileTransformer) {
paths = ['Messages.properties$']
keyTransformer = { key -> "net.minecraftforge.renamer.relocated.$key".toString() }
}
}
changelog {
from '0.1'
}
license {
header = file('LICENSE-header.txt')
newLine = false
exclude '**/*.properties'
}
publishing {
repositories {
maven gradleutils.publishingForgeMaven
}
publications.register('mavenJava', MavenPublication) {
changelog.publish(it)
gradleutils.promote(it)
suppressAllPomMetadataWarnings()
from components.java
pom {
name = 'Renamer'
description = 'A tool that renames java bytecode elements.'
url = 'https://github.com/MinecraftForge/renamer'
gradleutils.pom.addRemoteDetails(pom)
license gradleutils.pom.licenses.LGPLv2_1
developers {
developer gradleutils.pom.developers.LexManos
}
}
}
}