forked from Sinytra/ForgeAutoRenamingTool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
150 lines (128 loc) · 4.05 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
buildscript {
repositories {
mavenCentral()
maven { url = 'https://maven.minecraftforge.net/' }
}
dependencies {
classpath group: 'net.minecraftforge.gradleutils', name: 'GradleUtils', version: '2.+', changing: true
}
}
plugins {
id 'java-library'
id 'eclipse'
id 'maven-publish'
id 'org.cadixdev.licenser' version '0.6.1'
id 'com.github.johnrengelman.shadow' version '7.0.0'
}
apply plugin: 'net.minecraftforge.gradleutils'
group 'xyz.bluspring'
version = gradleutils.getTagOffsetBranchVersion(null, 'master', 'HEAD')
println('Version: ' + version)
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
compileJava.options.encoding = 'UTF-8'
ext {
CHANGELOG = rootProject.file('build/changelog.txt')
REPO = 'ForgeAutoRenamingTool'
TITLE = 'Forge Auto Renaming Tool'
MANIFEST = manifest{
attributes('Main-Class': 'net.minecraftforge.fart.Main')
attributes([
'Specification-Title': 'ForgeAutoRenamingTool',
'Specification-Vendor': 'Forge Development LLC',
'Specification-Version': gradleutils.gitInfo.tag,
'Implementation-Title': 'SimpleInstaller',
'Implementation-Version': project.version,
'Implementation-Vendor': 'Forge Development LLC'
] as LinkedHashMap, 'net/minecraftforge/fart/')
}
INITIAL_CHANGELOG_TAG = '0.1'
}
repositories {
mavenCentral()
maven { url = 'https://maven.minecraftforge.net/' }
}
test {
useJUnitPlatform()
}
license {
header = file('LICENSE-header.txt')
ext.project = TITLE
}
dependencies {
implementation 'net.sf.jopt-simple:jopt-simple:6.0-alpha-3'
api 'net.minecraftforge:srgutils:0.5.1'
implementation 'org.ow2.asm:asm:9.5'
implementation 'org.ow2.asm:asm-commons:9.5'
implementation 'org.ow2.asm:asm-tree:9.5'
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()
shadowJar {
manifest.from(MANIFEST)
minimize()
def relocations = [
'org.objectweb.asm',
'net.minecraftforge.srgutils',
'joptsimple'
]
relocations.forEach {
relocate it, "net.minecraftforge.fart.relocated.$it"
}
}
assemble.dependsOn shadowJar
publishing {
publications {
mavenJava(MavenPublication) {
groupId = "xyz.bluspring"
artifactId = "AutoRenamingTool"
from components.java
pom {
name = TITLE
description = 'A tool that renames java bytecode elements.'
url = "https://github.com/MinecraftForge/${REPO}"
scm {
url = "https://github.com/MinecraftForge/${REPO}"
connection = "scm:git:git://github.com/MinecraftForge/${REPO}.git"
developerConnection = "scm:git:git@github.com:MinecraftForge/${REPO}.git"
}
issueManagement {
system = 'github'
url = "https://github.com/MinecraftForge/${REPO}/issues"
}
licenses {
license {
name = 'LGPLv2.1'
url = 'https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt'
}
}
developers {
developer {
id = 'LexManos'
name = 'LexManos'
}
}
}
}
}
repositories {
maven {
url = uri("https://mvn.devos.one/snapshots")
credentials {
username = System.getenv()["MAVEN_USER"]
password = System.getenv()["MAVEN_PASS"]
}
}
}
}
changelog {
fromTag INITIAL_CHANGELOG_TAG
}