-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathbuild.gradle
150 lines (130 loc) · 3.89 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
plugins {
id 'java-library'
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.neoforged.moddev' version '2.0.63-beta'
}
version = "3.10.1"
group = "dev.gigaherz.guidebook"
var minecraftVersionResolver = project.neoForge.version.map { "1." + (it =~ /^(\d+(?:\.[1-9]\d*|))\./)[0][1] }
base {
archivesName = minecraftVersionResolver.map { "Guidebook-${it}" }
}
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
java.withSourcesJar()
repositories {
maven {
url 'https://dogforce-games.com/maven'
}
maven {
url "https://maven.tterrag.com/"
}
maven {
// location of the maven that hosts JEI files
name = "Progwml6 maven"
url = "https://dvs1.progwml6.com/files/maven/"
}
maven {
// location of a maven mirror for JEI files, as a fallback
name = "ModMaven"
url = "https://modmaven.k-4u.nl"
}
maven {
// game stages
url 'https://maven.blamejared.com'
}
mavenLocal()
}
neoForge {
version = "21.4.77-beta"
runs {
// applies to all the run configs below
configureEach {
gameDirectory = project.file('run')
logLevel = org.slf4j.event.Level.DEBUG
}
client {
client()
}
server {
server()
}
}
mods {
thismod {
sourceSet(sourceSets.main)
}
}
parchment {
minecraftVersion = "1.21.4"
mappingsVersion = "2025.01.19"
}
}
dependencies {
//compileOnly ("mezz.jei:jei-1.20-common-api:14.0.0.4")
//runtimeOnly fg.deobf("mezz.jei:jei-1.20-common:14.0.0.4")
//compileOnly ("mezz.jei:jei-1.20-forge-api:14.0.0.4")
//runtimeOnly fg.deobf("mezz.jei:jei-1.20-forge:14.0.0.4")
/*
compileOnly fg.deobf( "net.darkhax.gamestages:GameStages-Forge-1.19.2:11.0.2")
compileOnly fg.deobf( "net.darkhax.bookshelf:Bookshelf-Forge-1.19.2:16.1.4")
*/
}
tasks.named("jar") {
from(files('LICENSE.txt'))
manifest {
attributes([
"Specification-Title": "guidebook",
"Specification-Vendor": "gigaherz",
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": "guidebook",
"Implementation-Version": project.version,
"Implementation-Vendor" :"gigaherz",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"Maven-Artifact":"${project.group}:${project.base.archivesName}:${project.version}"
])
}
}
tasks.named('sourcesJar') {
from(files('LICENSE.txt'))
}
project.afterEvaluate {
publish.dependsOn('build')
publishing {
publications {
mavenJava(MavenPublication) {
artifactId project.archivesBaseName
from components.java
}
}
repositories {
if (findProperty("RELEASE") && System.env.giga_maven_host != null) {
System.out.println("Remote publish enabled on " + System.env.giga_maven_host)
maven {
url System.env.giga_maven_host
credentials {
username System.env.giga_maven_user
password System.env.giga_maven_password
}
}
}
else {
System.out.println("Remote publish disabled.")
maven {
url "$projectDir/../CommonMaven"
}
}
}
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}
// IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior.
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}