Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert to multiplatform #11

Merged
merged 48 commits into from
Feb 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
bc64b1f
update gradle v6.0.1 -> v6.6.1
fullkomnun Dec 23, 2020
e01af85
update kotlin v1.3.61 -> v1.4.21
fullkomnun Dec 23, 2020
95e529f
prepare buildSrc and gradle.properties to go multiplatform
fullkomnun Dec 23, 2020
0d5f7ed
update gradle v6.6.1 -> v6.7.1
fullkomnun Dec 23, 2020
ad9b8a5
converted to multiplatform with jvm and nodeJS targets
fullkomnun Dec 23, 2020
52afdf2
configure 'com.github.ben-manes.versions' gradle plugin
fullkomnun Jan 11, 2021
3429317
enabled strict 'explicitApi' mode for all modules
fullkomnun Jan 16, 2021
c404e56
use Kotlin DSL extension of 'tasks.named(...)' to avoid IDE errors
fullkomnun Jan 16, 2021
fefd453
increase mocha tests timeout to 10s
fullkomnun Jan 31, 2021
ec98a74
add js browser target
fullkomnun Jan 31, 2021
79c0e66
set jvm test target to 1.8 (default is 1.6)
fullkomnun Feb 5, 2021
d6981bd
update kotlin v1.4.21 -> v.1.4.30
fullkomnun Feb 5, 2021
20989d8
remove js browser target and avoid setting jvmTarget for now
fullkomnun Feb 6, 2021
41e97a9
remove *.gradle files from older multiplatform implementation
fullkomnun Feb 6, 2021
d1ceef2
update gradle v6.7.1 -> v6.8.1
fullkomnun Feb 6, 2021
5fed6cd
set jvm target to 1.8 (default is 1.6)
fullkomnun Feb 6, 2021
bbb7340
added GitHub actions based ci
fullkomnun Feb 6, 2021
ef90cc4
config dependencyResolutionManagement in settings.gradle.kts
fullkomnun Feb 7, 2021
16847ac
define logging for all test tasks
fullkomnun Feb 7, 2021
4333330
create root aggregate test report for all sub-modules
fullkomnun Feb 7, 2021
bd7d60b
amend github action workflows
fullkomnun Feb 7, 2021
5fd6e8f
fix jacoco config
fullkomnun Feb 7, 2021
3050643
remove unnecessary repo
fullkomnun Feb 7, 2021
3b001d6
set GitHub credentials for deployment in workflow
fullkomnun Feb 7, 2021
5a07be3
added 'maven-publish' plugin and config for GitHub Packages
fullkomnun Feb 7, 2021
4cb9282
if build fails - bundle and upload build reports
fullkomnun Feb 7, 2021
e715e08
add a failing test to check ci build failure report
fullkomnun Feb 7, 2021
6bd7cfe
remove failing test - now ci should pass
fullkomnun Feb 7, 2021
8a53dcc
added upload failed build reports to ci
fullkomnun Feb 7, 2021
184b0ed
ci workflow - publish 'master-SNAPSHOT' versions to GitHub Packages
fullkomnun Feb 7, 2021
df7b60a
Merge pull request #1 from fullkomnun/convert_to_multiplatform
Feb 7, 2021
810984d
fix GitHub Packages maven repo name that affects expected property na…
fullkomnun Feb 7, 2021
ec6c9a3
Merge pull request #2 from fullkomnun/convert_to_multiplatform
Feb 7, 2021
88ee2b2
update README.md for multiplatform support
fullkomnun Feb 8, 2021
9c112e9
make suer maven 'groupId' of published modules is in lowercase
fullkomnun Feb 8, 2021
27671e1
Merge pull request #3 from fullkomnun/convert_to_multiplatform
Feb 8, 2021
24be71c
add CI badge to README.md
fullkomnun Feb 8, 2021
2d9e198
add a github release workflow
fullkomnun Feb 8, 2021
c0b9b72
Merge pull request #4 from fullkomnun/convert_to_multiplatform
Feb 8, 2021
1cf913c
Update release.yml
Feb 8, 2021
974526d
Update mpp-module.gradle.kts
Feb 8, 2021
bcdaa03
pass 'version' property to gradle when publishing
fullkomnun Feb 8, 2021
fc7b32f
Merge branch 'master' into convert_to_multiplatform
Feb 8, 2021
fdc76c3
pass 'version' system property to gradle when publishing
fullkomnun Feb 8, 2021
96c9eff
Merge remote-tracking branch 'origin/convert_to_multiplatform' into c…
fullkomnun Feb 8, 2021
791fa95
fix names of workflows
fullkomnun Feb 8, 2021
645c02d
update gradle v6.8.1 -> v6.8.2
fullkomnun Feb 19, 2021
aa091af
update README.md
fullkomnun Feb 21, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Continuous Integration

