From c5dbc42496949c1a9fb2c370d9773047a42ee590 Mon Sep 17 00:00:00 2001 From: Salomon BRYS Date: Mon, 6 Jul 2020 21:45:17 +0200 Subject: [PATCH] Kotlin 1.4-M3, fixed CI glitches & fixed build on Mac (#4) * Kotlin 1.4-M3, fixed CI glitches & fixed build on Mac * Fixes https://github.com/eskatos/gradle-command-action/issues/24 * Explicit mode requirements in Android tests Co-authored-by: Salomon BRYS --- .github/workflows/release.yml | 6 ++-- .github/workflows/snapshot.yml | 10 ++++--- .github/workflows/test.yml | 28 ++++++++++++------- README.md | 2 +- build.gradle.kts | 4 +-- jni/build.sh | 5 ++-- src/nativeInterop/cinterop/libsecp256k1.def | 2 -- .../kotlin/fr/acinq/secp256k1/Placeholder.kt | 2 +- 8 files changed, 34 insertions(+), 25 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fb0f252..e27296e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,7 +29,7 @@ jobs: - name: Check uses: eskatos/gradle-command-action@v1 with: - wrapper-cache-enabled: true + wrapper-cache-enabled: false # https://github.com/eskatos/gradle-command-action/issues/24 arguments: iosX64Test - name: Publish uses: eskatos/gradle-command-action@v1 @@ -37,6 +37,7 @@ jobs: BINTRAY_USER: ${{ secrets.bintray_user }} BINTRAY_APIKEY: ${{ secrets.bintray_apikey }} with: + wrapper-cache-enabled: false # https://github.com/eskatos/gradle-command-action/issues/24 arguments: publishIosArm64PublicationToBintrayRepository publishIosX64PublicationToBintrayRepository publish: @@ -60,7 +61,7 @@ jobs: - name: Check uses: eskatos/gradle-command-action@v1 with: - wrapper-cache-enabled: true + wrapper-cache-enabled: false # https://github.com/eskatos/gradle-command-action/issues/24 arguments: check - name: Publish uses: eskatos/gradle-command-action@v1 @@ -68,4 +69,5 @@ jobs: BINTRAY_USER: ${{ secrets.bintray_user }} BINTRAY_APIKEY: ${{ secrets.bintray_apikey }} with: + wrapper-cache-enabled: false # https://github.com/eskatos/gradle-command-action/issues/24 arguments: publishAllPublicationsToBintrayRepository \ No newline at end of file diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 16e76f9..b3513d9 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -8,8 +8,8 @@ on: - '**.md' - '**.adoc' - '**/.gitignore' - - './github/**' - - '!./github/workflow/snapshot.yml' + - '.github/**' + - '!.github/workflows/snapshot.yml' jobs: @@ -36,7 +36,7 @@ jobs: - name: Check uses: eskatos/gradle-command-action@v1 with: - wrapper-cache-enabled: true + wrapper-cache-enabled: false # https://github.com/eskatos/gradle-command-action/issues/24 arguments: iosX64Test - name: Publish uses: eskatos/gradle-command-action@v1 @@ -44,6 +44,7 @@ jobs: BINTRAY_USER: ${{ secrets.bintray_user }} BINTRAY_APIKEY: ${{ secrets.bintray_apikey }} with: + wrapper-cache-enabled: false # https://github.com/eskatos/gradle-command-action/issues/24 arguments: publishIosArm64PublicationToBintrayRepository publishIosX64PublicationToBintrayRepository -PsnapshotNumber=${{ github.run_number }} -PgitRef=${{ github.ref }} -PgitSha=${{ github.sha }} publish: @@ -67,7 +68,7 @@ jobs: - name: Check uses: eskatos/gradle-command-action@v1 with: - wrapper-cache-enabled: true + wrapper-cache-enabled: false # https://github.com/eskatos/gradle-command-action/issues/24 arguments: check - name: Publish uses: eskatos/gradle-command-action@v1 @@ -75,4 +76,5 @@ jobs: BINTRAY_USER: ${{ secrets.bintray_user }} BINTRAY_APIKEY: ${{ secrets.bintray_apikey }} with: + wrapper-cache-enabled: false # https://github.com/eskatos/gradle-command-action/issues/24 arguments: publishAllPublicationsToBintrayRepository -PsnapshotNumber=${{ github.run_number }} -PgitRef=${{ github.ref }} -PgitSha=${{ github.sha }} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 64af9c2..9738047 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,16 +1,22 @@ name: Check on: - push: - branches: - - 'master' - pull_request: + pull_request: paths-ignore: - '**.md' - '**.adoc' - '**/.gitignore' - - './github/**' - - '!./github/workflow/test.yml' + - '.github/**' + - '!.github/workflows/test.yml' + push: + branches: + - 'master' + paths-ignore: + - '**.md' + - '**.adoc' + - '**/.gitignore' + - '.github/**' + - '!.github/workflows/test.yml' jobs: @@ -35,12 +41,14 @@ jobs: - name: Check JNI uses: eskatos/gradle-command-action@v1 with: - wrapper-cache-enabled: true - dependencies-cache-enabled: true + wrapper-cache-enabled: false # https://github.com/eskatos/gradle-command-action/issues/24 + dependencies-cache-enabled: false arguments: jvmTest -PnoCrossCompile=true - name: Check Linux uses: eskatos/gradle-command-action@v1 with: + wrapper-cache-enabled: false # https://github.com/eskatos/gradle-command-action/issues/24 + dependencies-cache-enabled: false arguments: linuxTest -PnoCrossCompile=true macos: @@ -66,8 +74,8 @@ jobs: - name: Check iOS uses: eskatos/gradle-command-action@v1 with: - wrapper-cache-enabled: true - dependencies-cache-enabled: true + wrapper-cache-enabled: false # https://github.com/eskatos/gradle-command-action/issues/24 + dependencies-cache-enabled: false arguments: iosX64Test -PnoCrossCompile=true - name: Check Android uses: reactivecircus/android-emulator-runner@v2 diff --git a/README.md b/README.md index d503ba5..441046d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Kotlin/Multiplatform wrapper for Bitcoin Core's secp256k1 library. Targets: JVM, ## Installation -[ ![Download](https://api.bintray.com/packages/acinq/libs/secp256k1-kmp/images/download.svg) ](https://bintray.com/acinq/libs/secp256k1-kmp/0.1.0-1.4-M2/link) +[ ![Download](https://api.bintray.com/packages/acinq/libs/secp256k1-kmp/images/download.svg) ](https://bintray.com/acinq/libs/secp256k1-kmp/) First, you need to add the ACINQ libraries repository: diff --git a/build.gradle.kts b/build.gradle.kts index 8cda112..04ad366 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - kotlin("multiplatform") version "1.4-M2-mt" + kotlin("multiplatform") version "1.4-M3" `maven-publish` } @@ -17,7 +17,7 @@ buildscript { allprojects { group = "fr.acinq.secp256k1" - version = "0.1.1-1.4-M2" + version = "0.1.0-1.4-M3" repositories { jcenter() diff --git a/jni/build.sh b/jni/build.sh index f0dd5d6..1ecf546 100755 --- a/jni/build.sh +++ b/jni/build.sh @@ -14,13 +14,12 @@ JNI_HEADERS=$TARGET if [ "$TARGET" == "linux" ]; then OUTFILE=libsecp256k1-jni.so + [ "$CROSS" == "1" ] && sudo apt -y install libgmp-dev ADD_LIB=-lgmp CC_OPTS="-fPIC" elif [ "$TARGET" == "darwin" ]; then OUTFILE=libsecp256k1-jni.dylib - if [ -z "$CROSS_TRIPLE" ]; then - ADD_LIB=-lgmp - fi + ADD_LIB=-lgmp elif [ "$TARGET" == "mingw" ]; then OUTFILE=secp256k1-jni.dll CC=/usr/src/mxe/usr/bin/x86_64-w64-mingw32.static-gcc diff --git a/src/nativeInterop/cinterop/libsecp256k1.def b/src/nativeInterop/cinterop/libsecp256k1.def index eec43c9..c0251c3 100644 --- a/src/nativeInterop/cinterop/libsecp256k1.def +++ b/src/nativeInterop/cinterop/libsecp256k1.def @@ -3,10 +3,8 @@ package = secp256k1 headers = secp256k1.h secp256k1_ecdh.h secp256k1_recovery.h headerFilter = secp256k1/** secp256k1_ecdh.h secp256k1_recovery.h secp256k1.h -staticLibraries.linux = libsecp256k1.a libraryPaths.linux = c/secp256k1/build/linux/ linkerOpts.linux = -L/usr/lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/local/lib -lgmp -staticLibraries.ios = libsecp256k1.a libraryPaths.ios = c/secp256k1/build/ios/ /usr/local/lib linkerOpts.ios = -framework Security -framework Foundation diff --git a/tests/src/androidMain/kotlin/fr/acinq/secp256k1/Placeholder.kt b/tests/src/androidMain/kotlin/fr/acinq/secp256k1/Placeholder.kt index f54be9e..4eb889e 100644 --- a/tests/src/androidMain/kotlin/fr/acinq/secp256k1/Placeholder.kt +++ b/tests/src/androidMain/kotlin/fr/acinq/secp256k1/Placeholder.kt @@ -1,4 +1,4 @@ package fr.acinq.secp256k1 -class Placeholder +public class Placeholder