mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-08-27 04:37:47 +00:00
Adding myself and fixing Windows Tests.
This commit is contained in:
@@ -64,3 +64,8 @@ __pycache__/
|
|||||||
.docs-wip/
|
.docs-wip/
|
||||||
|
|
||||||
AGENTS.md
|
AGENTS.md
|
||||||
|
|
||||||
|
# Local build tooling, not part of the project
|
||||||
|
build-lt.sh
|
||||||
|
BUILDS/
|
||||||
|
.run/
|
||||||
|
|||||||
+19
-19
@@ -25,7 +25,7 @@ import static org.junit.Assert.assertTrue;
|
|||||||
public class IrisChunkGeneratorFailureContractTest {
|
public class IrisChunkGeneratorFailureContractTest {
|
||||||
@Test
|
@Test
|
||||||
public void structureLocateDoesNotCatchAndFallThroughToAnotherImplementation() throws IOException {
|
public void structureLocateDoesNotCatchAndFallThroughToAnotherImplementation() throws IOException {
|
||||||
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource")));
|
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource"))).replace("\r\n", "\n");
|
||||||
int locateStart = source.indexOf("public @Nullable Pair<BlockPos, Holder<Structure>> findNearestMapStructure");
|
int locateStart = source.indexOf("public @Nullable Pair<BlockPos, Holder<Structure>> findNearestMapStructure");
|
||||||
int locateEnd = source.indexOf("private HolderSet<Structure> filterReachableStructures", locateStart);
|
int locateEnd = source.indexOf("private HolderSet<Structure> filterReachableStructures", locateStart);
|
||||||
String locate = source.substring(locateStart, locateEnd);
|
String locate = source.substring(locateStart, locateEnd);
|
||||||
@@ -51,7 +51,7 @@ public class IrisChunkGeneratorFailureContractTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void structureGenerationAbortsInsteadOfLoggingAndContinuing() throws IOException {
|
public void structureGenerationAbortsInsteadOfLoggingAndContinuing() throws IOException {
|
||||||
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource")));
|
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource"))).replace("\r\n", "\n");
|
||||||
int adjustmentStart = source.indexOf("private void adjustGeneratedStructures");
|
int adjustmentStart = source.indexOf("private void adjustGeneratedStructures");
|
||||||
int adjustmentEnd = source.indexOf("public ChunkGeneratorStructureState createState", adjustmentStart);
|
int adjustmentEnd = source.indexOf("public ChunkGeneratorStructureState createState", adjustmentStart);
|
||||||
String adjustment = source.substring(adjustmentStart, adjustmentEnd);
|
String adjustment = source.substring(adjustmentStart, adjustmentEnd);
|
||||||
@@ -83,7 +83,7 @@ public class IrisChunkGeneratorFailureContractTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void heightmapRuntimeReadsAreGenerationLeased() throws IOException {
|
public void heightmapRuntimeReadsAreGenerationLeased() throws IOException {
|
||||||
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource")));
|
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource"))).replace("\r\n", "\n");
|
||||||
|
|
||||||
assertTrue(source.contains("engine.acquireGenerationLease(\"bukkit_nms_heightmaps\")"));
|
assertTrue(source.contains("engine.acquireGenerationLease(\"bukkit_nms_heightmaps\")"));
|
||||||
assertTrue(source.contains("engine.acquireGenerationLease(\"bukkit_nms_base_height\")"));
|
assertTrue(source.contains("engine.acquireGenerationLease(\"bukkit_nms_base_height\")"));
|
||||||
@@ -93,7 +93,7 @@ public class IrisChunkGeneratorFailureContractTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void structureReferenceRepairIsGenerationLeased() throws IOException {
|
public void structureReferenceRepairIsGenerationLeased() throws IOException {
|
||||||
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource")));
|
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource"))).replace("\r\n", "\n");
|
||||||
int referencesStart = source.indexOf("public void createReferences");
|
int referencesStart = source.indexOf("public void createReferences");
|
||||||
int referencesEnd = source.indexOf("public CompletableFuture<ChunkAccess> createBiomes", referencesStart);
|
int referencesEnd = source.indexOf("public CompletableFuture<ChunkAccess> createBiomes", referencesStart);
|
||||||
String references = source.substring(referencesStart, referencesEnd);
|
String references = source.substring(referencesStart, referencesEnd);
|
||||||
@@ -116,7 +116,7 @@ public class IrisChunkGeneratorFailureContractTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void structureGenerationAcquiresBootstrapGateBeforeUsingPublishedState() throws IOException {
|
public void structureGenerationAcquiresBootstrapGateBeforeUsingPublishedState() throws IOException {
|
||||||
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource")));
|
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource"))).replace("\r\n", "\n");
|
||||||
int generationStart = source.indexOf("public void createStructures(");
|
int generationStart = source.indexOf("public void createStructures(");
|
||||||
int generationEnd = source.indexOf("private void adjustGeneratedStructures", generationStart);
|
int generationEnd = source.indexOf("private void adjustGeneratedStructures", generationStart);
|
||||||
String generation = source.substring(generationStart, generationEnd);
|
String generation = source.substring(generationStart, generationEnd);
|
||||||
@@ -144,7 +144,7 @@ public class IrisChunkGeneratorFailureContractTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void nativeRingBootstrapTracksTheExactMinecraftFutures() throws IOException {
|
public void nativeRingBootstrapTracksTheExactMinecraftFutures() throws IOException {
|
||||||
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource")));
|
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource"))).replace("\r\n", "\n");
|
||||||
int initializeStart = source.indexOf("private CompletableFuture<Void> initializeStructureState(");
|
int initializeStart = source.indexOf("private CompletableFuture<Void> initializeStructureState(");
|
||||||
int initializeEnd = source.indexOf("private Map<?, ?> structureRingPositions", initializeStart);
|
int initializeEnd = source.indexOf("private Map<?, ?> structureRingPositions", initializeStart);
|
||||||
String initialize = source.substring(initializeStart, initializeEnd);
|
String initialize = source.substring(initializeStart, initializeEnd);
|
||||||
@@ -169,7 +169,7 @@ public class IrisChunkGeneratorFailureContractTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void standardActivationClaimsTheExactPublishedStateBeforeInitialization() throws IOException {
|
public void standardActivationClaimsTheExactPublishedStateBeforeInitialization() throws IOException {
|
||||||
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource")));
|
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource"))).replace("\r\n", "\n");
|
||||||
int activationStart = source.indexOf("CompletableFuture<Void> activateStudioStructureState(");
|
int activationStart = source.indexOf("CompletableFuture<Void> activateStudioStructureState(");
|
||||||
int activationEnd = source.indexOf(
|
int activationEnd = source.indexOf(
|
||||||
"private CompletableFuture<Void> startStructureStateBootstrap", activationStart);
|
"private CompletableFuture<Void> startStructureStateBootstrap", activationStart);
|
||||||
@@ -195,7 +195,7 @@ public class IrisChunkGeneratorFailureContractTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void terrainWritesPrimeTheWorldgenHeightmapsForEveryChunk() throws IOException {
|
public void terrainWritesPrimeTheWorldgenHeightmapsForEveryChunk() throws IOException {
|
||||||
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource")));
|
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource"))).replace("\r\n", "\n");
|
||||||
int fillStart = source.indexOf("public CompletableFuture<ChunkAccess> fillFromNoise");
|
int fillStart = source.indexOf("public CompletableFuture<ChunkAccess> fillFromNoise");
|
||||||
int fillEnd = source.indexOf("public WeightedList<MobSpawnSettings.SpawnerData> getMobsAt", fillStart);
|
int fillEnd = source.indexOf("public WeightedList<MobSpawnSettings.SpawnerData> getMobsAt", fillStart);
|
||||||
String fill = source.substring(fillStart, fillEnd);
|
String fill = source.substring(fillStart, fillEnd);
|
||||||
@@ -221,7 +221,7 @@ public class IrisChunkGeneratorFailureContractTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void fillFromNoiseLeaseSpansTheDelegateAndHeightmapPipeline() throws IOException {
|
public void fillFromNoiseLeaseSpansTheDelegateAndHeightmapPipeline() throws IOException {
|
||||||
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource")));
|
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource"))).replace("\r\n", "\n");
|
||||||
int fillStart = source.indexOf("public CompletableFuture<ChunkAccess> fillFromNoise");
|
int fillStart = source.indexOf("public CompletableFuture<ChunkAccess> fillFromNoise");
|
||||||
int fillEnd = source.indexOf("private static boolean isCancellationFailure", fillStart);
|
int fillEnd = source.indexOf("private static boolean isCancellationFailure", fillStart);
|
||||||
String fill = source.substring(fillStart, fillEnd);
|
String fill = source.substring(fillStart, fillEnd);
|
||||||
@@ -324,7 +324,7 @@ public class IrisChunkGeneratorFailureContractTest {
|
|||||||
CompletionException failure = assertThrows(CompletionException.class, transformed::join);
|
CompletionException failure = assertThrows(CompletionException.class, transformed::join);
|
||||||
assertTrue(failure.getCause() instanceof CancellationException);
|
assertTrue(failure.getCause() instanceof CancellationException);
|
||||||
|
|
||||||
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource")));
|
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource"))).replace("\r\n", "\n");
|
||||||
String cancellation = method(
|
String cancellation = method(
|
||||||
source,
|
source,
|
||||||
"private static boolean isCancellationFailure",
|
"private static boolean isCancellationFailure",
|
||||||
@@ -335,7 +335,7 @@ public class IrisChunkGeneratorFailureContractTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void noiseAdmissionCanPrepareStudioBeforeAcquiringTheGenerationLease() throws IOException {
|
public void noiseAdmissionCanPrepareStudioBeforeAcquiringTheGenerationLease() throws IOException {
|
||||||
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource")));
|
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource"))).replace("\r\n", "\n");
|
||||||
String fill = method(
|
String fill = method(
|
||||||
source,
|
source,
|
||||||
"public CompletableFuture<ChunkAccess> fillFromNoise",
|
"public CompletableFuture<ChunkAccess> fillFromNoise",
|
||||||
@@ -356,7 +356,7 @@ public class IrisChunkGeneratorFailureContractTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void everyTopLevelMoonriseStageEntersTheFairGateBeforeItsGenerationLease() throws IOException {
|
public void everyTopLevelMoonriseStageEntersTheFairGateBeforeItsGenerationLease() throws IOException {
|
||||||
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource")));
|
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource"))).replace("\r\n", "\n");
|
||||||
String structures = method(source, "public void createStructures(", "private void adjustGeneratedStructures");
|
String structures = method(source, "public void createStructures(", "private void adjustGeneratedStructures");
|
||||||
String references = method(source, "public void createReferences(", "public CompletableFuture<ChunkAccess> createBiomes");
|
String references = method(source, "public void createReferences(", "public CompletableFuture<ChunkAccess> createBiomes");
|
||||||
String biomes = method(source, "public CompletableFuture<ChunkAccess> createBiomes", "public void buildSurface");
|
String biomes = method(source, "public CompletableFuture<ChunkAccess> createBiomes", "public void buildSurface");
|
||||||
@@ -388,7 +388,7 @@ public class IrisChunkGeneratorFailureContractTest {
|
|||||||
assertTrue("Worldgen heightmap priming must be shared with the modded loaders through "
|
assertTrue("Worldgen heightmap priming must be shared with the modded loaders through "
|
||||||
+ nativegen, Files.isRegularFile(shared));
|
+ nativegen, Files.isRegularFile(shared));
|
||||||
|
|
||||||
String heightmaps = Files.readString(shared);
|
String heightmaps = Files.readString(shared).replace("\r\n", "\n");
|
||||||
|
|
||||||
assertTrue(heightmaps.contains("package art.arcane.iris.nativegen;"));
|
assertTrue(heightmaps.contains("package art.arcane.iris.nativegen;"));
|
||||||
assertTrue(heightmaps.contains("public static void primeTerrain("));
|
assertTrue(heightmaps.contains("public static void primeTerrain("));
|
||||||
@@ -396,14 +396,14 @@ public class IrisChunkGeneratorFailureContractTest {
|
|||||||
assertFalse(heightmaps.contains("org.bukkit"));
|
assertFalse(heightmaps.contains("org.bukkit"));
|
||||||
assertFalse(heightmaps.contains("craftbukkit"));
|
assertFalse(heightmaps.contains("craftbukkit"));
|
||||||
|
|
||||||
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource")));
|
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource"))).replace("\r\n", "\n");
|
||||||
|
|
||||||
assertTrue(source.contains("import art.arcane.iris.nativegen.WorldgenTerrainHeightmaps;"));
|
assertTrue(source.contains("import art.arcane.iris.nativegen.WorldgenTerrainHeightmaps;"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void onlySidecarOwnedInjectedStartsUsePersistedPlacementPolicy() throws IOException {
|
public void onlySidecarOwnedInjectedStartsUsePersistedPlacementPolicy() throws IOException {
|
||||||
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource")));
|
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource"))).replace("\r\n", "\n");
|
||||||
int placementStart = source.indexOf("private void placeVanillaStructures");
|
int placementStart = source.indexOf("private void placeVanillaStructures");
|
||||||
int placementEnd = source.indexOf("private static String nativeStructureBatchContext", placementStart);
|
int placementEnd = source.indexOf("private static String nativeStructureBatchContext", placementStart);
|
||||||
String placement = source.substring(placementStart, placementEnd);
|
String placement = source.substring(placementStart, placementEnd);
|
||||||
@@ -414,9 +414,9 @@ public class IrisChunkGeneratorFailureContractTest {
|
|||||||
int adjustmentEnd = source.indexOf("public ChunkGeneratorStructureState createState", adjustmentStart);
|
int adjustmentEnd = source.indexOf("public ChunkGeneratorStructureState createState", adjustmentStart);
|
||||||
String adjustment = source.substring(adjustmentStart, adjustmentEnd);
|
String adjustment = source.substring(adjustmentStart, adjustmentEnd);
|
||||||
Path nativegen = Path.of(System.getProperty("iris.nativeStructurePostProcessorSource")).getParent();
|
Path nativegen = Path.of(System.getProperty("iris.nativeStructurePostProcessorSource")).getParent();
|
||||||
String factory = Files.readString(nativegen.resolve("NativeStructureFactory.java"));
|
String factory = Files.readString(nativegen.resolve("NativeStructureFactory.java")).replace("\r\n", "\n");
|
||||||
String injector = Files.readString(nativegen.resolve("NativeStructureStartInjector.java"));
|
String injector = Files.readString(nativegen.resolve("NativeStructureStartInjector.java")).replace("\r\n", "\n");
|
||||||
String recovery = Files.readString(nativegen.resolve("NativeStructureOwnershipRecovery.java"));
|
String recovery = Files.readString(nativegen.resolve("NativeStructureOwnershipRecovery.java")).replace("\r\n", "\n");
|
||||||
int ownershipRecord = injector.indexOf("NativeStructureOwnershipStore.record(");
|
int ownershipRecord = injector.indexOf("NativeStructureOwnershipStore.record(");
|
||||||
int startPublication = injector.indexOf(
|
int startPublication = injector.indexOf(
|
||||||
"context.structureManager().setStartForStructure(", ownershipRecord);
|
"context.structureManager().setStartForStructure(", ownershipRecord);
|
||||||
@@ -476,7 +476,7 @@ public class IrisChunkGeneratorFailureContractTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void vanillaChunkGenerationMobsUseTheVisibleBiomesVanillaDerivative() throws IOException {
|
public void vanillaChunkGenerationMobsUseTheVisibleBiomesVanillaDerivative() throws IOException {
|
||||||
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource")));
|
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource"))).replace("\r\n", "\n");
|
||||||
int spawnStart = source.indexOf("public void spawnOriginalMobs");
|
int spawnStart = source.indexOf("public void spawnOriginalMobs");
|
||||||
int spawnEnd = source.indexOf("private static WeightedList", spawnStart);
|
int spawnEnd = source.indexOf("private static WeightedList", spawnStart);
|
||||||
String spawn = source.substring(spawnStart, spawnEnd);
|
String spawn = source.substring(spawnStart, spawnEnd);
|
||||||
|
|||||||
+5
-5
@@ -20,7 +20,7 @@ import static org.junit.Assert.assertSame;
|
|||||||
public class IrisChunkGeneratorMonumentLocateContractTest {
|
public class IrisChunkGeneratorMonumentLocateContractTest {
|
||||||
@Test
|
@Test
|
||||||
public void nativeLocateAllowsMonumentsAfterPolicyAndReachabilityChecks() throws IOException {
|
public void nativeLocateAllowsMonumentsAfterPolicyAndReachabilityChecks() throws IOException {
|
||||||
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource")));
|
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource"))).replace("\r\n", "\n");
|
||||||
int findStart = source.indexOf("findNearestMapStructure(ServerLevel level");
|
int findStart = source.indexOf("findNearestMapStructure(ServerLevel level");
|
||||||
assertTrue(findStart >= 0);
|
assertTrue(findStart >= 0);
|
||||||
int irisHelperStart = source.indexOf("private Pair<BlockPos, Holder<Structure>> findNearestIrisStructure(", findStart);
|
int irisHelperStart = source.indexOf("private Pair<BlockPos, Holder<Structure>> findNearestIrisStructure(", findStart);
|
||||||
@@ -120,7 +120,7 @@ public class IrisChunkGeneratorMonumentLocateContractTest {
|
|||||||
@Test
|
@Test
|
||||||
public void nativePredictionIsReadOnlyUntilTheWinnerIsCommitted() throws IOException {
|
public void nativePredictionIsReadOnlyUntilTheWinnerIsCommitted() throws IOException {
|
||||||
Path nativegen = Path.of(System.getProperty("iris.nativeStructurePostProcessorSource")).getParent();
|
Path nativegen = Path.of(System.getProperty("iris.nativeStructurePostProcessorSource")).getParent();
|
||||||
String source = Files.readString(nativegen.resolve("NativeStructureVanillaLocator.java"));
|
String source = Files.readString(nativegen.resolve("NativeStructureVanillaLocator.java")).replace("\r\n", "\n");
|
||||||
int predictionStart = source.indexOf("private static Candidate predictAt(");
|
int predictionStart = source.indexOf("private static Candidate predictAt(");
|
||||||
int candidateStart = source.indexOf("public static final class Candidate", predictionStart);
|
int candidateStart = source.indexOf("public static final class Candidate", predictionStart);
|
||||||
String prediction = source.substring(predictionStart, candidateStart);
|
String prediction = source.substring(predictionStart, candidateStart);
|
||||||
@@ -134,9 +134,9 @@ public class IrisChunkGeneratorMonumentLocateContractTest {
|
|||||||
@Test
|
@Test
|
||||||
public void stiltSupportUsesPlacedSolidOccupancyWithoutSnapshotDifferenceRequirement() throws IOException {
|
public void stiltSupportUsesPlacedSolidOccupancyWithoutSnapshotDifferenceRequirement() throws IOException {
|
||||||
Path processor = Path.of(System.getProperty("iris.nativeStructurePostProcessorSource"));
|
Path processor = Path.of(System.getProperty("iris.nativeStructurePostProcessorSource"));
|
||||||
String source = Files.readString(processor);
|
String source = Files.readString(processor).replace("\r\n", "\n");
|
||||||
String foundation = Files.readString(
|
String foundation = Files.readString(
|
||||||
processor.resolveSibling("NativeStructureFoundationBuilder.java"));
|
processor.resolveSibling("NativeStructureFoundationBuilder.java")).replace("\r\n", "\n");
|
||||||
int placement = source.indexOf("start.placeInChunk(world, structureManager, generator");
|
int placement = source.indexOf("start.placeInChunk(world, structureManager, generator");
|
||||||
int stiltPlacement = source.indexOf("placeStilts(world, area, structureId, start", placement);
|
int stiltPlacement = source.indexOf("placeStilts(world, area, structureId, start", placement);
|
||||||
int stiltDefinition = foundation.indexOf("static void placeStilts(");
|
int stiltDefinition = foundation.indexOf("static void placeStilts(");
|
||||||
@@ -158,7 +158,7 @@ public class IrisChunkGeneratorMonumentLocateContractTest {
|
|||||||
public void verticalPlacementMovesPiecesMonumentChildrenJigsawJunctionsAndCachedBoundsTogether() throws IOException {
|
public void verticalPlacementMovesPiecesMonumentChildrenJigsawJunctionsAndCachedBoundsTogether() throws IOException {
|
||||||
String source = Files.readString(
|
String source = Files.readString(
|
||||||
Path.of(System.getProperty("iris.nativeStructurePostProcessorSource"))
|
Path.of(System.getProperty("iris.nativeStructurePostProcessorSource"))
|
||||||
.resolveSibling("NativeStructureVerticalPlacer.java"));
|
.resolveSibling("NativeStructureVerticalPlacer.java")).replace("\r\n", "\n");
|
||||||
int placementStart = source.indexOf("public static int applyVerticalPlacement");
|
int placementStart = source.indexOf("public static int applyVerticalPlacement");
|
||||||
int shiftStart = source.indexOf("public static int applyVerticalShift", placementStart);
|
int shiftStart = source.indexOf("public static int applyVerticalShift", placementStart);
|
||||||
int alignmentStart = source.indexOf("static int alignOceanMonumentToSeaLevel", shiftStart);
|
int alignmentStart = source.indexOf("static int alignOceanMonumentToSeaLevel", shiftStart);
|
||||||
|
|||||||
+3
-3
@@ -18,7 +18,7 @@ import static org.junit.Assert.assertTrue;
|
|||||||
public class NMSBindingCurrentPaperWorldDataContractTest {
|
public class NMSBindingCurrentPaperWorldDataContractTest {
|
||||||
@Test
|
@Test
|
||||||
public void bindingDelegatesWithoutLinkingPaperSavedDataClasses() throws Exception {
|
public void bindingDelegatesWithoutLinkingPaperSavedDataClasses() throws Exception {
|
||||||
String bindingSource = Files.readString(bindingSourcePath());
|
String bindingSource = Files.readString(bindingSourcePath()).replace("\r\n", "\n");
|
||||||
String writer = section(
|
String writer = section(
|
||||||
bindingSource,
|
bindingSource,
|
||||||
"public void writeCurrentPaperWorldData(",
|
"public void writeCurrentPaperWorldData(",
|
||||||
@@ -43,7 +43,7 @@ public class NMSBindingCurrentPaperWorldDataContractTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void stagesAllCurrentPaperWorldDataFromLiveServerState() throws Exception {
|
public void stagesAllCurrentPaperWorldDataFromLiveServerState() throws Exception {
|
||||||
String writer = Files.readString(writerSourcePath());
|
String writer = Files.readString(writerSourcePath()).replace("\r\n", "\n");
|
||||||
|
|
||||||
assertTrue(writer.contains("WorldReplacementSeed.copyWithAuthoritativeSeed("));
|
assertTrue(writer.contains("WorldReplacementSeed.copyWithAuthoritativeSeed("));
|
||||||
assertTrue(writer.contains("UUID metadataUuid = UUID.randomUUID()"));
|
assertTrue(writer.contains("UUID metadataUuid = UUID.randomUUID()"));
|
||||||
@@ -69,7 +69,7 @@ public class NMSBindingCurrentPaperWorldDataContractTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void capturesOnlyLiveLevelOverridesOnTheGlobalThread() throws Exception {
|
public void capturesOnlyLiveLevelOverridesOnTheGlobalThread() throws Exception {
|
||||||
String source = Files.readString(writerSourcePath());
|
String source = Files.readString(writerSourcePath()).replace("\r\n", "\n");
|
||||||
String capture = section(
|
String capture = section(
|
||||||
source,
|
source,
|
||||||
"private static PaperLevelOverrides captureLevelOverrides(",
|
"private static PaperLevelOverrides captureLevelOverrides(",
|
||||||
|
|||||||
+4
-4
@@ -354,7 +354,7 @@ public class NMSBindingDatapackStructureScopeTest {
|
|||||||
@Test
|
@Test
|
||||||
public void standardPublishesOneDeferredStateWhileJigsawPublishesInitializedEmptyState() throws IOException {
|
public void standardPublishesOneDeferredStateWhileJigsawPublishesInitializedEmptyState() throws IOException {
|
||||||
Path chunkGeneratorSource = Path.of(System.getProperty("iris.nmsChunkGeneratorSource"));
|
Path chunkGeneratorSource = Path.of(System.getProperty("iris.nmsChunkGeneratorSource"));
|
||||||
String source = Files.readString(chunkGeneratorSource.resolveSibling("NMSBinding.java"));
|
String source = Files.readString(chunkGeneratorSource.resolveSibling("NMSBinding.java")).replace("\r\n", "\n");
|
||||||
int methodStart = source.indexOf("public DatapackStructureScopeResult scopeDatapackStructures(");
|
int methodStart = source.indexOf("public DatapackStructureScopeResult scopeDatapackStructures(");
|
||||||
int methodEnd = source.indexOf("\n @Override\n public void completeStudioStructureBootstrap", methodStart);
|
int methodEnd = source.indexOf("\n @Override\n public void completeStudioStructureBootstrap", methodStart);
|
||||||
|
|
||||||
@@ -392,7 +392,7 @@ public class NMSBindingDatapackStructureScopeTest {
|
|||||||
@Test
|
@Test
|
||||||
public void standardCompletionActivatesTheAlreadyPublishedStateWithoutReplacingIt() throws IOException {
|
public void standardCompletionActivatesTheAlreadyPublishedStateWithoutReplacingIt() throws IOException {
|
||||||
Path chunkGeneratorSource = Path.of(System.getProperty("iris.nmsChunkGeneratorSource"));
|
Path chunkGeneratorSource = Path.of(System.getProperty("iris.nmsChunkGeneratorSource"));
|
||||||
String source = Files.readString(chunkGeneratorSource.resolveSibling("NMSBinding.java"));
|
String source = Files.readString(chunkGeneratorSource.resolveSibling("NMSBinding.java")).replace("\r\n", "\n");
|
||||||
int methodStart = source.indexOf("public void completeStudioStructureBootstrap(World world)");
|
int methodStart = source.indexOf("public void completeStudioStructureBootstrap(World world)");
|
||||||
int methodEnd = source.indexOf("\n @Override\n public void abandonStudioStructureBootstrap", methodStart);
|
int methodEnd = source.indexOf("\n @Override\n public void abandonStudioStructureBootstrap", methodStart);
|
||||||
|
|
||||||
@@ -411,7 +411,7 @@ public class NMSBindingDatapackStructureScopeTest {
|
|||||||
@Test
|
@Test
|
||||||
public void injectionVerifiesTheCanonicalPaperGeneratorBeforeStructureRetargeting() throws IOException {
|
public void injectionVerifiesTheCanonicalPaperGeneratorBeforeStructureRetargeting() throws IOException {
|
||||||
Path chunkGeneratorSource = Path.of(System.getProperty("iris.nmsChunkGeneratorSource"));
|
Path chunkGeneratorSource = Path.of(System.getProperty("iris.nmsChunkGeneratorSource"));
|
||||||
String source = Files.readString(chunkGeneratorSource.resolveSibling("NMSBinding.java"));
|
String source = Files.readString(chunkGeneratorSource.resolveSibling("NMSBinding.java")).replace("\r\n", "\n");
|
||||||
int methodStart = source.indexOf("public void inject(long seed, Engine engine, World world)");
|
int methodStart = source.indexOf("public void inject(long seed, Engine engine, World world)");
|
||||||
int methodEnd = source.indexOf("\n @Override\n public DatapackStructureScopeResult", methodStart);
|
int methodEnd = source.indexOf("\n @Override\n public DatapackStructureScopeResult", methodStart);
|
||||||
|
|
||||||
@@ -432,7 +432,7 @@ public class NMSBindingDatapackStructureScopeTest {
|
|||||||
@Test
|
@Test
|
||||||
public void structureStateRecreationUsesTheWorldOwnedSpigotConfiguration() throws IOException {
|
public void structureStateRecreationUsesTheWorldOwnedSpigotConfiguration() throws IOException {
|
||||||
Path chunkGeneratorSource = Path.of(System.getProperty("iris.nmsChunkGeneratorSource"));
|
Path chunkGeneratorSource = Path.of(System.getProperty("iris.nmsChunkGeneratorSource"));
|
||||||
String source = Files.readString(chunkGeneratorSource.resolveSibling("NMSBinding.java"));
|
String source = Files.readString(chunkGeneratorSource.resolveSibling("NMSBinding.java")).replace("\r\n", "\n");
|
||||||
int methodStart = source.indexOf("private ChunkGeneratorStructureState createStructureState(");
|
int methodStart = source.indexOf("private ChunkGeneratorStructureState createStructureState(");
|
||||||
int methodEnd = source.indexOf(
|
int methodEnd = source.indexOf(
|
||||||
"\n private void initializeAndPublishStructureState(", methodStart);
|
"\n private void initializeAndPublishStructureState(", methodStart);
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ public class NMSBindingPlacementFailureContractTest {
|
|||||||
@Test
|
@Test
|
||||||
public void structurePlacementPropagatesRuntimeFailuresWithContext() throws IOException {
|
public void structurePlacementPropagatesRuntimeFailuresWithContext() throws IOException {
|
||||||
Path chunkGeneratorSource = Path.of(System.getProperty("iris.nmsChunkGeneratorSource"));
|
Path chunkGeneratorSource = Path.of(System.getProperty("iris.nmsChunkGeneratorSource"));
|
||||||
String source = Files.readString(chunkGeneratorSource.resolveSibling("NMSBinding.java"));
|
String source = Files.readString(chunkGeneratorSource.resolveSibling("NMSBinding.java")).replace("\r\n", "\n");
|
||||||
int methodStart = source.indexOf("public int[] placeStructure(");
|
int methodStart = source.indexOf("public int[] placeStructure(");
|
||||||
int methodEnd = source.indexOf("\n @Override", methodStart + 1);
|
int methodEnd = source.indexOf("\n @Override", methodStart + 1);
|
||||||
String method = source.substring(methodStart, methodEnd);
|
String method = source.substring(methodStart, methodEnd);
|
||||||
|
|||||||
+3
-3
@@ -12,7 +12,7 @@ public class NMSBindingServerLevelAdviceContractTest {
|
|||||||
@Test
|
@Test
|
||||||
public void serverLevelAdviceSupportsCurrentSpigotAndPaperConstructorLayouts() throws Exception {
|
public void serverLevelAdviceSupportsCurrentSpigotAndPaperConstructorLayouts() throws Exception {
|
||||||
String source = Files.readString(
|
String source = Files.readString(
|
||||||
Path.of(System.getProperty("iris.nmsBindingSource")));
|
Path.of(System.getProperty("iris.nmsBindingSource"))).replace("\r\n", "\n");
|
||||||
String transformer = section(
|
String transformer = section(
|
||||||
source,
|
source,
|
||||||
"public boolean injectBukkit()",
|
"public boolean injectBukkit()",
|
||||||
@@ -35,7 +35,7 @@ public class NMSBindingServerLevelAdviceContractTest {
|
|||||||
@Test
|
@Test
|
||||||
public void currentSpigotStorageAccessReceivesManagedIdentityBeforeConstruction() throws Exception {
|
public void currentSpigotStorageAccessReceivesManagedIdentityBeforeConstruction() throws Exception {
|
||||||
String source = Files.readString(
|
String source = Files.readString(
|
||||||
Path.of(System.getProperty("iris.nmsBindingSource")));
|
Path.of(System.getProperty("iris.nmsBindingSource"))).replace("\r\n", "\n");
|
||||||
String transformer = section(
|
String transformer = section(
|
||||||
source,
|
source,
|
||||||
"public boolean injectBukkit()",
|
"public boolean injectBukkit()",
|
||||||
@@ -68,7 +68,7 @@ public class NMSBindingServerLevelAdviceContractTest {
|
|||||||
@Test
|
@Test
|
||||||
public void ownedWorldPublishesItsManagedIdentityAndRuntimeStemTogether() throws Exception {
|
public void ownedWorldPublishesItsManagedIdentityAndRuntimeStemTogether() throws Exception {
|
||||||
String source = Files.readString(
|
String source = Files.readString(
|
||||||
Path.of(System.getProperty("iris.nmsBindingSource")));
|
Path.of(System.getProperty("iris.nmsBindingSource"))).replace("\r\n", "\n");
|
||||||
String advice = section(
|
String advice = section(
|
||||||
source,
|
source,
|
||||||
"private static class ServerLevelAdvice",
|
"private static class ServerLevelAdvice",
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ import static org.junit.Assert.assertTrue;
|
|||||||
public class NMSBindingShutdownBoundaryContractTest {
|
public class NMSBindingShutdownBoundaryContractTest {
|
||||||
@Test
|
@Test
|
||||||
public void shutdownBoundaryUsesPaperFullyShutdownStateAndServerThread() throws Exception {
|
public void shutdownBoundaryUsesPaperFullyShutdownStateAndServerThread() throws Exception {
|
||||||
String source = Files.readString(Path.of(System.getProperty("iris.nmsBindingSource")));
|
String source = Files.readString(Path.of(System.getProperty("iris.nmsBindingSource"))).replace("\r\n", "\n");
|
||||||
String boundary = section(source, "public boolean awaitServerShutdownBoundary", "public KMap<Material, List<BlockProperty>> getBlockProperties");
|
String boundary = section(source, "public boolean awaitServerShutdownBoundary", "public KMap<Material, List<BlockProperty>> getBlockProperties");
|
||||||
|
|
||||||
assertTrue(boundary.contains("ServerShutdownBoundary.await("));
|
assertTrue(boundary.contains("ServerShutdownBoundary.await("));
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@ public class NMSBindingStructureFailureContractTest {
|
|||||||
@Test
|
@Test
|
||||||
public void structureRegistryHooksThrowInsteadOfReturningEmptyOnFailure() throws IOException {
|
public void structureRegistryHooksThrowInsteadOfReturningEmptyOnFailure() throws IOException {
|
||||||
Path chunkGeneratorSource = Path.of(System.getProperty("iris.nmsChunkGeneratorSource"));
|
Path chunkGeneratorSource = Path.of(System.getProperty("iris.nmsChunkGeneratorSource"));
|
||||||
String source = Files.readString(chunkGeneratorSource.resolveSibling("NMSBinding.java"));
|
String source = Files.readString(chunkGeneratorSource.resolveSibling("NMSBinding.java")).replace("\r\n", "\n");
|
||||||
List<String> methodNames = List.of(
|
List<String> methodNames = List.of(
|
||||||
"getStructureKeys",
|
"getStructureKeys",
|
||||||
"getStructureSetKeys",
|
"getStructureSetKeys",
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ public class NMSBindingTileDeserializeContractTest {
|
|||||||
@Test
|
@Test
|
||||||
public void ownedRegionTileDataMergesBeforeScheduledFallback() throws IOException {
|
public void ownedRegionTileDataMergesBeforeScheduledFallback() throws IOException {
|
||||||
Path chunkGeneratorSource = Path.of(System.getProperty("iris.nmsChunkGeneratorSource"));
|
Path chunkGeneratorSource = Path.of(System.getProperty("iris.nmsChunkGeneratorSource"));
|
||||||
String source = Files.readString(chunkGeneratorSource.resolveSibling("NMSBinding.java"));
|
String source = Files.readString(chunkGeneratorSource.resolveSibling("NMSBinding.java")).replace("\r\n", "\n");
|
||||||
int methodStart = source.indexOf("public void deserializeTile(");
|
int methodStart = source.indexOf("public void deserializeTile(");
|
||||||
int methodEnd = source.indexOf("\n private void merge(", methodStart);
|
int methodEnd = source.indexOf("\n private void merge(", methodStart);
|
||||||
String method = source.substring(methodStart, methodEnd);
|
String method = source.substring(methodStart, methodEnd);
|
||||||
|
|||||||
+1
-1
@@ -223,7 +223,7 @@ public class NativeStructurePostProcessorEncaseTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void encaseFillRunsBeforeNativePlacement() throws IOException {
|
public void encaseFillRunsBeforeNativePlacement() throws IOException {
|
||||||
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource")));
|
String source = Files.readString(Path.of(System.getProperty("iris.nmsChunkGeneratorSource"))).replace("\r\n", "\n");
|
||||||
int prepareTerrain = source.indexOf("NativeStructurePostProcessor.prepareTerrain(");
|
int prepareTerrain = source.indexOf("NativeStructurePostProcessor.prepareTerrain(");
|
||||||
int placementLoop = source.indexOf("for (NativePlacementGroup group : placementGroups)", prepareTerrain);
|
int placementLoop = source.indexOf("for (NativePlacementGroup group : placementGroups)", prepareTerrain);
|
||||||
int placement = source.indexOf("placeVanillaStructure(world, structureManager, random", placementLoop);
|
int placement = source.indexOf("placeVanillaStructure(world, structureManager, random", placementLoop);
|
||||||
|
|||||||
@@ -316,6 +316,12 @@ public final class PendingWorldDeleteQueue implements WorldDeletionQueue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void forceDirectory(Path directory) throws IOException {
|
private static void forceDirectory(Path directory) throws IOException {
|
||||||
|
// A directory can only be opened and fsynced on a POSIX filesystem; Windows rejects the
|
||||||
|
// open outright. Matches DirectoryDurability and DatapackIngestService, which already
|
||||||
|
// skip the barrier there.
|
||||||
|
if (!Files.getFileStore(directory).supportsFileAttributeView("posix")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
try (FileChannel channel = FileChannel.open(directory, StandardOpenOption.READ)) {
|
try (FileChannel channel = FileChannel.open(directory, StandardOpenOption.READ)) {
|
||||||
channel.force(true);
|
channel.force(true);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -47,7 +47,7 @@ public class IrisDiagnosticLogLevelTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void adapterSideWarningsCarryTheSameSeverityAsCoreWarnings() throws Exception {
|
public void adapterSideWarningsCarryTheSameSeverityAsCoreWarnings() throws Exception {
|
||||||
String source = Files.readString(Path.of("src/main/java/art/arcane/iris/Iris.java"));
|
String source = Files.readString(Path.of("src/main/java/art/arcane/iris/Iris.java")).replace("\r\n", "\n");
|
||||||
|
|
||||||
String warn = method(source, "public static void warn(String format, Object... objs)");
|
String warn = method(source, "public static void warn(String format, Object... objs)");
|
||||||
assertTrue(warn, warn.contains("diagnostic(Level.WARNING"));
|
assertTrue(warn, warn.contains("diagnostic(Level.WARNING"));
|
||||||
@@ -60,7 +60,7 @@ public class IrisDiagnosticLogLevelTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void theCoreLogBridgeRoutesDiagnosticsToThePluginLogger() throws Exception {
|
public void theCoreLogBridgeRoutesDiagnosticsToThePluginLogger() throws Exception {
|
||||||
String source = Files.readString(Path.of("src/main/java/art/arcane/iris/Iris.java"));
|
String source = Files.readString(Path.of("src/main/java/art/arcane/iris/Iris.java")).replace("\r\n", "\n");
|
||||||
String bridge = method(source, "private static void bridgeLog(LogLevel level, String message)");
|
String bridge = method(source, "private static void bridgeLog(LogLevel level, String message)");
|
||||||
|
|
||||||
assertTrue(bridge, bridge.contains("diagnosticLevel(target)"));
|
assertTrue(bridge, bridge.contains("diagnosticLevel(target)"));
|
||||||
|
|||||||
+3
-3
@@ -80,7 +80,7 @@ public class IrisWorldGeneratorResolverTest {
|
|||||||
@Test
|
@Test
|
||||||
public void startupValidationPublishesFingerprintBoundExactRootResults() throws Exception {
|
public void startupValidationPublishesFingerprintBoundExactRootResults() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/IrisWorldGeneratorResolver.java"));
|
"src/main/java/art/arcane/iris/core/IrisWorldGeneratorResolver.java")).replace("\r\n", "\n");
|
||||||
int validateAll = source.indexOf("public void validateAllPacks()");
|
int validateAll = source.indexOf("public void validateAllPacks()");
|
||||||
int snapshot = source.indexOf("ServerConfigurator.computePackContentSnapshot(packsRoot)", validateAll);
|
int snapshot = source.indexOf("ServerConfigurator.computePackContentSnapshot(packsRoot)", validateAll);
|
||||||
int perPackFingerprint = source.indexOf("contentSnapshot.packContents()", snapshot);
|
int perPackFingerprint = source.indexOf("contentSnapshot.packContents()", snapshot);
|
||||||
@@ -191,7 +191,7 @@ public class IrisWorldGeneratorResolverTest {
|
|||||||
@Test
|
@Test
|
||||||
public void configuredWorldResolutionUsesOnlyFrozenWorldLocalSnapshot() throws Exception {
|
public void configuredWorldResolutionUsesOnlyFrozenWorldLocalSnapshot() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/IrisWorldGeneratorResolver.java"));
|
"src/main/java/art/arcane/iris/core/IrisWorldGeneratorResolver.java")).replace("\r\n", "\n");
|
||||||
int resolverStart = source.indexOf("private ChunkGenerator resolveFrozenWorldGenerator(");
|
int resolverStart = source.indexOf("private ChunkGenerator resolveFrozenWorldGenerator(");
|
||||||
int resolverEnd = source.indexOf("private record FreshValidation", resolverStart);
|
int resolverEnd = source.indexOf("private record FreshValidation", resolverStart);
|
||||||
String resolver = source.substring(resolverStart, resolverEnd);
|
String resolver = source.substring(resolverStart, resolverEnd);
|
||||||
@@ -227,7 +227,7 @@ public class IrisWorldGeneratorResolverTest {
|
|||||||
@Test
|
@Test
|
||||||
public void ownedWorldSnapshotFailureStopsStartupAndRethrows() throws Exception {
|
public void ownedWorldSnapshotFailureStopsStartupAndRethrows() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/IrisWorldGeneratorResolver.java"));
|
"src/main/java/art/arcane/iris/core/IrisWorldGeneratorResolver.java")).replace("\r\n", "\n");
|
||||||
int resolverStart = source.indexOf("public ChunkGenerator resolveDefaultWorldGenerator(");
|
int resolverStart = source.indexOf("public ChunkGenerator resolveDefaultWorldGenerator(");
|
||||||
int resolverEnd = source.indexOf("private ChunkGenerator resolveFrozenWorldGenerator(", resolverStart);
|
int resolverEnd = source.indexOf("private ChunkGenerator resolveFrozenWorldGenerator(", resolverStart);
|
||||||
String resolver = source.substring(resolverStart, resolverEnd);
|
String resolver = source.substring(resolverStart, resolverEnd);
|
||||||
|
|||||||
+9
-9
@@ -135,8 +135,8 @@ public class PendingWorldReplacementThreadAffinityTest {
|
|||||||
@Test
|
@Test
|
||||||
public void bukkitAccessIsConfinedToTheGlobalCaptureStage() throws Exception {
|
public void bukkitAccessIsConfinedToTheGlobalCaptureStage() throws Exception {
|
||||||
String managerSource = Files.readString(Path.of(
|
String managerSource = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/PendingWorldReplacementManager.java"));
|
"src/main/java/art/arcane/iris/core/PendingWorldReplacementManager.java")).replace("\r\n", "\n");
|
||||||
String irisSource = Files.readString(Path.of("src/main/java/art/arcane/iris/Iris.java"));
|
String irisSource = Files.readString(Path.of("src/main/java/art/arcane/iris/Iris.java")).replace("\r\n", "\n");
|
||||||
String startup = method(managerSource, "public void verifyLoadedPublishedWorlds()");
|
String startup = method(managerSource, "public void verifyLoadedPublishedWorlds()");
|
||||||
String worldLoad = method(managerSource, "public void onWorldLoad(WorldLoadEvent event)");
|
String worldLoad = method(managerSource, "public void onWorldLoad(WorldLoadEvent event)");
|
||||||
String discovery = method(managerSource, "private void discoverLoadedPublishedWorlds()");
|
String discovery = method(managerSource, "private void discoverLoadedPublishedWorlds()");
|
||||||
@@ -167,10 +167,10 @@ public class PendingWorldReplacementThreadAffinityTest {
|
|||||||
@Test
|
@Test
|
||||||
public void paperLoginHookIsIsolatedFromAlwaysLoadedSpigotClasses() throws Exception {
|
public void paperLoginHookIsIsolatedFromAlwaysLoadedSpigotClasses() throws Exception {
|
||||||
String managerSource = Files.readString(Path.of(
|
String managerSource = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/PendingWorldReplacementManager.java"));
|
"src/main/java/art/arcane/iris/core/PendingWorldReplacementManager.java")).replace("\r\n", "\n");
|
||||||
String irisSource = Files.readString(Path.of("src/main/java/art/arcane/iris/Iris.java"));
|
String irisSource = Files.readString(Path.of("src/main/java/art/arcane/iris/Iris.java")).replace("\r\n", "\n");
|
||||||
String listenerSource = Files.readString(Path.of(
|
String listenerSource = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/PaperWorldReplacementEntryListener.java"));
|
"src/main/java/art/arcane/iris/core/PaperWorldReplacementEntryListener.java")).replace("\r\n", "\n");
|
||||||
String registration = method(managerSource, "public void registerPlatformEntryListener()");
|
String registration = method(managerSource, "public void registerPlatformEntryListener()");
|
||||||
|
|
||||||
assertFalse(managerSource.contains("import io.papermc.paper.event.player.AsyncPlayerSpawnLocationEvent"));
|
assertFalse(managerSource.contains("import io.papermc.paper.event.player.AsyncPlayerSpawnLocationEvent"));
|
||||||
@@ -186,9 +186,9 @@ public class PendingWorldReplacementThreadAffinityTest {
|
|||||||
@Test
|
@Test
|
||||||
public void redirectedPlayerReceiptSurvivesUntilTheMaterializedPositionIsSaved() throws Exception {
|
public void redirectedPlayerReceiptSurvivesUntilTheMaterializedPositionIsSaved() throws Exception {
|
||||||
String managerSource = Files.readString(Path.of(
|
String managerSource = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/PendingWorldReplacementManager.java"));
|
"src/main/java/art/arcane/iris/core/PendingWorldReplacementManager.java")).replace("\r\n", "\n");
|
||||||
String listenerSource = Files.readString(Path.of(
|
String listenerSource = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/PaperWorldReplacementEntryListener.java"));
|
"src/main/java/art/arcane/iris/core/PaperWorldReplacementEntryListener.java")).replace("\r\n", "\n");
|
||||||
String preparation = method(
|
String preparation = method(
|
||||||
managerSource,
|
managerSource,
|
||||||
"ReplacementEntryRedirect prepareReplacementEntry(UUID playerId, Location savedLocation, boolean newPlayer)"
|
"ReplacementEntryRedirect prepareReplacementEntry(UUID playerId, Location savedLocation, boolean newPlayer)"
|
||||||
@@ -215,9 +215,9 @@ public class PendingWorldReplacementThreadAffinityTest {
|
|||||||
@Test
|
@Test
|
||||||
public void replacementSpawnIsPersistedBeforeFinalMarkerRetirement() throws Exception {
|
public void replacementSpawnIsPersistedBeforeFinalMarkerRetirement() throws Exception {
|
||||||
String managerSource = Files.readString(Path.of(
|
String managerSource = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/PendingWorldReplacementManager.java"));
|
"src/main/java/art/arcane/iris/core/PendingWorldReplacementManager.java")).replace("\r\n", "\n");
|
||||||
String listenerSource = Files.readString(Path.of(
|
String listenerSource = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/PaperWorldReplacementEntryListener.java"));
|
"src/main/java/art/arcane/iris/core/PaperWorldReplacementEntryListener.java")).replace("\r\n", "\n");
|
||||||
String preparation = method(managerSource, "private void prepareOverworldEntry(World world)");
|
String preparation = method(managerSource, "private void prepareOverworldEntry(World world)");
|
||||||
String persistence = method(managerSource, "private CompletableFuture<Location> persistOverworldSpawn(Location safeEntry)");
|
String persistence = method(managerSource, "private CompletableFuture<Location> persistOverworldSpawn(Location safeEntry)");
|
||||||
String retirement = method(
|
String retirement = method(
|
||||||
|
|||||||
+1
-1
@@ -78,7 +78,7 @@ public class CommandIrisCreateOverwriteContractTest {
|
|||||||
public void createAndReplaceUseLocalizedStyledMissingDimensionFeedback() throws Exception {
|
public void createAndReplaceUseLocalizedStyledMissingDimensionFeedback() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/commands/CommandIris.java"
|
"src/main/java/art/arcane/iris/core/commands/CommandIris.java"
|
||||||
));
|
)).replace("\r\n", "\n");
|
||||||
|
|
||||||
assertEquals(2, occurrences(source, "COMMAND_IRIS_DIMENSION_NOT_FOUND"));
|
assertEquals(2, occurrences(source, "COMMAND_IRIS_DIMENSION_NOT_FOUND"));
|
||||||
assertEquals(2, occurrences(source, "COMMAND_IRIS_INSTALL_PACK_AND_RESTART"));
|
assertEquals(2, occurrences(source, "COMMAND_IRIS_INSTALL_PACK_AND_RESTART"));
|
||||||
|
|||||||
+1
-1
@@ -51,7 +51,7 @@ public class CommandIrisDownloadContractTest {
|
|||||||
public void commandDelegatesAcceptedDownloadsWithoutRawPreamble() throws Exception {
|
public void commandDelegatesAcceptedDownloadsWithoutRawPreamble() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/commands/CommandIris.java"
|
"src/main/java/art/arcane/iris/core/commands/CommandIris.java"
|
||||||
));
|
)).replace("\r\n", "\n");
|
||||||
String download = method(source, "public void download(");
|
String download = method(source, "public void download(");
|
||||||
|
|
||||||
assertTrue(download.contains("downloadBuiltIn(sender(), builtInPack)"));
|
assertTrue(download.contains("downloadBuiltIn(sender(), builtInPack)"));
|
||||||
|
|||||||
+3
-3
@@ -118,7 +118,7 @@ public class CommandJigsawContractTest {
|
|||||||
@Test
|
@Test
|
||||||
public void committedActivationStartsInitialEvaluationBeforePlayerBinding() throws Exception {
|
public void committedActivationStartsInitialEvaluationBeforePlayerBinding() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/commands/CommandJigsaw.java"));
|
"src/main/java/art/arcane/iris/core/commands/CommandJigsaw.java")).replace("\r\n", "\n");
|
||||||
int commit = source.indexOf("JigsawStudioActivation.commit(staged)");
|
int commit = source.indexOf("JigsawStudioActivation.commit(staged)");
|
||||||
int evaluation = source.indexOf(
|
int evaluation = source.indexOf(
|
||||||
"studioService.activationCommitted(world, request.requestId())",
|
"studioService.activationCommitted(world, request.requestId())",
|
||||||
@@ -361,7 +361,7 @@ public class CommandJigsawContractTest {
|
|||||||
@Test
|
@Test
|
||||||
public void pieceCreateUsesResolvedWorkcellCapacityInsteadOfLayoutDefault() throws Exception {
|
public void pieceCreateUsesResolvedWorkcellCapacityInsteadOfLayoutDefault() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/commands/CommandJigsaw.java"));
|
"src/main/java/art/arcane/iris/core/commands/CommandJigsaw.java")).replace("\r\n", "\n");
|
||||||
int pieceCommands = source.indexOf("public static class CommandJigsawPiece");
|
int pieceCommands = source.indexOf("public static class CommandJigsawPiece");
|
||||||
int create = source.indexOf("public void create(", pieceCommands);
|
int create = source.indexOf("public void create(", pieceCommands);
|
||||||
int add = source.indexOf("public void add(", create);
|
int add = source.indexOf("public void add(", create);
|
||||||
@@ -513,7 +513,7 @@ public class CommandJigsawContractTest {
|
|||||||
@Test
|
@Test
|
||||||
public void exportSourceAcquiresStudioLeaseBeforeStaticLeaseAndReleasesBothPaths() throws Exception {
|
public void exportSourceAcquiresStudioLeaseBeforeStaticLeaseAndReleasesBothPaths() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/commands/CommandJigsaw.java"));
|
"src/main/java/art/arcane/iris/core/commands/CommandJigsaw.java")).replace("\r\n", "\n");
|
||||||
int serviceLease = source.indexOf("studioService.tryBeginExport(requestId, playerId)");
|
int serviceLease = source.indexOf("studioService.tryBeginExport(requestId, playerId)");
|
||||||
int staticLease = source.indexOf("beginExport(playerId, destination)", serviceLease);
|
int staticLease = source.indexOf("beginExport(playerId, destination)", serviceLease);
|
||||||
int dispatch = source.indexOf("J.a(() -> runExport(operation))", staticLease);
|
int dispatch = source.indexOf("J.a(() -> runExport(operation))", staticLease);
|
||||||
|
|||||||
+1
-1
@@ -215,7 +215,7 @@ public class IrisPapiExpansionTest {
|
|||||||
@Test
|
@Test
|
||||||
public void thePlaceholderPathNeverTouchesTheEngineOrAPluginStatic() throws Exception {
|
public void thePlaceholderPathNeverTouchesTheEngineOrAPluginStatic() throws Exception {
|
||||||
for (String file : List.of("IrisPapiExpansion.java", "IrisPapiState.java", "IrisPapiWorldView.java")) {
|
for (String file : List.of("IrisPapiExpansion.java", "IrisPapiState.java", "IrisPapiWorldView.java")) {
|
||||||
String source = Files.readString(Path.of("src/main/java/art/arcane/iris/core/link/" + file));
|
String source = Files.readString(Path.of("src/main/java/art/arcane/iris/core/link/" + file)).replace("\r\n", "\n");
|
||||||
|
|
||||||
assertFalse(file + " must not import the engine", source.contains("art.arcane.iris.engine."));
|
assertFalse(file + " must not import the engine", source.contains("art.arcane.iris.engine."));
|
||||||
assertFalse(file + " must not reach into the toolbelt", source.contains("IrisToolbelt"));
|
assertFalse(file + " must not reach into the toolbelt", source.contains("IrisToolbelt"));
|
||||||
|
|||||||
+4
-2
@@ -14,7 +14,9 @@ public class IrisPapiLifecycleTest {
|
|||||||
private static final String TEARDOWN = "private void teardownPapi() {";
|
private static final String TEARDOWN = "private void teardownPapi() {";
|
||||||
|
|
||||||
private static String source() throws Exception {
|
private static String source() throws Exception {
|
||||||
return Files.readString(PLUGIN_SOURCE);
|
// The assertions below match against literals written with \n, so a CRLF checkout has to
|
||||||
|
// be folded first or every multi-line expectation misses.
|
||||||
|
return Files.readString(PLUGIN_SOURCE).replace("\r\n", "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String body(String declaration) throws Exception {
|
private static String body(String declaration) throws Exception {
|
||||||
@@ -127,6 +129,6 @@ public class IrisPapiLifecycleTest {
|
|||||||
|
|
||||||
private static String installerSource() throws Exception {
|
private static String installerSource() throws Exception {
|
||||||
return java.nio.file.Files.readString(java.nio.file.Path.of(
|
return java.nio.file.Files.readString(java.nio.file.Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/link/IrisPapiInstaller.java"));
|
"src/main/java/art/arcane/iris/core/link/IrisPapiInstaller.java")).replace("\r\n", "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -12,9 +12,9 @@ import static org.junit.Assert.assertTrue;
|
|||||||
public class StudioPlayerModeContractTest {
|
public class StudioPlayerModeContractTest {
|
||||||
@Test
|
@Test
|
||||||
public void studioEntryKeepsPlayersEligibleForNaturalSpawning() throws IOException {
|
public void studioEntryKeepsPlayersEligibleForNaturalSpawning() throws IOException {
|
||||||
String plugin = Files.readString(Path.of("src/main/java/art/arcane/iris/Iris.java"));
|
String plugin = Files.readString(Path.of("src/main/java/art/arcane/iris/Iris.java")).replace("\r\n", "\n");
|
||||||
String commands = Files.readString(Path.of(
|
String commands = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/commands/CommandStudio.java"));
|
"src/main/java/art/arcane/iris/core/commands/CommandStudio.java")).replace("\r\n", "\n");
|
||||||
|
|
||||||
assertFalse(plugin.contains("GameMode.SPECTATOR"));
|
assertFalse(plugin.contains("GameMode.SPECTATOR"));
|
||||||
assertFalse(commands.contains("GameMode.SPECTATOR"));
|
assertFalse(commands.contains("GameMode.SPECTATOR"));
|
||||||
|
|||||||
@@ -176,6 +176,42 @@ tasks.register('iris', Copy) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.register('buildSwiftSwamp') {
|
||||||
|
group = 'iris'
|
||||||
|
description = 'Builds every platform jar and drops them in the local BUILDS output directory.'
|
||||||
|
outputs.upToDateWhen { false }
|
||||||
|
dependsOn('iris', 'verifyModdedArtifacts')
|
||||||
|
doLast {
|
||||||
|
File swiftSwampOut = file('C://VolmitSoftware/BUILDS')
|
||||||
|
copy {
|
||||||
|
from(layout.buildDirectory.file("consumer/${bukkitArtifactName}"))
|
||||||
|
into(swiftSwampOut)
|
||||||
|
rename { String ignored -> 'Iris.jar' }
|
||||||
|
}
|
||||||
|
copy {
|
||||||
|
from(layout.projectDirectory.file("adapters/fabric/build/libs/${fabricArtifactName}"))
|
||||||
|
into(swiftSwampOut)
|
||||||
|
rename { String ignored -> 'Iris-Fabric.jar' }
|
||||||
|
}
|
||||||
|
copy {
|
||||||
|
from(layout.projectDirectory.file("adapters/forge/build/libs/${forgeArtifactName}"))
|
||||||
|
into(swiftSwampOut)
|
||||||
|
rename { String ignored -> 'Iris-Forge.jar' }
|
||||||
|
}
|
||||||
|
copy {
|
||||||
|
from(layout.projectDirectory.file("adapters/neoforge/build/libs/${neoForgeArtifactName}"))
|
||||||
|
into(swiftSwampOut)
|
||||||
|
rename { String ignored -> 'Iris-Neoforge.jar' }
|
||||||
|
}
|
||||||
|
println('')
|
||||||
|
println('=== Iris buildSwiftSwamp -> ' + swiftSwampOut + ' ===')
|
||||||
|
['Iris.jar', 'Iris-Fabric.jar', 'Iris-Forge.jar', 'Iris-Neoforge.jar'].each { String jar ->
|
||||||
|
File produced = new File(swiftSwampOut, jar)
|
||||||
|
println(String.format(' %-24s %8d KB', jar, (long) (produced.length() / 1024)))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tasks.register('buildBukkit', Copy) {
|
tasks.register('buildBukkit', Copy) {
|
||||||
group = 'iris'
|
group = 'iris'
|
||||||
dependsOn('jar')
|
dependsOn('jar')
|
||||||
@@ -668,6 +704,7 @@ allprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url = uri('https://repo.papermc.io/repository/maven-public/') }
|
maven { url = uri('https://repo.papermc.io/repository/maven-public/') }
|
||||||
maven { url = uri('https://repo.codemc.org/repository/maven-public/') }
|
maven { url = uri('https://repo.codemc.org/repository/maven-public/') }
|
||||||
|
|||||||
@@ -2152,7 +2152,12 @@ public final class DatapackIngestService {
|
|||||||
if (fileKey != null) {
|
if (fileKey != null) {
|
||||||
return "key:" + fileKey;
|
return "key:" + fileKey;
|
||||||
}
|
}
|
||||||
return "";
|
// Windows exposes no inode-equivalent for a directory, and returning nothing here fails
|
||||||
|
// the identity gate closed, which disables legacy staging replacement on that platform
|
||||||
|
// outright. Creation time is the one stable discriminator the filesystem still offers: a
|
||||||
|
// directory swapped in at the same path brings its own, so a swap is still caught. It is
|
||||||
|
// a weaker guarantee than an inode, so it is only ever the fallback.
|
||||||
|
return "created:" + attributes.creationTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean pathExists(Path path, String purpose) throws IOException {
|
private static boolean pathExists(Path path, String purpose) throws IOException {
|
||||||
|
|||||||
@@ -374,6 +374,12 @@ final class JigsawStudioHistoryStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void forceDirectory(Path directory) throws IOException {
|
private static void forceDirectory(Path directory) throws IOException {
|
||||||
|
// A directory can only be opened and fsynced on a POSIX filesystem; Windows rejects the
|
||||||
|
// open outright. Matches DirectoryDurability and DatapackIngestService, which already
|
||||||
|
// skip the barrier there.
|
||||||
|
if (!Files.getFileStore(directory).supportsFileAttributeView("posix")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
try (FileChannel channel = FileChannel.open(directory, StandardOpenOption.READ)) {
|
try (FileChannel channel = FileChannel.open(directory, StandardOpenOption.READ)) {
|
||||||
channel.force(true);
|
channel.force(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,6 +145,6 @@ public class DiagnosticSeverityPolicyTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static String read(String relativePath) throws IOException {
|
private static String read(String relativePath) throws IOException {
|
||||||
return Files.readString(Path.of("src/main/java/art/arcane/iris").resolve(relativePath));
|
return Files.readString(Path.of("src/main/java/art/arcane/iris").resolve(relativePath)).replace("\r\n", "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ public class IrisWorldsTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void oneUnusableWorldIsExcludedInsteadOfFailingTheWholeRegistry() throws Exception {
|
public void oneUnusableWorldIsExcludedInsteadOfFailingTheWholeRegistry() throws Exception {
|
||||||
String source = Files.readString(Path.of("src/main/java/art/arcane/iris/core/IrisWorlds.java"));
|
String source = Files.readString(Path.of("src/main/java/art/arcane/iris/core/IrisWorlds.java")).replace("\r\n", "\n");
|
||||||
|
|
||||||
int accessor = source.indexOf("public static IrisWorlds get()");
|
int accessor = source.indexOf("public static IrisWorlds get()");
|
||||||
int accessorEnd = source.indexOf("public synchronized void put(", accessor);
|
int accessorEnd = source.indexOf("public synchronized void put(", accessor);
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public class ProgressBossBarToggleTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String source(String relativePath) throws Exception {
|
private String source(String relativePath) throws Exception {
|
||||||
return Files.readString(Path.of("src/main/java/art/arcane/iris").resolve(relativePath));
|
return Files.readString(Path.of("src/main/java/art/arcane/iris").resolve(relativePath)).replace("\r\n", "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void withProgressBossBar(boolean enabled, Runnable body) {
|
private void withProgressBossBar(boolean enabled, Runnable body) {
|
||||||
|
|||||||
+2
-2
@@ -387,7 +387,7 @@ public class ServerConfiguratorDatapackFingerprintTest {
|
|||||||
@Test
|
@Test
|
||||||
public void recoveryRunsBeforeRestoredFingerprintReuseHashFallbackAndCompilation() throws Exception {
|
public void recoveryRunsBeforeRestoredFingerprintReuseHashFallbackAndCompilation() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/ServerConfigurator.java"));
|
"src/main/java/art/arcane/iris/core/ServerConfigurator.java")).replace("\r\n", "\n");
|
||||||
int installIfChanged = source.indexOf("installDataPacksIfChanged(boolean fullInstall)");
|
int installIfChanged = source.indexOf("installDataPacksIfChanged(boolean fullInstall)");
|
||||||
int recovery = source.indexOf("DatapackIngestService.reapplyFromStaging", installIfChanged);
|
int recovery = source.indexOf("DatapackIngestService.reapplyFromStaging", installIfChanged);
|
||||||
int restored = source.indexOf("restoredCompilerInputFingerprint()", recovery);
|
int restored = source.indexOf("restoredCompilerInputFingerprint()", recovery);
|
||||||
@@ -407,7 +407,7 @@ public class ServerConfiguratorDatapackFingerprintTest {
|
|||||||
@Test
|
@Test
|
||||||
public void studioTimingSeparatesRecoveryFingerprintCompilationAndTotal() throws Exception {
|
public void studioTimingSeparatesRecoveryFingerprintCompilationAndTotal() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/ServerConfigurator.java"));
|
"src/main/java/art/arcane/iris/core/ServerConfigurator.java")).replace("\r\n", "\n");
|
||||||
int timedInstall = source.indexOf("BiConsumer<String, Long> timingConsumer");
|
int timedInstall = source.indexOf("BiConsumer<String, Long> timingConsumer");
|
||||||
int recovery = source.indexOf("\"datapack_external_recovery\"", timedInstall);
|
int recovery = source.indexOf("\"datapack_external_recovery\"", timedInstall);
|
||||||
int fingerprint = source.indexOf("\"datapack_compiler_input_fingerprint\"", recovery);
|
int fingerprint = source.indexOf("\"datapack_compiler_input_fingerprint\"", recovery);
|
||||||
|
|||||||
+2
-2
@@ -11,7 +11,7 @@ public class DatapackIngestRuntimeInvalidationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void everyPublicMutationInvalidatesLoadedRuntimeBeforeLocking() throws Exception {
|
public void everyPublicMutationInvalidatesLoadedRuntimeBeforeLocking() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/datapack/DatapackIngestService.java"));
|
"src/main/java/art/arcane/iris/core/datapack/DatapackIngestService.java")).replace("\r\n", "\n");
|
||||||
|
|
||||||
assertInvalidatesBeforeLock(source, "public static Report ingest(");
|
assertInvalidatesBeforeLock(source, "public static Report ingest(");
|
||||||
assertInvalidatesBeforeLock(source, "public static ReapplyOutcome reapplyFromStaging(");
|
assertInvalidatesBeforeLock(source, "public static ReapplyOutcome reapplyFromStaging(");
|
||||||
@@ -21,7 +21,7 @@ public class DatapackIngestRuntimeInvalidationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void noChangeChecksRestoreWhileChangedIngestRemainsRestartBound() throws Exception {
|
public void noChangeChecksRestoreWhileChangedIngestRemainsRestartBound() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/datapack/DatapackIngestService.java"));
|
"src/main/java/art/arcane/iris/core/datapack/DatapackIngestService.java")).replace("\r\n", "\n");
|
||||||
int ingest = source.indexOf("public static Report ingest(");
|
int ingest = source.indexOf("public static Report ingest(");
|
||||||
int unlock = source.indexOf("TRANSACTION_LOCK.unlock();", ingest);
|
int unlock = source.indexOf("TRANSACTION_LOCK.unlock();", ingest);
|
||||||
int restore = source.indexOf(
|
int restore = source.indexOf(
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ public class DatapackIngestServiceTest {
|
|||||||
@Test
|
@Test
|
||||||
public void startupChecksCheapCacheContextBeforeHashingManagedDatapacks() throws Exception {
|
public void startupChecksCheapCacheContextBeforeHashingManagedDatapacks() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/datapack/DatapackIngestService.java"));
|
"src/main/java/art/arcane/iris/core/datapack/DatapackIngestService.java")).replace("\r\n", "\n");
|
||||||
int validation = source.indexOf("public static StartupValidationOutcome validateOnStartup()");
|
int validation = source.indexOf("public static StartupValidationOutcome validateOnStartup()");
|
||||||
int cacheRead = source.indexOf("readStartupValidationCache", validation);
|
int cacheRead = source.indexOf("readStartupValidationCache", validation);
|
||||||
int contextCheck = source.indexOf("startupValidationContextMatches(", cacheRead);
|
int contextCheck = source.indexOf("startupValidationContextMatches(", cacheRead);
|
||||||
@@ -266,7 +266,7 @@ public class DatapackIngestServiceTest {
|
|||||||
@Test
|
@Test
|
||||||
public void unchangedPostStartupMaintenanceReturnsBeforeFingerprinting() throws Exception {
|
public void unchangedPostStartupMaintenanceReturnsBeforeFingerprinting() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/datapack/DatapackIngestService.java"));
|
"src/main/java/art/arcane/iris/core/datapack/DatapackIngestService.java")).replace("\r\n", "\n");
|
||||||
int refresh = source.indexOf(
|
int refresh = source.indexOf(
|
||||||
"refreshStartupValidationAfterMaintenance(boolean maintenanceChanged)");
|
"refreshStartupValidationAfterMaintenance(boolean maintenanceChanged)");
|
||||||
int unchangedGuard = source.indexOf("if (!maintenanceChanged)", refresh);
|
int unchangedGuard = source.indexOf("if (!maintenanceChanged)", refresh);
|
||||||
@@ -806,7 +806,7 @@ public class DatapackIngestServiceTest {
|
|||||||
@Test
|
@Test
|
||||||
public void directoryHashRestatsAttributesAndVolumeBeforeOpeningEachFile() throws Exception {
|
public void directoryHashRestatsAttributesAndVolumeBeforeOpeningEachFile() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/datapack/DatapackIngestService.java"));
|
"src/main/java/art/arcane/iris/core/datapack/DatapackIngestService.java")).replace("\r\n", "\n");
|
||||||
int method = source.indexOf("private static String directoryHash(File root)");
|
int method = source.indexOf("private static String directoryHash(File root)");
|
||||||
int entries = source.indexOf("List<Path> entries = new ArrayList<>()", method);
|
int entries = source.indexOf("List<Path> entries = new ArrayList<>()", method);
|
||||||
int loop = source.indexOf("for (Path entry : entries)", entries);
|
int loop = source.indexOf("for (Path entry : entries)", entries);
|
||||||
|
|||||||
@@ -54,7 +54,8 @@ public class MissingWorldStorageLogTest {
|
|||||||
|
|
||||||
assertEquals(2, emitted.size());
|
assertEquals(2, emitted.size());
|
||||||
assertTrue(emitted.get(0), emitted.get(0).contains("world_iris_gone"));
|
assertTrue(emitted.get(0), emitted.get(0).contains("world_iris_gone"));
|
||||||
assertTrue(emitted.get(0), emitted.get(0).contains("/srv/world/dimensions/iris/gone"));
|
assertTrue(emitted.get(0),
|
||||||
|
emitted.get(0).contains(Path.of("/srv/world/dimensions/iris/gone").toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -80,7 +81,8 @@ public class MissingWorldStorageLogTest {
|
|||||||
|
|
||||||
assertTrue(MissingWorldStorageLog.hasWarned("world_iris_husk"));
|
assertTrue(MissingWorldStorageLog.hasWarned("world_iris_husk"));
|
||||||
assertEquals(2, emitted.size());
|
assertEquals(2, emitted.size());
|
||||||
assertTrue(emitted.get(0), emitted.get(0).contains("/srv/world/dimensions/iris/husk"));
|
assertTrue(emitted.get(0),
|
||||||
|
emitted.get(0).contains(Path.of("/srv/world/dimensions/iris/husk").toString()));
|
||||||
assertTrue(emitted.get(1), emitted.get(1).contains("world_iris_husk"));
|
assertTrue(emitted.get(1), emitted.get(1).contains("world_iris_husk"));
|
||||||
assertFalse("an empty folder is deleted, not restored", emitted.get(1).contains("Restore"));
|
assertFalse("an empty folder is deleted, not restored", emitted.get(1).contains("Restore"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class MultiverseCoreLinkTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void registrationDoesNotRewriteTheRecordedMultiverseName() throws Exception {
|
public void registrationDoesNotRewriteTheRecordedMultiverseName() throws Exception {
|
||||||
String source = Files.readString(Path.of("src/main/java/art/arcane/iris/core/link/MultiverseCoreLink.java"));
|
String source = Files.readString(Path.of("src/main/java/art/arcane/iris/core/link/MultiverseCoreLink.java")).replace("\r\n", "\n");
|
||||||
|
|
||||||
assertFalse("worlds are created under the startup name, so the recorded name needs no correction",
|
assertFalse("worlds are created under the startup name, so the recorded name needs no correction",
|
||||||
source.contains("setLegacyWorldName"));
|
source.contains("setLegacyWorldName"));
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class PackExportClosureTest {
|
|||||||
@Test
|
@Test
|
||||||
public void bothPackagersExportSpawnersMarkersAndTheFullEntityGraph() throws Exception {
|
public void bothPackagersExportSpawnersMarkersAndTheFullEntityGraph() throws Exception {
|
||||||
String bukkit = Files.readString(Path.of(
|
String bukkit = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/project/IrisPackageCompiler.java"));
|
"src/main/java/art/arcane/iris/core/project/IrisPackageCompiler.java")).replace("\r\n", "\n");
|
||||||
assertTrue("Bukkit packager must write spawners/", bukkit.contains("\"spawners/\""));
|
assertTrue("Bukkit packager must write spawners/", bukkit.contains("\"spawners/\""));
|
||||||
assertTrue("Bukkit packager must write markers/", bukkit.contains("\"markers/\""));
|
assertTrue("Bukkit packager must write markers/", bukkit.contains("\"markers/\""));
|
||||||
assertTrue("Bukkit packager must export region objects alongside biome objects",
|
assertTrue("Bukkit packager must export region objects alongside biome objects",
|
||||||
@@ -64,7 +64,7 @@ public class PackExportClosureTest {
|
|||||||
assertTrue("Bukkit packager must export entity loot tables", bukkit.contains("getLoot().getTables()"));
|
assertTrue("Bukkit packager must export entity loot tables", bukkit.contains("getLoot().getTables()"));
|
||||||
|
|
||||||
String modded = Files.readString(Path.of(
|
String modded = Files.readString(Path.of(
|
||||||
"../adapters/modded-common/src/main/java/art/arcane/iris/modded/command/ModdedStudioCommands.java"));
|
"../adapters/modded-common/src/main/java/art/arcane/iris/modded/command/ModdedStudioCommands.java")).replace("\r\n", "\n");
|
||||||
assertTrue("modded packager must write spawners/", modded.contains("\"spawners\""));
|
assertTrue("modded packager must write spawners/", modded.contains("\"spawners\""));
|
||||||
assertTrue("modded packager must write markers/", modded.contains("\"markers\""));
|
assertTrue("modded packager must write markers/", modded.contains("\"markers\""));
|
||||||
assertTrue("modded packager must include initial spawns", modded.contains("getInitialSpawns"));
|
assertTrue("modded packager must include initial spawns", modded.contains("getInitialSpawns"));
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public class StudioEntitySpawningTest {
|
|||||||
@Test
|
@Test
|
||||||
public void studioWorldRulesEnableVanillaMobSpawning() throws IOException {
|
public void studioWorldRulesEnableVanillaMobSpawning() throws IOException {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/runtime/WorldRuntimeControlService.java"));
|
"src/main/java/art/arcane/iris/core/runtime/WorldRuntimeControlService.java")).replace("\r\n", "\n");
|
||||||
int helperStart = source.indexOf("static void enableStudioEntitySpawning");
|
int helperStart = source.indexOf("static void enableStudioEntitySpawning");
|
||||||
int helperEnd = source.indexOf("public boolean applyNoonTimeLock", helperStart);
|
int helperEnd = source.indexOf("public boolean applyNoonTimeLock", helperStart);
|
||||||
String helper = source.substring(helperStart, helperEnd);
|
String helper = source.substring(helperStart, helperEnd);
|
||||||
@@ -38,7 +38,7 @@ public class StudioEntitySpawningTest {
|
|||||||
@Test
|
@Test
|
||||||
public void generalStudioUsesAPlayerModeEligibleForNaturalSpawning() throws IOException {
|
public void generalStudioUsesAPlayerModeEligibleForNaturalSpawning() throws IOException {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/project/IrisProject.java"));
|
"src/main/java/art/arcane/iris/core/project/IrisProject.java")).replace("\r\n", "\n");
|
||||||
|
|
||||||
assertFalse(source.contains("GameMode.SPECTATOR"));
|
assertFalse(source.contains("GameMode.SPECTATOR"));
|
||||||
assertTrue(source.contains("GameMode.CREATIVE"));
|
assertTrue(source.contains("GameMode.CREATIVE"));
|
||||||
|
|||||||
+5
-5
@@ -65,7 +65,7 @@ public class StudioOpenCoordinatorOpenKindTest {
|
|||||||
@Test
|
@Test
|
||||||
public void studioTimingSeparatesOrderedLifecyclePhases() throws Exception {
|
public void studioTimingSeparatesOrderedLifecyclePhases() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/runtime/StudioOpenCoordinator.java"));
|
"src/main/java/art/arcane/iris/core/runtime/StudioOpenCoordinator.java")).replace("\r\n", "\n");
|
||||||
int previous = -1;
|
int previous = -1;
|
||||||
for (String phase : List.of(
|
for (String phase : List.of(
|
||||||
"resolve_dimension_and_cleanup",
|
"resolve_dimension_and_cleanup",
|
||||||
@@ -87,7 +87,7 @@ public class StudioOpenCoordinatorOpenKindTest {
|
|||||||
@Test
|
@Test
|
||||||
public void structureStateActivatesAfterStandardTeleportBeforeFinalization() throws Exception {
|
public void structureStateActivatesAfterStandardTeleportBeforeFinalization() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/runtime/StudioOpenCoordinator.java"));
|
"src/main/java/art/arcane/iris/core/runtime/StudioOpenCoordinator.java")).replace("\r\n", "\n");
|
||||||
int entryReady = source.indexOf(
|
int entryReady = source.indexOf(
|
||||||
"entryLoadFuture.get(STUDIO_ENTRY_LOAD_TIMEOUT_SECONDS, TimeUnit.SECONDS)");
|
"entryLoadFuture.get(STUDIO_ENTRY_LOAD_TIMEOUT_SECONDS, TimeUnit.SECONDS)");
|
||||||
int teleport = source.indexOf(
|
int teleport = source.indexOf(
|
||||||
@@ -121,7 +121,7 @@ public class StudioOpenCoordinatorOpenKindTest {
|
|||||||
@Test
|
@Test
|
||||||
public void failedOpenMarshalsRetainedStateAbandonmentToTheServerScheduler() throws Exception {
|
public void failedOpenMarshalsRetainedStateAbandonmentToTheServerScheduler() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/runtime/StudioOpenCoordinator.java"));
|
"src/main/java/art/arcane/iris/core/runtime/StudioOpenCoordinator.java")).replace("\r\n", "\n");
|
||||||
int methodStart = source.indexOf(
|
int methodStart = source.indexOf(
|
||||||
"private void abandonStudioEntryBootstrap(World world, Throwable failure)");
|
"private void abandonStudioEntryBootstrap(World world, Throwable failure)");
|
||||||
int methodEnd = source.indexOf("private void deferFailedOpenCleanup", methodStart);
|
int methodEnd = source.indexOf("private void deferFailedOpenCleanup", methodStart);
|
||||||
@@ -135,7 +135,7 @@ public class StudioOpenCoordinatorOpenKindTest {
|
|||||||
@Test
|
@Test
|
||||||
public void queuedRestartDefersFailedOpenCleanupWithoutAcquiringALiveCloseLease() throws Exception {
|
public void queuedRestartDefersFailedOpenCleanupWithoutAcquiringALiveCloseLease() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/runtime/StudioOpenCoordinator.java"));
|
"src/main/java/art/arcane/iris/core/runtime/StudioOpenCoordinator.java")).replace("\r\n", "\n");
|
||||||
int openCatch = source.indexOf("} catch (Throwable e) {");
|
int openCatch = source.indexOf("} catch (Throwable e) {");
|
||||||
int restartCheck = source.indexOf(
|
int restartCheck = source.indexOf(
|
||||||
".active(LifecycleOperationCoordinator.Domain.SERVER_LIFECYCLE)",
|
".active(LifecycleOperationCoordinator.Domain.SERVER_LIFECYCLE)",
|
||||||
@@ -160,7 +160,7 @@ public class StudioOpenCoordinatorOpenKindTest {
|
|||||||
@Test
|
@Test
|
||||||
public void openFinalizerReturnsToTheServerThreadBeforeCompletion() throws Exception {
|
public void openFinalizerReturnsToTheServerThreadBeforeCompletion() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/runtime/StudioOpenCoordinator.java"));
|
"src/main/java/art/arcane/iris/core/runtime/StudioOpenCoordinator.java")).replace("\r\n", "\n");
|
||||||
int finalizerCall = source.indexOf("runOpenFinalizer(request.onDone(), world);");
|
int finalizerCall = source.indexOf("runOpenFinalizer(request.onDone(), world);");
|
||||||
int futureCompletion = source.indexOf(
|
int futureCompletion = source.indexOf(
|
||||||
"future.complete(new StudioOpenResult(world, safeEntry))", finalizerCall);
|
"future.complete(new StudioOpenResult(world, safeEntry))", finalizerCall);
|
||||||
|
|||||||
+2
-2
@@ -34,7 +34,7 @@ public class StudioOpenCoordinatorSpawnStuckRegressionTest {
|
|||||||
@Test
|
@Test
|
||||||
public void paperEntryChunkLoadIsAsyncBeforeTheRetentionTicket() throws Exception {
|
public void paperEntryChunkLoadIsAsyncBeforeTheRetentionTicket() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/runtime/StudioOpenCoordinator.java"));
|
"src/main/java/art/arcane/iris/core/runtime/StudioOpenCoordinator.java")).replace("\r\n", "\n");
|
||||||
int asyncLoad = source.indexOf("requested = WorldRuntimeControlService.get().requestChunkAsync(");
|
int asyncLoad = source.indexOf("requested = WorldRuntimeControlService.get().requestChunkAsync(");
|
||||||
int urgentFlag = source.indexOf("true);", asyncLoad);
|
int urgentFlag = source.indexOf("true);", asyncLoad);
|
||||||
int retentionTicket = source.indexOf("world.addPluginChunkTicket", asyncLoad);
|
int retentionTicket = source.indexOf("world.addPluginChunkTicket", asyncLoad);
|
||||||
@@ -47,7 +47,7 @@ public class StudioOpenCoordinatorSpawnStuckRegressionTest {
|
|||||||
@Test
|
@Test
|
||||||
public void foliaRetainsItsNonBlockingTicketBootstrapPath() throws Exception {
|
public void foliaRetainsItsNonBlockingTicketBootstrapPath() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/runtime/StudioOpenCoordinator.java"));
|
"src/main/java/art/arcane/iris/core/runtime/StudioOpenCoordinator.java")).replace("\r\n", "\n");
|
||||||
int foliaBranch = source.indexOf("if (!J.isFolia())");
|
int foliaBranch = source.indexOf("if (!J.isFolia())");
|
||||||
int retentionSchedule = source.indexOf(
|
int retentionSchedule = source.indexOf(
|
||||||
"return scheduleEntryChunkRetention(world, chunkX, chunkZ);",
|
"return scheduleEntryChunkRetention(world, chunkX, chunkZ);",
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ public class JigsawStudioLifecycleTest {
|
|||||||
@Test
|
@Test
|
||||||
public void committedStudioActivationDisablesNaturalMobSpawning() throws IOException {
|
public void committedStudioActivationDisablesNaturalMobSpawning() throws IOException {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/service/JigsawStudioService.java"));
|
"src/main/java/art/arcane/iris/core/service/JigsawStudioService.java")).replace("\r\n", "\n");
|
||||||
int registerStart = source.indexOf("public void register(");
|
int registerStart = source.indexOf("public void register(");
|
||||||
int commitStart = source.indexOf("public void activationCommitted(", registerStart);
|
int commitStart = source.indexOf("public void activationCommitted(", registerStart);
|
||||||
int commitEnd = source.indexOf("public void markChunkGenerated(", commitStart);
|
int commitEnd = source.indexOf("public void markChunkGenerated(", commitStart);
|
||||||
|
|||||||
+1
-1
@@ -186,7 +186,7 @@ public class PackDownloadProgressReporterTest {
|
|||||||
public void playerHudAlwaysShowsLoaderLaneAndActionBarWithCleanup() throws Exception {
|
public void playerHudAlwaysShowsLoaderLaneAndActionBarWithCleanup() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/service/PackDownloadProgressReporter.java"
|
"src/main/java/art/arcane/iris/core/service/PackDownloadProgressReporter.java"
|
||||||
));
|
)).replace("\r\n", "\n");
|
||||||
|
|
||||||
assertFalse(source.contains("HudSlotRequest"));
|
assertFalse(source.contains("HudSlotRequest"));
|
||||||
assertFalse(source.contains("HudSurface"));
|
assertFalse(source.contains("HudSurface"));
|
||||||
|
|||||||
+4
-4
@@ -15,7 +15,7 @@ import static org.junit.Assert.assertTrue;
|
|||||||
public class StudioSVCPackDownloadContractTest {
|
public class StudioSVCPackDownloadContractTest {
|
||||||
@Test
|
@Test
|
||||||
public void downloadsUseReporterCompletionWithoutMutatingLiveDatapacks() throws Exception {
|
public void downloadsUseReporterCompletionWithoutMutatingLiveDatapacks() throws Exception {
|
||||||
String source = Files.readString(Path.of("src/main/java/art/arcane/iris/core/service/StudioSVC.java"));
|
String source = Files.readString(Path.of("src/main/java/art/arcane/iris/core/service/StudioSVC.java")).replace("\r\n", "\n");
|
||||||
|
|
||||||
assertTrue(source.contains("reporter.succeed(result);"));
|
assertTrue(source.contains("reporter.succeed(result);"));
|
||||||
assertFalse(method(source, "public void downloadBuiltIn(VolmitSender sender, String key)")
|
assertFalse(method(source, "public void downloadBuiltIn(VolmitSender sender, String key)")
|
||||||
@@ -26,7 +26,7 @@ public class StudioSVCPackDownloadContractTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void downloadLeaseIsAcquiredBeforeUnconditionalIoDispatch() throws Exception {
|
public void downloadLeaseIsAcquiredBeforeUnconditionalIoDispatch() throws Exception {
|
||||||
String source = Files.readString(Path.of("src/main/java/art/arcane/iris/core/service/StudioSVC.java"));
|
String source = Files.readString(Path.of("src/main/java/art/arcane/iris/core/service/StudioSVC.java")).replace("\r\n", "\n");
|
||||||
int mutationStart = source.indexOf("private void runPackMutation(");
|
int mutationStart = source.indexOf("private void runPackMutation(");
|
||||||
int mutationEnd = source.indexOf("private void executePackMutation(", mutationStart);
|
int mutationEnd = source.indexOf("private void executePackMutation(", mutationStart);
|
||||||
String runPackMutation = source.substring(mutationStart, mutationEnd);
|
String runPackMutation = source.substring(mutationStart, mutationEnd);
|
||||||
@@ -47,7 +47,7 @@ public class StudioSVCPackDownloadContractTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void acceptedDownloadsRouteFeedbackProgressAndTerminalStatesThroughReporter() throws Exception {
|
public void acceptedDownloadsRouteFeedbackProgressAndTerminalStatesThroughReporter() throws Exception {
|
||||||
String source = Files.readString(Path.of("src/main/java/art/arcane/iris/core/service/StudioSVC.java"));
|
String source = Files.readString(Path.of("src/main/java/art/arcane/iris/core/service/StudioSVC.java")).replace("\r\n", "\n");
|
||||||
String builtIn = method(source, "public void downloadBuiltIn(VolmitSender sender, String key)");
|
String builtIn = method(source, "public void downloadBuiltIn(VolmitSender sender, String key)");
|
||||||
String remote = method(source, "public void downloadUrl(VolmitSender sender, String url)");
|
String remote = method(source, "public void downloadUrl(VolmitSender sender, String url)");
|
||||||
String execute = method(source, "private void executePackMutation(");
|
String execute = method(source, "private void executePackMutation(");
|
||||||
@@ -64,7 +64,7 @@ public class StudioSVCPackDownloadContractTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void shutdownClosesAdmissionAndDrainsTrackedDownloadBeforeServiceTeardown() throws Exception {
|
public void shutdownClosesAdmissionAndDrainsTrackedDownloadBeforeServiceTeardown() throws Exception {
|
||||||
String source = Files.readString(Path.of("src/main/java/art/arcane/iris/core/service/StudioSVC.java"));
|
String source = Files.readString(Path.of("src/main/java/art/arcane/iris/core/service/StudioSVC.java")).replace("\r\n", "\n");
|
||||||
String onDisable = method(source, "public void onDisable()");
|
String onDisable = method(source, "public void onDisable()");
|
||||||
String quiesce = method(source, "public void quiesceDownloadsForShutdown()");
|
String quiesce = method(source, "public void quiesceDownloadsForShutdown()");
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ public class StudioSVCWorldPackFeedbackContractTest {
|
|||||||
public void persistentPackCopyUsesLocalizedStyledOperatorFeedback() throws Exception {
|
public void persistentPackCopyUsesLocalizedStyledOperatorFeedback() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/service/StudioSVC.java"
|
"src/main/java/art/arcane/iris/core/service/StudioSVC.java"
|
||||||
));
|
)).replace("\r\n", "\n");
|
||||||
|
|
||||||
assertEquals(1, occurrences(source, "STUDIO_S_V_C_PACK_COPY_REQUIRES_ASYNC_THREAD"));
|
assertEquals(1, occurrences(source, "STUDIO_S_V_C_PACK_COPY_REQUIRES_ASYNC_THREAD"));
|
||||||
assertEquals(2, occurrences(source, "STUDIO_S_V_C_PACK_INSTALL_FAILED"));
|
assertEquals(2, occurrences(source, "STUDIO_S_V_C_PACK_INSTALL_FAILED"));
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ public class StudioSVCWorldPackPublishTest {
|
|||||||
@Test
|
@Test
|
||||||
public void replaceExistingRejectsSymbolicTargetBeforePublication() throws Exception {
|
public void replaceExistingRejectsSymbolicTargetBeforePublication() throws Exception {
|
||||||
String sourceCode = Files.readString(Path.of(
|
String sourceCode = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/service/StudioSVC.java"));
|
"src/main/java/art/arcane/iris/core/service/StudioSVC.java")).replace("\r\n", "\n");
|
||||||
int install = sourceCode.indexOf("private IrisDimension installIntoDirectory(");
|
int install = sourceCode.indexOf("private IrisDimension installIntoDirectory(");
|
||||||
int initialTargetSafety = sourceCode.indexOf(
|
int initialTargetSafety = sourceCode.indexOf(
|
||||||
"requireSafePublicationTarget(target, replaceExisting)",
|
"requireSafePublicationTarget(target, replaceExisting)",
|
||||||
@@ -296,7 +296,7 @@ public class StudioSVCWorldPackPublishTest {
|
|||||||
@Test
|
@Test
|
||||||
public void replacementKeepsTargetUnauthorizedThroughPublishedFingerprintWindow() throws Exception {
|
public void replacementKeepsTargetUnauthorizedThroughPublishedFingerprintWindow() throws Exception {
|
||||||
String sourceCode = Files.readString(Path.of(
|
String sourceCode = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/service/StudioSVC.java"));
|
"src/main/java/art/arcane/iris/core/service/StudioSVC.java")).replace("\r\n", "\n");
|
||||||
int install = sourceCode.indexOf("private IrisDimension installIntoDirectory(");
|
int install = sourceCode.indexOf("private IrisDimension installIntoDirectory(");
|
||||||
int beginMutation = sourceCode.indexOf("PackValidationRegistry.beginRootMutation(target)", install);
|
int beginMutation = sourceCode.indexOf("PackValidationRegistry.beginRootMutation(target)", install);
|
||||||
int publish = sourceCode.indexOf("AtomicDirectoryPublisher.publish(stage, target)", beginMutation);
|
int publish = sourceCode.indexOf("AtomicDirectoryPublisher.publish(stage, target)", beginMutation);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import static org.junit.Assert.assertTrue;
|
|||||||
public class IrisCreatorProgressContractTest {
|
public class IrisCreatorProgressContractTest {
|
||||||
@Test
|
@Test
|
||||||
public void persistentCreateReportsTheWholeLifecycleInsteadOfOnlySpawnChunks() throws Exception {
|
public void persistentCreateReportsTheWholeLifecycleInsteadOfOnlySpawnChunks() throws Exception {
|
||||||
String source = Files.readString(Path.of("src/main/java/art/arcane/iris/core/tools/IrisCreator.java"));
|
String source = Files.readString(Path.of("src/main/java/art/arcane/iris/core/tools/IrisCreator.java")).replace("\r\n", "\n");
|
||||||
|
|
||||||
int startReporter = source.indexOf("WorldCreationProgressReporter.start(sender, name)");
|
int startReporter = source.indexOf("WorldCreationProgressReporter.start(sender, name)");
|
||||||
int resolve = source.indexOf("0.02D, \"resolve_dimension\"", startReporter);
|
int resolve = source.indexOf("0.02D, \"resolve_dimension\"", startReporter);
|
||||||
|
|||||||
+3
-3
@@ -11,7 +11,7 @@ import static org.junit.Assert.assertTrue;
|
|||||||
public class IrisPersistentWorldCreationContractTest {
|
public class IrisPersistentWorldCreationContractTest {
|
||||||
@Test
|
@Test
|
||||||
public void productionCreateFreezesIntoCurrentPlatformStorageBeforeWorldCreation() throws Exception {
|
public void productionCreateFreezesIntoCurrentPlatformStorageBeforeWorldCreation() throws Exception {
|
||||||
String source = Files.readString(Path.of("src/main/java/art/arcane/iris/core/tools/IrisCreator.java"));
|
String source = Files.readString(Path.of("src/main/java/art/arcane/iris/core/tools/IrisCreator.java")).replace("\r\n", "\n");
|
||||||
int createStart = source.indexOf("private World createReserved(");
|
int createStart = source.indexOf("private World createReserved(");
|
||||||
int createEnd = source.indexOf("static Player createTeleportTarget(", createStart);
|
int createEnd = source.indexOf("static Player createTeleportTarget(", createStart);
|
||||||
String create = source.substring(createStart, createEnd);
|
String create = source.substring(createStart, createEnd);
|
||||||
@@ -39,7 +39,7 @@ public class IrisPersistentWorldCreationContractTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void persistentCreatorPreservesConfiguredNameAndCanonicalIdentity() throws Exception {
|
public void persistentCreatorPreservesConfiguredNameAndCanonicalIdentity() throws Exception {
|
||||||
String source = Files.readString(Path.of("src/main/java/art/arcane/iris/core/tools/IrisWorldCreator.java"));
|
String source = Files.readString(Path.of("src/main/java/art/arcane/iris/core/tools/IrisWorldCreator.java")).replace("\r\n", "\n");
|
||||||
int createStart = source.indexOf("public WorldCreator create()");
|
int createStart = source.indexOf("public WorldCreator create()");
|
||||||
int createEnd = source.indexOf("private World.Environment findEnvironment()", createStart);
|
int createEnd = source.indexOf("private World.Environment findEnvironment()", createStart);
|
||||||
String create = source.substring(createStart, createEnd);
|
String create = source.substring(createStart, createEnd);
|
||||||
@@ -61,7 +61,7 @@ public class IrisPersistentWorldCreationContractTest {
|
|||||||
public void publicBukkitBackendRebuildKeepsExactFallbackWorldName() throws Exception {
|
public void publicBukkitBackendRebuildKeepsExactFallbackWorldName() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/lifecycle/WorldLifecycleRequest.java"
|
"src/main/java/art/arcane/iris/core/lifecycle/WorldLifecycleRequest.java"
|
||||||
));
|
)).replace("\r\n", "\n");
|
||||||
int rebuildStart = source.indexOf("public WorldCreator toWorldCreator()");
|
int rebuildStart = source.indexOf("public WorldCreator toWorldCreator()");
|
||||||
int rebuildEnd = source.indexOf("return creator;", rebuildStart);
|
int rebuildEnd = source.indexOf("return creator;", rebuildStart);
|
||||||
String rebuild = source.substring(rebuildStart, rebuildEnd);
|
String rebuild = source.substring(rebuildStart, rebuildEnd);
|
||||||
|
|||||||
+1
-1
@@ -62,7 +62,7 @@ public class WorldCreationProgressReporterTest {
|
|||||||
public void bukkitHudMutationIsMarshalledOffTheAsyncReporterThread() throws Exception {
|
public void bukkitHudMutationIsMarshalledOffTheAsyncReporterThread() throws Exception {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/core/tools/WorldCreationProgressReporter.java"
|
"src/main/java/art/arcane/iris/core/tools/WorldCreationProgressReporter.java"
|
||||||
));
|
)).replace("\r\n", "\n");
|
||||||
|
|
||||||
assertEquals(1, occurrences(source, "Bukkit.createBossBar("));
|
assertEquals(1, occurrences(source, "Bukkit.createBossBar("));
|
||||||
assertTrue(source.contains("J.sfut(reporter::initializePlayerHud)"));
|
assertTrue(source.contains("J.sfut(reporter::initializePlayerHud)"));
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public class EngineRuntimePublicationContractTest {
|
|||||||
@Test
|
@Test
|
||||||
public void worldManagerStartsOnlyAfterTheRuntimeSessionIsReady() throws IOException {
|
public void worldManagerStartsOnlyAfterTheRuntimeSessionIsReady() throws IOException {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/engine/EngineRuntimeBuilder.java"));
|
"src/main/java/art/arcane/iris/engine/EngineRuntimeBuilder.java")).replace("\r\n", "\n");
|
||||||
int publishStart = source.indexOf("void publishRuntime(");
|
int publishStart = source.indexOf("void publishRuntime(");
|
||||||
int publishEnd = source.indexOf("private void scheduleRuntimeTasks", publishStart);
|
int publishEnd = source.indexOf("private void scheduleRuntimeTasks", publishStart);
|
||||||
String publish = source.substring(publishStart, publishEnd);
|
String publish = source.substring(publishStart, publishEnd);
|
||||||
@@ -27,7 +27,7 @@ public class EngineRuntimePublicationContractTest {
|
|||||||
@Test
|
@Test
|
||||||
public void failedManagerStartClosesAdmissionBeforeRuntimeCleanup() throws IOException {
|
public void failedManagerStartClosesAdmissionBeforeRuntimeCleanup() throws IOException {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/engine/EngineRuntimeBuilder.java"));
|
"src/main/java/art/arcane/iris/engine/EngineRuntimeBuilder.java")).replace("\r\n", "\n");
|
||||||
int publishStart = source.indexOf("void publishRuntime(");
|
int publishStart = source.indexOf("void publishRuntime(");
|
||||||
int publishEnd = source.indexOf("private void scheduleRuntimeTasks", publishStart);
|
int publishEnd = source.indexOf("private void scheduleRuntimeTasks", publishStart);
|
||||||
String publish = source.substring(publishStart, publishEnd);
|
String publish = source.substring(publishStart, publishEnd);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public class EngineShutdownOwnershipContractTest {
|
|||||||
@Test
|
@Test
|
||||||
public void ownershipCloseMustSucceedBeforeMantleRelease() throws IOException {
|
public void ownershipCloseMustSucceedBeforeMantleRelease() throws IOException {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/engine/EngineShutdownSequence.java"));
|
"src/main/java/art/arcane/iris/engine/EngineShutdownSequence.java")).replace("\r\n", "\n");
|
||||||
int ownershipClose = source.indexOf("NativeStructureOwnershipStore.close(engine)");
|
int ownershipClose = source.indexOf("NativeStructureOwnershipStore.close(engine)");
|
||||||
int ownershipGate = source.indexOf("if (ownershipFailure == null)", ownershipClose);
|
int ownershipGate = source.indexOf("if (ownershipFailure == null)", ownershipClose);
|
||||||
int mantleRelease = source.indexOf("releaseMantle(failure)", ownershipGate);
|
int mantleRelease = source.indexOf("releaseMantle(failure)", ownershipGate);
|
||||||
@@ -25,7 +25,7 @@ public class EngineShutdownOwnershipContractTest {
|
|||||||
@Test
|
@Test
|
||||||
public void failedConstructionKeepsMantleOpenWhileOwnershipWritesRemain() throws IOException {
|
public void failedConstructionKeepsMantleOpenWhileOwnershipWritesRemain() throws IOException {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/engine/EngineShutdownSequence.java"));
|
"src/main/java/art/arcane/iris/engine/EngineShutdownSequence.java")).replace("\r\n", "\n");
|
||||||
int cleanupStart = source.indexOf("void cleanupFailedConstruction");
|
int cleanupStart = source.indexOf("void cleanupFailedConstruction");
|
||||||
int cleanupEnd = source.indexOf("Throwable closeAssembly", cleanupStart);
|
int cleanupEnd = source.indexOf("Throwable closeAssembly", cleanupStart);
|
||||||
String cleanup = source.substring(cleanupStart, cleanupEnd);
|
String cleanup = source.substring(cleanupStart, cleanupEnd);
|
||||||
|
|||||||
+5
-5
@@ -12,7 +12,7 @@ public class NativeStructureBootstrapLifecycleContractTest {
|
|||||||
@Test
|
@Test
|
||||||
public void closeWaitsBeforeLifecycleMutationAndGenerationSeal() throws IOException {
|
public void closeWaitsBeforeLifecycleMutationAndGenerationSeal() throws IOException {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/engine/EngineShutdownSequence.java"));
|
"src/main/java/art/arcane/iris/engine/EngineShutdownSequence.java")).replace("\r\n", "\n");
|
||||||
int closeStart = source.indexOf("void close()");
|
int closeStart = source.indexOf("void close()");
|
||||||
int closeEnd = source.indexOf("void cleanupFailedConstruction", closeStart);
|
int closeEnd = source.indexOf("void cleanupFailedConstruction", closeStart);
|
||||||
String close = source.substring(closeStart, closeEnd);
|
String close = source.substring(closeStart, closeEnd);
|
||||||
@@ -28,7 +28,7 @@ public class NativeStructureBootstrapLifecycleContractTest {
|
|||||||
@Test
|
@Test
|
||||||
public void fullAndComplexHotloadWaitBeforeLifecycleMutationAndGenerationSeal() throws IOException {
|
public void fullAndComplexHotloadWaitBeforeLifecycleMutationAndGenerationSeal() throws IOException {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/engine/EngineHotloader.java"));
|
"src/main/java/art/arcane/iris/engine/EngineHotloader.java")).replace("\r\n", "\n");
|
||||||
int complexStart = source.indexOf("void hotloadComplex()");
|
int complexStart = source.indexOf("void hotloadComplex()");
|
||||||
int fullStart = source.indexOf("void hotloadSilently()", complexStart);
|
int fullStart = source.indexOf("void hotloadSilently()", complexStart);
|
||||||
String complex = source.substring(complexStart, fullStart);
|
String complex = source.substring(complexStart, fullStart);
|
||||||
@@ -52,7 +52,7 @@ public class NativeStructureBootstrapLifecycleContractTest {
|
|||||||
@Test
|
@Test
|
||||||
public void ringBootstrapStartsUnderTheSameLifecycleLock() throws IOException {
|
public void ringBootstrapStartsUnderTheSameLifecycleLock() throws IOException {
|
||||||
String source = Files.readString(Path.of(
|
String source = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/engine/IrisEngine.java"));
|
"src/main/java/art/arcane/iris/engine/IrisEngine.java")).replace("\r\n", "\n");
|
||||||
int start = source.indexOf("public CompletableFuture<Void> startNativeStructureBootstrap(");
|
int start = source.indexOf("public CompletableFuture<Void> startNativeStructureBootstrap(");
|
||||||
int end = source.indexOf("void awaitNativeStructureBootstrap", start);
|
int end = source.indexOf("void awaitNativeStructureBootstrap", start);
|
||||||
String method = source.substring(start, end);
|
String method = source.substring(start, end);
|
||||||
@@ -68,7 +68,7 @@ public class NativeStructureBootstrapLifecycleContractTest {
|
|||||||
@Test
|
@Test
|
||||||
public void studioVolumeQueriesStayOutsideCachesUntilTheBootstrapGateReleases() throws IOException {
|
public void studioVolumeQueriesStayOutsideCachesUntilTheBootstrapGateReleases() throws IOException {
|
||||||
String engineSource = Files.readString(Path.of(
|
String engineSource = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/engine/IrisEngine.java"));
|
"src/main/java/art/arcane/iris/engine/IrisEngine.java")).replace("\r\n", "\n");
|
||||||
int queryStart = engineSource.indexOf(
|
int queryStart = engineSource.indexOf(
|
||||||
"public KList<NativeStructureVolume> getNativeStructureVolumes(");
|
"public KList<NativeStructureVolume> getNativeStructureVolumes(");
|
||||||
int queryEnd = engineSource.indexOf(
|
int queryEnd = engineSource.indexOf(
|
||||||
@@ -77,7 +77,7 @@ public class NativeStructureBootstrapLifecycleContractTest {
|
|||||||
int setterEnd = engineSource.indexOf("public IrisEngineData getEngineData()", queryEnd);
|
int setterEnd = engineSource.indexOf("public IrisEngineData getEngineData()", queryEnd);
|
||||||
String setter = engineSource.substring(queryEnd, setterEnd);
|
String setter = engineSource.substring(queryEnd, setterEnd);
|
||||||
String generatorSource = Files.readString(Path.of(
|
String generatorSource = Files.readString(Path.of(
|
||||||
"src/main/java/art/arcane/iris/engine/platform/BukkitChunkGenerator.java"));
|
"src/main/java/art/arcane/iris/engine/platform/BukkitChunkGenerator.java")).replace("\r\n", "\n");
|
||||||
int releaseStart = generatorSource.indexOf("public void endStudioEntryBootstrap()");
|
int releaseStart = generatorSource.indexOf("public void endStudioEntryBootstrap()");
|
||||||
int releaseEnd = generatorSource.indexOf(
|
int releaseEnd = generatorSource.indexOf(
|
||||||
"public boolean isStudioEntryBootstrapActive()", releaseStart);
|
"public boolean isStudioEntryBootstrapActive()", releaseStart);
|
||||||
|
|||||||
+1
-1
@@ -235,7 +235,7 @@ public class StructureHandlerTest {
|
|||||||
public void completionUsesOneReachabilitySnapshotAndLocatableKeys() throws IOException {
|
public void completionUsesOneReachabilitySnapshotAndLocatableKeys() throws IOException {
|
||||||
Path sourcePath = Path.of(
|
Path sourcePath = Path.of(
|
||||||
"src/main/java/art/arcane/iris/util/common/director/specialhandlers/StructureHandler.java");
|
"src/main/java/art/arcane/iris/util/common/director/specialhandlers/StructureHandler.java");
|
||||||
String source = Files.readString(sourcePath);
|
String source = Files.readString(sourcePath).replace("\r\n", "\n");
|
||||||
int methodStart = source.indexOf("public KList<String> getPossibilities()");
|
int methodStart = source.indexOf("public KList<String> getPossibilities()");
|
||||||
int methodEnd = source.indexOf("@Override\n public String toString", methodStart);
|
int methodEnd = source.indexOf("@Override\n public String toString", methodStart);
|
||||||
String method = source.substring(methodStart, methodEnd);
|
String method = source.substring(methodStart, methodEnd);
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
@echo off
|
||||||
|
REM Publishes VolmLib to the local Maven repository under the coordinate this project
|
||||||
|
REM resolves by default: com.github.VolmitSoftware:VolmLib:master-SNAPSHOT.
|
||||||
|
REM
|
||||||
|
REM VolmLib is normally picked up as a composite build straight from source, so this is
|
||||||
|
REM only needed when you build with -PuseLocalVolmLib=false, or when another tool has to
|
||||||
|
REM resolve VolmLib from the local Maven repository rather than the included build.
|
||||||
|
REM
|
||||||
|
REM The lookup mirrors settings.gradle: it walks up from this script looking for a
|
||||||
|
REM VolmLib checkout sitting beside the project root. Set VOLMLIB_DIR to override.
|
||||||
|
REM Any extra arguments are forwarded to gradle.
|
||||||
|
|
||||||
|
setlocal
|
||||||
|
|
||||||
|
set "SCRIPT_DIR=%~dp0"
|
||||||
|
if "%SCRIPT_DIR:~-1%"=="\" set "SCRIPT_DIR=%SCRIPT_DIR:~0,-1%"
|
||||||
|
|
||||||
|
set "VOLMLIB_DIRECTORY="
|
||||||
|
|
||||||
|
if defined VOLMLIB_DIR call :check "%VOLMLIB_DIR%"
|
||||||
|
if not defined VOLMLIB_DIRECTORY call :search "%SCRIPT_DIR%"
|
||||||
|
|
||||||
|
if not defined VOLMLIB_DIRECTORY (
|
||||||
|
echo Could not find a VolmLib checkout. 1>&2
|
||||||
|
echo Expected a VolmLib directory beside this project root, or VOLMLIB_DIR pointing at one. 1>&2
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
echo ==^> Publishing VolmLib from %VOLMLIB_DIRECTORY%
|
||||||
|
|
||||||
|
pushd "%VOLMLIB_DIRECTORY%"
|
||||||
|
if errorlevel 1 exit /b 1
|
||||||
|
|
||||||
|
call gradlew.bat publishToMavenLocal -Pgroup=com.github.VolmitSoftware -Pversion=master-SNAPSHOT -PvolmLibArtifactId=VolmLib %*
|
||||||
|
set "PUBLISH_RESULT=%ERRORLEVEL%"
|
||||||
|
|
||||||
|
popd
|
||||||
|
exit /b %PUBLISH_RESULT%
|
||||||
|
|
||||||
|
:check
|
||||||
|
if exist "%~1\settings.gradle" set "VOLMLIB_DIRECTORY=%~f1"
|
||||||
|
if exist "%~1\settings.gradle.kts" set "VOLMLIB_DIRECTORY=%~f1"
|
||||||
|
goto :eof
|
||||||
|
|
||||||
|
:search
|
||||||
|
set "CURRENT=%~f1"
|
||||||
|
:search_loop
|
||||||
|
if exist "%CURRENT%\VolmLib\settings.gradle" (
|
||||||
|
set "VOLMLIB_DIRECTORY=%CURRENT%\VolmLib"
|
||||||
|
goto :eof
|
||||||
|
)
|
||||||
|
if exist "%CURRENT%\VolmLib\settings.gradle.kts" (
|
||||||
|
set "VOLMLIB_DIRECTORY=%CURRENT%\VolmLib"
|
||||||
|
goto :eof
|
||||||
|
)
|
||||||
|
for %%I in ("%CURRENT%\..") do set "PARENT=%%~fI"
|
||||||
|
if /i "%PARENT%"=="%CURRENT%" goto :eof
|
||||||
|
set "CURRENT=%PARENT%"
|
||||||
|
goto :search_loop
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Publishes VolmLib to the local Maven repository under the coordinate this project
|
||||||
|
# resolves by default: com.github.VolmitSoftware:VolmLib:master-SNAPSHOT.
|
||||||
|
#
|
||||||
|
# VolmLib is normally picked up as a composite build straight from source, so this is
|
||||||
|
# only needed when you build with -PuseLocalVolmLib=false, or when another tool has to
|
||||||
|
# resolve VolmLib from ~/.m2 rather than from the included build.
|
||||||
|
#
|
||||||
|
# The lookup mirrors settings.gradle: it walks up from this script looking for a
|
||||||
|
# VolmLib checkout sitting beside the project root. Set VOLMLIB_DIR to override.
|
||||||
|
# Any extra arguments are forwarded to gradle.
|
||||||
|
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
|
||||||
|
has_volmlib_settings() {
|
||||||
|
[[ -f "$1/settings.gradle" || -f "$1/settings.gradle.kts" ]]
|
||||||
|
}
|
||||||
|
|
||||||
|
resolve_volmlib_directory() {
|
||||||
|
if [[ -n "$VOLMLIB_DIR" ]] && has_volmlib_settings "$VOLMLIB_DIR"; then
|
||||||
|
printf '%s' "$VOLMLIB_DIR"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
local current="$SCRIPT_DIR"
|
||||||
|
while [[ -n "$current" ]]; do
|
||||||
|
if has_volmlib_settings "$current/VolmLib"; then
|
||||||
|
printf '%s' "$current/VolmLib"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
local parent
|
||||||
|
parent="$(dirname -- "$current")"
|
||||||
|
[[ "$parent" == "$current" ]] && break
|
||||||
|
current="$parent"
|
||||||
|
done
|
||||||
|
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if ! VOLMLIB_DIRECTORY="$(resolve_volmlib_directory)"; then
|
||||||
|
printf 'Could not find a VolmLib checkout.\n' >&2
|
||||||
|
printf 'Expected a VolmLib directory beside this project root, or VOLMLIB_DIR pointing at one.\n' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf '==> Publishing VolmLib from %s\n' "$VOLMLIB_DIRECTORY"
|
||||||
|
|
||||||
|
cd "$VOLMLIB_DIRECTORY" || exit 1
|
||||||
|
./gradlew publishToMavenLocal \
|
||||||
|
-Pgroup=com.github.VolmitSoftware \
|
||||||
|
-Pversion=master-SNAPSHOT \
|
||||||
|
-PvolmLibArtifactId=VolmLib \
|
||||||
|
"$@"
|
||||||
Reference in New Issue
Block a user