Skip to content

Commit

Permalink
move src of bundle modules to default MPP layout
Browse files Browse the repository at this point in the history
and remove rewrite src layout logic from build.gradle
  • Loading branch information
robstoll committed Jun 1, 2022
1 parent 73307f6 commit 3f5d650
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 62 deletions.
62 changes: 0 additions & 62 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -159,33 +159,6 @@ def newMultiplatformProjects = newMultiplatformProjectNames.collect { prefixedPr
configure(newMultiplatformProjects) { subproject ->
apply plugin: "kotlin-multiplatform"

//TODO 0.19.0 move sources to default path once all modules have been migrated

def oldParentName = subproject.name.substring(name.lastIndexOf("-") + 1)
def oldParent = "../" + oldParentName
if (subproject.name == "atrium-verbs-internal") {
oldParent = "../verbs-internal"
} else if (subproject.name == "atrium-api-fluent-en_GB" || subproject.name == "atrium-fluent-en_GB") {
oldParent = "../../fluent-en_GB"
} else if (subproject.name == "atrium-api-infix-en_GB" || subproject.name == "atrium-infix-en_GB") {
oldParent = "../../infix-en_GB"
} else if (subproject.projectDir.parent == "extensions") {
oldParent = "../"
}
oldParent = file("$oldParent/${subproject.name}-common").exists() ? oldParent : "../../" + oldParentName
def oldCommon = "$oldParent/${subproject.name}-common"
def oldJvm = "$oldParent/${subproject.name}-jvm"
def oldJs = "$oldParent/${subproject.name}-js"

def normalSrcLayout = [
"atrium-verbs", "atrium-verbs-internal", "atrium-specs",
"atrium-logic", "atrium-logic-kotlin_1_3",
"atrium-core",
"atrium-translations-de_CH","atrium-translations-en_GB",
"atrium-api-fluent-en_GB", "atrium-api-infix-en_GB",
"atrium-api-fluent-en_GB-kotlin_1_3", "atrium-api-infix-en_GB-kotlin_1_3",
]

kotlin {
jvm {
compilations.main.kotlinOptions {
Expand Down Expand Up @@ -265,37 +238,6 @@ configure(newMultiplatformProjects) { subproject ->
}
}
}


if (!normalSrcLayout.contains(subproject.name)) {

//TODO 0.19.0 switch to default folder layout once everything is migrated
commonMain {
kotlin.setSrcDirs(["$oldCommon/src/main/kotlin"])
resources.setSrcDirs(["$oldCommon/src/main/resources"])
}
commonTest {
kotlin.setSrcDirs(["$oldCommon/src/test/kotlin"])
resources.setSrcDirs(["$oldCommon/src/test/resources"])
}
jvmMain {
kotlin.setSrcDirs(["$oldJvm/src/main/kotlin"])
resources.setSrcDirs(["$oldJvm/src/main/resources"])
}
jvmTest {
kotlin.setSrcDirs(["$oldJvm/src/test/kotlin", "${subproject.projectDir}/src/jvmTest/java"])
resources.setSrcDirs(["$oldJvm/src/test/resources"])
}
//TODO 0.19.0 activate once all are migrated to MPP
// jsMain {
// kotlin.setSrcDirs(["$oldJs/src/main/kotlin"])
// resources.setSrcDirs(["$oldJs/src/main/resources"])
// }
// jsTest {
// kotlin.setSrcDirs(["$oldJs/src/test/kotlin"])
// resources.setSrcDirs(["$oldJs/src/test/resources"])
// }
}
}
}

Expand All @@ -315,10 +257,6 @@ configure(newMultiplatformProjects) { subproject ->
)

def srcModule = "src/module"
//TODO 0.19.0 remove oldJvm once we move files to the default folder of jvmMain
if (!normalSrcLayout.contains(subproject.name)) {
srcModule = "$oldJvm/src/module"
}
def moduleInfo = subproject.file("$srcModule/module-info.java")

if (moduleInfo.exists()) {
Expand Down

0 comments on commit 3f5d650

Please sign in to comment.