From 19015dcb2aad477fc796a7b4456126b4c58f5880 Mon Sep 17 00:00:00 2001 From: danicheg Date: Sun, 20 Aug 2023 10:13:54 +0300 Subject: [PATCH 01/12] Tweak to the filename in Scala Native sources --- native/src/main/scala-2/mouse/{mouse.scala => package.scala} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename native/src/main/scala-2/mouse/{mouse.scala => package.scala} (100%) diff --git a/native/src/main/scala-2/mouse/mouse.scala b/native/src/main/scala-2/mouse/package.scala similarity index 100% rename from native/src/main/scala-2/mouse/mouse.scala rename to native/src/main/scala-2/mouse/package.scala From 4c9c453515bf5890ce687a004415757739d0c51f Mon Sep 17 00:00:00 2001 From: danicheg Date: Sun, 20 Aug 2023 10:27:35 +0300 Subject: [PATCH 02/12] Tweak DEV.md --- DEV.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEV.md b/DEV.md index 43666add..ef4733ea 100644 --- a/DEV.md +++ b/DEV.md @@ -15,7 +15,7 @@ short or generic names if possible. However, for new operations, simply providing a lazy by-name variant is often the best choice unless there are clear reasons (eg performance impact) for needing an eager variant. -### Release Process +## Release Process Mouse uses Github Actions, https://github.com/djspiewak/sbt-github-actions and https://github.com/typelevel/sbt-typelevel for CI releases. Use the Github Create Release feature to tag a release, and it will publish to Sonatype automatically (using @benhutchison credentials). From 1aeb690bb9886ab3fb88e2a34651f64a06b4d89f Mon Sep 17 00:00:00 2001 From: danicheg Date: Sun, 20 Aug 2023 10:28:02 +0300 Subject: [PATCH 03/12] Add section about choosing base branch to the DEV.md --- DEV.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/DEV.md b/DEV.md index ef4733ea..70463d89 100644 --- a/DEV.md +++ b/DEV.md @@ -20,3 +20,11 @@ However, for new operations, simply providing a lazy by-name variant is often th Mouse uses Github Actions, https://github.com/djspiewak/sbt-github-actions and https://github.com/typelevel/sbt-typelevel for CI releases. Use the Github Create Release feature to tag a release, and it will publish to Sonatype automatically (using @benhutchison credentials). sbt-release and sbt-ci-release is no longer in use. + +## Choosing the appropriate base branch + +There are two options for choosing a base branch for your PRs: + +* Use the `main` branch if you would like to deliver changes within the `1.x` series. It's for binary-compatible changes only. + +* Use the `series/2.x` branch if you would like to deliver changes within the `2.x` series. It's for non-binary-compatible changes and basically stands for the next major `mouse` release. From 2cf472568cedc127faaa0fa1010469be62c7a95e Mon Sep 17 00:00:00 2001 From: danicheg Date: Sun, 20 Aug 2023 10:29:15 +0300 Subject: [PATCH 04/12] Update site docs as well --- docs/contributing-guide.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/contributing-guide.md b/docs/contributing-guide.md index 965f129a..34044251 100644 --- a/docs/contributing-guide.md +++ b/docs/contributing-guide.md @@ -23,6 +23,14 @@ Mouse uses Github Actions, [sbt-github-actions] and [sbt-typelevel] for CI relea Use the Github Create Release feature to tag a release, and it will publish to Sonatype automatically (using @benhutchison credentials). +### Choosing the appropriate base branch + +There are two options for choosing a base branch for your PRs: + +* Use the `main` branch if you would like to deliver changes within the `1.x` series. It's for binary-compatible changes only. + +* Use the `series/2.x` branch if you would like to deliver changes within the `2.x` series. It's for non-binary-compatible changes and basically stands for the next major `mouse` release. + [sbt-github-actions]: https://github.com/djspiewak/sbt-github-actions [sbt-typelevel]: https://github.com/typelevel/sbt-typelevel From b90d9e7043779e6687912ed0dc8238f71a0a3d9b Mon Sep 17 00:00:00 2001 From: danicheg Date: Sun, 20 Aug 2023 10:52:26 +0300 Subject: [PATCH 05/12] Tweak the contributing guide one more time --- DEV.md | 2 +- docs/contributing-guide.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEV.md b/DEV.md index 70463d89..ae0e2746 100644 --- a/DEV.md +++ b/DEV.md @@ -21,7 +21,7 @@ Mouse uses Github Actions, https://github.com/djspiewak/sbt-github-actions and h sbt-release and sbt-ci-release is no longer in use. -## Choosing the appropriate base branch +## Choosing an Appropriate Base Branch There are two options for choosing a base branch for your PRs: diff --git a/docs/contributing-guide.md b/docs/contributing-guide.md index 34044251..40dce85b 100644 --- a/docs/contributing-guide.md +++ b/docs/contributing-guide.md @@ -23,7 +23,7 @@ Mouse uses Github Actions, [sbt-github-actions] and [sbt-typelevel] for CI relea Use the Github Create Release feature to tag a release, and it will publish to Sonatype automatically (using @benhutchison credentials). -### Choosing the appropriate base branch +### Choosing an Appropriate Base Branch There are two options for choosing a base branch for your PRs: From 3209f9c6fb8857d1f75629e38e7da129b712d064 Mon Sep 17 00:00:00 2001 From: "typelevel-steward[bot]" <106827141+typelevel-steward[bot]@users.noreply.github.com> Date: Wed, 23 Aug 2023 00:36:33 +0000 Subject: [PATCH 06/12] Update sbt-typelevel, sbt-typelevel-site to 0.5.0 --- project/plugins.sbt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 91ecb3f4..194008a4 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -2,5 +2,5 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.13.2") addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2") addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.14") addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2") -addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.4.22") -addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % "0.4.22") +addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.5.0") +addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % "0.5.0") From 24025c7e89106bfeb1e048f6cdeb300433314f66 Mon Sep 17 00:00:00 2001 From: "typelevel-steward[bot]" <106827141+typelevel-steward[bot]@users.noreply.github.com> Date: Wed, 23 Aug 2023 00:37:18 +0000 Subject: [PATCH 07/12] Run prePR with sbt-typelevel Executed command: sbt tlPrePrBotHook --- .github/workflows/ci.yml | 255 ++++++++++++++++++++------------------- 1 file changed, 129 insertions(+), 126 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a680539..bdaf7a91 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,81 +15,64 @@ on: tags: [v*] env: - PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }} - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} - PGP_SECRET: ${{ secrets.PGP_SECRET }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +concurrency: + group: ${{ github.workflow }} @ ${{ github.ref }} + cancel-in-progress: true + jobs: build: name: Build and Test strategy: matrix: os: [ubuntu-22.04] - scala: [2.12.18, 3.3.0, 2.13.11] + scala: [2.12, 3, 2.13] java: [temurin@8, temurin@17] project: [rootJS, rootJVM, rootNative] exclude: - - scala: 2.12.18 + - scala: 2.12 java: temurin@17 - - scala: 3.3.0 + - scala: 3 java: temurin@17 - project: rootJS java: temurin@17 - project: rootNative java: temurin@17 runs-on: ${{ matrix.os }} + timeout-minutes: 60 steps: - name: Checkout current branch (full) uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Download Java (temurin@8) - id: download-java-temurin-8 - if: matrix.java == 'temurin@8' - uses: typelevel/download-java@v2 - with: - distribution: temurin - java-version: 8 - - name: Setup Java (temurin@8) + id: setup-java-temurin-8 if: matrix.java == 'temurin@8' uses: actions/setup-java@v3 with: - distribution: jdkfile + distribution: temurin java-version: 8 - jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }} + cache: sbt - - name: Download Java (temurin@17) - id: download-java-temurin-17 - if: matrix.java == 'temurin@17' - uses: typelevel/download-java@v2 - with: - distribution: temurin - java-version: 17 + - name: sbt update + if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false' + run: sbt +update - name: Setup Java (temurin@17) + id: setup-java-temurin-17 if: matrix.java == 'temurin@17' uses: actions/setup-java@v3 with: - distribution: jdkfile + distribution: temurin java-version: 17 - jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }} + cache: sbt - - name: Cache sbt - uses: actions/cache@v3 - with: - path: | - ~/.sbt - ~/.ivy2/cache - ~/.coursier/cache/v1 - ~/.cache/coursier/v1 - ~/AppData/Local/Coursier/Cache/v1 - ~/Library/Caches/Coursier/v1 - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + - name: sbt update + if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false' + run: sbt +update - name: Check that workflows are up to date run: sbt githubWorkflowCheck @@ -119,11 +102,11 @@ jobs: - name: Make target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') - run: mkdir -p js/target target .js/target site/target jvm/target .jvm/target .native/target native/target project/target + run: mkdir -p js/target jvm/target native/target project/target - name: Compress target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') - run: tar cf targets.tar js/target target .js/target site/target jvm/target .jvm/target .native/target native/target project/target + run: tar cf targets.tar js/target jvm/target native/target project/target - name: Upload target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') @@ -147,156 +130,149 @@ jobs: with: fetch-depth: 0 - - name: Download Java (temurin@8) - id: download-java-temurin-8 - if: matrix.java == 'temurin@8' - uses: typelevel/download-java@v2 - with: - distribution: temurin - java-version: 8 - - name: Setup Java (temurin@8) + id: setup-java-temurin-8 if: matrix.java == 'temurin@8' uses: actions/setup-java@v3 with: - distribution: jdkfile + distribution: temurin java-version: 8 - jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }} + cache: sbt - - name: Download Java (temurin@17) - id: download-java-temurin-17 - if: matrix.java == 'temurin@17' - uses: typelevel/download-java@v2 - with: - distribution: temurin - java-version: 17 + - name: sbt update + if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false' + run: sbt +update - name: Setup Java (temurin@17) + id: setup-java-temurin-17 if: matrix.java == 'temurin@17' uses: actions/setup-java@v3 with: - distribution: jdkfile + distribution: temurin java-version: 17 - jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }} + cache: sbt - - name: Cache sbt - uses: actions/cache@v3 - with: - path: | - ~/.sbt - ~/.ivy2/cache - ~/.coursier/cache/v1 - ~/.cache/coursier/v1 - ~/AppData/Local/Coursier/Cache/v1 - ~/Library/Caches/Coursier/v1 - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - - - name: Download target directories (2.12.18, rootJS) + - name: sbt update + if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false' + run: sbt +update + + - name: Download target directories (2.12, rootJS) uses: actions/download-artifact@v3 with: - name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.18-rootJS + name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootJS - - name: Inflate target directories (2.12.18, rootJS) + - name: Inflate target directories (2.12, rootJS) run: | tar xf targets.tar rm targets.tar - - name: Download target directories (2.12.18, rootJVM) + - name: Download target directories (2.12, rootJVM) uses: actions/download-artifact@v3 with: - name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.18-rootJVM + name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootJVM - - name: Inflate target directories (2.12.18, rootJVM) + - name: Inflate target directories (2.12, rootJVM) run: | tar xf targets.tar rm targets.tar - - name: Download target directories (2.12.18, rootNative) + - name: Download target directories (2.12, rootNative) uses: actions/download-artifact@v3 with: - name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.18-rootNative + name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootNative - - name: Inflate target directories (2.12.18, rootNative) + - name: Inflate target directories (2.12, rootNative) run: | tar xf targets.tar rm targets.tar - - name: Download target directories (3.3.0, rootJS) + - name: Download target directories (3, rootJS) uses: actions/download-artifact@v3 with: - name: target-${{ matrix.os }}-${{ matrix.java }}-3.3.0-rootJS + name: target-${{ matrix.os }}-${{ matrix.java }}-3-rootJS - - name: Inflate target directories (3.3.0, rootJS) + - name: Inflate target directories (3, rootJS) run: | tar xf targets.tar rm targets.tar - - name: Download target directories (3.3.0, rootJVM) + - name: Download target directories (3, rootJVM) uses: actions/download-artifact@v3 with: - name: target-${{ matrix.os }}-${{ matrix.java }}-3.3.0-rootJVM + name: target-${{ matrix.os }}-${{ matrix.java }}-3-rootJVM - - name: Inflate target directories (3.3.0, rootJVM) + - name: Inflate target directories (3, rootJVM) run: | tar xf targets.tar rm targets.tar - - name: Download target directories (3.3.0, rootNative) + - name: Download target directories (3, rootNative) uses: actions/download-artifact@v3 with: - name: target-${{ matrix.os }}-${{ matrix.java }}-3.3.0-rootNative + name: target-${{ matrix.os }}-${{ matrix.java }}-3-rootNative - - name: Inflate target directories (3.3.0, rootNative) + - name: Inflate target directories (3, rootNative) run: | tar xf targets.tar rm targets.tar - - name: Download target directories (2.13.11, rootJS) + - name: Download target directories (2.13, rootJS) uses: actions/download-artifact@v3 with: - name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.11-rootJS + name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootJS - - name: Inflate target directories (2.13.11, rootJS) + - name: Inflate target directories (2.13, rootJS) run: | tar xf targets.tar rm targets.tar - - name: Download target directories (2.13.11, rootJVM) + - name: Download target directories (2.13, rootJVM) uses: actions/download-artifact@v3 with: - name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.11-rootJVM + name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootJVM - - name: Inflate target directories (2.13.11, rootJVM) + - name: Inflate target directories (2.13, rootJVM) run: | tar xf targets.tar rm targets.tar - - name: Download target directories (2.13.11, rootNative) + - name: Download target directories (2.13, rootNative) uses: actions/download-artifact@v3 with: - name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.11-rootNative + name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootNative - - name: Inflate target directories (2.13.11, rootNative) + - name: Inflate target directories (2.13, rootNative) run: | tar xf targets.tar rm targets.tar - name: Import signing key if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == '' + env: + PGP_SECRET: ${{ secrets.PGP_SECRET }} + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} run: echo $PGP_SECRET | base64 -di | gpg --import - name: Import signing key and strip passphrase if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != '' + env: + PGP_SECRET: ${{ secrets.PGP_SECRET }} + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} run: | echo "$PGP_SECRET" | base64 -di > /tmp/signing-key.gpg echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg (echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1) - name: Publish + env: + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }} run: sbt tlCiRelease - site: - name: Generate Site + dependency-submission: + name: Submit Dependencies + if: github.event_name != 'pull_request' strategy: matrix: os: [ubuntu-latest] @@ -308,56 +284,83 @@ jobs: with: fetch-depth: 0 - - name: Download Java (temurin@8) - id: download-java-temurin-8 + - name: Setup Java (temurin@8) + id: setup-java-temurin-8 if: matrix.java == 'temurin@8' - uses: typelevel/download-java@v2 + uses: actions/setup-java@v3 with: distribution: temurin java-version: 8 + cache: sbt + + - name: sbt update + if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false' + run: sbt +update + + - name: Setup Java (temurin@17) + id: setup-java-temurin-17 + if: matrix.java == 'temurin@17' + uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 17 + cache: sbt + + - name: sbt update + if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false' + run: sbt +update + + - name: Submit Dependencies + uses: scalacenter/sbt-dependency-submission@v2 + with: + modules-ignore: mouse_2.12 mouse_3 mouse_2.13 docs_2.12 docs_3 docs_2.13 mouse_2.12 mouse_3 mouse_2.13 mouse_2.12 mouse_3 mouse_2.13 + configs-ignore: test scala-tool scala-doc-tool test-internal + + site: + name: Generate Site + strategy: + matrix: + os: [ubuntu-latest] + java: [temurin@8] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout current branch (full) + uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Setup Java (temurin@8) + id: setup-java-temurin-8 if: matrix.java == 'temurin@8' uses: actions/setup-java@v3 with: - distribution: jdkfile + distribution: temurin java-version: 8 - jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }} + cache: sbt - - name: Download Java (temurin@17) - id: download-java-temurin-17 - if: matrix.java == 'temurin@17' - uses: typelevel/download-java@v2 - with: - distribution: temurin - java-version: 17 + - name: sbt update + if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false' + run: sbt +update - name: Setup Java (temurin@17) + id: setup-java-temurin-17 if: matrix.java == 'temurin@17' uses: actions/setup-java@v3 with: - distribution: jdkfile + distribution: temurin java-version: 17 - jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }} + cache: sbt - - name: Cache sbt - uses: actions/cache@v3 - with: - path: | - ~/.sbt - ~/.ivy2/cache - ~/.coursier/cache/v1 - ~/.cache/coursier/v1 - ~/AppData/Local/Coursier/Cache/v1 - ~/Library/Caches/Coursier/v1 - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + - name: sbt update + if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false' + run: sbt +update - name: Generate site run: sbt docs/tlSite - name: Publish site if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' - uses: peaceiris/actions-gh-pages@v3.9.0 + uses: peaceiris/actions-gh-pages@v3.9.3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: site/target/docs/site From f25fcaef862e44741d0e5b3834cd17e7babd87f3 Mon Sep 17 00:00:00 2001 From: danicheg Date: Wed, 23 Aug 2023 11:00:22 +0300 Subject: [PATCH 08/12] Work around an issue with package object inheritance --- js/src/main/scala-2/mouse/package.scala | 6 +++++- jvm/src/main/scala-2/src/main/scala/mouse/package.scala | 6 +++++- native/src/main/scala-2/mouse/package.scala | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/js/src/main/scala-2/mouse/package.scala b/js/src/main/scala-2/mouse/package.scala index 9bb58ec9..2ceb7f63 100644 --- a/js/src/main/scala-2/mouse/package.scala +++ b/js/src/main/scala-2/mouse/package.scala @@ -18,8 +18,12 @@ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +package mouse -package object mouse extends MouseFunctions { +import org.typelevel.scalaccompat.annotation._ + +@nowarn213("msg=package object inheritance is deprecated") +object `package` extends MouseFunctions { object all extends AllSharedSyntax with AllJsSyntax object any extends AnySyntax object anyf extends AnyFSyntax diff --git a/jvm/src/main/scala-2/src/main/scala/mouse/package.scala b/jvm/src/main/scala-2/src/main/scala/mouse/package.scala index abe4a150..fb6f4d05 100644 --- a/jvm/src/main/scala-2/src/main/scala/mouse/package.scala +++ b/jvm/src/main/scala-2/src/main/scala/mouse/package.scala @@ -18,8 +18,12 @@ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +package mouse -package object mouse extends MouseFunctions { +import org.typelevel.scalaccompat.annotation._ + +@nowarn213("msg=package object inheritance is deprecated") +object `package` extends MouseFunctions { object all extends AllSharedSyntax with AllJvmSyntax object any extends AnySyntax object anyf extends AnyFSyntax diff --git a/native/src/main/scala-2/mouse/package.scala b/native/src/main/scala-2/mouse/package.scala index 2a68b410..adc0a6bb 100644 --- a/native/src/main/scala-2/mouse/package.scala +++ b/native/src/main/scala-2/mouse/package.scala @@ -18,8 +18,12 @@ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +package mouse -package object mouse extends MouseFunctions { +import org.typelevel.scalaccompat.annotation._ + +@nowarn213("msg=package object inheritance is deprecated") +object `package` extends MouseFunctions { object all extends AllSharedSyntax object any extends AnySyntax object anyf extends AnyFSyntax From 6daa3fdebb31c52e9eb5923b0399f2f2e50bd430 Mon Sep 17 00:00:00 2001 From: danicheg Date: Wed, 23 Aug 2023 11:06:41 +0300 Subject: [PATCH 09/12] Fix OptionSyntaxTest and TrySyntaxTest for Scala 2.12 --- shared/src/test/scala/mouse/OptionSyntaxTest.scala | 3 ++- shared/src/test/scala/mouse/TrySyntaxTest.scala | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/shared/src/test/scala/mouse/OptionSyntaxTest.scala b/shared/src/test/scala/mouse/OptionSyntaxTest.scala index 3db1c953..94358c4b 100644 --- a/shared/src/test/scala/mouse/OptionSyntaxTest.scala +++ b/shared/src/test/scala/mouse/OptionSyntaxTest.scala @@ -21,12 +21,13 @@ package mouse +import org.typelevel.scalaccompat.annotation._ import scala.annotation.nowarn import scala.util.{Failure, Success} class OptionSyntaxTest extends MouseSuite { implicit class ExtraTest[A](a: A) { - def shouldBeA[T](implicit ev: T =:= A): Unit = () + def shouldBeA[T](implicit @nowarn212 ev: T =:= A): Unit = () } test("OptionSyntax.cata") { diff --git a/shared/src/test/scala/mouse/TrySyntaxTest.scala b/shared/src/test/scala/mouse/TrySyntaxTest.scala index 35a706b0..47b8a532 100644 --- a/shared/src/test/scala/mouse/TrySyntaxTest.scala +++ b/shared/src/test/scala/mouse/TrySyntaxTest.scala @@ -23,6 +23,7 @@ package mouse import cats.syntax.eq._ +import org.typelevel.scalaccompat.annotation._ import org.scalacheck.Gen import org.scalacheck.Prop._ @@ -73,7 +74,7 @@ class TrySyntaxTest extends MouseSuite { } implicit class ExtraTest[A](a: A) { - def shouldBeA[T](implicit ev: T =:= A): Unit = () + def shouldBeA[T](implicit @nowarn212 ev: T =:= A): Unit = () } property("toEither") { From 4edd2c7440296900b546f77f62bb97305939094d Mon Sep 17 00:00:00 2001 From: danicheg Date: Wed, 23 Aug 2023 11:28:41 +0300 Subject: [PATCH 10/12] Fix DoubleSyntaxTest, IntSyntaxTest, LongSyntaxTest --- shared/src/test/scala/mouse/DoubleSyntaxTest.scala | 5 +++-- shared/src/test/scala/mouse/IntSyntaxTest.scala | 2 +- shared/src/test/scala/mouse/LongSyntaxTest.scala | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/shared/src/test/scala/mouse/DoubleSyntaxTest.scala b/shared/src/test/scala/mouse/DoubleSyntaxTest.scala index 1f741344..98f8df22 100644 --- a/shared/src/test/scala/mouse/DoubleSyntaxTest.scala +++ b/shared/src/test/scala/mouse/DoubleSyntaxTest.scala @@ -23,8 +23,9 @@ package mouse class DoubleSyntaxTest extends MouseSuite { test("DoubleSyntax.toByteArray") { - assert( - 123456789.123456789.toByteArray.sameElements(Array(65, -99, 111, 52, 84, 126, 107, 117)) + assertEquals( + 123456789.123456789.toByteArray.toSeq, + Array[Byte](65, -99, 111, 52, 84, 126, 107, 117).toSeq ) } diff --git a/shared/src/test/scala/mouse/IntSyntaxTest.scala b/shared/src/test/scala/mouse/IntSyntaxTest.scala index 800340f0..d53e65c7 100644 --- a/shared/src/test/scala/mouse/IntSyntaxTest.scala +++ b/shared/src/test/scala/mouse/IntSyntaxTest.scala @@ -23,7 +23,7 @@ package mouse class IntSyntaxTest extends MouseSuite { test("IntSyntax.toByteArray") { - assert(123456789.toByteArray.sameElements(Array(7, 91, -51, 21))) + assertEquals(123456789.toByteArray.toSeq, Array[Byte](7, 91, -51, 21).toSeq) } test("IntSyntax.toBase64") { diff --git a/shared/src/test/scala/mouse/LongSyntaxTest.scala b/shared/src/test/scala/mouse/LongSyntaxTest.scala index 19cd0631..99e8d81d 100644 --- a/shared/src/test/scala/mouse/LongSyntaxTest.scala +++ b/shared/src/test/scala/mouse/LongSyntaxTest.scala @@ -23,8 +23,9 @@ package mouse class LongSyntaxTest extends MouseSuite { test("LongSyntax.toByteArray") { - assert( - 123456789123456789L.toByteArray.sameElements(Array(1, -74, -101, 75, -84, -48, 95, 21)) + assertEquals( + 123456789123456789L.toByteArray.toSeq, + Array[Byte](1, -74, -101, 75, -84, -48, 95, 21).toSeq ) } From 9a2733ee7941a1d4276a98ac8c9e90bd113e46da Mon Sep 17 00:00:00 2001 From: danicheg Date: Wed, 23 Aug 2023 11:31:50 +0300 Subject: [PATCH 11/12] Create headers --- js/src/main/scala-2/mouse/package.scala | 1 + jvm/src/main/scala-2/src/main/scala/mouse/package.scala | 1 + native/src/main/scala-2/mouse/package.scala | 1 + 3 files changed, 3 insertions(+) diff --git a/js/src/main/scala-2/mouse/package.scala b/js/src/main/scala-2/mouse/package.scala index 2ceb7f63..04582dab 100644 --- a/js/src/main/scala-2/mouse/package.scala +++ b/js/src/main/scala-2/mouse/package.scala @@ -18,6 +18,7 @@ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + package mouse import org.typelevel.scalaccompat.annotation._ diff --git a/jvm/src/main/scala-2/src/main/scala/mouse/package.scala b/jvm/src/main/scala-2/src/main/scala/mouse/package.scala index fb6f4d05..4fa11916 100644 --- a/jvm/src/main/scala-2/src/main/scala/mouse/package.scala +++ b/jvm/src/main/scala-2/src/main/scala/mouse/package.scala @@ -18,6 +18,7 @@ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + package mouse import org.typelevel.scalaccompat.annotation._ diff --git a/native/src/main/scala-2/mouse/package.scala b/native/src/main/scala-2/mouse/package.scala index adc0a6bb..07b9fbd3 100644 --- a/native/src/main/scala-2/mouse/package.scala +++ b/native/src/main/scala-2/mouse/package.scala @@ -18,6 +18,7 @@ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + package mouse import org.typelevel.scalaccompat.annotation._ From 9e38477e3159dc9e1f8e23d38b120c6f1b7adc53 Mon Sep 17 00:00:00 2001 From: danicheg Date: Wed, 23 Aug 2023 12:04:03 +0300 Subject: [PATCH 12/12] Regenerate ci.yml --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46dabd5b..298cf78d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,11 +101,11 @@ jobs: run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' doc - name: Make target directories - if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/series/2.x') run: mkdir -p js/target jvm/target native/target project/target - name: Compress target directories - if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/series/2.x') run: tar cf targets.tar js/target jvm/target native/target project/target - name: Upload target directories