From 6bf79393e1ed4d1ef1f4e0790fe874824ca33b79 Mon Sep 17 00:00:00 2001 From: David Bieregger <46626041+BierDav@users.noreply.github.com> Date: Thu, 18 May 2023 14:49:00 +0200 Subject: [PATCH] Fixing errors of PR 23 (#25) * update .gitignore with gradle template * update to kotlin 1.6.21, bignum 0.3.4 and gradle 7.4.2 * use new memory model * add native targets requires pr: https://github.com/komputing/KHex/pull/14 * Update KHex version Fix broken gradle.properties import Fix broken KHex import in build-src * Bump KHex version to 1.1.4 Bump KGP version to 1.8.21 Remove deprecated native targets Remove previously accidentally added line of code in build.gradle.kts Use macos as run target for all automations * Double workflow timout * Bump KHex version to expected version 1.1.5 * According to @Deprecation Annotation for legacy and IR compiler support (BOTH), switching to IR only Probably safe, because the user base for legacy is very limited Remove deprecated code, that shouldn't be necessary anymore due to the removal in the official JetBrains documentation * Update README.md * Remove --info attribute for less verbose CI outputs * Double workflow timeouts --------- Co-authored-by: Luca Spinazzola Co-authored-by: David Bieregger --- .github/workflows/continuous-integration.yml | 6 +-- .github/workflows/pr-check.yml | 6 +-- .github/workflows/release.yml | 6 +-- README.md | 41 ++++++++++--------- buildSrc/build.gradle.kts | 14 ++++++- buildSrc/gradle.properties | 1 - .../src/main/kotlin/mpp-module.gradle.kts | 4 ++ 7 files changed, 46 insertions(+), 32 deletions(-) delete mode 120000 buildSrc/gradle.properties diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 65246f6..11b3fb0 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -17,8 +17,8 @@ on: jobs: build: - timeout-minutes: 15 - runs-on: ubuntu-latest + timeout-minutes: 60 + runs-on: macos-latest steps: - name: Checkout the repo @@ -47,7 +47,7 @@ jobs: run: chmod +x gradlew - name: Build project and run tests with Gradle - run: ./gradlew clean build --info + run: ./gradlew clean build - name: Bundle the failed build report if: failure() diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 8f113de..5177906 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -15,8 +15,8 @@ on: jobs: build: - timeout-minutes: 15 - runs-on: ubuntu-latest + timeout-minutes: 60 + runs-on: macos-latest steps: - name: Checkout the repo @@ -45,7 +45,7 @@ jobs: run: chmod +x gradlew - name: Build project and run tests - run: ./gradlew clean build --info + run: ./gradlew clean build - name: Bundle the failed build report if: failure() diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 80b2f8a..ff068aa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,8 +12,8 @@ on: jobs: build: - timeout-minutes: 15 - runs-on: ubuntu-latest + timeout-minutes: 60 + runs-on: macos-latest steps: - name: Checkout the repo @@ -42,7 +42,7 @@ jobs: run: chmod +x gradlew - name: Build project and run tests with Gradle - run: ./gradlew clean build --info + run: ./gradlew clean build - name: Bundle the failed build report if: failure() diff --git a/README.md b/README.md index 7f37736..850c893 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ KHash is a Kotlin multiplatform library implementing common hashing functions. -A part from that, it also provides some useful [extensions functions](https://kotlinlang.org/docs/reference/extensions.html). +Apart from that, it also provides some useful [extensions functions](https://kotlinlang.org/docs/reference/extensions.html). The implemented hashing functions are the following. * [RIPEMD160](https://en.wikipedia.org/wiki/RIPEMD) @@ -19,8 +19,13 @@ The implemented hashing functions are the following. This library is available through GitHub Packages. -![badge][badge-js] +![badge][badge-android] +![badge][badge-ios] +![badge][badge-js-ir] ![badge][badge-jvm] +![badge][badge-linux] +![badge][badge-mac] +![badge][badge-apple-silicon] In order to use it, first include the GitHub Packages maven repository inside your project `build.gradle.kts` file: @@ -36,22 +41,6 @@ repositories { } } ``` -When 'username' could be anything and 'password' is an [encoded access token for public access](https://github.community/t/download-from-github-package-registry-without-authentication/14407/44). - -### JitPack (JVM only!) - -This library is available on Jitpack. The current version is: - -[![](https://jitpack.io/v/komputing/khash.svg)](https://jitpack.io/#komputing/khash) -![badge][badge-jvm] - -In order to use it, first include the Jitpack maven repository inside your project `build.gradle.kts` file: - -```kotlin -repositories { - maven { url="https://jitpack.io" } -} -``` ## Set it up @@ -144,5 +133,17 @@ Also this code is not hardened against side channel attacks. Keep this in mind w # License MIT -[badge-js]: http://img.shields.io/badge/platform-js-yellow.svg?style=flat -[badge-jvm]: http://img.shields.io/badge/platform-jvm-orange.svg?style=flat \ No newline at end of file +[badge-android]: http://img.shields.io/badge/-android-6EDB8D.svg?style=flat +[badge-android-native]: http://img.shields.io/badge/support-[AndroidNative]-6EDB8D.svg?style=flat +[badge-jvm]: http://img.shields.io/badge/-jvm-DB413D.svg?style=flat +[badge-js]: http://img.shields.io/badge/-js-F8DB5D.svg?style=flat +[badge-js-ir]: http://img.shields.io/badge/-js--IR-F8DB5D.svg?style=flat +[badge-nodejs]: https://img.shields.io/badge/-nodejs-68a063.svg?style=flat +[badge-linux]: http://img.shields.io/badge/-linux-2D3F6C.svg?style=flat +[badge-windows]: http://img.shields.io/badge/-windows-4D76CD.svg?style=flat +[badge-wasm]: https://img.shields.io/badge/-wasm-624FE8.svg?style=flat +[badge-apple-silicon]: http://img.shields.io/badge/support-[AppleSilicon]-43BBFF.svg?style=flat +[badge-ios]: http://img.shields.io/badge/-ios-CDCDCD.svg?style=flat +[badge-mac]: http://img.shields.io/badge/-macos-111111.svg?style=flat +[badge-watchos]: http://img.shields.io/badge/-watchos-C0C0C0.svg?style=flat +[badge-tvos]: http://img.shields.io/badge/-tvos-808080.svg?style=flat \ No newline at end of file diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 7ede595..5bd19fe 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -1,9 +1,16 @@ +import java.io.File +import java.util.* + plugins { idea `kotlin-dsl` `kotlin-dsl-precompiled-script-plugins` } +val rootProperties = Properties().apply { + load(File(projectDir, "../gradle.properties").inputStream()) +} + repositories { gradlePluginPortal() } @@ -16,6 +23,9 @@ idea { } dependencies { - implementation(kotlin("gradle-plugin", "${property("kgp")}")) - implementation("com.github.ben-manes", "gradle-versions-plugin", "${property("plugin.com.github.ben-manes.versions")}") + implementation(kotlin("gradle-plugin", rootProperties.getProperty("kgp"))) + implementation( + "com.github.ben-manes", "gradle-versions-plugin", + rootProperties.getProperty("plugin.com.github.ben-manes.versions") + ) } \ No newline at end of file diff --git a/buildSrc/gradle.properties b/buildSrc/gradle.properties deleted file mode 120000 index 7677fb7..0000000 --- a/buildSrc/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -../gradle.properties \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/mpp-module.gradle.kts b/buildSrc/src/main/kotlin/mpp-module.gradle.kts index 72f9715..38576ce 100644 --- a/buildSrc/src/main/kotlin/mpp-module.gradle.kts +++ b/buildSrc/src/main/kotlin/mpp-module.gradle.kts @@ -1,3 +1,5 @@ +@file:Suppress("UNUSED_VARIABLE") + import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestLogEvent @@ -8,6 +10,7 @@ plugins { id("maven-publish") } + val darwinTargets = arrayOf( "macosX64", "macosArm64", "iosArm64", "iosX64", "iosSimulatorArm64", @@ -18,6 +21,7 @@ val linuxTargets = arrayOf("linuxX64", "linuxArm64") val mingwTargets = arrayOf("mingwX64") val nativeTargets = linuxTargets + darwinTargets + mingwTargets + kotlin { explicitApi() targets {