diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 9aab9a859..08ccd1e44 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,7 @@ Base Metals 3.1.0.119041 - Use the new creative tabs and fluid types. Filled molten-metal buckets remain visible and searchable. - Update door models, recipes, loot, configuration screens and save conversion for the newer Minecraft APIs. - Save configuration-screen changes together so quick edits aren't lost. +- Preserve translated characters when building on Windows. - Remove obsolete vanilla biome registry snapshots during upgrades, with a backup. Keep modded biome snapshots untouched. - Require the published OreSpawn 4.1.0.119041 release, keeping the same ore rules and copper defaults. - Keep unsupported optional-mod jars out of development launches. Their integration data is retained for future compatibility work. diff --git a/gradle/release/artifacts.gradle b/gradle/release/artifacts.gradle index 35c0e88aa..32aae58b7 100644 --- a/gradle/release/artifacts.gradle +++ b/gradle/release/artifacts.gradle @@ -6,6 +6,7 @@ import org.apache.tools.ant.filters.FixCrLfFilter // Normalize archive text as well as the working tree, including generated Javadocs. tasks.withType(Jar).configureEach { + filteringCharset = 'UTF-8' filesMatching(['**/*.java', '**/*.json', '**/*.lang', '**/*.mcmeta', '**/*.md', '**/*.txt', '**/*.cfg', '**/*.properties', '**/*.xml', '**/*.html', '**/*.css', '**/*.js', '**/element-list', '**/package-list']) { @@ -16,6 +17,7 @@ tasks.withType(Jar).configureEach { // Expand the release identity into Forge metadata and package public documentation. tasks.named('processResources', ProcessResources).configure { + filteringCharset = 'UTF-8' var replaceProperties = [ minecraft_version: minecraft_version, minecraft_version_range: minecraft_version_range, forge_version: forge_version, forge_version_range: forge_version_range, @@ -343,6 +345,20 @@ tasks.register('verifyReleaseArtifacts') { if (locales.size() != 18) { throw new GradleException("Release jar must contain all 18 language files, found ${locales.size()}") } + locales.each { path -> + File sourceFile = sourceSets.main.resources.srcDirs + .collect { new File(it, path) }.find { it.isFile() } + if (sourceFile == null) { + throw new GradleException("No source language file for ${path}") + } + String source = sourceFile.getText('UTF-8') + .replace('\r\n', '\n').replace('\r', '\n') + if (!source.endsWith('\n')) source += '\n' + String packaged = zip.getInputStream(zip.getEntry(path)).getText('UTF-8') + if (packaged != source) { + throw new GradleException("Release jar changed translated text in ${path}") + } + } if (names.any { it.endsWith('.class') && (it.contains('/gametest/') || it.contains('/smoke/') || it.startsWith('com/mcmoddev/')) }) { throw new GradleException('Release jar contains validation or legacy implementation classes')