Skip to content

Commit 0aea50f

Browse files
Fix release detection failures (#937)
2 parents 9cb0378 + b767474 commit 0aea50f

File tree

7 files changed

+92
-43
lines changed

7 files changed

+92
-43
lines changed

Common/build.gradle

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
plugins {
22
id 'org.spongepowered.gradle.vanilla' version '0.2.1-SNAPSHOT'
3-
id "at.petra-k.PKSubprojPlugin"
4-
}
5-
6-
pkSubproj {
7-
platform "common"
3+
id "at.petra-k.pkpcpbp.PKSubprojPlugin"
84
}
95

106
minecraft {

Common/gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
platform=common

Fabric/build.gradle

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
plugins {
22
id 'fabric-loom' version "1.6-SNAPSHOT"
3-
id "at.petra-k.PKSubprojPlugin"
3+
id "at.petra-k.pkpcpbp.PKSubprojPlugin"
44
}
55

66
pkSubproj {
7-
platform "fabric"
8-
curseforgeJar remapJar.archiveFile
7+
curseforgeJar = remapJar.archiveFile
98
curseforgeDependencies([
10-
"paucal:0.6.0", "patchouli:1.20.1-80", "fabric-language-kotlin:1.9.4+kotlin.1.8.21",
11-
"inline:1.20.1-1.0.1", "cloth-config:11.1.0",
12-
"cardinal-components-api:5.2.1", "fabric-api:0.84"
9+
"paucal:0.6.0",
10+
"patchouli:1.20.1-80",
11+
"fabric-language-kotlin:1.9.4+kotlin.1.8.21",
12+
"inline:1.20.1-1.0.1",
13+
"cloth-config:11.1.0",
14+
"cardinal-components-api:5.2.1",
15+
"fabric-api:0.84",
1316
])
14-
modrinthJar remapJar.archiveFile
17+
modrinthJar = remapJar.archiveFile
1518
modrinthDependencies([
16-
"paucal:0.6.0", "patchouli:1.20.1-80", "fabric-language-kotlin:1.9.4+kotlin.1.8.21",
17-
"inline:1.20.1-1.0.1", "cloth-config:11.1.0",
18-
"cardinal-components-api:5.2.1", "fabric-api:0.84"
19+
"paucal:0.6.0",
20+
"patchouli:1.20.1-80",
21+
"fabric-language-kotlin:1.9.4+kotlin.1.8.21",
22+
"inline:1.20.1-1.0.1",
23+
"cloth-config:11.1.0",
24+
"cardinal-components-api:5.2.1",
25+
"fabric-api:0.84",
1926
])
2027
}
2128

Fabric/gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
platform=fabric
2+
13
fabricVersion=0.85.0+1.20.1
24
fabricLoaderVersion=0.14.21
35
fabricLanguageKotlinVersion=1.9.4+kotlin.1.8.21

Forge/build.gradle

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,26 @@ plugins {
1717
id "java"
1818
id "maven-publish"
1919

20-
id "at.petra-k.PKSubprojPlugin"
20+
id "at.petra-k.pkpcpbp.PKSubprojPlugin"
2121
}
2222

2323
apply plugin: 'net.minecraftforge.gradle'
2424
apply plugin: 'org.spongepowered.mixin'
2525

2626
pkSubproj {
27-
platform "forge"
28-
curseforgeJar jar.archiveFile
27+
curseforgeJar = jar.archiveFile
2928
curseforgeDependencies([
30-
"paucal:0.6.0", "patchouli:1.20.1-80", "caelus:3.1.0+1.20", "inline:1.20.1-1.0.1"
29+
"paucal:0.6.0",
30+
"patchouli:1.20.1-80",
31+
"caelus:3.1.0+1.20",
32+
"inline:1.20.1-1.0.1",
3133
])
32-
modrinthJar jar.archiveFile
34+
modrinthJar = jar.archiveFile
3335
modrinthDependencies([
34-
"paucal:0.6.0", "patchouli:1.20.1-80", "caelus:3.1.0+1.20", "inline:1.20.1-1.0.1"
36+
"paucal:0.6.0",
37+
"patchouli:1.20.1-80",
38+
"caelus:3.1.0+1.20",
39+
"inline:1.20.1-1.0.1",
3540
])
3641
}
3742

Forge/gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
platform=forge
2+
13
forgeVersion=47.1.47
24

35
kotlinForForgeVersion=4.3.0

build.gradle

Lines changed: 58 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import at.petrak.pkpcpbp.MiscUtil
2+
13
buildscript {
24
repositories {
35
mavenCentral()
@@ -17,42 +19,87 @@ plugins {
1719
// Also it looks like property lookups don't work this early
1820
id 'fabric-loom' version '1.6-SNAPSHOT' apply false
1921

20-
id("at.petra-k.PKPlugin") version "0.1.0-pre-87"
21-
id("at.petra-k.PKSubprojPlugin") version "0.1.0-pre-87" apply false
22+
id("at.petra-k.pkpcpbp.PKPlugin") version "0.2.0-pre-104"
23+
id("at.petra-k.pkpcpbp.PKSubprojPlugin") version "0.2.0-pre-104" apply false
24+
id("at.petra-k.pkpcpbp.PKJson5Plugin") version "0.2.0-pre-104" apply false
2225
}
2326

2427
repositories {
2528
mavenCentral()
2629
}
2730

2831
pkpcpbp {
32+
// if something goes wrong in CI, make sure we can see the logs to figure out why
33+
superDebugInfo = System.getenv("CI") != null
34+
// we set the maven coordinates manually in the subprojects block
35+
doProjectMetadata = false
36+
setupJarMetadata = true
37+
setupMavenMetadata = true
38+
javaVersion = 17
2939
modInfo {
30-
modID(project.modID)
31-
mcVersion(project.minecraftVersion)
32-
modVersion(project.modVersion)
40+
modID = project.modID
41+
mcVersion = project.minecraftVersion
42+
modVersion = project.modVersion
3343
}
3444
curseforgeInfo {
35-
id 569849
36-
stability "beta"
37-
token(System.getenv("CURSEFORGE_TOKEN"))
45+
id = 569849
46+
stability = "beta"
47+
token = System.getenv("CURSEFORGE_TOKEN")
3848
}
3949
modrinthInfo {
40-
id "nTW3yKrm"
41-
stability "beta"
42-
token(System.getenv("MODRINTH_TOKEN"))
50+
id = "nTW3yKrm"
51+
stability = "beta"
52+
token = System.getenv("MODRINTH_TOKEN")
4353
}
4454
}
4555

4656
subprojects {
4757
apply plugin: 'java'
4858
apply plugin: 'kotlin'
4959
apply plugin: 'maven-publish'
60+
apply plugin: 'at.petra-k.pkpcpbp.PKSubprojPlugin'
61+
apply plugin: 'at.petra-k.pkpcpbp.PKJson5Plugin'
62+
63+
group = "at.petra-k.$modID"
64+
base.archivesName = "$modID-$platform-$minecraftVersion"
65+
version = modVersion
66+
67+
def isRelease = MiscUtil.isRelease(MiscUtil.getMostRecentPush(project))
68+
def buildNumber = System.getenv("BUILD_NUMBER")
69+
if (!isRelease && buildNumber != null) {
70+
version += "-pre-$buildNumber"
71+
}
72+
73+
pkSubproj {
74+
platform = project.platform
75+
// this value is only checked if we run a publish task and the commit already starts with [Release]
76+
// so we should be fine to just leave it enabled
77+
pkPublish = true
78+
artifactId = base.archivesName.get()
79+
versionDisplayName = "$platform-$minecraftVersion-$modVersion"
80+
}
81+
82+
pkJson5 {
83+
autoProcessJson5 = true
84+
autoProcessJson5Flattening = true
85+
}
5086

5187
tasks.withType(JavaCompile).configureEach {
5288
it.options.encoding = 'UTF-8'
5389
it.options.release = 17
5490
}
5591

92+
compileKotlin {
93+
kotlinOptions {
94+
jvmTarget = "17"
95+
}
96+
}
97+
compileTestKotlin {
98+
kotlinOptions {
99+
jvmTarget = "17"
100+
}
101+
}
102+
56103
// Disables Gradle's custom module metadata from being published to maven. The
57104
// metadata includes mapped dependencies which are not reasonably consumable by
58105
// other mod developers.
@@ -85,17 +132,6 @@ allprojects {
85132
javadoc.options.addStringOption('Xdoclint:none', '-quiet')
86133
}
87134

88-
compileKotlin {
89-
kotlinOptions {
90-
jvmTarget = "17"
91-
}
92-
}
93-
compileTestKotlin {
94-
kotlinOptions {
95-
jvmTarget = "17"
96-
}
97-
}
98-
99135
tasks.register("runAllDatagen") {
100136
dependsOn ":Forge:runXplatDatagen"
101137
dependsOn ":Forge:runForgeDatagen"

0 commit comments

Comments
 (0)