-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
145 lines (116 loc) · 3.42 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
plugins {
id "application"
id "maven-publish"
}
repositories {
ivy {
name "Cosmic Reach"
url "https://cosmic-archive.netlify.app/"
patternLayout {
artifact "/Cosmic Reach-[revision].jar"
}
// This is required in Gradle 6.0+ as metadata file (ivy.xml) is mandatory
metadataSources {
artifact()
}
content {
includeGroup "finalforeach"
}
}
maven {
name "JitPack"
url "https://jitpack.io"
}
maven {
name "Quilt"
url "https://maven.quiltmc.org/repository/release"
}
maven {
name "Fabric"
url "https://maven.fabricmc.net/"
}
maven {
name "Sponge"
url "https://repo.spongepowered.org/maven/"
}
maven { url 'https://maven.crmodders.dev/releases' }
mavenCentral()
}
configurations {
cosmicreach // Config to provide the Cosmic Reach project
compileOnly.extendsFrom(cosmicreach) // Allows cosmic reach to be used in the codebase
}
//Includes NBT library in the mod's jar.
jar {
from {
configurations
.runtimeClasspath
.collect {
if(it.name.equalsIgnoreCase("NBT-6.1.jar")) {
project.logger.lifecycle('File: ' +it.name)
zipTree(it)
}
}
}
}
dependencies {
// Cosmic Reach jar
cosmicreach "finalforeach:cosmicreach:${cosmic_reach_version}"
//cosmicreach fileTree(dir: 'run/', include: ['*.jar'])
// Cosmic Quilt
implementation "dev.crmodders:cosmicquilt:${cosmic_quilt_version}"
implementation "dev.crmodders:fluxapi:${fluxapi_version}"
//quiltMod fileTree(dir: 'run/', include: ['*.jar'])
implementation "com.github.Querz:NBT:6.1"
}
processResources {
def resourceTargets = [ // Locations of where to inject the properties
"quilt.mod.json"
]
// Left item is the name in the target, right is the varuable name
def replaceProperties = [
"mod_version" : project.version,
"mod_group" : project.group,
"mod_name" : project.name,
"mod_id" : id,
]
inputs.properties replaceProperties
replaceProperties.put "project", project
filesMatching(resourceTargets) {
expand replaceProperties
}
}
application {
// As Quilt is our loader, use its main class at:
mainClass = "org.quiltmc.loader.impl.launch.knot.KnotClient"
}
applicationDefaultJvmArgs = [
"-Dloader.development=true", // Allows stuff to be found through the classpath
"-Dloader.gameJarPath=" + configurations.cosmicreach.asPath, // Defines path to Cosmic Reach
]
run {
// To run this project in the game, depend on the creation of jar task
dependsOn "jar"
// Change the run directory
File runningDir = new File("run/")
if (!runningDir.exists())
runningDir.mkdirs()
tasks.run.workingDir = runningDir
}
java {
withSourcesJar()
// withJavadocJar() // If docs are included with the project, this line can be un-commented
// Sets the Java version
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
publishing {
publications {
maven(MavenPublication) {
groupId = group
artifactId = id
from components.java
}
}
repositories {}
}