diff --git a/main/src/plugin/Run.kt b/main/src/plugin/Run.kt index 7981390..067213c 100644 --- a/main/src/plugin/Run.kt +++ b/main/src/plugin/Run.kt @@ -47,21 +47,21 @@ class MindustryRunPlugin : Plugin { for (client in x.clients) { val resolveClient = proj.tasks.register("resolveClient${client.name}") { group = R.taskGroup.mindustryStuff - val gameLocalProp = proj.localProp[client.locationLocalPropKey] - location.set( + location.set(proj.provider { + val gameLocalProp = proj.localProp[client.locationLocalPropKey] if (gameLocalProp != null) LocalGameLoc(gameLocalProp) else client.location - ) + }) } proj.tasks.register("runClient${client.name}") { group = R.taskGroup.mindustry dependsOn(resolveClient) startupArgs.addAll(client.startupArgs) - val dataDirLocalProp = proj.localProp[client.dataDirLocalPropKey] - dataDir.set( + dataDir.set(proj.provider { + val dataDirLocalProp = proj.localProp[client.dataDirLocalPropKey] if (dataDirLocalProp != null) LocalDataDirLoc(dataDirLocalProp) else client.dataDir - ) + }) gameFile.set(proj.provider { resolveClient.get().outputs.files.singleFile }) @@ -90,21 +90,21 @@ class MindustryRunPlugin : Plugin { for (server in x.servers) { val resolveServer = proj.tasks.register("resolveServer${server.name}") { group = R.taskGroup.mindustryStuff - val gameLocalProp = project.localProp[server.locationLocalPropKey] - location.set( + location.set(proj.provider { + val gameLocalProp = project.localProp[server.locationLocalPropKey] if (gameLocalProp != null) LocalGameLoc(gameLocalProp) else server.location - ) + }) } proj.tasks.register("runServer${server.name}") { group = R.taskGroup.mindustry dependsOn(resolveServer) startupArgs.addAll(server.startupArgs) - val dataDirLocalProp = proj.localProp[server.dataDirLocalPropKey] - dataDir.set( + dataDir.set(proj.provider { + val dataDirLocalProp = proj.localProp[server.dataDirLocalPropKey] if (dataDirLocalProp != null) LocalDataDirLoc(dataDirLocalProp) else server.dataDir - ) + }) gameFile.set(proj.provider { resolveServer.get().outputs.files.singleFile })