env:
GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.configureondemand=false -Dorg.gradle.vfs.watch=false -Dkotlin.compiler.execution.strategy=in-process'
JAVA_VERSION: 11
ORG_GRADLE_PROJECT_githubUsername: ${{ github.actor }}
ORG_GRADLE_PROJECT_githubPassword: ${{ github.token }}

on:
push:
branches:
- master
paths-ignore:
- '*.md'
- 'LICENSE'
- '.gitignore'

jobs:
build:
timeout-minutes: 15
runs-on: ubuntu-latest

steps:
- name: Checkout the repo
uses: actions/checkout@v2

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1

- name: Setup JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}

- name: Cache gradle
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.konan
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build project and run tests with Gradle
run: ./gradlew clean build --info

- name: Bundle the failed build report
if: failure()
run: find ./build -type d -name 'reports' | zip -@ -r build-reports.zip

- name: Upload the failed build report
if: failure()
uses: actions/upload-artifact@v2
with:
name: error-report
path: build-reports.zip
retention-days: 7

- name: Publish library with Gradle
run: ./gradlew publish -Dversion=master-SNAPSHOT
60 changes: 60 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Pull Request Check

env:
GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.configureondemand=false -Dorg.gradle.vfs.watch=false -Dkotlin.compiler.execution.strategy=in-process'
JAVA_VERSION: 11

on:
pull_request:
branches:
- master
paths-ignore:
- '*.md'
- 'LICENSE'
- '.gitignore'

jobs:
build:
timeout-minutes: 15
runs-on: ubuntu-latest

steps:
- name: Checkout the repo
uses: actions/checkout@v2

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1

- name: Setup JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}

- name: Cache gradle
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.konan
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build project and run tests
run: ./gradlew clean build --info

- name: Bundle the failed build report
if: failure()
run: find ./build -type d -name 'reports' | zip -@ -r build-reports.zip

- name: Upload the failed build report
if: failure()
uses: actions/upload-artifact@v2
with:
name: error-report
path: build-reports.zip
retention-days: 7
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Release

env:
GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.configureondemand=false -Dorg.gradle.vfs.watch=false -Dkotlin.compiler.execution.strategy=in-process'
JAVA_VERSION: 11
ORG_GRADLE_PROJECT_githubUsername: ${{ github.actor }}
ORG_GRADLE_PROJECT_githubPassword: ${{ github.token }}

on:
release:
types: [published]

jobs:
build:
timeout-minutes: 15
runs-on: ubuntu-latest

steps:
- name: Checkout the repo
uses: actions/checkout@v2

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1

- name: Setup JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}

- name: Cache gradle
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.konan
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build project and run tests with Gradle
run: ./gradlew clean build --info

- name: Bundle the failed build report
if: failure()
run: find ./build -type d -name 'reports' | zip -@ -r build-reports.zip

- name: Upload the failed build report
if: failure()
uses: actions/upload-artifact@v2
with:
name: error-report
path: build-reports.zip
retention-days: 7

