-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
167 lines (139 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import net.neoforged.snowblower.gradle.DependencyHashingTask
import net.neoforged.snowblower.gradle.ShadowJarFixupTask
import net.neoforged.gradleutils.PomUtilsExtension.License
plugins {
id 'java'
id 'maven-publish'
id 'eclipse'
id 'idea'
id 'org.cadixdev.licenser' version '0.6.1'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'net.neoforged.gradleutils' version '3.0.0-alpha.10'
}
group 'net.neoforged'
base {
archivesName.set('snowblower')
}
gradleutils {
setupSigning()
}
version = gradleutils.version
println "Version: $version"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
repositories {
mavenCentral()
maven gradleutils.maven
}
configurations {
shade
implementation.extendsFrom shade
}
dependencies {
compileOnly 'org.jetbrains:annotations:24.0.0'
// When updating shade dependencies, you must also run the generateDependencyHashes task
shade 'org.slf4j:slf4j-api:2.0.12'
shade 'ch.qos.logback:logback-classic:1.4.14'
shade 'org.eclipse.jgit:org.eclipse.jgit:6.4.0.202211300538-r'
shade 'net.sf.jopt-simple:jopt-simple:6.0-alpha-3'
shade 'com.google.code.gson:gson:2.10.1'
shade 'net.neoforged:srgutils:1.0.1'
shade 'org.vineflower:vineflower:1.10.1'
shade 'net.neoforged.installertools:installertools:2.1.2'
shade 'net.neoforged:AutoRenamingTool:2.0.1'
shade 'net.neoforged:mergetool:2.0.5'
shade 'org.bouncycastle:bcpkix-jdk15on:1.58'
shade 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.13.3'
shade 'io.jsonwebtoken:jjwt-api:0.11.5'
shade 'io.jsonwebtoken:jjwt-impl:0.11.5'
shade 'io.jsonwebtoken:jjwt-jackson:0.11.5'
shade 'org.kohsuke:github-api:1.313'
}
tasks.register('generateDependencyHashes', DependencyHashingTask) {
configuration = configurations.shade
output = file('src/main/generated_resources/dependency_hashes.txt')
}
tasks.register('shadowJarFixup', ShadowJarFixupTask) {
outputs.upToDateWhen { false }
input = shadowJar.archiveFile
output = shadowJar.archiveFile
}
afterEvaluate {
tasks.named('generateMetadataFileForMavenJavaPublication').configure {
dependsOn 'shadowJarFixup'
}
}
sourceSets {
main {
resources {
srcDirs += file('src/main/generated_resources')
}
}
}
tasks.named('processResources', ProcessResources).configure {
dependsOn 'generateDependencyHashes'
from 'gradlew'
from 'gradlew.bat'
}
tasks.named('eclipseClasspath', GenerateEclipseClasspath).configure {
dependsOn 'generateDependencyHashes'
}
tasks.named('idea').configure {
dependsOn 'generateDependencyHashes'
}
tasks.named('jar', Jar).configure {
from('gradle') {
into 'gradle'
}
manifest {
attributes([
'Main-Class': 'net.neoforged.snowblower.Main',
'Implementation-Version': "${project.version} (${gradleutils.gitInfo.commit})"
])
}
}
tasks.named('shadowJar', ShadowJar).configure {
archiveClassifier = 'all'
configurations = [project.configurations.shade]
from('gradle') {
into 'gradle'
rename '(.+).jar', '$1.zip'
}
finalizedBy 'shadowJarFixup'
}
artifacts {
archives tasks.named('shadowJar', ShadowJar)
}
changelog {
from '2.0'
}
license {
header = file('LICENSE-header.txt')
newLine = false
exclude '**/*.properties'
exclude '**/*.xml'
skipExistingHeaders true
}
test {
enabled = false
}
publishing {
publications.register('mavenJava', MavenPublication) {
from components.java
artifactId = 'snowblower'
gradleutils.sign(it)
pom {
name = 'Snowblower'
description = 'A utility to create a git repository of Minecraft decompiled code to make it easier to see what changed between minecraft versions.'
pomUtils.githubRepo(it, 'snowblower')
pomUtils.license(it, License.MIT)
}
}
repositories {
maven gradleutils.publishingMaven
}
}