Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Will <[email protected]>
  • Loading branch information
IotaBread and supersaiyansubtlety authored Sep 28, 2024
1 parent c7a340e commit 573f07f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ task mappingsUnpickedServer(type: EnigmaMappingsServerTask, dependsOn: unpickHas
}

task mappingsServer(type: EnigmaMappingsServerTask, dependsOn: "mapPerVersionMappingsJar") {
jarToMap.set mappings.fileConstants.perVersionMappingsJar
jarToMap.set project.extensions.mappings.fileConstants.perVersionMappingsJar
}

// Only build jars for package infos if we need to actually expose stuff like annotation in the future.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package quilt.internal.tasks.mappings;

import org.gradle.api.Project;
import org.gradle.api.file.DirectoryProperty;
import org.gradle.api.file.RegularFileProperty;
import org.gradle.api.tasks.InputDirectory;
import org.gradle.api.tasks.InputFile;
import org.gradle.api.tasks.JavaExec;
import quilt.internal.Constants;
Expand All @@ -10,24 +12,24 @@
import java.util.ArrayList;
import java.util.List;

public class EnigmaMappingsServerTask extends JavaExec implements MappingsTask {
public abstract class EnigmaMappingsServerTask extends JavaExec implements MappingsTask {
@InputFile
private final RegularFileProperty jarToMap;
@InputFile
private final RegularFileProperty mappings;
@InputDirectory
protected abstract DirectoryProperty getMappings();

private final List<String> serverArgs;

public EnigmaMappingsServerTask() {
Project project = this.getProject();
final Project project = this.getProject();
this.setGroup(Constants.Groups.MAPPINGS_GROUP);
this.getMainClass().set("org.quiltmc.enigma.network.DedicatedEnigmaServer");
this.classpath(project.getConfigurations().getByName("enigmaRuntime"));
this.jvmArgs("-Xmx2048m");

this.jarToMap = getObjectFactory().fileProperty();
this.mappings = getObjectFactory().fileProperty();
this.mappings.convention(() -> this.getProject().file("mappings"));
this.getMappings().convention(project.getLayout().dir(project.provider(() -> project.file("mappings"))));

this.serverArgs = new ArrayList<>();

Expand Down Expand Up @@ -55,7 +57,7 @@ public EnigmaMappingsServerTask() {
public void exec() {
var args = new ArrayList<>(List.of(
"-jar", this.jarToMap.get().getAsFile().getAbsolutePath(),
"-mappings", this.mappings.get().getAsFile().getAbsolutePath(),
"-mappings", this.getMappings().get().getAsFile().getAbsolutePath(),
"-profile", "enigma_profile.json"
));
args.addAll(this.serverArgs);
Expand Down

0 comments on commit 573f07f

Please sign in to comment.