- name: Publish library with Gradle
run: |
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3)
./gradlew publish -Dversion=${NEW_VERSION}
37 changes: 35 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,46 @@
![CI](https://github.com/komputing/KHex/workflows/Continuous%20Integration/badge.svg)
# What is it?
KHex is a Kotlin library to deal with hexadecimal encoding and decoding.

KHex is a Kotlin multiplatform library to deal with hexadecimal encoding and decoding.

It was incubated as part of [KEthereum](https://github.com/komputing/KEthereum) but then extracted as it can be useful
outside this context.


# Get it

## GitHub Packages

This library is available through GitHub Packages.

![badge][badge-js]
![badge][badge-jvm]

In order to use it, first include the GitHub Packages maven repository inside your project build.gradle.kts file:

```kotlin
repositories {
maven {
name = "komputing/KHex GitHub Packages"
url = uri("https://maven.pkg.github.com/komputing/KHex")
credentials {
username = "token"
password = "\u0039\u0032\u0037\u0034\u0031\u0064\u0038\u0033\u0064\u0036\u0039\u0061\u0063\u0061\u0066\u0031\u0062\u0034\u0061\u0030\u0034\u0035\u0033\u0061\u0063\u0032\u0036\u0038\u0036\u0062\u0036\u0032\u0035\u0065\u0034\u0061\u0065\u0034\u0032\u0062"
}
}
}
```
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/khex.svg)](https://jitpack.io/#komputing/khex)
![badge][badge-jvm]

In order to use it, first of all include the Jitpack maven repository inside your project `build.gradle` file:
In order to use it, first include the Jitpack maven repository inside your project `build.gradle` file:

```groovy
repositories {
Expand Down Expand Up @@ -74,3 +104,6 @@ HexString("0xaa12456789bb").clean0xPrefix()

# 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
65 changes: 12 additions & 53 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,61 +1,20 @@
apply {
from("https://raw.githubusercontent.com/ligi/gradle-common/master/versions_plugin_stable_only.gradle")
plugins {
base
}

buildscript {
repositories {
jcenter()
}

dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}")
classpath("com.github.ben-manes:gradle-versions-plugin:${Versions.versionsPlugin}")
}

val testAggregateReport = tasks.register<TestReport>("testAggregateReport") {
group = "Reporting"
description = "Collect aggregate test reports of all sub-modules."
destinationDir = file("$buildDir/reports/tests")
reportOn(subprojects.map {
it.tasks.withType<AbstractTestTask>()
})
}

allprojects {

repositories {
jcenter()
maven("https://jitpack.io")
}

}


subprojects {
repositories {
jcenter()
maven("https://jitpack.io")
maven("https://kotlin.bintray.com/kotlinx")
}

apply(plugin = "jacoco")
apply(plugin = "maven")
apply(plugin = "kotlin")

tasks.withType<Test> {
useJUnitPlatform()
}

configure<JavaPluginExtension> {
withSourcesJar()
withJavadocJar()
}

afterEvaluate {

dependencies {
"implementation"("org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}")

"testImplementation"("org.assertj:assertj-core:3.14.0")
"testImplementation"("org.junit.jupiter:junit-jupiter-api:${Versions.jupiter}")
"testRuntime"("org.junit.jupiter:junit-jupiter-engine:${Versions.jupiter}")

"testImplementation"("org.jetbrains.kotlin:kotlin-test")
tasks.withType<AbstractTestTask> {
finalizedBy(testAggregateReport)
}

}
}

}
6 changes: 6 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
idea
`kotlin-dsl`
`kotlin-dsl-precompiled-script-plugins`
}

repositories {
Expand All @@ -12,4 +13,9 @@ idea {
isDownloadJavadoc = false
isDownloadSources = false
}
}

dependencies {
implementation(kotlin("gradle-plugin", "${property("kgp")}"))
implementation("com.github.ben-manes", "gradle-versions-plugin", "${property("plugin.com.github.ben-manes.versions")}")
}
1 change: 1 addition & 0 deletions buildSrc/gradle.properties
5 changes: 2 additions & 3 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
object Versions {
const val kotlin = "1.3.61"
const val versionsPlugin = "0.27.0"
const val jupiter = "5.5.2"
const val jacocoPlugin = "0.8.5"
const val assertk = "0.23"
}
Loading