From b965407da2a98e599b1f906f248803a49ac703d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Segovia=20C=C3=B3rdoba?= <7463564+JavierSegoviaCordoba@users.noreply.github.com> Date: Fri, 1 Oct 2021 21:28:09 +0200 Subject: [PATCH] Add Arrow Gradle config (#2543) --- .github/workflows/publish.yml | 13 +- .github/workflows/pull_request.yml | 4 +- arrow-libs/ank/arrow-ank-gradle/build.gradle | 35 ----- .../ank/arrow-ank-gradle/build.gradle.kts | 40 ++++++ .../ank/arrow-ank-gradle/gradle.properties | 6 +- arrow-libs/ank/arrow-ank/build.gradle | 18 --- arrow-libs/ank/arrow-ank/build.gradle.kts | 16 +++ arrow-libs/ank/arrow-ank/gradle.properties | 6 +- arrow-libs/build.gradle | 41 ------ arrow-libs/build.gradle.kts | 39 +++++ arrow-libs/core/.editorconfig | 2 +- .../core/arrow-annotations/build.gradle | 9 -- .../core/arrow-annotations/build.gradle.kts | 32 +++++ .../core/arrow-annotations/gradle.properties | 4 +- .../core/arrow-continuations/build.gradle | 21 --- .../core/arrow-continuations/build.gradle.kts | 39 +++++ .../arrow-continuations/gradle.properties | 4 +- .../core/arrow-core-retrofit/build.gradle | 21 --- .../core/arrow-core-retrofit/build.gradle.kts | 19 +++ .../arrow-core-retrofit/gradle.properties | 4 +- arrow-libs/core/arrow-core-test/build.gradle | 22 --- .../core/arrow-core-test/build.gradle.kts | 36 +++++ .../core/arrow-core-test/gradle.properties | 4 +- arrow-libs/core/arrow-core/build.gradle | 28 ---- arrow-libs/core/arrow-core/build.gradle.kts | 41 ++++++ arrow-libs/core/arrow-core/gradle.properties | 4 +- .../arrow-meta-test-models/build.gradle | 13 -- .../arrow-meta-test-models/build.gradle.kts | 14 ++ arrow-libs/core/arrow-meta/build.gradle | 30 ---- arrow-libs/core/arrow-meta/build.gradle.kts | 28 ++++ arrow-libs/core/arrow-meta/gradle.properties | 4 +- arrow-libs/core/settings.gradle | 14 -- arrow-libs/core/settings.gradle.kts | 14 ++ arrow-libs/dokka/jekyll/build.gradle | 12 -- arrow-libs/dokka/jekyll/build.gradle.kts | 9 ++ arrow-libs/dokka/jekyll/gradle.properties | 4 +- .../nomisRev/DokkaFenceWorkaroundPlugin.kt | 2 +- .../fx/arrow-fx-coroutines-test/build.gradle | 25 ---- .../arrow-fx-coroutines-test/build.gradle.kts | 40 ++++++ .../gradle.properties | 4 +- .../fx/arrow-fx-coroutines/build.gradle | 32 ----- .../fx/arrow-fx-coroutines/build.gradle.kts | 41 ++++++ .../fx/arrow-fx-coroutines/gradle.properties | 4 +- arrow-libs/fx/arrow-fx-stm/build.gradle | 29 ---- arrow-libs/fx/arrow-fx-stm/build.gradle.kts | 41 ++++++ arrow-libs/fx/arrow-fx-stm/gradle.properties | 4 +- .../{settings.gradle => settings.gradle.kts} | 22 +-- arrow-libs/gradle.properties | 29 ++-- arrow-libs/gradle/libs.versions.toml | 59 ++++++++ arrow-libs/gradle/publication-mpp.gradle | 98 ------------- arrow-libs/gradle/publication.gradle | 93 ------------ arrow-libs/gradle/setup.gradle | 2 +- arrow-libs/gradle/subproject-mpp.gradle | 135 ------------------ arrow-libs/gradle/subproject.gradle | 63 -------- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../optics/arrow-optics-test/build.gradle | 23 --- .../optics/arrow-optics-test/build.gradle.kts | 37 +++++ .../arrow-optics-test/gradle.properties | 4 +- arrow-libs/optics/arrow-optics/build.gradle | 35 ----- .../optics/arrow-optics/build.gradle.kts | 50 +++++++ .../optics/arrow-optics/gradle.properties | 4 +- .../{settings.gradle => settings.gradle.kts} | 54 ++++--- 62 files changed, 687 insertions(+), 895 deletions(-) delete mode 100644 arrow-libs/ank/arrow-ank-gradle/build.gradle create mode 100644 arrow-libs/ank/arrow-ank-gradle/build.gradle.kts delete mode 100644 arrow-libs/ank/arrow-ank/build.gradle create mode 100644 arrow-libs/ank/arrow-ank/build.gradle.kts delete mode 100644 arrow-libs/build.gradle create mode 100644 arrow-libs/build.gradle.kts delete mode 100644 arrow-libs/core/arrow-annotations/build.gradle create mode 100644 arrow-libs/core/arrow-annotations/build.gradle.kts delete mode 100644 arrow-libs/core/arrow-continuations/build.gradle create mode 100644 arrow-libs/core/arrow-continuations/build.gradle.kts delete mode 100644 arrow-libs/core/arrow-core-retrofit/build.gradle create mode 100644 arrow-libs/core/arrow-core-retrofit/build.gradle.kts delete mode 100644 arrow-libs/core/arrow-core-test/build.gradle create mode 100644 arrow-libs/core/arrow-core-test/build.gradle.kts delete mode 100644 arrow-libs/core/arrow-core/build.gradle create mode 100644 arrow-libs/core/arrow-core/build.gradle.kts delete mode 100644 arrow-libs/core/arrow-meta/arrow-meta-test-models/build.gradle create mode 100644 arrow-libs/core/arrow-meta/arrow-meta-test-models/build.gradle.kts delete mode 100644 arrow-libs/core/arrow-meta/build.gradle create mode 100644 arrow-libs/core/arrow-meta/build.gradle.kts delete mode 100644 arrow-libs/core/settings.gradle create mode 100644 arrow-libs/core/settings.gradle.kts delete mode 100644 arrow-libs/dokka/jekyll/build.gradle create mode 100644 arrow-libs/dokka/jekyll/build.gradle.kts delete mode 100644 arrow-libs/fx/arrow-fx-coroutines-test/build.gradle create mode 100644 arrow-libs/fx/arrow-fx-coroutines-test/build.gradle.kts delete mode 100644 arrow-libs/fx/arrow-fx-coroutines/build.gradle create mode 100644 arrow-libs/fx/arrow-fx-coroutines/build.gradle.kts delete mode 100644 arrow-libs/fx/arrow-fx-stm/build.gradle create mode 100644 arrow-libs/fx/arrow-fx-stm/build.gradle.kts rename arrow-libs/fx/{settings.gradle => settings.gradle.kts} (58%) create mode 100644 arrow-libs/gradle/libs.versions.toml delete mode 100644 arrow-libs/gradle/publication-mpp.gradle delete mode 100644 arrow-libs/gradle/publication.gradle delete mode 100644 arrow-libs/gradle/subproject-mpp.gradle delete mode 100644 arrow-libs/gradle/subproject.gradle delete mode 100644 arrow-libs/optics/arrow-optics-test/build.gradle create mode 100644 arrow-libs/optics/arrow-optics-test/build.gradle.kts delete mode 100644 arrow-libs/optics/arrow-optics/build.gradle create mode 100644 arrow-libs/optics/arrow-optics/build.gradle.kts rename arrow-libs/{settings.gradle => settings.gradle.kts} (63%) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7e0180c722c..f7b4be35e36 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,6 +17,15 @@ env: ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_signingKey }} ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_signingPassword }} GRADLE_OPTS: -Dorg.gradle.configureondemand=true -Dorg.gradle.parallel=false -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8" + OSS_USER: '${{ secrets.OSS_USER }}' + OSS_TOKEN: '${{ secrets.OSS_TOKEN }}' + OSS_STAGING_PROFILE_ID: '${{ secrets.OSS_STAGING_PROFILE_ID }}' + SIGNING_KEY_NAME: '${{ secrets.SIGNING_KEY_NAME }}' + SIGNING_KEY_ID: '${{ secrets.SIGNING_KEY_ID }}' + SIGNING_KEY_PASSPHRASE: '${{ secrets.SIGNING_KEY_PASSPHRASE }}' + SIGNING_KEY: '${{ secrets.SIGNING_KEY }}' + GRADLE_PUBLISH_KEY: '${{ secrets.GRADLE_PUBLISH_KEY }}' + GRADLE_PUBLISH_SECRET: '${{ secrets.GRADLE_PUBLISH_SECRET }}' jobs: publish_apple_linux_jvm_js: @@ -52,7 +61,7 @@ jobs: - name: Publish Apple, Linux, JVM & JS targets working-directory: arrow-libs run: | - ./gradlew publish + ./gradlew publishToSonatype echo "$(cat $BASEDIR/gradle.properties | grep VERSION_NAME | cut -d'=' -f2) Apple, Linux, JVM & JS deployed!" publish_windows: @@ -87,7 +96,7 @@ jobs: - name: Publish Windows working-directory: arrow-libs run: | - ./gradlew publishMingwX64PublicationToMavenRepository + ./gradlew publishToSonatype echo "$(cat gradle.properties | grep VERSION_NAME | cut -d'=' -f2) MingwX64 deployed!" publish-arrow-stack: diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 26d000f03dd..63ab6fd607b 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -116,7 +116,7 @@ jobs: - name: Build working-directory: arrow-libs - run: ./gradlew macosX64Test iosX64Test macosArm64Test iosSimulatorArm64Test iosArm64TestBinaries iosArm64TestKlibrary iosArm32TestBinaries iosArm32TestKlibrary + run: ./gradlew iosX64Test macosX64Test - name: "Prepare test reports" if: ${{ always() }} @@ -157,7 +157,7 @@ jobs: - name: Build working-directory: arrow-libs - run: ./gradlew watchosX64Test watchosX86Test watchosSimulatorArm64Test watchosArm32TestBinaries watchosArm32TestKlibrary tvosX64Test tvosSimulatorArm64Test tvosArm64TestBinaries tvosArm64TestKlibrary + run: ./gradlew tvosX64Test watchosX64Test - name: "Prepare test reports" if: ${{ always() }} diff --git a/arrow-libs/ank/arrow-ank-gradle/build.gradle b/arrow-libs/ank/arrow-ank-gradle/build.gradle deleted file mode 100644 index 1a019461463..00000000000 --- a/arrow-libs/ank/arrow-ank-gradle/build.gradle +++ /dev/null @@ -1,35 +0,0 @@ -plugins { - id 'java-gradle-plugin' - id "org.jetbrains.kotlin.jvm" - id "org.jlleitschuh.gradle.ktlint" -} - -apply from: "$SUB_PROJECT" -apply from: "$PUBLICATION" - -sourceSets { - main.java.srcDirs += 'src/main/kotlin' - test.java.srcDirs += 'src/test/kotlin' -} - -processResources { - filesMatching('**/plugin.properties') { - filter { it.replace('%CURRENT_VERSION%', VERSION_NAME) } - filter { it.replace('%KOTLIN_VERSION%', KOTLIN_VERSION) } - } -} - -gradlePlugin { - plugins { - ank { - id = 'ank-gradle-plugin' - implementationClass = 'arrow.ank.AnkPlugin' - } - } -} - -tasks.whenTaskAdded { task -> - if (task.name.matches('.*Plugin.*MavenPublication.*')) { - task.enabled = false - } -} diff --git a/arrow-libs/ank/arrow-ank-gradle/build.gradle.kts b/arrow-libs/ank/arrow-ank-gradle/build.gradle.kts new file mode 100644 index 00000000000..504130622ac --- /dev/null +++ b/arrow-libs/ank/arrow-ank-gradle/build.gradle.kts @@ -0,0 +1,40 @@ +import org.jetbrains.kotlin.gradle.get + +plugins { + id("java-gradle-plugin") + alias(libs.plugins.arrowGradleConfig.jvm) + alias(libs.plugins.arrowGradleConfig.publishJvm) +} + +sourceSets { + main { + java.srcDirs("src/main/kotlin") + } + test { + java.srcDirs("src/test/kotlin") + } +} + +tasks { + withType { + filesMatching("**/plugin.properties") { + filter { it.replace("%CURRENT_VERSION%", properties["projects.version"].toString()) } + filter { it.replace("%KOTLIN_VERSION%", libs.versions.kotlin.get()) } + } + } +} + +gradlePlugin { + plugins { + create("ank") { + id = "ank-gradle-plugin" + implementationClass = "arrow.ank.AnkPlugin" + } + } +} + +tasks.whenTaskAdded { + if (name.matches(".*Plugin.*MavenPublication.*".toRegex())) { + enabled = false + } +} diff --git a/arrow-libs/ank/arrow-ank-gradle/gradle.properties b/arrow-libs/ank/arrow-ank-gradle/gradle.properties index ae6d74c34aa..437265bebb8 100644 --- a/arrow-libs/ank/arrow-ank-gradle/gradle.properties +++ b/arrow-libs/ank/arrow-ank-gradle/gradle.properties @@ -1,5 +1,3 @@ # Maven publishing configuration -POM_NAME=Arrow Ank Gradle Plugin -POM_ARTIFACT_ID=arrow-ank-gradle -POM_PACKAGING=jar -POM_DESCRIPTION=Compile time docs verification and evaluation for Kotlin and Java +pom.name=Arrow Ank Gradle Plugin +pom.description=Compile time docs verification and evaluation for Kotlin and Java diff --git a/arrow-libs/ank/arrow-ank/build.gradle b/arrow-libs/ank/arrow-ank/build.gradle deleted file mode 100644 index 29ec85daa30..00000000000 --- a/arrow-libs/ank/arrow-ank/build.gradle +++ /dev/null @@ -1,18 +0,0 @@ -plugins { - id "org.jetbrains.kotlin.jvm" - id "org.jlleitschuh.gradle.ktlint" -} - -apply from: "$SUB_PROJECT" -apply from: "$DOC_CREATION" -apply from: "$PUBLICATION" - -dependencies { - implementation project(":arrow-fx-coroutines") - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$KOTLIN_VERSION" - - implementation "org.jetbrains.kotlin:kotlin-compiler:$KOTLIN_VERSION" - implementation "org.jetbrains.kotlin:kotlin-script-util:$KOTLIN_VERSION" - runtimeOnly "org.jetbrains.kotlin:kotlin-reflect:$KOTLIN_VERSION" - runtimeOnly "org.jetbrains.kotlin:kotlin-scripting-compiler:$KOTLIN_VERSION" -} diff --git a/arrow-libs/ank/arrow-ank/build.gradle.kts b/arrow-libs/ank/arrow-ank/build.gradle.kts new file mode 100644 index 00000000000..5a342d1fdd3 --- /dev/null +++ b/arrow-libs/ank/arrow-ank/build.gradle.kts @@ -0,0 +1,16 @@ +plugins { + alias(libs.plugins.arrowGradleConfig.jvm) + alias(libs.plugins.arrowGradleConfig.publishJvm) +} + +apply(from = property("DOC_CREATION")) + +dependencies { + implementation(projects.arrowFxCoroutines) + implementation(libs.kotlin.stdlibJDK8) + + implementation(libs.kotlin.compiler) + implementation(libs.kotlin.scriptUtil) + runtimeOnly(libs.kotlin.reflect) + runtimeOnly(libs.kotlin.scriptingCompiler) +} diff --git a/arrow-libs/ank/arrow-ank/gradle.properties b/arrow-libs/ank/arrow-ank/gradle.properties index 9a420331f5f..82168464ca2 100644 --- a/arrow-libs/ank/arrow-ank/gradle.properties +++ b/arrow-libs/ank/arrow-ank/gradle.properties @@ -1,6 +1,4 @@ # Maven publishing configuration -POM_NAME=Arrow Ank -POM_ARTIFACT_ID=arrow-ank -POM_PACKAGING=jar -POM_DESCRIPTION=Compile time docs verification and evaluation for Kotlin and Java +pom.name=Arrow Ank +pom.description=Compile time docs verification and evaluation for Kotlin and Java kapt.incremental.apt=false diff --git a/arrow-libs/build.gradle b/arrow-libs/build.gradle deleted file mode 100644 index ee6cd2c9bc1..00000000000 --- a/arrow-libs/build.gradle +++ /dev/null @@ -1,41 +0,0 @@ -buildscript { - ext { - apply from: "gradle/$COMMON_SETUP" - } - repositories { - mavenCentral() - } -} - -plugins { - id "org.jlleitschuh.gradle.ktlint" version "$KTLINT_GRADLE_VERSION" apply false - id "org.jetbrains.dokka" version "$DOKKA_VERSION" apply false - id "ru.vyarus.animalsniffer" version "$ANIMALS_SNIFFER_VERSION" apply false - id("io.kotest.multiplatform") version "$KOTEST_GRADLE_VERSION" apply false - id "org.jetbrains.kotlin.multiplatform" version "$KOTLIN_VERSION" apply false - id "org.jetbrains.kotlinx.binary-compatibility-validator" version "$BINARYCOMP_VERSION" -} - -apply from: "gradle/$ROOT_PROJECT" - -task generateDoc(type: Exec) { - commandLine "sh", "gradlew", "dokkaGfm" -} - -task runValidation(type: Exec) { - workingDir "../arrow-site" - commandLine "sh", "gradlew", "runAnk" -} - -task buildDoc { - group = "documentation" - description = "Generates and validates the documentation" - dependsOn 'generateDoc' - dependsOn 'runValidation' -} - -runValidation.mustRunAfter generateDoc - -apiValidation { - ignoredProjects += ["jekyll"] -} diff --git a/arrow-libs/build.gradle.kts b/arrow-libs/build.gradle.kts new file mode 100644 index 00000000000..bf5c7e1bf4c --- /dev/null +++ b/arrow-libs/build.gradle.kts @@ -0,0 +1,39 @@ +buildscript { + apply(from = "gradle/setup.gradle") +} + +plugins { + alias(libs.plugins.ktlint) apply false + alias(libs.plugins.dokka) apply false + alias(libs.plugins.animalSniffer) apply false + alias(libs.plugins.kotest.multiplatform) apply false + alias(libs.plugins.kotlin.multiplatform) apply false + alias(libs.plugins.kotlin.binaryCompatibilityValidator) + alias(libs.plugins.arrowGradleConfig.nexus) +} + +apply(from = "gradle/main.gradle") + +tasks { + val generateDoc by creating(Exec::class) { + group = "documentation" + commandLine("sh", "gradlew", "dokkaGfm") + } + val runValidation by creating(Exec::class) { + group = "documentation" + workingDir = file("../arrow-site") + commandLine("sh", "gradlew", "dokkaGfm") + } + val buildDoc by creating(Exec::class) { + group = "documentation" + description = "Generates and validates the documentation" + dependsOn(generateDoc) + dependsOn(runValidation) + } + + runValidation.mustRunAfter(generateDoc) +} + +apiValidation { + ignoredProjects.add("jekyll") +} diff --git a/arrow-libs/core/.editorconfig b/arrow-libs/core/.editorconfig index 38d9a0ce1c1..125ab7582f7 120000 --- a/arrow-libs/core/.editorconfig +++ b/arrow-libs/core/.editorconfig @@ -1 +1 @@ -../.editorconfig \ No newline at end of file +../.editorconfig diff --git a/arrow-libs/core/arrow-annotations/build.gradle b/arrow-libs/core/arrow-annotations/build.gradle deleted file mode 100644 index 9188eaff431..00000000000 --- a/arrow-libs/core/arrow-annotations/build.gradle +++ /dev/null @@ -1,9 +0,0 @@ -plugins { - id "org.jetbrains.kotlin.multiplatform" - id "org.jlleitschuh.gradle.ktlint" -} - -apply from: "$SUB_PROJECT_MPP" -apply from: "$DOC_CREATION" -apply from: "$PUBLICATION_MPP" -apply from: "$ANIMALSNIFFER_MPP" diff --git a/arrow-libs/core/arrow-annotations/build.gradle.kts b/arrow-libs/core/arrow-annotations/build.gradle.kts new file mode 100644 index 00000000000..c5e789b58d8 --- /dev/null +++ b/arrow-libs/core/arrow-annotations/build.gradle.kts @@ -0,0 +1,32 @@ +plugins { + alias(libs.plugins.arrowGradleConfig.multiplatform) + alias(libs.plugins.arrowGradleConfig.publishMultiplatform) +} + +kotlin { + sourceSets { + commonMain { + dependencies { + implementation(libs.kotlin.stdlibCommon) + } + } + jvmMain { + dependencies { + implementation(libs.kotlin.stdlibJDK8) + } + } + jvmTest { + dependencies { + runtimeOnly(libs.kotest.runnerJUnit5) + } + } + jsMain { + dependencies { + implementation(libs.kotlin.stdlibJS) + } + } + } +} + +apply(from = property("DOC_CREATION")) +apply(from = property("ANIMALSNIFFER_MPP")) diff --git a/arrow-libs/core/arrow-annotations/gradle.properties b/arrow-libs/core/arrow-annotations/gradle.properties index 7e241b93714..4a15118ff2b 100644 --- a/arrow-libs/core/arrow-annotations/gradle.properties +++ b/arrow-libs/core/arrow-annotations/gradle.properties @@ -1,4 +1,2 @@ # Maven publishing configuration -POM_NAME=Arrow Annotations -POM_ARTIFACT_ID=arrow-annotations -POM_PACKAGING=jar +pom.name=Arrow Annotations diff --git a/arrow-libs/core/arrow-continuations/build.gradle b/arrow-libs/core/arrow-continuations/build.gradle deleted file mode 100644 index df3b1e5e416..00000000000 --- a/arrow-libs/core/arrow-continuations/build.gradle +++ /dev/null @@ -1,21 +0,0 @@ -plugins { - id "org.jetbrains.kotlin.multiplatform" - id "org.jlleitschuh.gradle.ktlint" -} - -apply from: "$SUB_PROJECT_MPP" -apply from: "$TEST_COVERAGE" -apply from: "$DOC_CREATION" -apply from: "$PUBLICATION_MPP" -apply from: "$ANIMALSNIFFER_MPP" -apply plugin: 'io.kotest.multiplatform' - -kotlin { - sourceSets { - commonTest { - dependencies { - implementation project(":arrow-core-test") - } - } - } -} diff --git a/arrow-libs/core/arrow-continuations/build.gradle.kts b/arrow-libs/core/arrow-continuations/build.gradle.kts new file mode 100644 index 00000000000..67f66e26fd0 --- /dev/null +++ b/arrow-libs/core/arrow-continuations/build.gradle.kts @@ -0,0 +1,39 @@ +plugins { + alias(libs.plugins.arrowGradleConfig.multiplatform) + alias(libs.plugins.arrowGradleConfig.publishMultiplatform) +} + +apply(from = property("TEST_COVERAGE")) +apply(from = property("DOC_CREATION")) +apply(from = property("ANIMALSNIFFER_MPP")) +apply(plugin = "io.kotest.multiplatform") + +kotlin { + sourceSets { + commonMain { + dependencies { + implementation(libs.kotlin.stdlibCommon) + } + } + commonTest { + dependencies { + implementation(projects.arrowCoreTest) + } + } + jvmMain { + dependencies { + implementation(libs.kotlin.stdlibJDK8) + } + } + jvmTest { + dependencies { + runtimeOnly(libs.kotest.runnerJUnit5) + } + } + jsMain { + dependencies { + implementation(libs.kotlin.stdlibJS) + } + } + } +} diff --git a/arrow-libs/core/arrow-continuations/gradle.properties b/arrow-libs/core/arrow-continuations/gradle.properties index 05db45fd096..b657b4ed748 100644 --- a/arrow-libs/core/arrow-continuations/gradle.properties +++ b/arrow-libs/core/arrow-continuations/gradle.properties @@ -1,6 +1,4 @@ # Maven publishing configuration -POM_NAME=Arrow Continuations -POM_ARTIFACT_ID=arrow-continuations -POM_PACKAGING=jar +pom.name=Arrow Continuations # Build configuration kapt.incremental.apt=false diff --git a/arrow-libs/core/arrow-core-retrofit/build.gradle b/arrow-libs/core/arrow-core-retrofit/build.gradle deleted file mode 100644 index f77dfe2f6ee..00000000000 --- a/arrow-libs/core/arrow-core-retrofit/build.gradle +++ /dev/null @@ -1,21 +0,0 @@ -plugins { - id "org.jetbrains.kotlin.jvm" - id "org.jlleitschuh.gradle.ktlint" -} - -apply from: "$SUB_PROJECT" -apply from: "$TEST_COVERAGE" -apply from: "$DOC_CREATION" -apply from: "$PUBLICATION" -apply from: "$ANIMALSNIFFER" - -dependencies { - compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$KOTLIN_VERSION" - compileOnly project(":arrow-core") - compileOnly "com.squareup.retrofit2:retrofit:$RETROFIT_VERSION" - testCompileOnly "org.jetbrains.kotlin:kotlin-reflect:$KOTLIN_VERSION" - testRuntimeOnly "io.kotest:kotest-runner-junit5:$KOTEST_VERSION" - testImplementation project(":arrow-core-test") - testImplementation "com.squareup.retrofit2:converter-gson:$RETROFIT_VERSION" - testImplementation "com.squareup.okhttp3:mockwebserver:$MOCKWEBSERVER_VERSION" -} diff --git a/arrow-libs/core/arrow-core-retrofit/build.gradle.kts b/arrow-libs/core/arrow-core-retrofit/build.gradle.kts new file mode 100644 index 00000000000..87827f1475a --- /dev/null +++ b/arrow-libs/core/arrow-core-retrofit/build.gradle.kts @@ -0,0 +1,19 @@ +plugins { + alias(libs.plugins.arrowGradleConfig.jvm) + alias(libs.plugins.arrowGradleConfig.publishJvm) +} + +apply(from = property("TEST_COVERAGE")) +apply(from = property("DOC_CREATION")) +apply(from = property("ANIMALSNIFFER")) + +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.retrofitConverterGson) + testImplementation(libs.squareup.okhttpMockWebServer) +} diff --git a/arrow-libs/core/arrow-core-retrofit/gradle.properties b/arrow-libs/core/arrow-core-retrofit/gradle.properties index a0ede30c3db..71cc2b472fd 100644 --- a/arrow-libs/core/arrow-core-retrofit/gradle.properties +++ b/arrow-libs/core/arrow-core-retrofit/gradle.properties @@ -1,4 +1,2 @@ # Maven publishing configuration -POM_NAME=Arrow-Core-Retrofit -POM_ARTIFACT_ID=arrow-core-retrofit -POM_PACKAGING=jar +pom.name=Arrow-Core-Retrofit diff --git a/arrow-libs/core/arrow-core-test/build.gradle b/arrow-libs/core/arrow-core-test/build.gradle deleted file mode 100644 index 5cae9a4349e..00000000000 --- a/arrow-libs/core/arrow-core-test/build.gradle +++ /dev/null @@ -1,22 +0,0 @@ -plugins { - id "org.jetbrains.kotlin.multiplatform" - id "org.jlleitschuh.gradle.ktlint" -} - -apply from: "$SUB_PROJECT_MPP" -apply from: "$PUBLICATION_MPP" -apply from: "$ANIMALSNIFFER_MPP" - -kotlin { - sourceSets { - commonMain { - dependencies { - api project(":arrow-core") - api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$KOTLINX_COROUTINES_VERSION" - api "io.kotest:kotest-property:$KOTEST_VERSION" - api "io.kotest:kotest-framework-engine:$KOTEST_VERSION" - api "io.kotest:kotest-assertions-core:$KOTEST_VERSION" - } - } - } -} diff --git a/arrow-libs/core/arrow-core-test/build.gradle.kts b/arrow-libs/core/arrow-core-test/build.gradle.kts new file mode 100644 index 00000000000..2c14c3c304e --- /dev/null +++ b/arrow-libs/core/arrow-core-test/build.gradle.kts @@ -0,0 +1,36 @@ +plugins { + alias(libs.plugins.arrowGradleConfig.multiplatform) + alias(libs.plugins.arrowGradleConfig.publishMultiplatform) +} + +apply(from = property("ANIMALSNIFFER_MPP")) + +kotlin { + sourceSets { + commonMain { + dependencies { + api(projects.arrowCore) + api(libs.coroutines.core) + api(libs.kotest.assertionsCore) + api(libs.kotest.frameworkEngine) + api(libs.kotest.property) + implementation(libs.kotlin.stdlibCommon) + } + } + jvmMain { + dependencies { + implementation(libs.kotlin.stdlibJDK8) + } + } + jvmTest { + dependencies { + runtimeOnly(libs.kotest.runnerJUnit5) + } + } + jsMain { + dependencies { + implementation(libs.kotlin.stdlibJS) + } + } + } +} diff --git a/arrow-libs/core/arrow-core-test/gradle.properties b/arrow-libs/core/arrow-core-test/gradle.properties index c4c5dc4a932..4c111c13f4d 100644 --- a/arrow-libs/core/arrow-core-test/gradle.properties +++ b/arrow-libs/core/arrow-core-test/gradle.properties @@ -1,5 +1,3 @@ # Maven publishing configuration -POM_NAME=Arrow-Core-Test -POM_ARTIFACT_ID=arrow-core-test -POM_PACKAGING=jar +pom.name=Arrow-Core-Test kapt.incremental.apt=false diff --git a/arrow-libs/core/arrow-core/build.gradle b/arrow-libs/core/arrow-core/build.gradle deleted file mode 100644 index b7dc6966726..00000000000 --- a/arrow-libs/core/arrow-core/build.gradle +++ /dev/null @@ -1,28 +0,0 @@ -plugins { - id "org.jetbrains.kotlin.multiplatform" - id "org.jlleitschuh.gradle.ktlint" -} - -apply plugin: 'io.kotest.multiplatform' - -apply from: "$SUB_PROJECT_MPP" -apply from: "$TEST_COVERAGE" -apply from: "$DOC_CREATION" -apply from: "$PUBLICATION_MPP" -apply from: "$ANIMALSNIFFER_MPP" - -kotlin { - sourceSets { - commonMain { - dependencies { - api project(":arrow-continuations") - api project(":arrow-annotations") - } - } - commonTest { - dependencies { - implementation project(":arrow-core-test") - } - } - } -} diff --git a/arrow-libs/core/arrow-core/build.gradle.kts b/arrow-libs/core/arrow-core/build.gradle.kts new file mode 100644 index 00000000000..825a02aeb43 --- /dev/null +++ b/arrow-libs/core/arrow-core/build.gradle.kts @@ -0,0 +1,41 @@ +plugins { + alias(libs.plugins.arrowGradleConfig.multiplatform) + alias(libs.plugins.arrowGradleConfig.publishMultiplatform) +} + +apply(plugin = "io.kotest.multiplatform") +apply(from = property("TEST_COVERAGE")) +apply(from = property("DOC_CREATION")) +apply(from = property("ANIMALSNIFFER_MPP")) + +kotlin { + sourceSets { + commonMain { + dependencies { + api(projects.arrowContinuations) + api(projects.arrowAnnotations) + implementation(libs.kotlin.stdlibCommon) + } + } + commonTest { + dependencies { + implementation(projects.arrowCoreTest) + } + } + jvmMain { + dependencies { + implementation(libs.kotlin.stdlibJDK8) + } + } + jvmTest { + dependencies { + runtimeOnly(libs.kotest.runnerJUnit5) + } + } + jsMain { + dependencies { + implementation(libs.kotlin.stdlibJS) + } + } + } +} diff --git a/arrow-libs/core/arrow-core/gradle.properties b/arrow-libs/core/arrow-core/gradle.properties index c0473999f28..07cf1183f89 100644 --- a/arrow-libs/core/arrow-core/gradle.properties +++ b/arrow-libs/core/arrow-core/gradle.properties @@ -1,6 +1,4 @@ # Maven publishing configuration -POM_NAME=Arrow Core Extensions -POM_ARTIFACT_ID=arrow-core -POM_PACKAGING=jar +pom.name=Arrow Core Extensions # Build configuration kapt.incremental.apt=false diff --git a/arrow-libs/core/arrow-meta/arrow-meta-test-models/build.gradle b/arrow-libs/core/arrow-meta/arrow-meta-test-models/build.gradle deleted file mode 100644 index dad1db3af53..00000000000 --- a/arrow-libs/core/arrow-meta/arrow-meta-test-models/build.gradle +++ /dev/null @@ -1,13 +0,0 @@ -plugins { - id "org.jetbrains.kotlin.jvm" - id "org.jetbrains.kotlin.kapt" - id "org.jlleitschuh.gradle.ktlint" -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$KOTLIN_VERSION" - implementation "com.google.auto.service:auto-service:$GOOGLE_AUTO_SERVICE_VERSION" - kapt "com.google.auto.service:auto-service:$GOOGLE_AUTO_SERVICE_VERSION" - implementation project(":arrow-annotations") - implementation project(":arrow-core") -} diff --git a/arrow-libs/core/arrow-meta/arrow-meta-test-models/build.gradle.kts b/arrow-libs/core/arrow-meta/arrow-meta-test-models/build.gradle.kts new file mode 100644 index 00000000000..d15dd4afe7a --- /dev/null +++ b/arrow-libs/core/arrow-meta/arrow-meta-test-models/build.gradle.kts @@ -0,0 +1,14 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + kotlin("jvm") + id("org.jetbrains.kotlin.kapt") +} + +dependencies { + implementation(libs.kotlin.stdlibJDK8) + implementation(libs.google.autoService) + kapt(libs.google.autoService) + implementation(projects.arrowAnnotations) + implementation(projects.arrowCore) +} diff --git a/arrow-libs/core/arrow-meta/build.gradle b/arrow-libs/core/arrow-meta/build.gradle deleted file mode 100644 index 5cc6b0bc587..00000000000 --- a/arrow-libs/core/arrow-meta/build.gradle +++ /dev/null @@ -1,30 +0,0 @@ -import org.gradle.internal.jvm.Jvm - -plugins { - id "org.jetbrains.kotlin.jvm" - id "org.jetbrains.kotlin.kapt" - id "org.jlleitschuh.gradle.ktlint" -} - -apply from: "$SUB_PROJECT" -apply from: "$PUBLICATION" - -dependencies { - api project(':arrow-annotations') - api "io.arrow-kt:kotlin-metadata:$KOTLIN_VERSION" - api("com.squareup:kotlinpoet:$KOTLIN_POET_VERSION") { - exclude group: 'org.jetbrains.kotlin', module: 'kotlin-reflect' - } - api "org.jetbrains.kotlin:kotlin-reflect:$KOTLIN_VERSION" - implementation "com.google.auto.service:auto-service:$GOOGLE_AUTO_SERVICE_VERSION" - kapt "com.google.auto.service:auto-service:$GOOGLE_AUTO_SERVICE_VERSION" - - //To generate stubs for data classes - kaptTest "com.google.auto.service:auto-service:$GOOGLE_AUTO_SERVICE_VERSION" - testImplementation "com.google.testing.compile:compile-testing:$GOOGLE_COMPILE_TESTING_VERSION" - testImplementation fileTree(dir: './src/test/libs', includes: ['*.jar']) - testImplementation project(":arrow-meta:arrow-meta-test-models") - testImplementation("junit:junit:$JUNIT_VERSION") - testRuntimeOnly("org.junit.vintage:junit-vintage-engine:$JUNIT_VINTAGE_VERSION") - testImplementation "io.kotlintest:kotlintest-runner-junit4:$KOTLIN_TEST_VERSION", excludeArrow -} diff --git a/arrow-libs/core/arrow-meta/build.gradle.kts b/arrow-libs/core/arrow-meta/build.gradle.kts new file mode 100644 index 00000000000..3451d7a3916 --- /dev/null +++ b/arrow-libs/core/arrow-meta/build.gradle.kts @@ -0,0 +1,28 @@ +plugins { + alias(libs.plugins.arrowGradleConfig.jvm) + alias(libs.plugins.arrowGradleConfig.publishJvm) + id("org.jetbrains.kotlin.kapt") +} + +dependencies { + api(projects.arrowAnnotations) + api(libs.arrow.kotlinMetadata) + api(libs.squareup.kotlinPoet) { + exclude( + group = libs.kotlin.reflect.get().module.group, + module = libs.kotlin.reflect.get().module.toString(), + ) + } + api(libs.kotlin.reflect) + implementation(libs.google.autoService) + kapt(libs.google.autoService) + + // To generate stubs for data classes + kaptTest(libs.google.autoService) + testImplementation(libs.google.compileTesting) + testImplementation(fileTree("dir" to "./src/test/libs", "includes" to listOf("*.jar"))) + testImplementation(projects.arrowMeta.arrowMetaTestModels) + testImplementation(libs.jUnitJUnit) + testRuntimeOnly(libs.jUnitVintageEngine) + testImplementation(libs.kotlinTest.runnerJUnit4) { exclude(group = "io.arrow-kt") } +} diff --git a/arrow-libs/core/arrow-meta/gradle.properties b/arrow-libs/core/arrow-meta/gradle.properties index 723f5795597..e099e8bf656 100644 --- a/arrow-libs/core/arrow-meta/gradle.properties +++ b/arrow-libs/core/arrow-meta/gradle.properties @@ -1,4 +1,2 @@ # Maven publishing configuration -POM_NAME=Arrow Meta -POM_ARTIFACT_ID=arrow-meta -POM_PACKAGING=jar +pom.name=Arrow Meta diff --git a/arrow-libs/core/settings.gradle b/arrow-libs/core/settings.gradle deleted file mode 100644 index 8c28aadcee2..00000000000 --- a/arrow-libs/core/settings.gradle +++ /dev/null @@ -1,14 +0,0 @@ -// This file allows to open just core libraries - -rootProject.name = 'arrow-core-libs' - -include 'arrow-meta:arrow-meta-test-models' -include 'arrow-meta' -include 'arrow-annotations' -include 'arrow-core' -include 'arrow-core-test' -include 'arrow-continuations' -include 'arrow-core-retrofit' - -include 'jekyll' -project(":jekyll").projectDir = file("dokka/jekyll") \ No newline at end of file diff --git a/arrow-libs/core/settings.gradle.kts b/arrow-libs/core/settings.gradle.kts new file mode 100644 index 00000000000..3f0e8198e3c --- /dev/null +++ b/arrow-libs/core/settings.gradle.kts @@ -0,0 +1,14 @@ +// This file allows to open just core libraries + +rootProject.name = "arrow-core-libs" + +include("arrow-meta:arrow-meta-test-models") +include("arrow-meta") +include("arrow-annotations") +include("arrow-core") +include("arrow-core-test") +include("arrow-continuations") +include("arrow-core-retrofit") + +include("jekyll") +project(":jekyll").projectDir = file("dokka/jekyll") diff --git a/arrow-libs/dokka/jekyll/build.gradle b/arrow-libs/dokka/jekyll/build.gradle deleted file mode 100644 index 9cb3c56ebf1..00000000000 --- a/arrow-libs/dokka/jekyll/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ -plugins { - id "org.jetbrains.kotlin.jvm" - id "org.jlleitschuh.gradle.ktlint" -} - -apply from: "$SUB_PROJECT" - -dependencies { - compileOnly "org.jetbrains.dokka:dokka-core:$DOKKA_VERSION" - implementation "org.jetbrains.dokka:dokka-base:$DOKKA_VERSION" - implementation "org.jetbrains.dokka:gfm-plugin:$DOKKA_VERSION" -} diff --git a/arrow-libs/dokka/jekyll/build.gradle.kts b/arrow-libs/dokka/jekyll/build.gradle.kts new file mode 100644 index 00000000000..5a7fe2dbdff --- /dev/null +++ b/arrow-libs/dokka/jekyll/build.gradle.kts @@ -0,0 +1,9 @@ +plugins { + alias(libs.plugins.arrowGradleConfig.jvm) +} + +dependencies { + compileOnly(libs.dokka.core) + implementation(libs.dokka.base) + implementation(libs.dokka.gfmPluginx) +} diff --git a/arrow-libs/dokka/jekyll/gradle.properties b/arrow-libs/dokka/jekyll/gradle.properties index 063f7e883eb..7311771ce57 100644 --- a/arrow-libs/dokka/jekyll/gradle.properties +++ b/arrow-libs/dokka/jekyll/gradle.properties @@ -1,4 +1,2 @@ # Maven publishing configuration -POM_NAME=Arrow Dokka Jekyll -POM_ARTIFACT_ID=arrow-dokka-jekyll -POM_PACKAGING=jar +pom.name=Arrow Dokka Jekyll diff --git a/arrow-libs/dokka/jekyll/src/main/kotlin/com/github/nomisRev/DokkaFenceWorkaroundPlugin.kt b/arrow-libs/dokka/jekyll/src/main/kotlin/com/github/nomisRev/DokkaFenceWorkaroundPlugin.kt index d2b0b8ebbab..77c79f55fb1 100644 --- a/arrow-libs/dokka/jekyll/src/main/kotlin/com/github/nomisRev/DokkaFenceWorkaroundPlugin.kt +++ b/arrow-libs/dokka/jekyll/src/main/kotlin/com/github/nomisRev/DokkaFenceWorkaroundPlugin.kt @@ -79,7 +79,7 @@ public class JekyllRenderer(context: DokkaContext) : CommonmarkRenderer(context) override val preprocessors: List = context.plugin().query { jekyllPreprocessors } - override fun StringBuilder.buildNewLine() { + public override fun StringBuilder.buildNewLine() { append("\n") } diff --git a/arrow-libs/fx/arrow-fx-coroutines-test/build.gradle b/arrow-libs/fx/arrow-fx-coroutines-test/build.gradle deleted file mode 100644 index 4a3642cb598..00000000000 --- a/arrow-libs/fx/arrow-fx-coroutines-test/build.gradle +++ /dev/null @@ -1,25 +0,0 @@ -plugins { - id "org.jetbrains.kotlin.multiplatform" - id "org.jlleitschuh.gradle.ktlint" -} - - -apply from: "$SUB_PROJECT_MPP" -apply from: "$DOC_CREATION" -apply from: "$PUBLICATION_MPP" -apply from: "$ANIMALSNIFFER_MPP" - -kotlin { - sourceSets { - commonMain { - dependencies { - api project(":arrow-core-test") - api project(":arrow-fx-coroutines") - api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$KOTLINX_COROUTINES_VERSION" - api "io.kotest:kotest-property:$KOTEST_VERSION" - api "io.kotest:kotest-framework-engine:$KOTEST_VERSION" - api "io.kotest:kotest-assertions-core:$KOTEST_VERSION" - } - } - } -} diff --git a/arrow-libs/fx/arrow-fx-coroutines-test/build.gradle.kts b/arrow-libs/fx/arrow-fx-coroutines-test/build.gradle.kts new file mode 100644 index 00000000000..af9ec8b20db --- /dev/null +++ b/arrow-libs/fx/arrow-fx-coroutines-test/build.gradle.kts @@ -0,0 +1,40 @@ +plugins { + alias(libs.plugins.arrowGradleConfig.multiplatform) + alias(libs.plugins.arrowGradleConfig.publishMultiplatform) +} + +apply(from = property("DOC_CREATION")) +apply(from = property("ANIMALSNIFFER_MPP")) + +kotlin { + sourceSets { + sourceSets { + commonMain { + dependencies { + api(projects.arrowCoreTest) + api(projects.arrowFxCoroutines) + api(libs.coroutines.core) + api(libs.kotest.assertionsCore) + api(libs.kotest.frameworkEngine) + api(libs.kotest.property) + implementation(libs.kotlin.stdlibCommon) + } + } + named("jvmMain") { + dependencies { + implementation(libs.kotlin.stdlibJDK8) + } + } + named("jvmTest") { + dependencies { + runtimeOnly(libs.kotest.runnerJUnit5) + } + } + named("jsMain") { + dependencies { + implementation(libs.kotlin.stdlibJS) + } + } + } + } +} diff --git a/arrow-libs/fx/arrow-fx-coroutines-test/gradle.properties b/arrow-libs/fx/arrow-fx-coroutines-test/gradle.properties index 63759d2eb02..5092830b03b 100644 --- a/arrow-libs/fx/arrow-fx-coroutines-test/gradle.properties +++ b/arrow-libs/fx/arrow-fx-coroutines-test/gradle.properties @@ -1,4 +1,2 @@ # Maven publishing configuration -POM_NAME=Arrow-Fx-Coroutines-Test -POM_ARTIFACT_ID=arrow-fx-coroutines-test -POM_PACKAGING=jar +pom.name=Arrow-Fx-Coroutines-Test diff --git a/arrow-libs/fx/arrow-fx-coroutines/build.gradle b/arrow-libs/fx/arrow-fx-coroutines/build.gradle deleted file mode 100644 index a74d730234f..00000000000 --- a/arrow-libs/fx/arrow-fx-coroutines/build.gradle +++ /dev/null @@ -1,32 +0,0 @@ -plugins { - id "org.jetbrains.kotlin.multiplatform" - id "org.jlleitschuh.gradle.ktlint" -} - -apply plugin: 'io.kotest.multiplatform' - -apply from: "$SUB_PROJECT_MPP" -apply from: "$TEST_COVERAGE" -apply from: "$DOC_CREATION" -apply from: "$PUBLICATION_MPP" - -kotlin { - sourceSets { - commonMain { - dependencies { - api project(":arrow-core") - api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$KOTLINX_COROUTINES_VERSION" - } - } - commonTest { - dependencies { - implementation project(":arrow-fx-coroutines-test") - } - } - jvmTest { - dependencies { - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$KOTLINX_COROUTINES_VERSION" - } - } - } -} diff --git a/arrow-libs/fx/arrow-fx-coroutines/build.gradle.kts b/arrow-libs/fx/arrow-fx-coroutines/build.gradle.kts new file mode 100644 index 00000000000..854faa1b76a --- /dev/null +++ b/arrow-libs/fx/arrow-fx-coroutines/build.gradle.kts @@ -0,0 +1,41 @@ +plugins { + alias(libs.plugins.arrowGradleConfig.multiplatform) + alias(libs.plugins.arrowGradleConfig.publishMultiplatform) +} + +apply(plugin = "io.kotest.multiplatform") +apply(from = property("TEST_COVERAGE")) +apply(from = property("DOC_CREATION")) + +kotlin { + sourceSets { + commonMain { + dependencies { + api(projects.arrowCore) + api(libs.coroutines.core) + implementation(libs.kotlin.stdlibCommon) + } + } + commonTest { + dependencies { + implementation(projects.arrowFxCoroutinesTest) + } + } + jvmMain { + dependencies { + implementation(libs.kotlin.stdlibJDK8) + } + } + jvmTest { + dependencies { + runtimeOnly(libs.kotest.runnerJUnit5) + implementation(libs.coroutines.test) + } + } + jsMain { + dependencies { + implementation(libs.kotlin.stdlibJS) + } + } + } +} diff --git a/arrow-libs/fx/arrow-fx-coroutines/gradle.properties b/arrow-libs/fx/arrow-fx-coroutines/gradle.properties index ebcbd5f3447..5d283a136e2 100644 --- a/arrow-libs/fx/arrow-fx-coroutines/gradle.properties +++ b/arrow-libs/fx/arrow-fx-coroutines/gradle.properties @@ -1,4 +1,2 @@ # Maven publishing configuration -POM_NAME=Arrow-Fx-Coroutines -POM_ARTIFACT_ID=arrow-fx-coroutines -POM_PACKAGING=jar +pom.name=Arrow-Fx-Coroutines diff --git a/arrow-libs/fx/arrow-fx-stm/build.gradle b/arrow-libs/fx/arrow-fx-stm/build.gradle deleted file mode 100644 index 1181faa8862..00000000000 --- a/arrow-libs/fx/arrow-fx-stm/build.gradle +++ /dev/null @@ -1,29 +0,0 @@ -plugins { - id "org.jetbrains.kotlin.multiplatform" - id "org.jlleitschuh.gradle.ktlint" -} - -apply plugin: 'io.kotest.multiplatform' - -apply from: "$SUB_PROJECT_MPP" -apply from: "$TEST_COVERAGE" -apply from: "$DOC_CREATION" -apply from: "$PUBLICATION_MPP" -apply from: "$ANIMALSNIFFER_MPP" - -kotlin { - sourceSets { - commonMain { - dependencies { - api project(":arrow-core") - compileOnly "org.jetbrains.kotlin:kotlin-stdlib-common:$KOTLIN_VERSION" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$KOTLINX_COROUTINES_VERSION" - } - } - commonTest { - dependencies { - implementation project(":arrow-fx-coroutines-test") - } - } - } -} diff --git a/arrow-libs/fx/arrow-fx-stm/build.gradle.kts b/arrow-libs/fx/arrow-fx-stm/build.gradle.kts new file mode 100644 index 00000000000..c33795827c9 --- /dev/null +++ b/arrow-libs/fx/arrow-fx-stm/build.gradle.kts @@ -0,0 +1,41 @@ +plugins { + alias(libs.plugins.arrowGradleConfig.multiplatform) + alias(libs.plugins.arrowGradleConfig.publishMultiplatform) +} + +apply(plugin = "io.kotest.multiplatform") +apply(from = property("TEST_COVERAGE")) +apply(from = property("DOC_CREATION")) +apply(from = property("ANIMALSNIFFER_MPP")) + +kotlin { + sourceSets { + commonMain { + dependencies { + api(projects.arrowCore) + compileOnly(libs.kotlin.stdlibCommon) + implementation(libs.coroutines.core) + } + } + commonTest { + dependencies { + implementation(projects.arrowFxCoroutinesTest) + } + } + jvmMain { + dependencies { + implementation(libs.kotlin.stdlibJDK8) + } + } + jvmTest { + dependencies { + runtimeOnly(libs.kotest.runnerJUnit5) + } + } + jsMain { + dependencies { + implementation(libs.kotlin.stdlibJS) + } + } + } +} diff --git a/arrow-libs/fx/arrow-fx-stm/gradle.properties b/arrow-libs/fx/arrow-fx-stm/gradle.properties index 67ff552bdf6..134a40c3da7 100644 --- a/arrow-libs/fx/arrow-fx-stm/gradle.properties +++ b/arrow-libs/fx/arrow-fx-stm/gradle.properties @@ -1,4 +1,2 @@ # Maven publishing configuration -POM_NAME=Arrow-Fx-STM -POM_ARTIFACT_ID=arrow-fx-stm -POM_PACKAGING=jar +pom.name=Arrow-Fx-STM diff --git a/arrow-libs/fx/settings.gradle b/arrow-libs/fx/settings.gradle.kts similarity index 58% rename from arrow-libs/fx/settings.gradle rename to arrow-libs/fx/settings.gradle.kts index c2aca72f237..275098dc30a 100644 --- a/arrow-libs/fx/settings.gradle +++ b/arrow-libs/fx/settings.gradle.kts @@ -1,18 +1,18 @@ // This file allows to open just fx libraries -rootProject.name = 'arrow-fx-libs' +rootProject.name = "arrow-fx-libs" -include 'arrow-fx-coroutines' -include 'arrow-fx-coroutines-test' -include 'arrow-fx-stm' +include("arrow-fx-coroutines") +include("arrow-fx-coroutines-test") +include("arrow-fx-stm") // To allow the use of local projects from ../core: -include 'arrow-core' -include 'arrow-core-test' -include 'arrow-annotations' -include 'arrow-continuations' -include 'arrow-core-retrofit' +include("arrow-core") +include("arrow-core-test") +include("arrow-annotations") +include("arrow-continuations") +include("arrow-core-retrofit") project(":arrow-core").projectDir = file("../core/arrow-core") project(":arrow-core-test").projectDir = file("../core/arrow-core-test") @@ -20,5 +20,5 @@ project(":arrow-annotations").projectDir = file("../core/arrow-annotations") project(":arrow-continuations").projectDir = file("../core/arrow-continuations") project(":arrow-core-retrofit").projectDir = file("../core/arrow-core-retrofit") -include 'jekyll' -project(":jekyll").projectDir = file("dokka/jekyll") \ No newline at end of file +include("jekyll") +project(":jekyll").projectDir = file("dokka/jekyll") diff --git a/arrow-libs/gradle.properties b/arrow-libs/gradle.properties index 72ea6284249..f85a8c68c75 100644 --- a/arrow-libs/gradle.properties +++ b/arrow-libs/gradle.properties @@ -1,7 +1,9 @@ # Package definitions -GROUP=io.arrow-kt +projects.group=io.arrow-kt +projects.version=1.0.1-SNAPSHOT +# TODO: remove when all projects use `projects.version` VERSION_NAME=1.0.1-SNAPSHOT -LATEST_VERSION=1.0.0 +projects.latestVersion=1.0.0 # Versions ANDROID_LIFECYCLE_VERSION=2.2.0 ANDROID_TOOLS_BUILD_PLUGIN_VERSION=4.0.0 @@ -42,16 +44,15 @@ SCALA_LIBRARY_VERSION=2.13.1 RELEASE_REPOSITORY=https://oss.sonatype.org/service/local/staging/deploy/maven2/ SNAPSHOT_REPOSITORY=https://oss.sonatype.org/content/repositories/snapshots/ # Pomfile definitions -POM_DESCRIPTION=Functional companion to Kotlin's Standard Library -POM_URL=https://github.com/arrow-kt/arrow/ -POM_SCM_URL=https://github.com/arrow-kt/arrow/ -POM_SCM_CONNECTION=scm:git:git://github.com/arrow-kt/arrow.git -POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/arrow-kt/arrow.git -POM_LICENCE_NAME=The Apache Software License, Version 2.0 -POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt -POM_LICENCE_DIST=repo -POM_DEVELOPER_ID=arrow-kt -POM_DEVELOPER_NAME=The Arrow Authors +pom.description=Functional companion to Kotlin's Standard Library +pom.url=https://github.com/arrow-kt/arrow/ +pom.license.name=The Apache Software License, Version 2.0 +pom.license.url=https://www.apache.org/licenses/LICENSE-2.0.txt +pom.developer.id=arrow-kt +pom.developer.name=The Arrow Authors +pom.smc.url=https://github.com/arrow-kt/arrow/ +pom.smc.connection=scm:git:git://github.com/arrow-kt/arrow.git +pom.smc.developerConnection=scm:git:ssh://git@github.com/arrow-kt/arrow.git # Gradle options org.gradle.jvmargs=-Xmx4g @@ -78,11 +79,7 @@ kapt.use.worker.api=false COMMON_SETUP=../gradle/setup.gradle ROOT_PROJECT=../gradle/main.gradle -SUB_PROJECT=../../gradle/subproject.gradle -SUB_PROJECT_MPP=../../gradle/subproject-mpp.gradle TEST_COVERAGE=../../gradle/test-coverage.gradle DOC_CREATION=../../gradle/apidoc-creation.gradle -PUBLICATION=../../gradle/publication.gradle -PUBLICATION_MPP=../../gradle/publication-mpp.gradle ANIMALSNIFFER=../../gradle/animalsniffer.gradle ANIMALSNIFFER_MPP=../../gradle/animalsniffer-mpp.gradle diff --git a/arrow-libs/gradle/libs.versions.toml b/arrow-libs/gradle/libs.versions.toml new file mode 100644 index 00000000000..2a8c3557916 --- /dev/null +++ b/arrow-libs/gradle/libs.versions.toml @@ -0,0 +1,59 @@ +[versions] +animalSniffer = "1.5.0" +arrowGradleConfig = "0.1.0" +autoService = "1.0-rc7" +compileTesting = "0.18" +coroutines = "1.5.2" +dokka = "1.5.0" +jUnit = "4.12" +jUnitVintage = "5.5.2" +kotest = "5.0.0.M2" +kotestGradle = "5.0.0.5" +kotlinTest = "3.3.3" +kotlin = "1.5.31" +kotlinBinaryCompatibilityValidator = "0.7.1" +kotlinPoet = "1.5.0" +ktlint = "10.1.0" +mockWebServer = "3.13.1" +retrofit = "2.8.1" + +[libraries] +arrow-kotlinMetadata = { module = "io.arrow-kt:kotlin-metadata", version.ref = "kotlin" } +coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" } +coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" } +dokka-core = { module = "org.jetbrains.dokka:dokka-core", version.ref = "dokka" } +dokka-base = { module = "org.jetbrains.dokka:dokka-base", version.ref = "dokka" } +dokka-gfmPluginx = { module = "org.jetbrains.dokka:gfm-plugin", version.ref = "dokka" } +google-autoService = { module = "com.google.auto.service:auto-service", version.ref = "autoService" } +google-compileTesting = { module = "com.google.testing.compile:compile-testing", version.ref = "compileTesting" } +jUnitJUnit = { module = "junit:junit", version.ref = "jUnit" } +jUnitVintageEngine = { module = "org.junit.vintage:junit-vintage-engine", version.ref = "jUnitVintage" } +kotest-assertionsCore = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" } +kotest-frameworkEngine = { module = "io.kotest:kotest-framework-engine", version.ref = "kotest" } +kotest-property = { module = "io.kotest:kotest-property", version.ref = "kotest" } +kotlinTest-runnerJUnit4 = { module = "io.kotlintest:kotlintest-runner-junit4", version.ref = "kotlinTest" } +kotest-runnerJUnit5 = { module = "io.kotest:kotest-runner-junit5", version.ref = "kotest" } +kotlin-compiler = { module = "org.jetbrains.kotlin:kotlin-compiler" } +kotlin-scriptingCompiler = { module = "org.jetbrains.kotlin:kotlin-scripting-compiler" } +kotlin-scriptUtil = { module = "org.jetbrains.kotlin:kotlin-script-util" } +kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect" } +kotlin-stdlibCommon = { module = "org.jetbrains.kotlin:kotlin-stdlib-common" } +kotlin-stdlibJDK8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8" } +kotlin-stdlibJS = { module = "org.jetbrains.kotlin:kotlin-stdlib-js" } +squareup-kotlinPoet = { module = "com.squareup:kotlinpoet", version.ref = "kotlinPoet" } +squareup-okhttpMockWebServer = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "mockWebServer" } +squareup-retrofitConverterGson = { module = "com.squareup.retrofit2:converter-gson", version.ref = "retrofit" } +squareup-retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" } + +[plugins] +animalSniffer = { id = "ru.vyarus.animalsniffer", version.ref = "animalSniffer" } +arrowGradleConfig-jvm = { id = "io.arrow-kt.arrow-gradle-config-jvm", version.ref = "arrowGradleConfig" } +arrowGradleConfig-multiplatform = { id = "io.arrow-kt.arrow-gradle-config-multiplatform", version.ref = "arrowGradleConfig" } +arrowGradleConfig-nexus = { id = "io.arrow-kt.arrow-gradle-config-nexus", version.ref = "arrowGradleConfig" } +arrowGradleConfig-publishJvm = { id = "io.arrow-kt.arrow-gradle-config-publish-jvm", version.ref = "arrowGradleConfig" } +arrowGradleConfig-publishMultiplatform = { id = "io.arrow-kt.arrow-gradle-config-publish-multiplatform", version.ref = "arrowGradleConfig" } +dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } +kotest-multiplatform = { id = "io.kotest.multiplatform", version.ref = "kotestGradle" } +kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } +kotlin-binaryCompatibilityValidator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "kotlinBinaryCompatibilityValidator" } +ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" } diff --git a/arrow-libs/gradle/publication-mpp.gradle b/arrow-libs/gradle/publication-mpp.gradle deleted file mode 100644 index feca0ae7124..00000000000 --- a/arrow-libs/gradle/publication-mpp.gradle +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (C) 2021 The Arrow Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -apply plugin: 'maven-publish' -apply plugin: 'signing' - -task javadocJar(type: Jar) { - archiveClassifier = 'javadoc' -} - -afterEvaluate { - publishing { - def variantName = "${project.name}" - publications.all { - version = VERSION_NAME - - artifact javadocJar - - def type = it.name - logger.error("Configuring $type") - switch (type) { - case 'kotlinMultiplatform': - // With Kotlin 1.4.0, the root module ID has no suffix, but for compatibility with - // the consumers who can't read Gradle module metadata, we publish the JVM artifacts in it - it.artifactId = variantName - apply from: "$rootDir/gradle/publish-mpp-root-module-in-platform.gradle" - publishPlatformArtifactsInRootModule(publications["jvm"]) - logger.error("after publishPlatformArtifactsInRootModule") - break - case 'metadata': - case 'jvm': - case 'js': - it.artifactId = "$variantName-$type" - break - } - logger.error("Artifact id = ${it.artifactId}") - - pom { - name = POM_NAME - //packaging = POM_PACKAGING - description = POM_DESCRIPTION - url = POM_URL - - scm { - url = POM_SCM_URL - connection = POM_SCM_CONNECTION - developerConnection = POM_SCM_DEV_CONNECTION - } - licenses { - license { - name = POM_LICENCE_NAME - url = POM_LICENCE_URL - distribution = POM_LICENCE_DIST - } - } - developers { - developer { - id = POM_DEVELOPER_ID - name = POM_DEVELOPER_NAME - } - } - } - } - repositories { - maven { - credentials { - username "$System.env.SONATYPE_USER" - password "$System.env.SONATYPE_PWD" - } - url = VERSION_NAME.endsWith('SNAPSHOT') ? SNAPSHOT_REPOSITORY : RELEASE_REPOSITORY - } - } - } - - // Guide: https://docs.gradle.org/current/userguide/signing_plugin.html - if (project.hasProperty("signingKey") && project.hasProperty("signingPassword")) { - signing { - def signingKey = findProperty("signingKey") - def signingPassword = findProperty("signingPassword") - useInMemoryPgpKeys(signingKey, signingPassword) - - sign publishing.publications - } - } -} \ No newline at end of file diff --git a/arrow-libs/gradle/publication.gradle b/arrow-libs/gradle/publication.gradle deleted file mode 100644 index 5b964361f07..00000000000 --- a/arrow-libs/gradle/publication.gradle +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (C) 2020 The Arrow Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -apply plugin: 'java-library' -apply plugin: 'maven-publish' -apply plugin: 'signing' - -afterEvaluate { - publishing { - publications { - mavenJava(MavenPublication) { - groupId = GROUP - artifactId = POM_ARTIFACT_ID - version = VERSION_NAME - - artifact sourcesJar - artifact javadocJar - from components.java - - pom { - name = POM_NAME - packaging = POM_PACKAGING - description = POM_DESCRIPTION - url = POM_URL - - scm { - url = POM_SCM_URL - connection = POM_SCM_CONNECTION - developerConnection = POM_SCM_DEV_CONNECTION - } - licenses { - license { - name = POM_LICENCE_NAME - url = POM_LICENCE_URL - distribution = POM_LICENCE_DIST - } - } - developers { - developer { - id = POM_DEVELOPER_ID - name = POM_DEVELOPER_NAME - } - } - } - } - } - repositories { - maven { - credentials { - username "$System.env.SONATYPE_USER" - password "$System.env.SONATYPE_PWD" - } - url = VERSION_NAME.endsWith('SNAPSHOT') ? SNAPSHOT_REPOSITORY : RELEASE_REPOSITORY - } - } - } - - // Guide: https://docs.gradle.org/current/userguide/signing_plugin.html - if (project.hasProperty("signingKey") && project.hasProperty("signingPassword")) { - signing { - def signingKey = findProperty("signingKey") - def signingPassword = findProperty("signingPassword") - useInMemoryPgpKeys(signingKey, signingPassword) - - sign publishing.publications.mavenJava - } - } -} - -task sourcesJar(type: Jar, dependsOn: classes) { - //noinspection GroovyAccessibility //alternatively replace this with archiveClassifier.set('...') - archiveClassifier = 'sources' - from sourceSets.main.allSource, 'build/generated/source/kapt/main', 'build/generated/source/kaptKotlin/main' -} - -task javadocJar(type: Jar, dependsOn: javadoc) { - //noinspection GroovyAccessibility //alternatively replace this with archiveClassifier.set('...') - archiveClassifier = 'javadoc' - from javadoc.destinationDir -} diff --git a/arrow-libs/gradle/setup.gradle b/arrow-libs/gradle/setup.gradle index 464d023255f..82f99d815b7 100644 --- a/arrow-libs/gradle/setup.gradle +++ b/arrow-libs/gradle/setup.gradle @@ -38,7 +38,7 @@ ext.showBanner = { println "" println " A library for Typed Functional Programming in Kotlin" println "" - println " v$VERSION_NAME (Kotlin $KOTLIN_VERSION)" + println " v${project.property('projects.version')} (Kotlin $KOTLIN_VERSION)" println "" println " $rootProject.name $project.gradle.startParameter.taskNames" println "" diff --git a/arrow-libs/gradle/subproject-mpp.gradle b/arrow-libs/gradle/subproject-mpp.gradle deleted file mode 100644 index 626c4903aab..00000000000 --- a/arrow-libs/gradle/subproject-mpp.gradle +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (C) 2020 The Arrow Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -kotlin { - explicitApi() - jvm { - // JVM target ignores Java sources and compiles only Kotlin source files. - // Fix: - withJava() - } - js(IR) { - browser() - nodejs() - } - linuxX64() - - mingwX64() - - macosX64() - macosArm64() - - tvos() - tvosSimulatorArm64() - - watchosArm32() - watchosX86() - watchosX64() - watchosSimulatorArm64() - - iosX64() - iosArm64() - iosArm32() - iosSimulatorArm64() - - targets.all { - compilations.all { - kotlinOptions { - verbose = true - } - } - } - - sourceSets { - commonMain { - dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-common:$KOTLIN_VERSION" - } - } - jvmMain { - dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$KOTLIN_VERSION" - } - } - jvmTest { - dependencies { - runtimeOnly "io.kotest:kotest-runner-junit5:$KOTEST_VERSION" - } - } - jsMain { - dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-js:$KOTLIN_VERSION" - } - } - nativeMain { - dependsOn(commonMain) - macosX64Main.dependsOn(it) - macosArm64Main.dependsOn(it) - mingwX64Main.dependsOn(it) - linuxX64Main.dependsOn(it) - iosX64Main.dependsOn(it) - iosArm64Main.dependsOn(it) - iosArm32Main.dependsOn(it) - iosSimulatorArm64Main.dependsOn(it) - watchosX86Main.dependsOn(it) - watchosArm32Main.dependsOn(it) - watchosX64Main.dependsOn(it) - watchosSimulatorArm64Main.dependsOn(it) - tvosMain.dependsOn(it) - tvosSimulatorArm64Main.dependsOn(it) - } - nativeTest { - dependsOn(commonTest) - macosX64Test.dependsOn(it) - macosArm64Test.dependsOn(it) - mingwX64Test.dependsOn(it) - linuxX64Test.dependsOn(it) - iosX64Test.dependsOn(it) - iosArm64Test.dependsOn(it) - iosArm32Test.dependsOn(it) - iosSimulatorArm64Test.dependsOn(it) - watchosX86Test.dependsOn(it) - watchosArm32Test.dependsOn(it) - watchosX64Test.dependsOn(it) - watchosSimulatorArm64Test.dependsOn(it) - tvosTest.dependsOn(it) - tvosSimulatorArm64Test.dependsOn(it) - } - } -} - -ktlint { - version = KTLINT_VERSION -} - -group = GROUP -archivesBaseName = POM_ARTIFACT_ID - -configurations.all { - resolutionStrategy.cacheChangingModulesFor 0, 'seconds' -} - -tasks.withType(Test) { - maxParallelForks = Runtime.runtime.availableProcessors() -} - -tasks.jvmTest { - useJUnitPlatform() - testLogging { - exceptionFormat 'full' - events "passed", "skipped", "failed", "standardOut", "standardError" - } -} diff --git a/arrow-libs/gradle/subproject.gradle b/arrow-libs/gradle/subproject.gradle deleted file mode 100644 index fa7c321566e..00000000000 --- a/arrow-libs/gradle/subproject.gradle +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2020 The Arrow Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -compileKotlin { - kotlinOptions { - freeCompilerArgs += ["-Xskip-runtime-version-check"] - jvmTarget = "1.8" - } - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} - -compileTestKotlin { - kotlinOptions { - jvmTarget = "1.8" - } - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} - -ktlint { - version = KTLINT_VERSION -} - -clean.doFirst { - delete "${projectDir}/../../../arrow-site/docs/apidocs" -} - -group = GROUP -archivesBaseName = POM_ARTIFACT_ID - -test { - useJUnitPlatform() - testLogging { - exceptionFormat 'full' - events "skipped", "failed", "standardOut", "standardError" - } -} - -configurations.all { - resolutionStrategy.cacheChangingModulesFor 0, 'seconds' -} - -tasks.withType(Test) { - maxParallelForks = Runtime.runtime.availableProcessors() -} - -kotlin { - explicitApi() -} diff --git a/arrow-libs/gradle/wrapper/gradle-wrapper.properties b/arrow-libs/gradle/wrapper/gradle-wrapper.properties index 05679dc3c18..ffed3a254e9 100644 --- a/arrow-libs/gradle/wrapper/gradle-wrapper.properties +++ b/arrow-libs/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/arrow-libs/optics/arrow-optics-test/build.gradle b/arrow-libs/optics/arrow-optics-test/build.gradle deleted file mode 100644 index 55ab8bf95be..00000000000 --- a/arrow-libs/optics/arrow-optics-test/build.gradle +++ /dev/null @@ -1,23 +0,0 @@ -plugins { - id "org.jetbrains.kotlin.multiplatform" - id "org.jlleitschuh.gradle.ktlint" -} - -apply from: "$SUB_PROJECT_MPP" -apply from: "$PUBLICATION_MPP" -apply from: "$ANIMALSNIFFER_MPP" - -kotlin { - sourceSets { - commonMain { - dependencies { - api project(":arrow-optics") - api project(":arrow-core-test") - api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$KOTLINX_COROUTINES_VERSION" - api "io.kotest:kotest-property:$KOTEST_VERSION" - api "io.kotest:kotest-framework-engine:$KOTEST_VERSION" - api "io.kotest:kotest-assertions-core:$KOTEST_VERSION" - } - } - } -} diff --git a/arrow-libs/optics/arrow-optics-test/build.gradle.kts b/arrow-libs/optics/arrow-optics-test/build.gradle.kts new file mode 100644 index 00000000000..db8258b1b10 --- /dev/null +++ b/arrow-libs/optics/arrow-optics-test/build.gradle.kts @@ -0,0 +1,37 @@ +plugins { + alias(libs.plugins.arrowGradleConfig.multiplatform) + alias(libs.plugins.arrowGradleConfig.publishMultiplatform) +} + +apply(from = property("ANIMALSNIFFER_MPP")) + +kotlin { + sourceSets { + commonMain { + dependencies { + api(projects.arrowOptics) + api(projects.arrowCoreTest) + api(libs.coroutines.core) + api(libs.kotest.assertionsCore) + api(libs.kotest.frameworkEngine) + api(libs.kotest.property) + implementation(libs.kotlin.stdlibCommon) + } + } + jvmMain { + dependencies { + implementation(libs.kotlin.stdlibJDK8) + } + } + jvmTest { + dependencies { + runtimeOnly(libs.kotest.runnerJUnit5) + } + } + jsMain { + dependencies { + implementation(libs.kotlin.stdlibJS) + } + } + } +} diff --git a/arrow-libs/optics/arrow-optics-test/gradle.properties b/arrow-libs/optics/arrow-optics-test/gradle.properties index f40cb1a4be1..68b2b448dde 100644 --- a/arrow-libs/optics/arrow-optics-test/gradle.properties +++ b/arrow-libs/optics/arrow-optics-test/gradle.properties @@ -1,5 +1,3 @@ # Maven publishing configuration -POM_NAME=Arrow-Optics-Test -POM_ARTIFACT_ID=arrow-optics-test -POM_PACKAGING=jar +pom.name=Arrow-Optics-Test kapt.incremental.apt=false diff --git a/arrow-libs/optics/arrow-optics/build.gradle b/arrow-libs/optics/arrow-optics/build.gradle deleted file mode 100644 index 396aa2b039c..00000000000 --- a/arrow-libs/optics/arrow-optics/build.gradle +++ /dev/null @@ -1,35 +0,0 @@ -plugins { - id "org.jetbrains.kotlin.multiplatform" - id "org.jetbrains.kotlin.kapt" - id "org.jlleitschuh.gradle.ktlint" -} - -apply plugin: 'io.kotest.multiplatform' - -apply from: "$SUB_PROJECT_MPP" -apply from: "$TEST_COVERAGE" -apply from: "$DOC_CREATION" -apply from: "$PUBLICATION_MPP" -apply from: "$ANIMALSNIFFER_MPP" - -kotlin { - sourceSets { - commonMain { - dependencies { - api project(":arrow-core") - } - } - commonTest { - dependencies { - implementation project(":arrow-optics-test") - } - } - jvmTest { - kotlin.srcDirs += '/build/generated/source/kapt/test' - } - } -} - -dependencies { - "kaptTest"(project(":arrow-meta")) -} diff --git a/arrow-libs/optics/arrow-optics/build.gradle.kts b/arrow-libs/optics/arrow-optics/build.gradle.kts new file mode 100644 index 00000000000..fd655baad60 --- /dev/null +++ b/arrow-libs/optics/arrow-optics/build.gradle.kts @@ -0,0 +1,50 @@ +plugins { + alias(libs.plugins.arrowGradleConfig.multiplatform) + alias(libs.plugins.arrowGradleConfig.publishMultiplatform) + id("org.jetbrains.kotlin.kapt") +} + +apply(plugin = "io.kotest.multiplatform") + +apply(from = property("TEST_COVERAGE")) +apply(from = property("DOC_CREATION")) +apply(from = property("ANIMALSNIFFER_MPP")) + +kotlin { + sourceSets { + commonMain { + dependencies { + api(projects.arrowCore) + implementation(libs.kotlin.stdlibCommon) + } + } + + commonTest { + dependencies { + implementation(projects.arrowOpticsTest) + } + } + + jvmMain { + dependencies { + implementation(libs.kotlin.stdlibJDK8) + } + } + jvmTest { + kotlin.srcDirs("/build/generated/source/kapt/test") + + dependencies { + runtimeOnly(libs.kotest.runnerJUnit5) + } + } + jsMain { + dependencies { + implementation(libs.kotlin.stdlibJS) + } + } + } +} + +dependencies { + "kaptTest"(projects.arrowMeta) +} diff --git a/arrow-libs/optics/arrow-optics/gradle.properties b/arrow-libs/optics/arrow-optics/gradle.properties index cfbf2f7eb90..7c588e83e02 100644 --- a/arrow-libs/optics/arrow-optics/gradle.properties +++ b/arrow-libs/optics/arrow-optics/gradle.properties @@ -1,6 +1,4 @@ # Maven publishing configuration -POM_NAME=Arrow Optics -POM_ARTIFACT_ID=arrow-optics -POM_PACKAGING=jar +pom.name=Arrow Optics # Build configuration kapt.incremental.apt=false diff --git a/arrow-libs/settings.gradle b/arrow-libs/settings.gradle.kts similarity index 63% rename from arrow-libs/settings.gradle rename to arrow-libs/settings.gradle.kts index dc82673beba..26a822e062b 100644 --- a/arrow-libs/settings.gradle +++ b/arrow-libs/settings.gradle.kts @@ -1,7 +1,7 @@ /* This file includes the configuration of 'projectDir' beyond 'include' to - allow to work with: + allow working with: - All the libraries when opening 'arrow-libs' - CORE libraries when opening 'arrow-libs/core' @@ -13,51 +13,67 @@ the number of artifacts in a single task. */ +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") +enableFeaturePreview("VERSION_CATALOGS") -rootProject.name = 'arrow-libs' +rootProject.name = "arrow-libs" + +pluginManagement { + repositories { + gradlePluginPortal() + mavenCentral() + } +} + +dependencyResolutionManagement { + repositories { + mavenCentral() + } +} // Core -include 'arrow-core' -include 'arrow-core-test' -include 'arrow-annotations' -include 'arrow-continuations' -include 'arrow-meta:arrow-meta-test-models' -include 'arrow-meta' -include 'arrow-core-retrofit' +include("arrow-core") +include("arrow-core-test") +include("arrow-annotations") +include("arrow-continuations") +include("arrow-meta:arrow-meta-test-models") +include("arrow-meta") +include("arrow-core-retrofit") project(":arrow-core").projectDir = file("core/arrow-core") project(":arrow-core-test").projectDir = file("core/arrow-core-test") project(":arrow-annotations").projectDir = file("core/arrow-annotations") project(":arrow-continuations").projectDir = file("core/arrow-continuations") -project(":arrow-meta:arrow-meta-test-models").projectDir = file("core/arrow-meta/arrow-meta-test-models") +project(":arrow-meta:arrow-meta-test-models").projectDir = + file("core/arrow-meta/arrow-meta-test-models") project(":arrow-meta").projectDir = file("core/arrow-meta") project(":arrow-core-retrofit").projectDir = file("core/arrow-core-retrofit") // Fx -include 'arrow-fx-coroutines' -include 'arrow-fx-coroutines-test' -include 'arrow-fx-stm' +include("arrow-fx-coroutines") +include("arrow-fx-coroutines-test") +include("arrow-fx-stm") project(":arrow-fx-coroutines").projectDir = file("fx/arrow-fx-coroutines") project(":arrow-fx-coroutines-test").projectDir = file("fx/arrow-fx-coroutines-test") project(":arrow-fx-stm").projectDir = file("fx/arrow-fx-stm") // Optics -include 'arrow-optics' -include 'arrow-optics-test' +include("arrow-optics") +include("arrow-optics-test") project(":arrow-optics").projectDir = file("optics/arrow-optics") project(":arrow-optics-test").projectDir = file("optics/arrow-optics-test") // Ank -include 'arrow-ank' -include 'arrow-ank-gradle' +include("arrow-ank") +include("arrow-ank-gradle") project(":arrow-ank").projectDir = file("ank/arrow-ank") project(":arrow-ank-gradle").projectDir = file("ank/arrow-ank-gradle") -include 'jekyll' +include("jekyll") project(":jekyll").projectDir = file("dokka/jekyll") // Examples -include 'examples' +include("examples")