forked from samolego/Taterzens
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
141 lines (118 loc) · 3.69 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
plugins {
// Fabric loom
id "fabric-loom" version "1.1-SNAPSHOT" apply false
// Forge Gradle
id 'net.minecraftforge.gradle' version '6.0.+' apply false
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
id "com.modrinth.minotaur" version "2.+" apply false
}
repositories {
mavenCentral()
maven {
url 'https://jitpack.io'
}
maven { url "https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven" }
}
allprojects {
apply plugin: "java"
apply plugin: "maven-publish"
archivesBaseName = rootProject.archives_base_name + "-" + project.name + "-" + rootProject.minecraft_version
version = rootProject.mod_version
group = rootProject.maven_group
repositories {
mavenCentral()
maven {
url 'https://jitpack.io'
}
maven { url 'https://maven.nucleoid.xyz' }
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
def javaTarget = 17
it.options.release = javaTarget
sourceCompatibility = JavaVersion.toVersion(javaTarget)
targetCompatibility = JavaVersion.toVersion(javaTarget)
if (JavaVersion.current() < JavaVersion.toVersion(javaTarget)) {
toolchain.languageVersion.set(JavaLanguageVersion.of(javaTarget))
}
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = rootProject.archives_base_name + "-" + project.name
from components.java
}
}
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
mavenLocal()
}
}
}
subprojects {
// Publishing plugins
if (it.name != "common") {
apply plugin: "com.modrinth.minotaur"
apply plugin: "com.matthewprenger.cursegradle"
}
if (it.name != "forge") {
apply plugin: "fabric-loom"
repositories {
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots'
}
maven {
url 'https://masa.dy.fi/maven'
}
}
loom {
accessWidenerPath = file("${project.rootDir}/common/src/main/resources/taterzens.accesswidener")
}
dependencies {
// To change the versions see the gradle.properties file
modImplementation "net.fabricmc:fabric-loader:${rootProject.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_version}"
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.layered {
//mappings("net.fabricmc:yarn:$project.yarn_mappings:v2")
it.officialMojangMappings()
}
// C2B
modImplementation("com.github.samolego.Config2Brigadier:config2brigadier-fabric:${rootProject.c2b_version}")
// Disguiselib
modImplementation("xyz.nucleoid:disguiselib-fabric:${project.disguiselib_version}")
}
}
if (it.name != "common") {
dependencies {
compileOnly project(":common")
}
processResources {
from project(":common").sourceSets.main.resources
}
tasks.withType(JavaCompile) {
source(project(":common").sourceSets.main.allSource)
}
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }
}
manifest {
attributes([
"Specification-Title" : rootProject.archives_base_name,
"Specification-Vendor" : "",
"Specification-Version" : rootProject.mod_version,
"Implementation-Title" : project.name,
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" : "",
"MixinConfigs" : "${rootProject.archives_base_name}.mixins.json",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
}