From ea119b9264f065e07ad9a3a63cec2e33f04ffc3a Mon Sep 17 00:00:00 2001 From: Vladimir Panimaskin Date: Tue, 12 Nov 2024 00:59:33 +0200 Subject: [PATCH] WEB-70221 WebTemplateNewProjectWizard-based generators misplace the `*.iml` file (cherry picked from commit 7d14bd613239e7c7c65e1a7e387fc6aeff0a8b19) IJ-CR-149103 GitOrigin-RevId: b1ab392eadc2c263812bc10cd735408326311d2c --- platform/lang-impl/api-dump-unreviewed.txt | 2 +- .../projectWizard/WebTemplateProjectWizardStep.kt | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/platform/lang-impl/api-dump-unreviewed.txt b/platform/lang-impl/api-dump-unreviewed.txt index 4013ee13d136..6cdd3686d57f 100644 --- a/platform/lang-impl/api-dump-unreviewed.txt +++ b/platform/lang-impl/api-dump-unreviewed.txt @@ -12883,7 +12883,7 @@ com.intellij.ide.util.projectWizard.WebTemplateProjectWizardData f:com.intellij.ide.util.projectWizard.WebTemplateProjectWizardData$Companion - f:getKEY():com.intellij.openapi.util.Key - f:getWebTemplateData(com.intellij.ide.wizard.NewProjectWizardStep):com.intellij.ide.util.projectWizard.WebTemplateProjectWizardData -f:com.intellij.ide.util.projectWizard.WebTemplateProjectWizardStep +c:com.intellij.ide.util.projectWizard.WebTemplateProjectWizardStep - com.intellij.ide.wizard.AbstractNewProjectWizardStep - com.intellij.ide.util.projectWizard.WebTemplateProjectWizardData - (com.intellij.ide.wizard.NewProjectWizardBaseStep,com.intellij.ide.util.projectWizard.WebProjectTemplate):V diff --git a/platform/lang-impl/src/com/intellij/ide/util/projectWizard/WebTemplateProjectWizardStep.kt b/platform/lang-impl/src/com/intellij/ide/util/projectWizard/WebTemplateProjectWizardStep.kt index c7a511b3ee10..e14a205f8628 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/projectWizard/WebTemplateProjectWizardStep.kt +++ b/platform/lang-impl/src/com/intellij/ide/util/projectWizard/WebTemplateProjectWizardStep.kt @@ -1,6 +1,7 @@ // Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.ide.util.projectWizard +import com.intellij.ide.highlighter.ModuleFileType import com.intellij.ide.wizard.AbstractNewProjectWizardStep import com.intellij.ide.wizard.NewProjectWizardBaseStep import com.intellij.openapi.module.Module @@ -11,10 +12,11 @@ import com.intellij.platform.ProjectGeneratorPeer import com.intellij.ui.JBColor import com.intellij.ui.dsl.builder.AlignX import com.intellij.ui.dsl.builder.Panel +import java.nio.file.Path import java.util.function.Consumer import javax.swing.JLabel -class WebTemplateProjectWizardStep( +open class WebTemplateProjectWizardStep( val parent: NewProjectWizardBaseStep, val template: WebProjectTemplate ) : AbstractNewProjectWizardStep(parent), WebTemplateProjectWizardData { @@ -45,10 +47,13 @@ class WebTemplateProjectWizardStep( } private fun webModuleBuilder(): WebModuleBuilder { + val moduleName = parent.name + val projectPath = Path.of(parent.path, moduleName) + return WebModuleBuilder(template, peer).apply { - moduleFilePath = "${parent.path}/${parent.name}" - contentEntryPath = "${parent.path}/${parent.name}" - name = parent.name + contentEntryPath = projectPath.toString() + moduleFilePath = projectPath.resolve(moduleName + ModuleFileType.DOT_DEFAULT_EXTENSION).toString() + name = moduleName } }