-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
117 lines (90 loc) · 3.15 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
plugins {
id 'org.spongepowered.gradle.vanilla' version '0.2.+' apply false
id 'net.darkhax.curseforgegradle' version '1.+' apply false
id 'com.modrinth.minotaur' version '2.+' apply false
id 'io.freefair.lombok' version '8.+' apply false
id 'net.neoforged.gradleutils' version '3.+'
}
gradleutils.version {
tags {
if (mod_version_label != 'release')
label = mod_version_label
appendCommitOffset = false
}
}
println "$mod_name, Version: ${gradleutils.version.toString()}"
println "Minecraft: $mc_version, Mappings: $mappings_channel-$mappings_version"
allprojects {
repositories {
maven { url 'https://maven.minecraftforge.net/' }
maven { url 'https://api.modrinth.com/maven' }
maven { url 'https://maven.blamejared.com' }
mavenCentral() {
content {
includeGroup 'org.projectlombok'
}
}
}
}
subprojects {
if (project.name != 'Changelog') {
apply plugin: 'java'
if (project.name != 'Common') {
apply plugin: 'net.darkhax.curseforgegradle'
apply plugin: 'com.modrinth.minotaur'
evaluationDependsOn(':Common')
}
apply plugin: 'io.freefair.lombok'
apply plugin: 'idea'
apply plugin: 'maven-publish'
java {
toolchain.languageVersion = JavaLanguageVersion.of(java_version)
withSourcesJar()
sourceCompatibility = JavaVersion."VERSION_$java_version"
targetCompatibility = JavaVersion."VERSION_$java_version"
}
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}
}
version = gradleutils.version.toString()
group = "hantonik.$mod_id"
tasks.withType(JavaCompile).configureEach {
if (project.name != 'NeoForge')
source project(':Common').sourceSets.main.allSource
options.encoding = 'UTF-8'
}
tasks.withType(ProcessResources).configureEach {
from project(':Common').sourceSets.main.resources
var replaceProperties = [
'mod_id' : mod_id,
'mod_name' : mod_name,
'mod_version' : version,
'mc_version' : mc_version,
'java_version': java_version
]
inputs.properties replaceProperties
filesMatching(['META-INF/*mods.toml', 'fabric.mod.json', 'pack.mcmeta']) {
expand replaceProperties
}
}
tasks.withType(Jar).configureEach {
manifest {
attributes([
'Specification-Title': mod_id,
'Specification-Vendor': 'Hantonik',
'Specification-Version': '1',
'Implementation-Title': rootProject.name,
'Implementation-Version': jar.archiveVersion,
'Implementation-Vendor': 'Hantonik'
])
}
}
}
tasks.register('publishMod') {
dependsOn(':NeoForge:publishCurseForge').finalizedBy(':Fabric:publishCurseForge')
dependsOn(':NeoForge:modrinth').finalizedBy(':Fabric:modrinth')
}