Skip to content

Commit

Permalink
Explicit targets and dependencies declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
whyoleg committed Nov 12, 2023
1 parent eb370c4 commit 2f4e1d0
Show file tree
Hide file tree
Showing 28 changed files with 226 additions and 434 deletions.
49 changes: 47 additions & 2 deletions build-logic/src/main/kotlin/rsocketbuild.multiplatform.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@
* limitations under the License.
*/

import org.jetbrains.kotlin.gradle.plugin.*
import org.jetbrains.kotlin.gradle.plugin.mpp.*
import org.jetbrains.kotlin.gradle.targets.js.ir.*
import org.jetbrains.kotlin.gradle.targets.jvm.*
import rsocketbuild.*

plugins {
kotlin("multiplatform")
}

kotlin {
jvmToolchain(8)

targets.configureEach {
compilations.configureEach {
compilerOptions.configure {
Expand All @@ -29,6 +33,47 @@ kotlin {
}
}

targets.withType<KotlinJvmTarget>().configureEach {
testRuns.configureEach {
executionTask.configure {
// ActiveProcessorCount is used here, to make sure local setup is similar as on CI
// GitHub Actions linux runners have 2 cores
jvmArgs("-Xmx1g", "-XX:ActiveProcessorCount=2")
}
}
}

// revisit JS block after WASM support
targets.withType<KotlinJsIrTarget>().configureEach {
whenBrowserConfigured {
testTask {
useKarma {
useConfigDirectory(rootDir.resolve("gradle/js/karma.config.d"))
useChromeHeadless()
}
}
}
whenNodejsConfigured {
testTask {
useMocha {
timeout = "600s"
}
}
}
}

targets.withType<KotlinNativeTargetWithTests<*>>().configureEach {
//setup tests running in RELEASE mode
binaries.test(listOf(NativeBuildType.RELEASE))
testRuns.create("releaseTest") {
setExecutionSourceFrom(binaries.getTest(NativeBuildType.RELEASE))
}
//don't even link tests if we can't run them (like, linux on macos, or mingw on linux/macos, etc)
testRuns.configureEach {
executionSource.binary.linkTaskProvider.get().enabled = (this as ExecutionTaskHolder<*>).executionTask.get().enabled
}
}

sourceSets.configureEach {
languageSettings {
progressiveMode = true
Expand Down

This file was deleted.

21 changes: 0 additions & 21 deletions build-logic/src/main/kotlin/rsocketbuild.target.all.gradle.kts

This file was deleted.

20 changes: 0 additions & 20 deletions build-logic/src/main/kotlin/rsocketbuild.target.js.all.gradle.kts

This file was deleted.

This file was deleted.

31 changes: 0 additions & 31 deletions build-logic/src/main/kotlin/rsocketbuild.target.js.node.gradle.kts

This file was deleted.

42 changes: 0 additions & 42 deletions build-logic/src/main/kotlin/rsocketbuild.target.jvm.gradle.kts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,4 @@ plugins {

kotlin {
explicitApi()

sourceSets {
commonTest {
dependencies {
implementation(project(":rsocket-test"))
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

import rsocketbuild.*

plugins {
id("rsocketbuild.multiplatform")
}
Expand Down

This file was deleted.

Loading

0 comments on commit 2f4e1d0

Please sign in to comment.