From 2860c124f9628af4cdf1cb2bddae2f7484697cf4 Mon Sep 17 00:00:00 2001 From: Simon Vergauwen Date: Fri, 26 Apr 2024 13:52:33 +0200 Subject: [PATCH] Maven Publish Plugin (#3410) Co-authored-by: Alejandro Serrano --- .github/unused_workflows/publish.yml | 161 ------------------ .github/workflows/publish.yml | 20 +-- .../core/arrow-annotations/build.gradle.kts | 2 +- .../core/arrow-annotations/gradle.properties | 2 +- arrow-libs/core/arrow-atomic/build.gradle.kts | 2 +- .../core/arrow-atomic/gradle.properties | 2 +- .../core/arrow-autoclose/build.gradle.kts | 2 +- .../core/arrow-autoclose/gradle.properties | 2 +- .../core/arrow-cache4k/build.gradle.kts | 2 +- .../core/arrow-cache4k/gradle.properties | 2 +- .../arrow-core-high-arity/build.gradle.kts | 2 +- .../arrow-core-high-arity/gradle.properties | 2 +- .../core/arrow-core-retrofit/build.gradle.kts | 6 +- .../arrow-core-retrofit/gradle.properties | 2 +- .../arrow-core-serialization/build.gradle.kts | 2 +- .../gradle.properties | 2 +- arrow-libs/core/arrow-core/build.gradle.kts | 2 +- arrow-libs/core/arrow-core/gradle.properties | 2 +- arrow-libs/core/arrow-eval/build.gradle.kts | 2 +- arrow-libs/core/arrow-eval/gradle.properties | 2 +- .../core/arrow-functions/build.gradle.kts | 2 +- .../core/arrow-functions/gradle.properties | 2 +- .../fx/arrow-collectors/build.gradle.kts | 2 +- .../fx/arrow-collectors/gradle.properties | 2 +- .../fx/arrow-fx-coroutines/build.gradle.kts | 2 +- .../fx/arrow-fx-coroutines/gradle.properties | 2 +- arrow-libs/fx/arrow-fx-stm/build.gradle.kts | 2 +- arrow-libs/fx/arrow-fx-stm/gradle.properties | 2 +- .../arrow-optics-compose/build.gradle.kts | 4 +- .../arrow-optics-compose/gradle.properties | 2 +- .../arrow-optics-ksp-plugin/build.gradle.kts | 2 +- .../arrow-optics-ksp-plugin/gradle.properties | 2 +- .../arrow-optics-reflect/build.gradle.kts | 2 +- .../arrow-optics-reflect/gradle.properties | 2 +- .../optics/arrow-optics/build.gradle.kts | 2 +- .../optics/arrow-optics/gradle.properties | 2 +- .../arrow-resilience/build.gradle.kts | 4 +- .../arrow-resilience/gradle.properties | 2 +- arrow-libs/stack/build.gradle.kts | 2 +- arrow-libs/stack/gradle.properties | 2 +- build.gradle.kts | 44 +++-- gradle.properties | 46 +++-- gradle/libs.versions.toml | 6 +- 43 files changed, 101 insertions(+), 260 deletions(-) delete mode 100644 .github/unused_workflows/publish.yml diff --git a/.github/unused_workflows/publish.yml b/.github/unused_workflows/publish.yml deleted file mode 100644 index 5c7aa999eb9..00000000000 --- a/.github/unused_workflows/publish.yml +++ /dev/null @@ -1,161 +0,0 @@ -name: "Publish all libs, Arrow-stack and Docs" - -on: - push: - tags: - - '**' - -env: - BASEDIR: ${{github.workspace}}/arrow-libs - GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-Xmx5g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8" - SONATYPE_USER: ${{ secrets.SONATYPE_USER }} - SONATYPE_PWD: ${{ secrets.SONATYPE_PWD }} - ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_signingKey }} - ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_signingPassword }} - 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 }}' - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_CLOUDFRONT_ID: ${{ secrets.AWS_CLOUDFRONT_ID }} - AWS_DEFAULT_REGION: eu-west-1 - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - JEKYLL_ENV: production - S3_BUCKET: ${{ secrets.S3_BUCKET }} - -jobs: - publish: - timeout-minutes: 90 - runs-on: macos-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Set up Java - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - - - name: assemble - uses: gradle/gradle-build-action@v2 - with: - arguments: assemble -Pkotlin.mpp.enableCompatibilityMetadataVariant=true - - - name: Get Arrow version - id: version - run: echo "::set-output name=arrow::$(head -n 1 build/semver/version.txt)" - - - name: Upload reports - if: failure() - uses: actions/upload-artifact@v3 - with: - name: 'reports-${{ matrix.os }}' - path: '**/build/reports/**' - - - name: Publish alpha/beta/rc version - uses: gradle/gradle-build-action@v2 - if: | - contains(steps.version.outputs.arrow, 'alpha') || - contains(steps.version.outputs.arrow, 'beta') || - contains(steps.version.outputs.arrow, 'rc') - with: - arguments: -Pkotlin.mpp.enableCompatibilityMetadataVariant=true publishToSonatype closeAndReleaseSonatypeStagingRepository - - - name: Publish final version - uses: gradle/gradle-build-action@v2 - if: | - !contains(steps.version.outputs.arrow, 'alpha') && - !contains(steps.version.outputs.arrow, 'beta') && - !contains(steps.version.outputs.arrow, 'rc') - with: - arguments: -Pkotlin.mpp.enableCompatibilityMetadataVariant=true publishToSonatype closeSonatypeStagingRepository - - - name: Prepare environment - working-directory: arrow-site - run: | - mkdir $BASEDIR/logs - brew install tree - bundle config set --local path 'vendor/bundle' - bundle install --gemfile Gemfile - - - name: Create API doc - uses: gradle/gradle-build-action@v2 - with: - arguments: -Pkotlin.mpp.enableCompatibilityMetadataVariant=true dokkaGfm - - - name: Build release directory (/docs) - working-directory: arrow-site - if: | - !contains(steps.version.outputs.arrow, 'alpha') && - !contains(steps.version.outputs.arrow, 'beta') && - !contains(steps.version.outputs.arrow, 'rc') - run: | - bundle exec jekyll build -b docs -s docs - tree _site > $BASEDIR/logs/content_docs-${{ steps.version.outputs.arrow }}.log - - - name: Publish documentation (/docs) - working-directory: arrow-site - if: | - !contains(steps.version.outputs.arrow, 'alpha') && - !contains(steps.version.outputs.arrow, 'beta') && - !contains(steps.version.outputs.arrow, 'rc') - run: | - echo ">>> Latest release" >> $BASEDIR/logs/aws_sync.log - ${GITHUB_WORKSPACE}/.github/scripts/sync-docs-with-aws.sh - - - name: Build release directory (/docs/) - working-directory: arrow-site - if: | - !contains(steps.version.outputs.arrow, 'alpha') && - !contains(steps.version.outputs.arrow, 'beta') && - !contains(steps.version.outputs.arrow, 'rc') - run: | - bundle exec jekyll build -b docs/${{ steps.version.outputs.arrow }} -s docs - tree _site > $BASEDIR/logs/content_docs-${{ steps.version.outputs.arrow }}.log - - - name: Publish release directory (/docs/) - working-directory: arrow-site - if: | - !contains(steps.version.outputs.arrow, 'alpha') && - !contains(steps.version.outputs.arrow, 'beta') && - !contains(steps.version.outputs.arrow, 'rc') - run: | - aws s3 sync _site s3://$S3_BUCKET/docs/${{ steps.version.outputs.arrow }} --delete --exclude "/CNAME" --exclude "/code/*" --exclude "/index.html" --exclude "/redirects.json" >> $BASEDIR/logs/aws_sync.log - - - name: Build latest version (/docs/next) - working-directory: arrow-site - run: | - bundle exec jekyll build -b docs/next -s docs - tree _site > $BASEDIR/logs/content_docs-next.log - - - name: Publish latest version (/docs/next) - working-directory: arrow-site - run: | - aws s3 sync _site s3://$S3_BUCKET/docs/next --delete --exclude "/CNAME" --exclude "/code/*" --exclude "/index.html" --exclude "/redirects.json" >> $BASEDIR/logs/aws_sync.log - - - name: Publish sitemap.xml - if: | - !contains(steps.version.outputs.arrow, 'alpha') && - !contains(steps.version.outputs.arrow, 'beta') && - !contains(steps.version.outputs.arrow, 'rc') - run: | - ${GITHUB_WORKSPACE}/.github/scripts/create-sitemap.sh > sitemap.xml - aws s3 cp sitemap.xml s3://$S3_BUCKET/sitemap.xml >> $BASEDIR/logs/aws_sync.log - - - name: Invalidate CloudFront cache - run: aws cloudfront create-invalidation --distribution-id $AWS_CLOUDFRONT_ID --paths "/*" - - - name: List S3 - run: aws s3 ls s3://$S3_BUCKET --recursive --summarize > $BASEDIR/logs/site-content.log - - - uses: actions/upload-artifact@v3 - with: - name: logs - path: arrow-libs/logs. diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f4ec030fb4d..965f27ffa20 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,16 +2,14 @@ name: "Publish all libs, Arrow-stack and Docs" on: push: - branch: - - 'arrow-2' -#on: -# workflow_dispatch: -# branches: [main] -# inputs: -# version: -# description: 'Version' -# required: true -# type: string + branches: [ main ] + workflow_dispatch: + branches: [ main ] + inputs: + version: + description: 'Version' + required: true + type: string env: BASEDIR: ${{github.workspace}}/arrow-libs @@ -55,4 +53,4 @@ jobs: path: '**/build/reports/**' - name: Publish next major SNAPSHOT version - run: ./gradlew -Pversion=${{ inputs.version }} publishToSonatype closeSonatypeStagingRepository + run: ./gradlew -Pversion=${{ inputs.version }} publish diff --git a/arrow-libs/core/arrow-annotations/build.gradle.kts b/arrow-libs/core/arrow-annotations/build.gradle.kts index cbcaa791e5f..b06c40bd0d9 100644 --- a/arrow-libs/core/arrow-annotations/build.gradle.kts +++ b/arrow-libs/core/arrow-annotations/build.gradle.kts @@ -3,7 +3,7 @@ plugins { id(libs.plugins.kotlin.multiplatform.get().pluginId) alias(libs.plugins.arrowGradleConfig.kotlin) - alias(libs.plugins.arrowGradleConfig.publish) + alias(libs.plugins.publish) alias(libs.plugins.spotless) } diff --git a/arrow-libs/core/arrow-annotations/gradle.properties b/arrow-libs/core/arrow-annotations/gradle.properties index 4a15118ff2b..b1c84fa0748 100644 --- a/arrow-libs/core/arrow-annotations/gradle.properties +++ b/arrow-libs/core/arrow-annotations/gradle.properties @@ -1,2 +1,2 @@ # Maven publishing configuration -pom.name=Arrow Annotations +POM_NAME=Arrow Annotations diff --git a/arrow-libs/core/arrow-atomic/build.gradle.kts b/arrow-libs/core/arrow-atomic/build.gradle.kts index 3db0034dcf0..750a80923ab 100644 --- a/arrow-libs/core/arrow-atomic/build.gradle.kts +++ b/arrow-libs/core/arrow-atomic/build.gradle.kts @@ -5,7 +5,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id(libs.plugins.kotlin.multiplatform.get().pluginId) alias(libs.plugins.arrowGradleConfig.kotlin) - alias(libs.plugins.arrowGradleConfig.publish) + alias(libs.plugins.publish) alias(libs.plugins.kotlinx.kover) alias(libs.plugins.spotless) } diff --git a/arrow-libs/core/arrow-atomic/gradle.properties b/arrow-libs/core/arrow-atomic/gradle.properties index e9b3987e4af..3a73fe3687d 100644 --- a/arrow-libs/core/arrow-atomic/gradle.properties +++ b/arrow-libs/core/arrow-atomic/gradle.properties @@ -1,4 +1,4 @@ # Maven publishing configuration -pom.name=Arrow Atomic +POM_NAME=Arrow Atomic # Build configuration kapt.incremental.apt=false diff --git a/arrow-libs/core/arrow-autoclose/build.gradle.kts b/arrow-libs/core/arrow-autoclose/build.gradle.kts index 8b226eb44c2..eb7de7856a6 100644 --- a/arrow-libs/core/arrow-autoclose/build.gradle.kts +++ b/arrow-libs/core/arrow-autoclose/build.gradle.kts @@ -6,7 +6,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id(libs.plugins.kotlin.multiplatform.get().pluginId) alias(libs.plugins.arrowGradleConfig.kotlin) - alias(libs.plugins.arrowGradleConfig.publish) + alias(libs.plugins.publish) alias(libs.plugins.spotless) } diff --git a/arrow-libs/core/arrow-autoclose/gradle.properties b/arrow-libs/core/arrow-autoclose/gradle.properties index 81f9d59dd34..cdbe5073d01 100644 --- a/arrow-libs/core/arrow-autoclose/gradle.properties +++ b/arrow-libs/core/arrow-autoclose/gradle.properties @@ -1,2 +1,2 @@ # Maven publishing configuration -pom.name=Arrow AutoCloseable +POM_NAME=Arrow AutoCloseable diff --git a/arrow-libs/core/arrow-cache4k/build.gradle.kts b/arrow-libs/core/arrow-cache4k/build.gradle.kts index 4ab996cb97e..f356e50e5d4 100644 --- a/arrow-libs/core/arrow-cache4k/build.gradle.kts +++ b/arrow-libs/core/arrow-cache4k/build.gradle.kts @@ -3,7 +3,7 @@ plugins { `java-library` id(libs.plugins.kotlin.multiplatform.get().pluginId) - alias(libs.plugins.arrowGradleConfig.publish) + alias(libs.plugins.publish) alias(libs.plugins.spotless) } diff --git a/arrow-libs/core/arrow-cache4k/gradle.properties b/arrow-libs/core/arrow-cache4k/gradle.properties index 2a721969556..958434cf3a6 100644 --- a/arrow-libs/core/arrow-cache4k/gradle.properties +++ b/arrow-libs/core/arrow-cache4k/gradle.properties @@ -1,4 +1,4 @@ # Maven publishing configuration -pom.name=Arrow + cache4k +POM_NAME=Arrow + cache4k # Build configuration kapt.incremental.apt=false diff --git a/arrow-libs/core/arrow-core-high-arity/build.gradle.kts b/arrow-libs/core/arrow-core-high-arity/build.gradle.kts index f074a6c5b2d..4be415ff55f 100644 --- a/arrow-libs/core/arrow-core-high-arity/build.gradle.kts +++ b/arrow-libs/core/arrow-core-high-arity/build.gradle.kts @@ -5,7 +5,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id(libs.plugins.kotlin.multiplatform.get().pluginId) alias(libs.plugins.arrowGradleConfig.kotlin) - alias(libs.plugins.arrowGradleConfig.publish) + alias(libs.plugins.publish) alias(libs.plugins.kotlinx.kover) alias(libs.plugins.spotless) } diff --git a/arrow-libs/core/arrow-core-high-arity/gradle.properties b/arrow-libs/core/arrow-core-high-arity/gradle.properties index 69c77227ce6..0516ca6583d 100644 --- a/arrow-libs/core/arrow-core-high-arity/gradle.properties +++ b/arrow-libs/core/arrow-core-high-arity/gradle.properties @@ -1,4 +1,4 @@ # Maven publishing configuration -pom.name=Arrow Core High Arity +POM_NAME=Arrow Core High Arity # Build configuration kapt.incremental.apt=false diff --git a/arrow-libs/core/arrow-core-retrofit/build.gradle.kts b/arrow-libs/core/arrow-core-retrofit/build.gradle.kts index 3b632457569..a2591291de5 100644 --- a/arrow-libs/core/arrow-core-retrofit/build.gradle.kts +++ b/arrow-libs/core/arrow-core-retrofit/build.gradle.kts @@ -3,7 +3,7 @@ plugins { id(libs.plugins.kotlin.jvm.get().pluginId) alias(libs.plugins.arrowGradleConfig.kotlin) - alias(libs.plugins.arrowGradleConfig.publish) + alias(libs.plugins.publish) alias(libs.plugins.kotlinx.serialization) // Needed for testing only alias(libs.plugins.kotlinx.kover) alias(libs.plugins.spotless) @@ -18,8 +18,8 @@ spotless { apply(from = property("ANIMALSNIFFER")) dependencies { - compileOnly(libs.kotlin.stdlib) - compileOnly(projects.arrowCore) + implementation(libs.kotlin.stdlib) + api(projects.arrowCore) compileOnly(libs.squareup.retrofit.lib) testImplementation(projects.arrowCore) diff --git a/arrow-libs/core/arrow-core-retrofit/gradle.properties b/arrow-libs/core/arrow-core-retrofit/gradle.properties index 71cc2b472fd..95f00c8c2a0 100644 --- a/arrow-libs/core/arrow-core-retrofit/gradle.properties +++ b/arrow-libs/core/arrow-core-retrofit/gradle.properties @@ -1,2 +1,2 @@ # Maven publishing configuration -pom.name=Arrow-Core-Retrofit +POM_NAME=Arrow-Core-Retrofit diff --git a/arrow-libs/core/arrow-core-serialization/build.gradle.kts b/arrow-libs/core/arrow-core-serialization/build.gradle.kts index 6ba4450f34f..b5032a523d2 100644 --- a/arrow-libs/core/arrow-core-serialization/build.gradle.kts +++ b/arrow-libs/core/arrow-core-serialization/build.gradle.kts @@ -3,7 +3,7 @@ plugins { id(libs.plugins.kotlin.multiplatform.get().pluginId) alias(libs.plugins.arrowGradleConfig.kotlin) - alias(libs.plugins.arrowGradleConfig.publish) + alias(libs.plugins.kotlinx.kover) alias(libs.plugins.spotless) id(libs.plugins.kotlinx.serialization.get().pluginId) diff --git a/arrow-libs/core/arrow-core-serialization/gradle.properties b/arrow-libs/core/arrow-core-serialization/gradle.properties index 6b320e3d840..63d2ba6e5d9 100644 --- a/arrow-libs/core/arrow-core-serialization/gradle.properties +++ b/arrow-libs/core/arrow-core-serialization/gradle.properties @@ -1,4 +1,4 @@ # Maven publishing configuration -pom.name=Arrow Core Serialization +POM_NAME=Arrow Core Serialization # Build configuration kapt.incremental.apt=false diff --git a/arrow-libs/core/arrow-core/build.gradle.kts b/arrow-libs/core/arrow-core/build.gradle.kts index c1841844ac0..4701e2dbb3a 100644 --- a/arrow-libs/core/arrow-core/build.gradle.kts +++ b/arrow-libs/core/arrow-core/build.gradle.kts @@ -6,7 +6,7 @@ import java.time.Duration plugins { id(libs.plugins.kotlin.multiplatform.get().pluginId) alias(libs.plugins.arrowGradleConfig.kotlin) - alias(libs.plugins.arrowGradleConfig.publish) + alias(libs.plugins.publish) alias(libs.plugins.kotlinx.kover) alias(libs.plugins.spotless) } diff --git a/arrow-libs/core/arrow-core/gradle.properties b/arrow-libs/core/arrow-core/gradle.properties index ebbeba080da..4fc8985825c 100644 --- a/arrow-libs/core/arrow-core/gradle.properties +++ b/arrow-libs/core/arrow-core/gradle.properties @@ -1,4 +1,4 @@ # Maven publishing configuration -pom.name=Arrow Core +POM_NAME=Arrow Core # Build configuration kapt.incremental.apt=false diff --git a/arrow-libs/core/arrow-eval/build.gradle.kts b/arrow-libs/core/arrow-eval/build.gradle.kts index f54932ea495..46c68562995 100644 --- a/arrow-libs/core/arrow-eval/build.gradle.kts +++ b/arrow-libs/core/arrow-eval/build.gradle.kts @@ -3,7 +3,7 @@ plugins { id(libs.plugins.kotlin.multiplatform.get().pluginId) alias(libs.plugins.arrowGradleConfig.kotlin) - alias(libs.plugins.arrowGradleConfig.publish) + alias(libs.plugins.publish) alias(libs.plugins.kotlinx.kover) alias(libs.plugins.spotless) } diff --git a/arrow-libs/core/arrow-eval/gradle.properties b/arrow-libs/core/arrow-eval/gradle.properties index 42ce89e99da..add896d1e87 100644 --- a/arrow-libs/core/arrow-eval/gradle.properties +++ b/arrow-libs/core/arrow-eval/gradle.properties @@ -1,4 +1,4 @@ # Maven publishing configuration -pom.name=Arrow Eval +POM_NAME=Arrow Eval # Build configuration kapt.incremental.apt=false diff --git a/arrow-libs/core/arrow-functions/build.gradle.kts b/arrow-libs/core/arrow-functions/build.gradle.kts index 748b9680ca8..a5b7ca4ab7d 100644 --- a/arrow-libs/core/arrow-functions/build.gradle.kts +++ b/arrow-libs/core/arrow-functions/build.gradle.kts @@ -3,7 +3,7 @@ plugins { id(libs.plugins.kotlin.multiplatform.get().pluginId) alias(libs.plugins.arrowGradleConfig.kotlin) - alias(libs.plugins.arrowGradleConfig.publish) + alias(libs.plugins.publish) alias(libs.plugins.kotlinx.kover) alias(libs.plugins.spotless) } diff --git a/arrow-libs/core/arrow-functions/gradle.properties b/arrow-libs/core/arrow-functions/gradle.properties index 19c64baf9cb..9b550742fd6 100644 --- a/arrow-libs/core/arrow-functions/gradle.properties +++ b/arrow-libs/core/arrow-functions/gradle.properties @@ -1,4 +1,4 @@ # Maven publishing configuration -pom.name=Arrow Functions +POM_NAME=Arrow Functions # Build configuration kapt.incremental.apt=false diff --git a/arrow-libs/fx/arrow-collectors/build.gradle.kts b/arrow-libs/fx/arrow-collectors/build.gradle.kts index 98bd245dbbe..9bd99f8caed 100644 --- a/arrow-libs/fx/arrow-collectors/build.gradle.kts +++ b/arrow-libs/fx/arrow-collectors/build.gradle.kts @@ -5,7 +5,7 @@ import java.time.Duration plugins { id(libs.plugins.kotlin.multiplatform.get().pluginId) alias(libs.plugins.arrowGradleConfig.kotlin) - alias(libs.plugins.arrowGradleConfig.publish) + alias(libs.plugins.publish) alias(libs.plugins.spotless) alias(libs.plugins.kotlinx.kover) } diff --git a/arrow-libs/fx/arrow-collectors/gradle.properties b/arrow-libs/fx/arrow-collectors/gradle.properties index 204dd6f3804..96bf97f2c02 100644 --- a/arrow-libs/fx/arrow-collectors/gradle.properties +++ b/arrow-libs/fx/arrow-collectors/gradle.properties @@ -1,4 +1,4 @@ # Maven publishing configuration -pom.name=Arrow Collectors +POM_NAME=Arrow Collectors # Build configuration kapt.incremental.apt=false diff --git a/arrow-libs/fx/arrow-fx-coroutines/build.gradle.kts b/arrow-libs/fx/arrow-fx-coroutines/build.gradle.kts index 07841a4ff60..dc5673e8672 100644 --- a/arrow-libs/fx/arrow-fx-coroutines/build.gradle.kts +++ b/arrow-libs/fx/arrow-fx-coroutines/build.gradle.kts @@ -6,7 +6,7 @@ import java.time.Duration plugins { id(libs.plugins.kotlin.multiplatform.get().pluginId) alias(libs.plugins.arrowGradleConfig.kotlin) - alias(libs.plugins.arrowGradleConfig.publish) + alias(libs.plugins.publish) alias(libs.plugins.kotlinx.kover) alias(libs.plugins.spotless) } diff --git a/arrow-libs/fx/arrow-fx-coroutines/gradle.properties b/arrow-libs/fx/arrow-fx-coroutines/gradle.properties index 5d283a136e2..ac7b73adc18 100644 --- a/arrow-libs/fx/arrow-fx-coroutines/gradle.properties +++ b/arrow-libs/fx/arrow-fx-coroutines/gradle.properties @@ -1,2 +1,2 @@ # Maven publishing configuration -pom.name=Arrow-Fx-Coroutines +POM_NAME=Arrow-Fx-Coroutines diff --git a/arrow-libs/fx/arrow-fx-stm/build.gradle.kts b/arrow-libs/fx/arrow-fx-stm/build.gradle.kts index a44b7d98dbf..bc604417d2e 100644 --- a/arrow-libs/fx/arrow-fx-stm/build.gradle.kts +++ b/arrow-libs/fx/arrow-fx-stm/build.gradle.kts @@ -6,7 +6,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id(libs.plugins.kotlin.multiplatform.get().pluginId) alias(libs.plugins.arrowGradleConfig.kotlin) - alias(libs.plugins.arrowGradleConfig.publish) + alias(libs.plugins.publish) alias(libs.plugins.kotlinx.kover) alias(libs.plugins.spotless) } diff --git a/arrow-libs/fx/arrow-fx-stm/gradle.properties b/arrow-libs/fx/arrow-fx-stm/gradle.properties index 134a40c3da7..9c5b39749c8 100644 --- a/arrow-libs/fx/arrow-fx-stm/gradle.properties +++ b/arrow-libs/fx/arrow-fx-stm/gradle.properties @@ -1,2 +1,2 @@ # Maven publishing configuration -pom.name=Arrow-Fx-STM +POM_NAME=Arrow-Fx-STM diff --git a/arrow-libs/optics/arrow-optics-compose/build.gradle.kts b/arrow-libs/optics/arrow-optics-compose/build.gradle.kts index 4a10435a93a..8182a80d616 100644 --- a/arrow-libs/optics/arrow-optics-compose/build.gradle.kts +++ b/arrow-libs/optics/arrow-optics-compose/build.gradle.kts @@ -12,7 +12,7 @@ repositories { plugins { id(libs.plugins.kotlin.multiplatform.get().pluginId) // alias(libs.plugins.arrowGradleConfig.kotlin) - alias(libs.plugins.arrowGradleConfig.publish) + alias(libs.plugins.publish) alias(libs.plugins.spotless) alias(libs.plugins.jetbrainsCompose) alias(libs.plugins.android.library) @@ -78,7 +78,7 @@ compose { // override the choice of Compose if we use a Kotlin -dev version val kotlinVersion = project.rootProject.properties["kotlin_version"] as? String if (kotlinVersion != null && kotlinVersion.contains("-dev-")) { - kotlinCompilerPlugin.set(dependencies.compiler.forKotlin("2.0.0-Beta1")) + kotlinCompilerPlugin.set(dependencies.compiler.forKotlin("2.0.0-RC1")) kotlinCompilerPluginArgs.add("suppressKotlinVersionCompatibilityCheck=$kotlinVersion") } } diff --git a/arrow-libs/optics/arrow-optics-compose/gradle.properties b/arrow-libs/optics/arrow-optics-compose/gradle.properties index d569b6effb4..7a8cafdc66e 100644 --- a/arrow-libs/optics/arrow-optics-compose/gradle.properties +++ b/arrow-libs/optics/arrow-optics-compose/gradle.properties @@ -1,4 +1,4 @@ # Maven publishing configuration -pom.name=Arrow Optics for Compose +POM_NAME=Arrow Optics for Compose # Build configuration kapt.incremental.apt=false \ No newline at end of file diff --git a/arrow-libs/optics/arrow-optics-ksp-plugin/build.gradle.kts b/arrow-libs/optics/arrow-optics-ksp-plugin/build.gradle.kts index fc326c9f5d4..6a8c710024a 100644 --- a/arrow-libs/optics/arrow-optics-ksp-plugin/build.gradle.kts +++ b/arrow-libs/optics/arrow-optics-ksp-plugin/build.gradle.kts @@ -3,7 +3,7 @@ plugins { id(libs.plugins.kotlin.jvm.get().pluginId) alias(libs.plugins.arrowGradleConfig.kotlin) - alias(libs.plugins.arrowGradleConfig.publish) + alias(libs.plugins.publish) alias(libs.plugins.kotlinx.kover) alias(libs.plugins.spotless) } diff --git a/arrow-libs/optics/arrow-optics-ksp-plugin/gradle.properties b/arrow-libs/optics/arrow-optics-ksp-plugin/gradle.properties index 76898e2cbd4..3cad06197cf 100644 --- a/arrow-libs/optics/arrow-optics-ksp-plugin/gradle.properties +++ b/arrow-libs/optics/arrow-optics-ksp-plugin/gradle.properties @@ -3,4 +3,4 @@ POM_NAME=Arrow Optics Compiler KSP Plugin POM_ARTIFACT_ID=arrow-optics-ksp-plugin POM_PACKAGING=jar -pom.name=Arrow Optics Compiler KSP Plugin +POM_NAME=Arrow Optics Compiler KSP Plugin diff --git a/arrow-libs/optics/arrow-optics-reflect/build.gradle.kts b/arrow-libs/optics/arrow-optics-reflect/build.gradle.kts index 34c9a211738..a5f2cbcf692 100644 --- a/arrow-libs/optics/arrow-optics-reflect/build.gradle.kts +++ b/arrow-libs/optics/arrow-optics-reflect/build.gradle.kts @@ -3,7 +3,7 @@ plugins { id(libs.plugins.kotlin.jvm.get().pluginId) alias(libs.plugins.arrowGradleConfig.kotlin) - alias(libs.plugins.arrowGradleConfig.publish) + alias(libs.plugins.publish) alias(libs.plugins.kotlinx.kover) alias(libs.plugins.spotless) } diff --git a/arrow-libs/optics/arrow-optics-reflect/gradle.properties b/arrow-libs/optics/arrow-optics-reflect/gradle.properties index 73a39de367f..bc7a92ed517 100644 --- a/arrow-libs/optics/arrow-optics-reflect/gradle.properties +++ b/arrow-libs/optics/arrow-optics-reflect/gradle.properties @@ -1,4 +1,4 @@ # Maven publishing configuration -pom.name=Arrow Optics for Kotlin Reflection +POM_NAME=Arrow Optics for Kotlin Reflection # Build configuration kapt.incremental.apt=false diff --git a/arrow-libs/optics/arrow-optics/build.gradle.kts b/arrow-libs/optics/arrow-optics/build.gradle.kts index 55ad127fd24..d3af169c050 100644 --- a/arrow-libs/optics/arrow-optics/build.gradle.kts +++ b/arrow-libs/optics/arrow-optics/build.gradle.kts @@ -3,7 +3,7 @@ plugins { id(libs.plugins.kotlin.multiplatform.get().pluginId) alias(libs.plugins.arrowGradleConfig.kotlin) - alias(libs.plugins.arrowGradleConfig.publish) + alias(libs.plugins.publish) alias(libs.plugins.kotlinx.kover) alias(libs.plugins.spotless) } diff --git a/arrow-libs/optics/arrow-optics/gradle.properties b/arrow-libs/optics/arrow-optics/gradle.properties index 7c588e83e02..917dc93816a 100644 --- a/arrow-libs/optics/arrow-optics/gradle.properties +++ b/arrow-libs/optics/arrow-optics/gradle.properties @@ -1,4 +1,4 @@ # Maven publishing configuration -pom.name=Arrow Optics +POM_NAME=Arrow Optics # Build configuration kapt.incremental.apt=false diff --git a/arrow-libs/resilience/arrow-resilience/build.gradle.kts b/arrow-libs/resilience/arrow-resilience/build.gradle.kts index 678b74b3a37..4b3e910d765 100644 --- a/arrow-libs/resilience/arrow-resilience/build.gradle.kts +++ b/arrow-libs/resilience/arrow-resilience/build.gradle.kts @@ -3,7 +3,7 @@ plugins { id(libs.plugins.kotlin.multiplatform.get().pluginId) alias(libs.plugins.arrowGradleConfig.kotlin) - alias(libs.plugins.arrowGradleConfig.publish) + alias(libs.plugins.publish) alias(libs.plugins.kotlinx.kover) alias(libs.plugins.spotless) } @@ -19,7 +19,7 @@ kotlin { commonMain { dependencies { api(projects.arrowCore) - compileOnly(libs.kotlin.stdlib) + implementation(libs.kotlin.stdlib) implementation(libs.coroutines.core) } } diff --git a/arrow-libs/resilience/arrow-resilience/gradle.properties b/arrow-libs/resilience/arrow-resilience/gradle.properties index 126162eaf97..e534878b7e7 100644 --- a/arrow-libs/resilience/arrow-resilience/gradle.properties +++ b/arrow-libs/resilience/arrow-resilience/gradle.properties @@ -1,2 +1,2 @@ # Maven publishing configuration -pom.name=Arrow-Fx-Resilience \ No newline at end of file +POM_NAME=Arrow-Fx-Resilience \ No newline at end of file diff --git a/arrow-libs/stack/build.gradle.kts b/arrow-libs/stack/build.gradle.kts index 59d50419fec..fe20d481610 100644 --- a/arrow-libs/stack/build.gradle.kts +++ b/arrow-libs/stack/build.gradle.kts @@ -2,7 +2,7 @@ plugins { `java-platform` - alias(libs.plugins.arrowGradleConfig.publish) + alias(libs.plugins.publish) } diff --git a/arrow-libs/stack/gradle.properties b/arrow-libs/stack/gradle.properties index 5c805c3b564..c21e068e288 100644 --- a/arrow-libs/stack/gradle.properties +++ b/arrow-libs/stack/gradle.properties @@ -1,2 +1,2 @@ # Maven publishing configuration -pom.name=Arrow Stack +POM_NAME=Arrow Stack diff --git a/build.gradle.kts b/build.gradle.kts index f45928a16f2..6c5f257483a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,6 +6,12 @@ import org.jetbrains.dokka.gradle.DokkaTaskPartial import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +allprojects { + if (property("version") == "unspecified") { + setProperty("version", "2.0.0-SNAPSHOT") + } +} + buildscript { repositories { mavenCentral() @@ -44,13 +50,12 @@ plugins { alias(libs.plugins.kotlin.multiplatform) apply false alias(libs.plugins.kotlinx.serialization) apply false alias(libs.plugins.kotlin.binaryCompatibilityValidator) - alias(libs.plugins.arrowGradleConfig.nexus) alias(libs.plugins.spotless) apply false + alias(libs.plugins.publish) apply false alias(libs.plugins.jetbrainsCompose) apply false + alias(libs.plugins.kotlinx.knit) } -apply(plugin = libs.plugins.kotlinx.knit.get().pluginId) - configure { siteRoot = "https://arrow-kt.io/" rootDir = file("arrow-libs") @@ -85,41 +90,49 @@ allprojects { group = property("projects.group").toString() } +private val kotlinXUpstream = + setOf( + "arrow-fx-coroutines", + "arrow-resilience", + "arrow-fx-stm", + "arrow-collectors" + ) + subprojects { - this@subprojects.tasks.withType().configureEach { - this@subprojects.extensions.findByType()?.sourceSets?.forEach { kotlinSourceSet -> + tasks.withType().configureEach { + extensions.findByType()?.sourceSets?.forEach { kotlinSourceSet -> dokkaSourceSets.named(kotlinSourceSet.name) { perPackageOption { matchingRegex.set(".*\\.internal.*") suppress.set(true) } - if (project.name == "arrow-fx-coroutines") externalDocumentationLink("https://kotlinlang.org/api/kotlinx.coroutines/") + if (project.name in kotlinXUpstream) externalDocumentationLink("https://kotlinlang.org/api/kotlinx.coroutines/") skipDeprecated.set(true) reportUndocumented.set(false) - val baseUrl: String = checkNotNull(properties["pom.smc.url"]?.toString()) kotlinSourceSet.kotlin.srcDirs.filter { it.exists() }.forEach { srcDir -> sourceLink { localDirectory.set(srcDir) - remoteUrl.set(uri("$baseUrl/blob/main/${srcDir.relativeTo(rootProject.rootDir)}").toURL()) +remoteUrl.set(uri("https://github.com/arrow-kt/arrow/blob/main/${srcDir.relativeTo(rootProject.rootDir)}").toURL()) remoteLineSuffix.set("#L") } } } } } - - tasks.withType { - dependsOn(tasks.withType()) - } } tasks { val undocumentedProjects = listOf(project(":arrow-optics-ksp-plugin")) + val copyCNameFile = register("copyCNameFile") { + from(layout.projectDirectory.dir("static").file("CNAME")) + into(layout.projectDirectory.dir("docs")) + } + dokkaHtmlMultiModule { - dependsOn("copyCNameFile") + dependsOn(copyCNameFile) removeChildTasks(undocumentedProjects) } @@ -129,11 +142,6 @@ tasks { outputDirectory.set(file("docs")) moduleName.set("Arrow") } - - register("copyCNameFile") { - from(layout.projectDirectory.dir("static").file("CNAME")) - into(layout.projectDirectory.dir("docs")) - } } apiValidation { diff --git a/gradle.properties b/gradle.properties index 4bc9a0ebb16..1ec4a579517 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,41 +1,37 @@ # Package definitions projects.group=io.arrow-kt +projects.version=2.0.0-SNAPSHOT + # Pomfile definitions -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 +#RELEASE_SIGNING_ENABLED=true + +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_LICENSE_DIST=repo + +POM_DEVELOPER_ID=arrow-kt +POM_DEVELOPER_NAME=The Arrow Authors +POM_DEVELOPER_URL=https://github.com/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 + # Gradle options org.gradle.jvmargs=-Xmx4g org.gradle.parallel=true + # To disable publishing of sha-512 checksums for maven-metadata.xml files systemProp.org.gradle.internal.publish.checksums.insecure=true + # Kotlin configuration -kotlin.incremental=true -# Kotlin Test configuration -#Parallelism needs to be set to 1 since the concurrent tests in arrow-effects become flaky otherwise -kotest.framework.parallelism=1 -kapt.incremental.apt=false kotlin.stdlib.default.dependency=false -kotlin.mpp.stability.nowarn=true -# https://youtrack.jetbrains.com/issue/KT-32476 -kotlin.native.ignoreIncorrectDependencies=true -kotlin.native.ignoreDisabledTargets=true -# kotlin.native.cacheKind.linuxX64=none -# https://youtrack.jetbrains.com/issue/KT-45545#focus=Comments-27-4773544.0-0 -kapt.use.worker.api=false kotlin.mpp.applyDefaultHierarchyTemplate=false -COMMON_SETUP=../gradle/setup.gradle -ROOT_PROJECT=../gradle/main.gradle ANIMALSNIFFER=../../gradle/animalsniffer.gradle ANIMALSNIFFER_MPP=../../gradle/animalsniffer-mpp.gradle -dokkaEnabled=false - android.useAndroidX=true \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3b54dbfeb00..e586364443f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -19,9 +19,10 @@ moshi = "1.15.1" spotlessVersion = "6.25.0" compose = "1.6.6" composePlugin = "1.6.2" -agp = "8.3.2" +agp = "8.2.2" android-compileSdk = "34" cache4k = "0.13.0" +publish="0.28.0" [libraries] coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" } @@ -52,9 +53,8 @@ cache4k = { module = "io.github.reactivecircus.cache4k:cache4k", version.ref = " animalSniffer = { id = "ru.vyarus.animalsniffer", version.ref = "animalSniffer" } arrowGradleConfig-formatter = { id = "io.arrow-kt.arrow-gradle-config-formatter", version.ref = "arrowGradleConfig" } arrowGradleConfig-kotlin = { id = "io.arrow-kt.arrow-gradle-config-kotlin", version.ref = "arrowGradleConfig" } -arrowGradleConfig-nexus = { id = "io.arrow-kt.arrow-gradle-config-nexus", version.ref = "arrowGradleConfig" } arrowGradleConfig-publish = { id = "io.arrow-kt.arrow-gradle-config-publish", version.ref = "arrowGradleConfig" } -arrowGradleConfig-versioning = { id = "io.arrow-kt.arrow-gradle-config-versioning", version.ref = "arrowGradleConfig" } +publish = { id = "com.vanniktech.maven.publish", version.ref="publish" } dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }