-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
129 lines (104 loc) · 3.22 KB
/
build.gradle
File metadata and controls
129 lines (104 loc) · 3.22 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id 'java-library'
id 'idea'
id 'eclipse'
id 'maven-publish'
alias libs.plugins.licenser
alias libs.plugins.gradleutils
id 'net.minecraftforge.gitversion'
id 'net.minecraftforge.changelog'
alias libs.plugins.shadow
}
gradleutils.displayName = 'Git Version'
final projectVendor = 'Forge Development LLC'
description = 'Used by MinecraftForge projects to calculate project versions based on Git history.'
base.archivesName = 'gitversion'
group = 'net.minecraftforge'
version = gitversion.tagOffset
java {
toolchain.languageVersion = JavaLanguageVersion.of(17)
withSourcesJar()
}
configurations {
cli {
extendsFrom implementation
}
}
dependencies {
// Static Analysis
compileOnly libs.nulls
// Git
implementation libs.jgit
// Config
implementation libs.toml
// JSON Output
implementation libs.gson
cli project(':gitversion-cli')
}
license {
header = file 'LICENSE-header.txt'
newLine = false
exclude '**/*.properties'
}
tasks.named('jar', Jar) {
manifest {
attributes([
'Specification-Title' : gradleutils.displayName,
'Specification-Vendor' : projectVendor,
'Specification-Version' : gitversion.info.tag,
'Implementation-Title' : gradleutils.displayName,
'Implementation-Vendor' : projectVendor,
'Implementation-Version': project.version
], 'net/minecraftforge/gitver/api/')
}
}
tasks.named('shadowJar', ShadowJar) {
manifest {
attributes([
'Main-Class': 'net.minecraftforge.gitver.cli.Main'
])
}
archiveClassifier = 'fatjar'
configurations = project.configurations.named('cli').map { [it] }
enableAutoRelocation = true
relocationPrefix = 'net.minecraftforge.gitver.shadow'
relocate('net.minecraftforge.gitver', 'net.minecraftforge.gitver')
// Rewrite JOpt's message files, so that help text is displayed nicely.
transform(com.github.jengelman.gradle.plugins.shadow.transformers.PropertiesFileTransformer) {
paths = [ 'Messages.properties$' ]
keyTransformer = { key -> 'net.minecraftforge.gitver.shadow.' + key }
}
transform(com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer)
transform(com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer)
minimize {
exclude(project(':gitversion-cli'))
}
exclude('OSGI-INF/**')
exclude('META-INF/maven/**')
exclude('META-INF/proguard/**')
}
changelog {
fromBase()
}
publishing {
repositories {
maven gradleutils.publishingForgeMaven
}
publications.register('mavenJava', MavenPublication) {
from components.java
changelog.publish(it)
gradleutils.promote(it)
pom { pom ->
name = gradleutils.displayName
description = project.description
gradleutils.pom.addRemoteDetails(pom)
licenses {
license gradleutils.pom.licenses.LGPLv2_1
}
developers {
developer gradleutils.pom.developers.Jonathing
}
}
}
}