-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
107 lines (91 loc) · 3 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
plugins {
id 'idea'
id 'maven-publish'
id 'me.modmuss50.mod-publish-plugin' version '0.7.4' apply false
id 'net.neoforged.moddev' version '2.0.34-beta' apply false
}
version = "${project.mod_version}+mc${project.minecraft_version}"
group = project.maven_group
def targetJavaVersion = 21
subprojects {
apply plugin: 'java-library'
project.group = rootProject.group
project.version = rootProject.version
repositories {
maven { url = 'https://maven.quiltmc.org/repository/release' }
maven { url = 'https://maven.terraformersmc.com/releases' }
maven { url = 'https://repo.sleeping.town' }
maven {
name = "ParchmentMC"
url = "https://maven.parchmentmc.org"
content {
includeGroupAndSubgroups "org.parchmentmc"
}
}
}
java {
withSourcesJar()
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
it.options.release = targetJavaVersion
}
javadoc {
// need this so javadoc doesnt complain about mixin's @reason
options.tags = ['reason']
}
base {
archivesName = "${rootProject.archives_base_name}-${project.name}"
}
jar {
from('LICENSE') {
rename { "LICENSE_${rootProject.archives_base_name}"}
}
}
sourcesJar {
from('LICENSE') {
rename { "LICENSE_${rootProject.archives_base_name}" }
}
}
processResources {
filteringCharset 'UTF-8'
def expandProps = [
'version': version,
'minecraft_version': project.minecraft_version,
'mod_id': project.mod_id,
'maven_group_id': project.maven_group,
'website_url': project.website_url,
'sources_url': project.sources_url,
'issue_tracker_url': project.issue_tracker_url,
'discord_url': project.discord_url,
'fabric_loader_version': project.fabric_loader_version,
'neoforge_version': project.neoforge_version,
'java_version': targetJavaVersion
]
filesMatching(['pack.mcmeta', '*.mod.json', 'META-INF/*mods.toml', '*.mixins.json']) {
expand expandProps
}
inputs.properties(expandProps)
}
publishing {
publications {
"mavenJava_${project.name}"(MavenPublication) {
artifactId base.archivesName.get()
from components.java
}
}
}
}
allprojects {
// IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior.
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}
}