User: rednesto Date: 19 Mar 23 14:28 Revision: 705c9ee8b95c7255cdcc467d30e85dcae4909182 Summary: Build against 231.8109 to fix some new errors TeamCity URL: http://ci.mcdev.io:80/viewModification.html?tab=vcsModificationFiles&modId=8386&personal=false Index: gradle.properties =================================================================== --- gradle.properties (revision 4cd8f589d16998df2cd0c3dcf9d0e6266b0b5839) +++ gradle.properties (revision 705c9ee8b95c7255cdcc467d30e85dcae4909182) @@ -11,13 +11,13 @@ # suppress inspection "UnusedProperty" for whole file kotlin.code.style=official -ideaVersion = 231-EAP-SNAPSHOT +ideaVersion = 231.8109-EAP-CANDIDATE-SNAPSHOT ideaVersionName = 2023.1 coreVersion = 1.6.1 downloadIdeaSources = true -pluginTomlVersion = 231.4840.388 +pluginTomlVersion = 231.8109.1 # Silences a build-time warning because we are bundling our own kotlin library kotlin.stdlib.default.dependency = false Index: src/main/kotlin/creator/ProjectSetupFinalizerWizardStep.kt =================================================================== --- src/main/kotlin/creator/ProjectSetupFinalizerWizardStep.kt (revision 4cd8f589d16998df2cd0c3dcf9d0e6266b0b5839) +++ src/main/kotlin/creator/ProjectSetupFinalizerWizardStep.kt (revision 705c9ee8b95c7255cdcc467d30e85dcae4909182) @@ -12,10 +12,8 @@ import com.demonwav.mcdev.creator.ProjectSetupFinalizer.Factory import com.demonwav.mcdev.util.mapFirstNotNull -import com.demonwav.mcdev.util.toTypedArray import com.intellij.ide.wizard.AbstractNewProjectWizardStep import com.intellij.ide.wizard.NewProjectWizardStep -import com.intellij.ide.wizard.stepSequence import com.intellij.openapi.extensions.ExtensionPointName import com.intellij.openapi.observable.properties.GraphProperty import com.intellij.openapi.project.Project @@ -45,16 +43,11 @@ } result } - private val step by lazy { - if (finalizers.isEmpty()) { - null - } else { - stepSequence(finalizers[0], *finalizers.asSequence().drop(1).toTypedArray()) - } - } override fun setupUI(builder: Panel) { - step?.setupUI(builder) + for (step in finalizers) { + step.setupUI(builder) + } if (finalizers.isNotEmpty()) { builder.row { cell(JPanel()) @@ -69,9 +62,11 @@ } override fun setupProject(project: Project) { - step?.setupProject(project) + for (step in finalizers) { + step.setupProject(project) - } -} + } + } +} /** * A step applied after all other steps for all Minecraft project creators. These steps can also block project creation Index: src/main/kotlin/creator/step/FixedAssetsNewProjectWizardStep.kt =================================================================== --- src/main/kotlin/creator/step/FixedAssetsNewProjectWizardStep.kt (revision 4cd8f589d16998df2cd0c3dcf9d0e6266b0b5839) +++ src/main/kotlin/creator/step/FixedAssetsNewProjectWizardStep.kt (revision 705c9ee8b95c7255cdcc467d30e85dcae4909182) @@ -111,7 +111,7 @@ throw IOException("Unable to process template", e) } - val pathStr = "$outputDirectory/${asset.targetFileName}" + val pathStr = "$outputDirectory/${asset.relativePath}" val path = Path.of(pathStr) path.parent?.let(NioFiles::createDirectories) Files.writeString(path, code) @@ -122,7 +122,7 @@ private fun generateFile(asset: GeneratorResourceFile): VirtualFile? { val content = asset.resource.openStream().use { it.readAllBytes() } - val pathStr = "$outputDirectory/${asset.targetFileName}" + val pathStr = "$outputDirectory/${asset.relativePath}" val path = Path.of(pathStr) path.parent?.let(NioFiles::createDirectories) Files.write(path, content) @@ -131,7 +131,7 @@ } private fun generateFile(asset: GeneratorEmptyDirectory): VirtualFile? { - val pathStr = "$outputDirectory/${asset.targetFileName}" + val pathStr = "$outputDirectory/${asset.relativePath}" val path = Path.of(pathStr) NioFiles.createDirectories(path) return VfsUtil.findFile(path, true) @@ -169,7 +169,7 @@ } data class GeneratorAssetDelegate(val delegate: GeneratorAsset) : FixedGeneratorAsset() { - override val targetFileName get() = delegate.targetFileName + override val targetFileName get() = delegate.relativePath } class GeneratorFile( Index: src/main/kotlin/creator/step/OptionalSteps.kt =================================================================== --- src/main/kotlin/creator/step/OptionalSteps.kt (revision 4cd8f589d16998df2cd0c3dcf9d0e6266b0b5839) +++ src/main/kotlin/creator/step/OptionalSteps.kt (revision 705c9ee8b95c7255cdcc467d30e85dcae4909182) @@ -56,22 +56,22 @@ value = suggestValue() } valueProperty.updateWhenChanged(formatProperty, ::suggestValue) - valueProperty.updateWhenChanged(baseData.nameProperty, ::suggestValue) + valueProperty.updateWhenChanged(baseData!!.nameProperty, ::suggestValue) formatProperty.updateWhenChanged(valueProperty, ::suggestFormat) } - private fun suggestValue() = format.replace(PROJECT_NAME_PLACEHOLDER, baseData.name) + private fun suggestValue() = format.replace(PROJECT_NAME_PLACEHOLDER, baseData!!.name) private fun suggestFormat(): String { - val index = value.indexOf(baseData.name) + val index = value.indexOf(baseData!!.name) if (index == -1) { return value } - if (value.indexOf(baseData.name, startIndex = index + baseData.name.length) != -1) { + if (value.indexOf(baseData!!.name, startIndex = index + baseData!!.name.length) != -1) { // don't change format if there are multiple instances of the project name return format } - return value.replace(baseData.name, PROJECT_NAME_PLACEHOLDER) + return value.replace(baseData!!.name, PROJECT_NAME_PLACEHOLDER) } companion object { Index: src/main/kotlin/platform/bungeecord/creator/gradle-steps.kt =================================================================== --- src/main/kotlin/platform/bungeecord/creator/gradle-steps.kt (revision 4cd8f589d16998df2cd0c3dcf9d0e6266b0b5839) +++ src/main/kotlin/platform/bungeecord/creator/gradle-steps.kt (revision 705c9ee8b95c7255cdcc467d30e85dcae4909182) @@ -46,7 +46,7 @@ override val description = "Creating Gradle files" override fun setupAssets(project: Project) { - val projectName = baseData.name + val projectName = baseData!!.name val buildSystemProps = findStep>() assets.addTemplateProperties( "PROJECT_NAME" to projectName, Index: src/main/kotlin/platform/mixin/handlers/injectionPoint/LoadInjectionPoint.kt =================================================================== --- src/main/kotlin/platform/mixin/handlers/injectionPoint/LoadInjectionPoint.kt (revision 4cd8f589d16998df2cd0c3dcf9d0e6266b0b5839) +++ src/main/kotlin/platform/mixin/handlers/injectionPoint/LoadInjectionPoint.kt (revision 705c9ee8b95c7255cdcc467d30e85dcae4909182) @@ -180,10 +180,8 @@ override fun visitForeachStatement(statement: PsiForeachStatement) { checkImplicitLocalsPre(statement) if (store) { - (statement.iterationDeclaration as? PsiParameter)?.let { param -> - addLocalUsage(param, param.name) + addLocalUsage(statement.iterationParameter, statement.iterationParameter.name) - } + } - } super.visitForeachStatement(statement) checkImplicitLocalsPost(statement) } Index: src/main/kotlin/platform/mixin/util/LocalVariables.kt =================================================================== --- src/main/kotlin/platform/mixin/util/LocalVariables.kt (revision 4cd8f589d16998df2cd0c3dcf9d0e6266b0b5839) +++ src/main/kotlin/platform/mixin/util/LocalVariables.kt (revision 705c9ee8b95c7255cdcc467d30e85dcae4909182) @@ -303,7 +303,7 @@ is PsiVariable -> if (element.isDoubleSlot) 2 else 1 // arrays have copy of array, length and index variables, iterables have the iterator variable is PsiForeachStatement -> { - val param = element.iterationDeclaration as? PsiParameter + val param = element.iterationParameter as? PsiParameter if (param?.type is PsiArrayType) 3 else 1 } else -> 0 Index: src/main/kotlin/platform/sponge/inspection/SpongeInjectionInspection.kt =================================================================== --- src/main/kotlin/platform/sponge/inspection/SpongeInjectionInspection.kt (revision 4cd8f589d16998df2cd0c3dcf9d0e6266b0b5839) +++ src/main/kotlin/platform/sponge/inspection/SpongeInjectionInspection.kt (revision 705c9ee8b95c7255cdcc467d30e85dcae4909182) @@ -185,16 +185,24 @@ } } + if (fix == null) { - holder.registerProblem( - assetPathAttributeValue, - "Asset '$assetPath' does not exist.", - ProblemHighlightType.GENERIC_ERROR, + holder.registerProblem( + assetPathAttributeValue, + "Asset '$assetPath' does not exist.", + ProblemHighlightType.GENERIC_ERROR, + ) + } else { + holder.registerProblem( + assetPathAttributeValue, + "Asset '$assetPath' does not exist.", + ProblemHighlightType.GENERIC_ERROR, - fix, - ) - } - } - } - } + fix, + ) + } + } + } + } + } private fun checkConfig( variable: PsiVariable, Index: src/main/kotlin/platform/velocity/creator/gradle-steps.kt =================================================================== --- src/main/kotlin/platform/velocity/creator/gradle-steps.kt (revision 4cd8f589d16998df2cd0c3dcf9d0e6266b0b5839) +++ src/main/kotlin/platform/velocity/creator/gradle-steps.kt (revision 705c9ee8b95c7255cdcc467d30e85dcae4909182) @@ -53,7 +53,7 @@ override val description = "Creating Gradle files" override fun setupAssets(project: Project) { - val projectName = baseData.name + val projectName = baseData!!.name val buildSystemProps = findStep>() val javaVersion = findStep().preferredJdk.ordinal val mainClass = data.getUserData(MainClassStep.KEY) ?: return Index: src/main/kotlin/util/utils.kt =================================================================== --- src/main/kotlin/util/utils.kt (revision 4cd8f589d16998df2cd0c3dcf9d0e6266b0b5839) +++ src/main/kotlin/util/utils.kt (revision 705c9ee8b95c7255cdcc467d30e85dcae4909182) @@ -107,7 +107,7 @@ return result } -inline fun runReadActionAsync(crossinline runnable: () -> T): Promise { +fun runReadActionAsync(runnable: () -> T): Promise { return runAsync { runReadAction(runnable) }