-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
147 lines (126 loc) · 4.22 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
import net.minecraftforge.gradleutils.PomUtils
plugins {
id 'java-library'
id 'eclipse'
id 'maven-publish'
id 'net.minecraftforge.gradleutils' version '[2.3,2.4)'
id 'net.minecraftforge.licenser' version '1.0.1'
id 'org.gradlex.extra-java-module-info' version '1.5'
id 'com.github.ben-manes.versions' version '0.49.0'
}
java {
toolchain.languageVersion = JavaLanguageVersion.of(16)
withSourcesJar()
}
group = 'net.minecraftforge'
version = gradleutils.tagOffsetVersion
logger.lifecycle('Version: ' + version)
repositories {
mavenCentral()
maven gradleutils.forgeMaven
mavenLocal()
}
dependencies {
api(libs.bundles.asm)
implementation(libs.securemodules)
implementation(libs.bundles.log4j.runtime)
implementation(libs.jopt.simple)
implementation(libs.bootstrap.api)
compileOnly(libs.nulls)
annotationProcessor(libs.log4j.core)
}
configurations.all {
outgoing {
capability("net.minecraftforge:modlauncher:$version")
capability("net.minecraftforge:ModLauncher:$version") // Stupid case sensitivity when using project deps
capability("cpw.mods:modlauncher:$version")
}
}
extraJavaModuleInfo {
failOnMissingModuleInfo = false
automaticModule('net.sf.jopt-simple:jopt-simple', 'jopt.simple')
}
license {
header = file("LICENSE-header.txt")
}
jar {
manifest {
attributes([
'Forge-Module-Layer': 'boot'
] as LinkedHashMap)
attributes([
'Specification-Title': 'modlauncher',
'Specification-Vendor': 'Forge Development LLC',
'Specification-Version': gradleutils.gitInfo.tag,
'Implementation-Title': project.name,
'Implementation-Version': project.version,
'Implementation-Vendor': 'Forge Development LLC'
] as LinkedHashMap, 'cpw/mods/modlauncher/api/')
attributes([
'Specification-Title': 'modlauncherserviceapi',
'Specification-Vendor': 'Forge Development LLC',
'Specification-Version': gradleutils.gitInfo.tag,
'Implementation-Title': project.name,
'Implementation-Version': project.version,
'Implementation-Vendor': 'Forge Development LLC'
] as LinkedHashMap, 'cpw/mods/modlauncher/serviceapi/')
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.compilerArgs << '-Xlint:unchecked'
}
compileJava {
options.javaModuleVersion = project.version.toString()
options.javaModuleMainClass = 'cpw.mods.modlauncher.Launcher'
}
publishing {
publications.register('mavenJava', MavenPublication) {
configurations.all {
suppressPomMetadataWarningsFor(it.name)
}
from components.java
artifactId = 'modlauncher'
pom {
name = 'Mod Launcher'
description = 'Common ModLauncher framework'
url = 'https://github.com/MinecraftForge/ModLauncher'
PomUtils.setGitHubDetails(pom, 'ModLauncher')
license PomUtils.Licenses.LGPLv2_1
developers {
developer PomUtils.Developers.cpw
developer PomUtils.Developers.LexManos
}
}
}
repositories {
maven gradleutils.publishingForgeMaven
}
}
tasks.register('writeManifest') {
doLast {
jar.manifest.writeTo(file('src/main/resources/META-INF/MANIFEST.MF'))
}
}
eclipse {
autoBuildTasks writeManifest
}
// Hack eclipse into knowing that the gradle deps are modules
eclipse.classpath {
containers 'org.eclipse.buildship.core.gradleclasspathcontainer'
file.whenMerged { entries.findAll { it.kind == 'lib' || it.path == 'org.eclipse.buildship.core.gradleclasspathcontainer' }.each { it.entryAttributes['module'] = 'true' } }
}
allprojects {
ext.VALID_VMS = [
'Adoptium': [16, 17, 18, 19, 20, 21],
'Amazon': [16, 17, 18, 19, 20, 21],
'Azul': (16..21),
'BellSoft': (16..21),
'Graal_VM': [16, 17, 19, 20, 21],
'IBM': [16, 17, 18, 19, 20 ],
'Microsoft': [16, 17, 21],
'Oracle': (16..21),
'SAP': (16..20)
]
//ext.VALID_VMS = [ 'Adoptium': [16] ]
}