forked from neoforged/AutoRenamingTool
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
132 lines (112 loc) · 3.12 KB
/
Copy pathbuild.gradle
File metadata and controls
132 lines (112 loc) · 3.12 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
123
124
125
126
127
128
129
130
131
132
plugins {
id 'eclipse'
id 'signing'
id 'java-library'
id 'maven-publish'
id 'net.neoforged.licenser' version '0.7.5'
id 'com.gradleup.shadow' version '8.3.4'
id 'net.neoforged.gradleutils' version '5.0.4'
}
group 'org.sinytra'
gradleutils {
version {
branches {
suffixBranch()
}
}
setupCentralPublishing()
setupSigning(signAllPublications: true)
}
version = gradleutils.version
println('Version: ' + version)
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
compileJava.options.encoding = 'UTF-8'
ext {
TITLE = 'Auto Renaming Tool'
MANIFEST = manifest {
attributes('Main-Class': 'net.neoforged.art.Main')
attributes([
'Specification-Title' : 'AutoRenamingTool',
'Specification-Vendor' : 'Neo Forged',
'Specification-Version' : gradleutils.gitInfo.tag,
'Implementation-Title' : 'ART',
'Implementation-Version': project.version,
'Implementation-Vendor' : 'NeoForged'
] as LinkedHashMap, 'net/neoforged/art/')
}
INITIAL_CHANGELOG_TAG = '1.0'
}
repositories {
mavenCentral()
maven { url = 'https://maven.neoforged.net/releases' }
}
test {
useJUnitPlatform()
}
license {
skipExistingHeaders = true
header = file('LICENSE-header.txt')
ext.project = TITLE
}
dependencies {
implementation 'net.sf.jopt-simple:jopt-simple:6.0-alpha-3'
api 'net.neoforged:srgutils:1.0.0'
implementation 'org.ow2.asm:asm:9.9.1'
implementation 'org.ow2.asm:asm-commons:9.9.1'
implementation 'org.ow2.asm:asm-tree:9.9.1'
implementation 'net.neoforged.javadoctor:gson-io:2.0.17'
testImplementation(platform('org.junit:junit-bom:5.8.1'))
testImplementation('org.junit.jupiter:junit-jupiter')
testImplementation('org.powermock:powermock-core:2.0.9')
compileOnly 'org.jetbrains:annotations:24.0.1'
}
test {
useJUnitPlatform()
testLogging {
events 'passed', 'skipped', 'failed'
}
}
java.withSourcesJar()
java.withJavadocJar()
shadowJar {
manifest.from(MANIFEST)
minimize()
def relocations = [
'org.objectweb.asm',
'net.neoforged.srgutils',
'joptsimple',
'net.neoforged.cliutils'
]
relocations.forEach {
relocate it, "net.neoforged.art.relocated.$it"
}
}
assemble.dependsOn shadowJar
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = TITLE
description = 'A tool that renames java bytecode elements.'
}
}
}
repositories {
def env = System.getenv()
if (env["MAVEN_URL"] != null) {
repositories.maven {
url = env["MAVEN_URL"]
if (env["MAVEN_USERNAME"] != null) {
credentials {
username = env["MAVEN_USERNAME"]
password = env["MAVEN_PASSWORD"]
}
}
}
}
}
}
changelog {
from INITIAL_CHANGELOG_TAG
}