Merge remote-tracking branch 'FabricMC/dev/1.6' into dev/1.6

This commit is contained in:
shedaniel
2024-04-04 22:15:32 +09:00
5 changed files with 16 additions and 15 deletions

View File

@@ -12,7 +12,7 @@ mapping-io = "0.5.1"
lorenz-tiny = "4.0.2"
mercury = "0.1.4.17"
kotlinx-metadata = "0.9.0"
loom-native = "0.1.0"
loom-native = "0.1.1"
# Plugins
spotless = "6.25.0"

View File

@@ -85,6 +85,10 @@ public class LoomRepositoryPlugin implements Plugin<PluginAware> {
sources.artifact();
sources.ignoreGradleMetadataRedirection();
});
// Fallback to maven central for artifacts such as sources or javadocs that are not mirrored on Mojang's repo.
// See: https://github.com/FabricMC/fabric-loom/issues/1032
repo.artifactUrls(ArtifactRepositoryContainer.MAVEN_CENTRAL_URL);
});
repositories.maven(repo -> {
repo.setName("Forge");
@@ -143,10 +147,6 @@ public class LoomRepositoryPlugin implements Plugin<PluginAware> {
sources.artifact();
sources.ignoreGradleMetadataRedirection();
});
// Fallback to maven central for artifacts such as sources or javadocs that are not mirrored on Mojang's repo.
// See: https://github.com/FabricMC/fabric-loom/issues/1032
repo.artifactUrls(ArtifactRepositoryContainer.MAVEN_CENTRAL_URL);
});
}

View File

@@ -186,11 +186,14 @@ public abstract class RemapTaskConfiguration implements Runnable {
}
if (getConfigurations().getNames().contains(JavaPlugin.SOURCES_ELEMENTS_CONFIGURATION_NAME)) {
getArtifacts().add(JavaPlugin.SOURCES_ELEMENTS_CONFIGURATION_NAME, remapSourcesTask);
// Remove the dev sources artifact
Configuration configuration = getConfigurations().getByName(JavaPlugin.SOURCES_ELEMENTS_CONFIGURATION_NAME);
configuration.getArtifacts().removeIf(a -> a.getFile().equals(sourcesJarTask.getArchiveFile().get().getAsFile()));
configuration.getArtifacts().removeIf(a -> "sources".equals(a.getClassifier()));
// Add the remapped sources artifact
getArtifacts().add(JavaPlugin.SOURCES_ELEMENTS_CONFIGURATION_NAME, remapSourcesTask.map(AbstractArchiveTask::getArchiveFile), artifact -> {
artifact.setClassifier("sources");
});
} else {
// Sources jar may not have been created with withSourcesJar
getProject().getLogger().warn("Not publishing sources jar as it was not found. Use java.withSourcesJar() to fix.");

View File

@@ -279,10 +279,9 @@ public final class Download {
}
try {
// Once the file has been fully read, create a hard link to the destination file.
// And then remove the temporary file, this ensures that the output file only exists in fully populated state.
Files.createLink(output, partFile);
Files.delete(partFile);
// Once the file has been fully read, move it to the destination file.
// This ensures that the output file only exists in fully populated state.
Files.move(partFile, output);
} catch (IOException e) {
throw error(e, "Failed to complete download");
}

View File

@@ -26,15 +26,14 @@ package net.fabricmc.loom.test.integration.buildSrc.decompile
import java.nio.file.Path
import com.google.common.io.Files
import net.fabricmc.loom.api.decompilers.DecompilationMetadata
import net.fabricmc.loom.api.decompilers.LoomDecompiler
import net.fabricmc.loom.util.ZipUtils
class CustomDecompiler implements LoomDecompiler {
@Override
void decompile(Path compiledJar, Path sourcesDestination, Path linemapDestination, DecompilationMetadata metaData) {
println("Running custom decompiler")
Files.touch(sourcesDestination.toFile())
ZipUtils.add(sourcesDestination, "/META-INF/test.txt", "test")
}
}