|
1 | 1 | def verification = project.ext.oreSpawnVerification |
2 | | -def legacyFixtureArtifacts = verification.fixtureArtifacts |
3 | 2 | def legacyFixtureWorlds = verification.fixtureWorlds |
4 | 3 | def legacyMineralogy112OracleJar = verification.mineralogy112Oracle |
5 | 4 | def verifyLegacyFixtures = tasks.named('verifyLegacyFixtures') |
@@ -162,84 +161,6 @@ if (project.hasProperty('migrationRunDir')) { |
162 | 161 | } |
163 | 162 | } |
164 | 163 |
|
165 | | -// These probes were compiled against older OreSpawn APIs. Run them on demand to |
166 | | -// confirm that those public binaries still load without rebuilding the mods. |
167 | | -def os1AbiFixtureClasses = file("${buildDir}/legacy-abi/os1/classes") |
168 | | -def os3AbiFixtureClasses = file("${buildDir}/legacy-abi/os3/classes") |
169 | | - |
170 | | -task compileOs1AbiFixture(type: JavaCompile, dependsOn: verifyLegacyFixtures) { |
171 | | - source fileTree('src/os1AbiFixture/java') |
172 | | - classpath = files(sourceSets.main.compileClasspath, |
173 | | - new File(legacyFixtureArtifacts, 'OreSpawn_1.10.2-1.1.0.jar')) |
174 | | - destinationDirectory = os1AbiFixtureClasses |
175 | | - options.encoding = 'UTF-8' |
176 | | -} |
177 | | - |
178 | | -task os1AbiFixtureJar(type: Jar, dependsOn: compileOs1AbiFixture) { |
179 | | - archiveFileName = 'os1abiprobe.jar' |
180 | | - destinationDirectory = file("${buildDir}/legacy-abi/os1") |
181 | | - from os1AbiFixtureClasses |
182 | | - from 'src/os1AbiFixture/resources' |
183 | | -} |
184 | | - |
185 | | -task compileOs3AbiFixture(type: JavaCompile, dependsOn: verifyLegacyFixtures) { |
186 | | - source fileTree('src/os3AbiFixture/java') |
187 | | - classpath = files(sourceSets.main.compileClasspath, |
188 | | - new File(legacyFixtureArtifacts, 'OreSpawn-1.10.2-3.2.2.104.jar')) |
189 | | - destinationDirectory = os3AbiFixtureClasses |
190 | | - options.encoding = 'UTF-8' |
191 | | -} |
192 | | - |
193 | | -task os3AbiFixtureJar(type: Jar, dependsOn: compileOs3AbiFixture) { |
194 | | - archiveFileName = 'os3abiprobe.jar' |
195 | | - destinationDirectory = file("${buildDir}/legacy-abi/os3") |
196 | | - from os3AbiFixtureClasses |
197 | | - from 'src/os3AbiFixture/resources' |
198 | | -} |
199 | | - |
200 | | -def configureLegacyAbiProcess = { String generation, Task fixtureJar, String markerName -> |
201 | | - File runDirectory = file("${buildDir}/legacy-abi/${generation}/run") |
202 | | - Task prepare = tasks.create("prepare${generation.capitalize()}AbiRun", Copy) { |
203 | | - dependsOn fixtureJar |
204 | | - into new File(runDirectory, 'mods') |
205 | | - from fixtureJar.archiveFile |
206 | | - doFirst { project.delete(runDirectory) } |
207 | | - doLast { |
208 | | - new File(runDirectory, 'eula.txt').setText('eula=true\n', 'UTF-8') |
209 | | - new File(runDirectory, 'server.properties').setText( |
210 | | - 'eula=true\nonline-mode=false\nlevel-name=world\nlevel-seed=zsjpxah\n' + |
211 | | - 'spawn-animals=false\nspawn-monsters=false\n', 'UTF-8') |
212 | | - } |
213 | | - } |
214 | | - tasks.create("${generation}AbiIntegrationProcess", JavaExec) { |
215 | | - group = 'verification' |
216 | | - dependsOn prepare |
217 | | - workingDir runDirectory |
218 | | - configureFromForgeRun(delegate, 'runServer') |
219 | | - doLast { |
220 | | - File marker = new File(runDirectory, "world/${markerName}") |
221 | | - if (!marker.isFile() || !marker.text.contains('registered=true')) { |
222 | | - throw new GradleException("${generation.toUpperCase()} binary ABI probe did not complete: ${marker}") |
223 | | - } |
224 | | - File latest = new File(runDirectory, 'logs/latest.log') |
225 | | - if (latest.isFile() && latest.text.contains('Encountered an unexpected exception')) { |
226 | | - throw new GradleException("${generation.toUpperCase()} binary ABI probe logged a server failure") |
227 | | - } |
228 | | - } |
229 | | - } |
230 | | -} |
231 | | - |
232 | | -configureLegacyAbiProcess('os1', os1AbiFixtureJar, 'os1-abi-probe.properties') |
233 | | -configureLegacyAbiProcess('os3', os3AbiFixtureJar, 'os3-abi-probe.properties') |
234 | | - |
235 | | -task legacyAbiIntegrationTest { |
236 | | - group = 'verification' |
237 | | - dependsOn os1AbiIntegrationProcess, os3AbiIntegrationProcess |
238 | | -} |
239 | | - |
240 | | -// Forge 1.12's published OS3 ABI fixture remains an opt-in external gate; the |
241 | | -// 1.10 OS1/OS3 compiled probes are not part of this target's standard check. |
242 | | - |
243 | 164 | // The same old save is exercised with 1.10-origin and native 1.12 Mineralogy |
244 | 165 | // settings. Both paths must keep their intended values through a reload. |
245 | 166 | def legacyMineralogyArchive = new File(legacyFixtureWorlds, 'os3-331-default-source.zip') |
|
0 commit comments