This repository has been archived by the owner on Jun 22, 2024. It is now read-only.
forked from Engine-Room/Flywheel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
144 lines (121 loc) · 3.86 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
plugins {
id 'fabric-loom' version "${loom_version}"
id 'maven-publish'
}
boolean dev = System.getenv('RELEASE') == null || System.getenv('RELEASE').equalsIgnoreCase('false');
ext.buildNumber = System.getenv('BUILD_NUMBER')
group = 'dm.earth.flywheel'
archivesBaseName = "flywheel-fabric"
version = mod_version + (dev && buildNumber != null ? "-${buildNumber}" : '') + "+${artifact_minecraft_version}"
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + ' (' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
repositories {
maven {
url 'https://www.cursemaven.com'
content {
includeGroup "curse.maven"
}
}
maven {
name 'tterrag maven'
url 'https://maven.tterrag.com/'
}
maven {
url 'https://maven.parchmentmc.org/'
}
maven {
name 'Modrinth'
url 'https://api.modrinth.com/maven'
}
maven {
url 'https://maven.vram.io'
}
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
content {
includeGroup "maven.modrinth"
}
}
}
dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${minecraft_version}"
if (Boolean.parseBoolean(project.use_parchment)) {
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${minecraft_version}:${parchment_version}@zip")
}
} else {
mappings loom.officialMojangMappings()
}
modImplementation "net.fabricmc:fabric-loader:${loader_version}"
// Fabric API
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
modCompileOnly 'maven.modrinth:starlight:1.1.2+1.20'
modCompileOnly 'maven.modrinth:sodium:mc1.20.1-0.5.3'
modCompileOnly 'maven.modrinth:iris:1.6.9+1.20.1'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
}
loom {
runs {
client {
property('flw.loadRenderDoc', 'true')
}
}
}
processResources {
inputs.property 'version', project.version
filesMatching('fabric.mod.json') {
expand 'version': project.version
}
}
tasks.withType(JavaCompile).configureEach {
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}
javadoc {
source = [sourceSets.main.allJava]
// prevent java 8's strict doclint for javadocs from failing builds
options.addStringOption('Xdoclint:none', '-quiet')
}
jar {
manifest {
attributes([
'Specification-Title' : 'flywheel',
//'Specification-Vendor': 'flywheel authors',
'Specification-Version' : '1', // We are version 1 of ourselves
'Implementation-Title' : project.jar.archiveBaseName,
'Implementation-Version' : project.jar.archiveVersion,
//'Implementation-Vendor': 'flywheel authors',
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
//'MixinConfigs' : 'flywheel.mixins.json'
])
}
}
java {
withSourcesJar()
withJavadocJar()
}
void addLicense(jarTask) {
jarTask.from('LICENSE.md') {
rename '(.*)\\.(.*)', '$1_' + archivesBaseName + '.$2'
}
}
addLicense(jar)
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = archivesBaseName
from components.java
}
}
repositories {
if (project.hasProperty('mavendir')) {
maven { url mavendir }
}
}
}