Skip to content

Commit

Permalink
Adapt to new need for userdev and NFRT results
Browse files Browse the repository at this point in the history
  • Loading branch information
shartte committed Jun 6, 2024
1 parent 6952e68 commit 67eea9f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,15 @@ public void createArtifacts() throws IOException {
args.add("--warn-on-artifact-manifest-miss");
}

// NOTE: When we use NeoForm standalone, the result-ids also change
Collections.addAll(
args,
"--neoforge", artifactId + ":userdev",
"--dist", "joined",
"--write-result", "compiled:" + getCompiledArtifact().get().getAsFile().getAbsolutePath(),
"--write-result", "sources:" + getSourcesArtifact().get().getAsFile().getAbsolutePath(),
"--write-result", "compiledWithNeoForge:" + getCompiledArtifact().get().getAsFile().getAbsolutePath(),
"--write-result", "sourcesWithNeoForge:" + getSourcesArtifact().get().getAsFile().getAbsolutePath(),
"--write-result", "clientResources:" + getResourcesArtifact().get().getAsFile().getAbsolutePath(),
"--write-result", "compiledWithSources:" + getCompiledWithSourcesArtifact().get().getAsFile().getAbsolutePath()
"--write-result", "sourcesAndCompiledWithNeoForge:" + getCompiledWithSourcesArtifact().get().getAsFile().getAbsolutePath()
);

run(args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,13 @@ private void configureArtifactManifestTask(CreateArtifactManifestTask task, NeoF
spec.setDescription("Dependencies needed for running NeoFormRuntime for the selected NeoForge/NeoForm version (Classpath)");
spec.setCanBeConsumed(false);
spec.setCanBeResolved(true);
spec.withDependencies(depSpec -> depSpec.addLater(neoForgeDependency.map(dependency -> dependency.copy()
.capabilities(caps -> {
caps.requireCapability("net.neoforged:neoforge-dependencies");
}))));
spec.withDependencies(depSpec -> {
depSpec.addLater(neoForgeDependency); // Universal Jar
depSpec.addLater(neoForgeDependency.map(dependency -> dependency.copy()
.capabilities(caps -> {
caps.requireCapability("net.neoforged:neoforge-dependencies");
})));
});
spec.attributes(attributes -> {
attributes.attribute(Usage.USAGE_ATTRIBUTE, project.getObjects().named(Usage.class, Usage.JAVA_RUNTIME));
attributes.attribute(ATTRIBUTE_DISTRIBUTION, "client");
Expand Down Expand Up @@ -453,8 +456,9 @@ private static boolean shouldUseCombinedSourcesAndClassesArtifact() {
private void addTemporaryRepositories(RepositoryHandler repositories) {

repositories.maven(repo -> {
repo.setName("Temporary Repo for minecraft-dependencies");
repo.setUrl("https://prmaven.neoforged.net/GradleMinecraftDependencies/pr1");
repo.setName("Mojang Meta");
repo.setUrl("https://maven.neoforged.net/mojang-meta/");
repo.metadataSources(sources -> sources.gradleMetadata());
repo.content(content -> {
content.includeModule("net.neoforged", "minecraft-dependencies");
});
Expand Down

0 comments on commit 67eea9f

Please sign in to comment.