Skip to content

Commit 08a0027

Browse files
authored
Merge pull request #42 from SkyBlade1978/feature/poweradvantage-1.13.2-archive-reproducibility
Keep 1.13 development jars reproducible across checkouts
2 parents 539bf55 + ed6064a commit 08a0027

7 files changed

Lines changed: 24 additions & 4 deletions

File tree

‎.gitattributes‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
* text=auto eol=lf
2+
*.bat text eol=crlf
3+
*.png binary
4+
*.ogg binary
5+
*.jar binary
6+
*.zip binary

‎CHANGELOG.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Power Advantage 2.4.4.113021
22

3+
- Exclude empty directories so development jars match between existing workspaces and fresh CI checkouts.
34
- Port Power Advantage to Minecraft 1.13.2 with ForgeGradle 7 and Java 8 support.
45
- Keep existing block, item, fluid and saved-state names, the legacy public API and Iron Age Furniture compatibility facades.
56
- Add direct 1.10 and 1.12 world migration, including inventories, fluids, entities, pets, enchantments and old configuration files. Back up worlds before upgrading.

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Both the original Windows-input jar and a clean LF-checkout build have exact
2828
checksums in `gradle.properties`. Their class bytes and archive entries match;
2929
only text line endings differ. CI uses the LF build. Unknown hashes still fail.
3030
Advantage's own archives normalize text to LF.
31+
All Advantage archives also exclude empty directories left behind by older source layouts.
3132

3233
Release jars are written to `build/libs`; `deobfJar` writes the sibling-development jar to `build/libs-dev`.
3334

‎build.gradle‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ tasks.withType(Javadoc).configureEach {
7070
}
7171

7272
tasks.withType(AbstractArchiveTask).configureEach {
73+
includeEmptyDirs = false
7374
preserveFileTimestamps = false
7475
reproducibleFileOrder = true
7576
}
@@ -369,7 +370,7 @@ tasks.register('verifyReleaseConfiguration') {
369370
throw new GradleException("Persistent tile entity id changed or disappeared: ${id}")
370371
}
371372
}
372-
String modsToml = file('src/main/resources/META-INF/mods.toml').getText('UTF-8')
373+
String modsToml = file('src/main/resources/META-INF/mods.toml').getText('UTF-8').replace('\r\n', '\n')
373374
['modId="poweradvantage"', 'modId="basemetals"', 'modId="orespawn"',
374375
'mandatory=true'].each { required ->
375376
if (!modsToml.contains(required)) {
@@ -470,6 +471,17 @@ tasks.register('verifyReleaseArtifacts') {
470471
if (jars.collect { it.name } != expected) {
471472
throw new GradleException("Expected exactly ${expected}, found ${jars.collect { it.name }}")
472473
}
474+
// Empty source directories survive branch changes but are absent in fresh clones.
475+
(jars + [tasks.named('jar', Jar).get().archiveFile.get().asFile]).each { candidate ->
476+
new ZipFile(candidate).withCloseable { zip ->
477+
List entries = zip.entries().toList()
478+
entries.findAll { it.isDirectory() }.each { directory ->
479+
if (!entries.any { !it.isDirectory() && it.name.startsWith(directory.name) }) {
480+
throw new GradleException("${candidate.name} contains empty directory ${directory.name}")
481+
}
482+
}
483+
}
484+
}
473485
jars.each { candidate ->
474486
if (candidate.length() == 0L) {
475487
throw new GradleException("Empty release artifact: ${candidate.name}")

‎test-rig/profiles/dev-core-apocalyptic.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"version": "2.2.5.113021",
2525
"file": "SteamAdvantage-2.2.5.113021-deobf.jar",
2626
"path": "../../SteamAdvantage/SteamAdvantage/build/libs-dev/SteamAdvantage-2.2.5.113021-deobf.jar",
27-
"sha256": "5F381C5FD50B3C22BC3531B4D3D7160AF26F703711F360AF8FAD4530BAF21E37"
27+
"sha256": "CD0FF2C4F79484211DF3BBF1CA63F48C43620FEB764390FAC614AD3DDE0AF5C3"
2828
},
2929
{
3030
"id": "electricadvantage",

‎test-rig/profiles/dev-core-tech-progression.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"version": "2.2.5.113021",
2525
"file": "SteamAdvantage-2.2.5.113021-deobf.jar",
2626
"path": "../../SteamAdvantage/SteamAdvantage/build/libs-dev/SteamAdvantage-2.2.5.113021-deobf.jar",
27-
"sha256": "5F381C5FD50B3C22BC3531B4D3D7160AF26F703711F360AF8FAD4530BAF21E37"
27+
"sha256": "CD0FF2C4F79484211DF3BBF1CA63F48C43620FEB764390FAC614AD3DDE0AF5C3"
2828
},
2929
{
3030
"id": "electricadvantage",

‎test-rig/profiles/dev-core.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"version": "2.2.5.113021",
2424
"file": "SteamAdvantage-2.2.5.113021-deobf.jar",
2525
"path": "../../SteamAdvantage/SteamAdvantage/build/libs-dev/SteamAdvantage-2.2.5.113021-deobf.jar",
26-
"sha256": "5F381C5FD50B3C22BC3531B4D3D7160AF26F703711F360AF8FAD4530BAF21E37"
26+
"sha256": "CD0FF2C4F79484211DF3BBF1CA63F48C43620FEB764390FAC614AD3DDE0AF5C3"
2727
},
2828
{
2929
"id": "electricadvantage",

0 commit comments

Comments
 (0)