Skip to content

Commit

Permalink
refactor: Remove unused input parameter clientInstallPath
Browse files Browse the repository at this point in the history
  • Loading branch information
aoqia194 committed Dec 12, 2024
1 parent 85249c5 commit 9eeebe6
Showing 1 changed file with 32 additions and 39 deletions.
71 changes: 32 additions & 39 deletions src/main/java/net/aoqia/loom/task/launch/GenerateDLIConfigTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public GenerateDLIConfigTask() {
getCommonGameJarPath().set(getGameJarPath("common"));
}

getClientInstallPath().set(new File(getExtension().getFiles().getUserCache(), "assets").getAbsolutePath());
getNativesDirectoryPath()
.set(getExtension().getFiles().getNativesDirectory(getProject()).getAbsolutePath());
getDevLauncherConfig().set(getExtension().getFiles().getDevLauncherConfig());
Expand All @@ -80,42 +79,49 @@ public GenerateDLIConfigTask() {
@Input
protected abstract Property<Boolean> getSplitSourceSets();

@Input
protected abstract Property<Boolean> getPlainConsole();

@Input
protected abstract Property<Boolean> getANSISupportedIDE();

@Input
@Optional
protected abstract Property<String> getClassPathGroups();

@Input
protected abstract Property<String> getLog4jConfigPaths();
private static boolean ansiSupportedIde(Project project) {
File rootDir = project.getRootDir();
return new File(rootDir, ".vscode").exists()
|| new File(rootDir, ".idea").exists()
|| new File(rootDir, ".project").exists()
|| (Arrays.stream(rootDir.listFiles())
.anyMatch(file -> file.getName().endsWith(".iws")));
}

@Input
@Optional
protected abstract Property<String> getClientGameJarPath();
protected abstract Property<Boolean> getPlainConsole();

@Input
@Optional
protected abstract Property<String> getCommonGameJarPath();
protected abstract Property<String> getClassPathGroups();

@Input
protected abstract Property<String> getClientInstallPath();
/**
* See: https://github.com/FabricMC/fabric-loader/pull/585.
*/
private static String buildClassPathGroups(Project project) {
return LoomGradleExtension.get(project).getMods().stream()
.map(modSettings -> SourceSetHelper.getClasspath(modSettings, project).stream()
.map(File::getAbsolutePath)
.collect(Collectors.joining(File.pathSeparator)))
.collect(Collectors.joining(File.pathSeparator + File.pathSeparator));
}

@Input
protected abstract Property<String> getNativesDirectoryPath();

@OutputFile
protected abstract RegularFileProperty getDevLauncherConfig();
protected abstract Property<String> getLog4jConfigPaths();

private static String getAllLog4JConfigFiles(Project project) {
return LoomGradleExtension.get(project).getLog4jConfigs().getFiles().stream()
.map(File::getAbsolutePath)
.collect(Collectors.joining(","));
}

@Input
@Optional
protected abstract Property<String> getClientGameJarPath();

private String getGameJarPath(String env) {
MappedZomboidProvider.Split split =
(MappedZomboidProvider.Split) getExtension().getNamedZomboidProvider();
Expand All @@ -127,28 +133,15 @@ private String getGameJarPath(String env) {
};
}

/**
* See: https://github.com/FabricMC/fabric-loader/pull/585.
*/
private static String buildClassPathGroups(Project project) {
return LoomGradleExtension.get(project).getMods().stream()
.map(modSettings -> SourceSetHelper.getClasspath(modSettings, project).stream()
.map(File::getAbsolutePath)
.collect(Collectors.joining(File.pathSeparator)))
.collect(Collectors.joining(File.pathSeparator + File.pathSeparator));
}

private static boolean ansiSupportedIde(Project project) {
File rootDir = project.getRootDir();
return new File(rootDir, ".vscode").exists()
|| new File(rootDir, ".idea").exists()
|| new File(rootDir, ".project").exists()
|| (Arrays.stream(rootDir.listFiles())
.anyMatch(file -> file.getName().endsWith(".iws")));
}
@Input
@Optional
protected abstract Property<String> getCommonGameJarPath();

@Input
protected abstract Property<String> getServerInstallPath();
protected abstract Property<String> getNativesDirectoryPath();

@OutputFile
protected abstract RegularFileProperty getDevLauncherConfig();

@TaskAction
public void run() throws IOException {
Expand Down

0 comments on commit 9eeebe6

Please sign in to comment.