-
Notifications
You must be signed in to change notification settings - Fork 116
Expand file tree
/
Copy pathbuild.gradle
More file actions
136 lines (116 loc) · 3.5 KB
/
build.gradle
File metadata and controls
136 lines (116 loc) · 3.5 KB
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
import at.petrak.pkpcpbp.MiscUtil
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath group: 'com.diluv.schoomp', name: 'Schoomp', version: '1.2.6'
}
}
plugins {
id 'java'
id "org.jetbrains.kotlin.jvm"
id 'idea'
// This needs to be in the root
// https://github.com/FabricMC/fabric-loom/issues/612#issuecomment-1198444120
// Also it looks like property lookups don't work this early
id 'fabric-loom' version '1.6-SNAPSHOT' apply false
id("at.petra-k.pkpcpbp.PKPlugin") version "0.2.0-pre-104"
id("at.petra-k.pkpcpbp.PKSubprojPlugin") version "0.2.0-pre-104" apply false
id("at.petra-k.pkpcpbp.PKJson5Plugin") version "0.2.0-pre-104" apply false
}
repositories {
mavenCentral()
}
pkpcpbp {
// if something goes wrong in CI, make sure we can see the logs to figure out why
superDebugInfo = System.getenv("CI") != null
// we set the maven coordinates manually in the subprojects block
doProjectMetadata = false
setupJarMetadata = true
setupMavenMetadata = true
javaVersion = 17
modInfo {
modID = project.modID
mcVersion = project.minecraftVersion
modVersion = project.modVersion
}
curseforgeInfo {
id = 569849
stability = "beta"
token = System.getenv("CURSEFORGE_TOKEN")
}
modrinthInfo {
id = "nTW3yKrm"
stability = "beta"
token = System.getenv("MODRINTH_TOKEN")
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'maven-publish'
apply plugin: 'at.petra-k.pkpcpbp.PKSubprojPlugin'
apply plugin: 'at.petra-k.pkpcpbp.PKJson5Plugin'
group = "at.petra-k.$modID"
base.archivesName = "$modID-$platform-$minecraftVersion"
version = modVersion
def isRelease = MiscUtil.isRelease(MiscUtil.getMostRecentPush(project))
def buildNumber = System.getenv("BUILD_NUMBER")
if (!isRelease && buildNumber != null) {
version += "-pre-$buildNumber"
}
pkSubproj {
platform = project.platform
artifactId = base.archivesName.get()
versionDisplayName = "$platform-$minecraftVersion-$modVersion"
}
pkJson5 {
autoProcessJson5 = true
autoProcessJson5Flattening = true
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
it.options.release = 17
}
compileKotlin {
kotlinOptions {
jvmTarget = "17"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "17"
}
}
// Disables Gradle's custom module metadata from being published to maven. The
// metadata includes mapped dependencies which are not reasonably consumable by
// other mod developers.
tasks.withType(GenerateModuleMetadata) {
enabled = false
}
sourceSets.main.kotlin.srcDirs += 'src/main/java'
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
java.withSourcesJar()
java.withJavadocJar()
processResources {
exclude '.cache'
}
sourcesJar {
duplicatesStrategy 'exclude'
}
}
allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xmaxerrs" << "1000"
}
}
// disable most javadoc warnings
javadoc.options.addStringOption('Xdoclint:none', '-quiet')
}
tasks.register("runAllDatagen") {
dependsOn ":Forge:runXplatDatagen"
dependsOn ":Forge:runForgeDatagen"
dependsOn ":Fabric:runDatagen"
}