Skip to content

Commit

Permalink
Merged branch idea243.release into idea243.x
Browse files Browse the repository at this point in the history
  • Loading branch information
builduser committed Dec 20, 2024
2 parents db18b57 + 6dc4d6f commit fa45599
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ object SbtProjectSettings {
settings
}

def default(separateProdAndTestSources: Boolean): SbtProjectSettings = {
val settings = new SbtProjectSettings()
settings.converterVersion = ConverterVersion
settings.separateProdAndTestSources = separateProdAndTestSources
settings
}

def forProject(project: Project): Option[SbtProjectSettings] = {
val settings = SbtSettings.getInstance(project)
Option(project.getBasePath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.jetbrains.sbt.project.settings.SbtProjectSettings
@ApiStatus.Experimental
abstract class SbtModuleBuilderBase extends ModuleBuilderBase[SbtProjectSettings](
SbtProjectSystem.Id,
SbtProjectSettings.default
SbtProjectSettings.default(separateProdAndTestSources = true)
) {
override protected def externalSystemConfigFile: String = Sbt.BuildFile
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,26 @@ class NewSbtProjectWizardTest extends NewScalaProjectWizardTestBase with ExactMa
libraries := scalaLibraries
libraries.exactMatch()

lazy val mainModule = new module(s"$projectName.main") {
libraryDependencies := scalaLibraries
sources := Seq("scala")
}

lazy val testModule = new module(s"$projectName.test") {
libraryDependencies := scalaLibraries
testSources := Seq("scala")
moduleDependencies += new dependency(mainModule) { isExported := false }
}

modules := Seq(
new module(projectName) {
libraryDependencies := scalaLibraries
sources := Seq("src/main/scala")
testSources := Seq("src/test/scala")
excluded := Seq("target")
moduleDependencies:= Seq(
new dependency(mainModule) { isExported := false },
new dependency(testModule) { isExported := false }
)
},
mainModule, testModule,
new module(s"$projectName.$projectName-build") {
// TODO: why `-build` module contains empty string? in UI the `project` folder is marked as `sources`.
// Is it some implicit IntelliJ behaviour?
Expand Down Expand Up @@ -84,6 +97,6 @@ class NewSbtProjectWizardTest extends NewScalaProjectWizardTestBase with ExactMa
scalaSampleCodeData(step).setAddSampleCode(false)
}

useProject(project, false, assertProjectsEqual(expectedProject, _: Project))
useProject(project, false, assertProjectsEqual(expectedProject, _: Project, singleContentRootModules = false))
}
}

0 comments on commit fa45599

Please sign in to comment.