diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..0fc4431 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +* text=auto eol=lf +*.bat text eol=crlf +*.png binary +*.ogg binary +*.jar binary +*.zip binary diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2d22e85..256e545 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,6 @@ Power Advantage 2.4.4.113021 +- Exclude empty directories so development jars match between existing workspaces and fresh CI checkouts. - Port Power Advantage to Minecraft 1.13.2 with ForgeGradle 7 and Java 8 support. - Keep existing block, item, fluid and saved-state names, the legacy public API and Iron Age Furniture compatibility facades. - Add direct 1.10 and 1.12 world migration, including inventories, fluids, entities, pets, enchantments and old configuration files. Back up worlds before upgrading. diff --git a/README.md b/README.md index be8107c..a59588c 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ Both the original Windows-input jar and a clean LF-checkout build have exact checksums in `gradle.properties`. Their class bytes and archive entries match; only text line endings differ. CI uses the LF build. Unknown hashes still fail. Advantage's own archives normalize text to LF. +All Advantage archives also exclude empty directories left behind by older source layouts. Release jars are written to `build/libs`; `deobfJar` writes the sibling-development jar to `build/libs-dev`. diff --git a/build.gradle b/build.gradle index 2ef7220..3c74089 100644 --- a/build.gradle +++ b/build.gradle @@ -70,6 +70,7 @@ tasks.withType(Javadoc).configureEach { } tasks.withType(AbstractArchiveTask).configureEach { + includeEmptyDirs = false preserveFileTimestamps = false reproducibleFileOrder = true } @@ -369,7 +370,7 @@ tasks.register('verifyReleaseConfiguration') { throw new GradleException("Persistent tile entity id changed or disappeared: ${id}") } } - String modsToml = file('src/main/resources/META-INF/mods.toml').getText('UTF-8') + String modsToml = file('src/main/resources/META-INF/mods.toml').getText('UTF-8').replace('\r\n', '\n') ['modId="poweradvantage"', 'modId="basemetals"', 'modId="orespawn"', 'mandatory=true'].each { required -> if (!modsToml.contains(required)) { @@ -470,6 +471,17 @@ tasks.register('verifyReleaseArtifacts') { if (jars.collect { it.name } != expected) { throw new GradleException("Expected exactly ${expected}, found ${jars.collect { it.name }}") } + // Empty source directories survive branch changes but are absent in fresh clones. + (jars + [tasks.named('jar', Jar).get().archiveFile.get().asFile]).each { candidate -> + new ZipFile(candidate).withCloseable { zip -> + List entries = zip.entries().toList() + entries.findAll { it.isDirectory() }.each { directory -> + if (!entries.any { !it.isDirectory() && it.name.startsWith(directory.name) }) { + throw new GradleException("${candidate.name} contains empty directory ${directory.name}") + } + } + } + } jars.each { candidate -> if (candidate.length() == 0L) { throw new GradleException("Empty release artifact: ${candidate.name}") diff --git a/test-rig/profiles/dev-core-apocalyptic.json b/test-rig/profiles/dev-core-apocalyptic.json index 317fcd2..39d2ce4 100644 --- a/test-rig/profiles/dev-core-apocalyptic.json +++ b/test-rig/profiles/dev-core-apocalyptic.json @@ -24,7 +24,7 @@ "version": "2.2.5.113021", "file": "SteamAdvantage-2.2.5.113021-deobf.jar", "path": "../../SteamAdvantage/SteamAdvantage/build/libs-dev/SteamAdvantage-2.2.5.113021-deobf.jar", - "sha256": "5F381C5FD50B3C22BC3531B4D3D7160AF26F703711F360AF8FAD4530BAF21E37" + "sha256": "CD0FF2C4F79484211DF3BBF1CA63F48C43620FEB764390FAC614AD3DDE0AF5C3" }, { "id": "electricadvantage", diff --git a/test-rig/profiles/dev-core-tech-progression.json b/test-rig/profiles/dev-core-tech-progression.json index 85ecec9..2374298 100644 --- a/test-rig/profiles/dev-core-tech-progression.json +++ b/test-rig/profiles/dev-core-tech-progression.json @@ -24,7 +24,7 @@ "version": "2.2.5.113021", "file": "SteamAdvantage-2.2.5.113021-deobf.jar", "path": "../../SteamAdvantage/SteamAdvantage/build/libs-dev/SteamAdvantage-2.2.5.113021-deobf.jar", - "sha256": "5F381C5FD50B3C22BC3531B4D3D7160AF26F703711F360AF8FAD4530BAF21E37" + "sha256": "CD0FF2C4F79484211DF3BBF1CA63F48C43620FEB764390FAC614AD3DDE0AF5C3" }, { "id": "electricadvantage", diff --git a/test-rig/profiles/dev-core.json b/test-rig/profiles/dev-core.json index 563995e..9cec5cb 100644 --- a/test-rig/profiles/dev-core.json +++ b/test-rig/profiles/dev-core.json @@ -23,7 +23,7 @@ "version": "2.2.5.113021", "file": "SteamAdvantage-2.2.5.113021-deobf.jar", "path": "../../SteamAdvantage/SteamAdvantage/build/libs-dev/SteamAdvantage-2.2.5.113021-deobf.jar", - "sha256": "5F381C5FD50B3C22BC3531B4D3D7160AF26F703711F360AF8FAD4530BAF21E37" + "sha256": "CD0FF2C4F79484211DF3BBF1CA63F48C43620FEB764390FAC614AD3DDE0AF5C3" }, { "id": "electricadvantage",