Skip to content

Commit

Permalink
Add kotlin.mpp.enableCompatibilityMetadataVariant=true (#2747)
Browse files Browse the repository at this point in the history
* Add `kotlin.mpp.enableCompatibilityMetadataVariant=true`

* Move workflows to run `assemble` to avoid running tests
  • Loading branch information
JavierSegoviaCordoba committed Jun 26, 2022
1 parent 051847d commit c628dfa
Show file tree
Hide file tree
Showing 14 changed files with 228 additions and 102 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/generate-tag.yaml
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Gradle build
uses: gradle/gradle-build-action@v2.2.0
with:
arguments: --full-stacktrace build "-Psemver.scope=${{ github.event.inputs.scope }}" "-Psemver.stage=${{ github.event.inputs.stage }}"
arguments: --full-stacktrace assemble "-Psemver.scope=${{ github.event.inputs.scope }}" "-Psemver.stage=${{ github.event.inputs.stage }}"

- name: Stop Gradle daemons
run: ./gradlew --stop
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Build
uses: gradle/gradle-build-action@v2.2.0
with:
arguments: build --full-stacktrace
arguments: assemble --full-stacktrace

- name: Get Arrow version
id: version
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull_request.yml
Expand Up @@ -29,13 +29,13 @@ jobs:
uses: gradle/gradle-build-action@v2.2.0
if: matrix.os != 'windows-latest'
with:
arguments: --full-stacktrace build
arguments: --full-stacktrace assemble

- name: mingwX64Test
uses: gradle/gradle-build-action@v2.2.0
if: matrix.os == 'windows-latest'
with:
arguments: --full-stacktrace mingwX64Test
arguments: --full-stacktrace assemble

- name: Upload reports
uses: actions/upload-artifact@v3.1.0
Expand Down
29 changes: 21 additions & 8 deletions arrow-libs/core/arrow-continuations/build.gradle.kts
Expand Up @@ -8,28 +8,41 @@ apply(from = property("TEST_COVERAGE"))
apply(from = property("ANIMALSNIFFER_MPP"))
apply(plugin = "io.kotest.multiplatform")

val enableCompatibilityMetadataVariant =
providers.gradleProperty("kotlin.mpp.enableCompatibilityMetadataVariant")
.forUseAtConfigurationTime().orNull?.toBoolean() == true


if (enableCompatibilityMetadataVariant) {
tasks.withType<Test>().configureEach {
enabled = false
}
}

kotlin {
sourceSets {
commonMain {
dependencies {
implementation(libs.kotlin.stdlibCommon)
}
}
commonTest {
dependencies {
implementation(projects.arrowCoreTest)
if(!enableCompatibilityMetadataVariant) {
commonTest {
dependencies {
implementation(project(":arrow-core-test"))
}
}
jvmTest {
dependencies {
runtimeOnly(libs.kotest.runnerJUnit5)
}
}
}
jvmMain {
dependencies {
implementation(libs.kotlin.stdlibJDK8)
}
}
jvmTest {
dependencies {
runtimeOnly(libs.kotest.runnerJUnit5)
}
}
jsMain {
dependencies {
implementation(libs.kotlin.stdlibJS)
Expand Down
28 changes: 20 additions & 8 deletions arrow-libs/core/arrow-core-retrofit/build.gradle.kts
Expand Up @@ -8,17 +8,29 @@ plugins {
apply(from = property("TEST_COVERAGE"))
apply(from = property("ANIMALSNIFFER"))

val enableCompatibilityMetadataVariant =
providers.gradleProperty("kotlin.mpp.enableCompatibilityMetadataVariant")
.forUseAtConfigurationTime().orNull?.toBoolean() == true

if (enableCompatibilityMetadataVariant) {
tasks.withType<Test>().configureEach {
enabled = false
}
}

dependencies {
compileOnly(libs.kotlin.stdlibJDK8)
compileOnly(projects.arrowCore)
compileOnly(libs.squareup.retrofit)

testCompileOnly(libs.kotlin.reflect)
testRuntimeOnly(libs.kotest.runnerJUnit5)
testImplementation(projects.arrowCoreTest)
testImplementation(libs.squareup.okhttpMockWebServer)
testImplementation(libs.squareup.retrofitConverterGson)
testImplementation(libs.squareup.retrofitConverterMoshi)
testImplementation(libs.kotlinx.serializationJson)
testImplementation(libs.jakewharton.retrofitConverterKotlinxSerialization)
if (!enableCompatibilityMetadataVariant) {
testCompileOnly(libs.kotlin.reflect)
testRuntimeOnly(libs.kotest.runnerJUnit5)
testImplementation(project(":arrow-core-test"))
testImplementation(libs.squareup.okhttpMockWebServer)
testImplementation(libs.squareup.retrofitConverterGson)
testImplementation(libs.squareup.retrofitConverterMoshi)
testImplementation(libs.kotlinx.serializationJson)
testImplementation(libs.jakewharton.retrofitConverterKotlinxSerialization)
}
}
33 changes: 24 additions & 9 deletions arrow-libs/core/arrow-core/build.gradle.kts
Expand Up @@ -10,6 +10,16 @@ apply(plugin = "io.kotest.multiplatform")
apply(from = property("TEST_COVERAGE"))
apply(from = property("ANIMALSNIFFER_MPP"))

val enableCompatibilityMetadataVariant =
providers.gradleProperty("kotlin.mpp.enableCompatibilityMetadataVariant")
.forUseAtConfigurationTime().orNull?.toBoolean() == true

if (enableCompatibilityMetadataVariant) {
tasks.withType<Test>().configureEach {
enabled = false
}
}

kotlin {
sourceSets {
commonMain {
Expand All @@ -19,22 +29,27 @@ kotlin {
api(libs.kotlin.stdlibCommon)
}
}
commonTest {
dependencies {
implementation(projects.arrowCoreTest)
implementation(projects.arrowFxCoroutines)
if (!enableCompatibilityMetadataVariant) {
commonTest {
dependencies {
implementation(project(":arrow-core-test"))
implementation(project(":arrow-fx-coroutines"))
}
}

jvmTest {
dependencies {
runtimeOnly(libs.kotest.runnerJUnit5)
}
}
}

jvmMain {
dependencies {
implementation(libs.kotlin.stdlibJDK8)
}
}
jvmTest {
dependencies {
runtimeOnly(libs.kotest.runnerJUnit5)
}
}

jsMain {
dependencies {
implementation(libs.kotlin.stdlibJS)
Expand Down
31 changes: 22 additions & 9 deletions arrow-libs/fx/arrow-fx-coroutines/build.gradle.kts
Expand Up @@ -7,6 +7,16 @@ plugins {
apply(plugin = "io.kotest.multiplatform")
apply(from = property("TEST_COVERAGE"))

val enableCompatibilityMetadataVariant =
providers.gradleProperty("kotlin.mpp.enableCompatibilityMetadataVariant")
.forUseAtConfigurationTime().orNull?.toBoolean() == true

if (enableCompatibilityMetadataVariant) {
tasks.withType<Test>().configureEach {
enabled = false
}
}

kotlin {
sourceSets {
commonMain {
Expand All @@ -16,22 +26,25 @@ kotlin {
implementation(libs.kotlin.stdlibCommon)
}
}
commonTest {
dependencies {
implementation(projects.arrowFxCoroutinesTest)

if (!enableCompatibilityMetadataVariant) {
commonTest {
dependencies {
implementation(project(":arrow-fx-coroutines-test"))
}
}
jvmTest {
dependencies {
runtimeOnly(libs.kotest.runnerJUnit5)
implementation(libs.coroutines.test)
}
}
}
jvmMain {
dependencies {
implementation(libs.kotlin.stdlibJDK8)
}
}
jvmTest {
dependencies {
runtimeOnly(libs.kotest.runnerJUnit5)
implementation(libs.coroutines.test)
}
}
jsMain {
dependencies {
implementation(libs.kotlin.stdlibJS)
Expand Down
28 changes: 20 additions & 8 deletions arrow-libs/fx/arrow-fx-stm/build.gradle.kts
Expand Up @@ -8,6 +8,16 @@ apply(plugin = "io.kotest.multiplatform")
apply(from = property("TEST_COVERAGE"))
apply(from = property("ANIMALSNIFFER_MPP"))

val enableCompatibilityMetadataVariant =
providers.gradleProperty("kotlin.mpp.enableCompatibilityMetadataVariant")
.forUseAtConfigurationTime().orNull?.toBoolean() == true

if (enableCompatibilityMetadataVariant) {
tasks.withType<Test>().configureEach {
enabled = false
}
}

kotlin {
sourceSets {
commonMain {
Expand All @@ -17,21 +27,23 @@ kotlin {
implementation(libs.coroutines.core)
}
}
commonTest {
dependencies {
implementation(projects.arrowFxCoroutinesTest)
if (!enableCompatibilityMetadataVariant) {
commonTest {
dependencies {
implementation(project(":arrow-coroutines-fx-test"))
}
}
jvmTest {
dependencies {
runtimeOnly(libs.kotest.runnerJUnit5)
}
}
}
jvmMain {
dependencies {
implementation(libs.kotlin.stdlibJDK8)
}
}
jvmTest {
dependencies {
runtimeOnly(libs.kotest.runnerJUnit5)
}
}
jsMain {
dependencies {
implementation(libs.kotlin.stdlibJS)
Expand Down
50 changes: 31 additions & 19 deletions arrow-libs/optics/arrow-optics-ksp-plugin/build.gradle.kts
Expand Up @@ -11,27 +11,39 @@ kotlin {
apply(from = property("TEST_COVERAGE"))
apply(from = property("ANIMALSNIFFER_MPP"))

val enableCompatibilityMetadataVariant =
providers.gradleProperty("kotlin.mpp.enableCompatibilityMetadataVariant")
.forUseAtConfigurationTime().orNull?.toBoolean() == true

if (enableCompatibilityMetadataVariant) {
tasks.withType<Test>().configureEach {
enabled = false
}
}

dependencies {
implementation(libs.ksp)

testImplementation(libs.kotlin.stdlibJDK8)
testImplementation(libs.junitJupiter)
testImplementation(libs.junitJupiterEngine)
testImplementation(libs.assertj)
testImplementation(libs.classgraph)
testImplementation(libs.kotlinCompileTesting) {
exclude(
group = libs.classgraph.get().module.group,
module = libs.classgraph.get().module.name
)
exclude(
group = libs.kotlin.stdlibJDK8.get().module.group,
module = libs.kotlin.stdlibJDK8.get().module.name
)
if (!enableCompatibilityMetadataVariant) {
testImplementation(libs.kotlin.stdlibJDK8)
testImplementation(libs.junitJupiter)
testImplementation(libs.junitJupiterEngine)
testImplementation(libs.assertj)
testImplementation(libs.classgraph)
testImplementation(libs.kotlinCompileTesting) {
exclude(
group = libs.classgraph.get().module.group,
module = libs.classgraph.get().module.name
)
exclude(
group = libs.kotlin.stdlibJDK8.get().module.group,
module = libs.kotlin.stdlibJDK8.get().module.name
)
}
testImplementation(libs.kotlinCompileTestingKsp)
testRuntimeOnly(projects.arrowOpticsKspPlugin)
testRuntimeOnly(projects.arrowAnnotations)
testRuntimeOnly(projects.arrowCore)
testRuntimeOnly(projects.arrowOptics)
}
testImplementation(libs.kotlinCompileTestingKsp)
testRuntimeOnly(projects.arrowOpticsKspPlugin)
testRuntimeOnly(projects.arrowAnnotations)
testRuntimeOnly(projects.arrowCore)
testRuntimeOnly(projects.arrowOptics)
}
20 changes: 16 additions & 4 deletions arrow-libs/optics/arrow-optics-reflect/build.gradle.kts
Expand Up @@ -7,14 +7,26 @@ plugins {
apply(from = property("TEST_COVERAGE"))
apply(from = property("ANIMALSNIFFER_MPP"))

val enableCompatibilityMetadataVariant =
providers.gradleProperty("kotlin.mpp.enableCompatibilityMetadataVariant")
.forUseAtConfigurationTime().orNull?.toBoolean() == true

if (enableCompatibilityMetadataVariant) {
tasks.withType<Test>().configureEach {
enabled = false
}
}

dependencies {
api(projects.arrowCore)
api(projects.arrowOptics)
api(libs.kotlin.reflect)
implementation(libs.kotlin.stdlibJDK8)

testImplementation(projects.arrowOpticsTest)
testImplementation(libs.kotlin.stdlibJDK8)
testImplementation(libs.junitJupiterEngine)
testImplementation(libs.kotlin.reflect)
if(!enableCompatibilityMetadataVariant) {
testImplementation(project(":arrow-optics-test"))
testImplementation(libs.kotlin.stdlibJDK8)
testImplementation(libs.junitJupiterEngine)
testImplementation(libs.kotlin.reflect)
}
}

0 comments on commit c628dfa

Please sign in to comment.