Use a Property for appendProjectPathToConfigName

This commit is contained in:
modmuss50
2023-12-19 16:49:27 +00:00
parent a6547244e9
commit e980ee60ad
2 changed files with 4 additions and 8 deletions

View File

@@ -170,7 +170,7 @@ public class RunConfig {
runDir = "run";
}
boolean appendProjectPath = settings.getAppendProjectPathToConfigName();
boolean appendProjectPath = settings.getAppendProjectPathToConfigName().get();
RunConfig runConfig = new RunConfig();
runConfig.configName = configName;
populate(project, extension, runConfig, environment, appendProjectPath);

View File

@@ -79,7 +79,7 @@ public class RunConfigSettings implements Named {
* <p>Warning: could produce ambiguous run config names if disabled, unless used carefully in conjunction with
* {@link #configName}.
*/
private boolean appendProjectPathToConfigName;
private final Property<Boolean> appendProjectPathToConfigName;
/**
* The default main class of the run configuration.
@@ -128,7 +128,7 @@ public class RunConfigSettings implements Named {
public RunConfigSettings(Project project, String name) {
this.name = name;
this.project = project;
this.appendProjectPathToConfigName = true;
this.appendProjectPathToConfigName = project.getObjects().property(Boolean.class).convention(true);
this.extension = LoomGradleExtension.get(project);
this.ideConfigGenerated = extension.isRootProject();
this.mainClass = project.getObjects().property(String.class).convention(project.provider(() -> {
@@ -186,14 +186,10 @@ public class RunConfigSettings implements Named {
this.configName = name;
}
public boolean getAppendProjectPathToConfigName() {
public Property<Boolean> getAppendProjectPathToConfigName() {
return appendProjectPathToConfigName;
}
public void setAppendProjectPathToConfigName(boolean append) {
appendProjectPathToConfigName = append;
}
public String getDefaultMainClass() {
return defaultMainClass;
}