forked from LambdAurora/SpruceUI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
157 lines (133 loc) · 3.35 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
148
149
150
151
152
153
154
155
156
157
plugins {
id 'fabric-loom' version '1.+'
id 'io.github.juuxel.loom-quiltflower' version '1.8.+'
id 'org.quiltmc.gradle.licenser' version '1.1.+'
id 'java-library'
id 'maven-publish'
}
group = project.maven_group
version = "${project.mod_version}+${getMCVersionString()}"
archivesBaseName = project.archives_base_name
// This field defines the Java version your mod target.
def targetJavaVersion = 17
Set<String> modules = [
'fabric-api-base',
'fabric-lifecycle-events-v1',
'fabric-rendering-v1',
'fabric-resource-loader-v0',
'fabric-screen-api-v1',
'fabric-key-binding-api-v1'
]
String getMCVersionString() {
return project.minecraft_version
}
sourceSets {
testmod {
compileClasspath += sourceSets.main.compileClasspath
runtimeClasspath += sourceSets.main.runtimeClasspath
}
}
repositories {
mavenLocal()
maven {
name 'Quilt'
url 'https://maven.quiltmc.org/repository/release'
}
maven {
name 'TerraformersMC'
url 'https://maven.terraformersmc.com/releases'
}
maven {
name = "QuiltMC"
url = "https://maven.quiltmc.org/repository/release"
}
}
configurations {
api.extendsFrom libApi
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "org.quiltmc:quilt-mappings:${minecraft_version}+build.${quilt_mappings}:intermediary-v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modules.stream().map { fabricApi.module(it, project.fabric_api_version) }.forEach {
modImplementation it
}
modLocalRuntime("com.terraformersmc:modmenu:${project.modmenu_version}") {
transitive = false
}
modLocalRuntime fabricApi.module("fabric-key-binding-api-v1", project.fabric_api_version)
libApi 'org.jetbrains:annotations:23.0.0'
testmodImplementation sourceSets.main.output
}
java {
sourceCompatibility = JavaVersion.toVersion(targetJavaVersion)
targetCompatibility = JavaVersion.toVersion(targetJavaVersion)
withSourcesJar()
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
it.options.deprecation(true)
it.options.incremental(true)
it.options.release.set(targetJavaVersion)
}
processResources {
inputs.property 'version', project.version
filesMatching('fabric.mod.json') {
expand 'version': project.version
}
}
jar {
from('LICENSE') {
rename { "${it}_${project.archivesBaseName}" }
}
}
loom {
runs {
testmodClient {
client()
source(sourceSets.testmod)
}
}
}
license {
rule file('HEADER')
include '**/*.java'
}
// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = 'SpruceUI'
description = 'A Minecraft mod API which adds some GUI utilities.'
}
}
}
repositories {
mavenLocal()
maven {
name 'BuildDirLocal'
url "$buildDir/repo"
}
maven {
name 'GithubPackages'
url 'https://maven.pkg.github.com/LambdAurora/SpruceUI'
credentials {
username = project.findProperty('gpr.user') ?: System.getenv('USERNAME')
password = project.findProperty('gpr.key') ?: System.getenv('TOKEN')
}
}
def spruceuiMaven = System.getenv('SPRUCEUI_MAVEN')
if (spruceuiMaven) {
maven {
name = 'SpruceUIMaven'
url = uri(spruceuiMaven)
credentials {
username = project.findProperty('gpr.user') ?: System.getenv('MAVEN_USERNAME')
password = project.findProperty('gpr.key') ?: System.getenv('MAVEN_PASSWORD')
}
}
}
}
}