Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some cleanup and Javadocs #40

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
import java.io.Serializable;
import java.util.Objects;

/**
* Represents an entry in the Artifact manifest given to NFRT to prevent re-downloading of
* dependencies that Gradle has already downloaded to its cache.
* It uses the same format used in NeoForm/NeoForge configuration data to identify an artifact (Maven format).
*/
final class ArtifactManifestEntry implements Serializable {
@Input
private final String artifactId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
import java.io.IOException;
import java.util.Properties;

/**
* This task creates a properties file for NFRT that maps artifact ids found in
* NeoForge/NeoForm configuration data to existing files on disk.
*/
abstract class CreateArtifactManifestTask extends DefaultTask {
@Input
abstract SetProperty<ArtifactManifestEntry> getNeoForgeModDevArtifacts();
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
import java.util.ArrayList;
import java.util.Collections;

/**
* The primary task for creating the Minecraft artifacts that mods will be compiled against,
* using the NFRT CLI.
*/
@DisableCachingByDefault(because = "Implements its own caching")
abstract class CreateMinecraftArtifactsTask extends NeoFormRuntimeEngineTask {
@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
import org.gradle.api.attributes.AttributeDisambiguationRule;
import org.gradle.api.attributes.MultipleCandidatesDetails;

/**
* We generally will use "client" dependencies when we have to decide between client and server,
* since client libraries will usually be a superset of the server libraries.
*/
public abstract class DistributionDisambiguation implements AttributeDisambiguationRule<String> {
@Override
public void execute(MultipleCandidatesDetails<String> details) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
import javax.inject.Inject;
import java.util.List;

/**
* Use the NFRT CLI to download the asset index and assets for the Minecraft version used by the
* underlying NeoForge/NeoForm configuration.
*/
abstract class DownloadAssetsTask extends NeoFormRuntimeEngineTask {
@Inject
public DownloadAssetsTask() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
import java.util.function.Consumer;
import java.util.stream.Collectors;

/**
* The main plugin class.
*/
public class ModDevPlugin implements Plugin<Project> {
private static final Attribute<String> ATTRIBUTE_DISTRIBUTION = Attribute.of("net.neoforged.distribution", String.class);
private static final Attribute<String> ATTRIBUTE_OPERATING_SYSTEM = Attribute.of("net.neoforged.operatingsystem", String.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.util.List;

/**
* Base task implementation for running NFRT.
* Base task implementation for running the NFRT CLI, regardless of which sub-command is used.
*/
abstract public class NeoFormRuntimeTask extends DefaultTask {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import org.gradle.api.attributes.AttributeDisambiguationRule;
import org.gradle.api.attributes.MultipleCandidatesDetails;

/**
* This disambiguation rule will select native dependencies based on the operating system Gradle is currently running on.
*/
public abstract class OperatingSystemDisambiguation implements AttributeDisambiguationRule<String> {
@Override
public void execute(MultipleCandidatesDetails<String> details) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

import javax.inject.Inject;

/**
* Prepare all files needed to run a particular flavor of the game.
*/
abstract class PrepareRun extends PrepareRunOrTest {
@Input
public abstract Property<String> getRunType();
Expand Down
Loading