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

Add more targets and minor updates. #6

Merged
merged 4 commits into from
Jul 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 8 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17
- name: Run Spotless
run: ./gradlew spotlessCheck

build:
runs-on: macos-latest
runs-on: macos-12
steps:
- uses: actions/checkout@v1
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17
- name: Build with Gradle
run: ./gradlew build
- name: Archive .gradle folder
Expand All @@ -42,7 +42,7 @@ jobs:

publish:
needs: build
runs-on: macos-latest
runs-on: macos-12
if: github.ref == 'refs/heads/main'
environment: Sonatype
env:
Expand All @@ -51,10 +51,10 @@ jobs:
SECRETS_KEY: ${{ secrets.SECRETS_KEY }}
steps:
- uses: actions/checkout@v1
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17
- name: Download .gradle folder
uses: actions/download-artifact@v1
with:
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
- Dependency update:
- [Android Gradle Plugin 7.2.1](https://developer.android.com/studio/releases/gradle-plugin#7-2-0)
- [Kotlin 1.7.10](https://github.com/JetBrains/kotlin/releases/tag/v1.7.10)
- [Gradle-7.5](https://docs.gradle.org/7.5/release-notes.html)
- [Spotless-6.9.0](https://github.com/diffplug/spotless/blob/main/plugin-gradle/CHANGES.md#690---2022-07-28)
- Add targets: linuxX64, macosArm64, mingwX64
- Stop building frameworks, they aren't published by default

## [1.0.5] - 2022-05-19
### Added
Expand Down
28 changes: 18 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
# Kase64

[![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)
![Maven Central](https://img.shields.io/maven-central/v/de.peilicke.sascha/kase64)
![Kotlin Version](https://img.shields.io/badge/Kotlin-1.7.10-B125EA?logo=kotlin)
[![Maven Central](https://img.shields.io/maven-central/v/de.peilicke.sascha/kase64.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22de.peilicke.sascha%22%20AND%20a:%22kase64%22)
[![Build Status](https://github.com/saschpe/kase64/workflows/Main%20CI/badge.svg)](https://github.com/saschpe/kase64/actions)
![badge-android](http://img.shields.io/badge/platform-android-brightgreen.svg?style=flat)
![badge-ios](http://img.shields.io/badge/platform-ios-brightgreen.svg?style=flat)
![badge-native](http://img.shields.io/badge/platform-native-lightgrey.svg?style=flat)
![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)
![Kotlin Version](https://img.shields.io/badge/kotlin-v1.3.60-F88909?style=flat&logo=kotlin)

Base64 encoder/decoder for Kotlin/Multiplatform. Supports Android, iOS, JavaScript and plain JVM environments.
[![License](http://img.shields.io/:License-Apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)

![badge-android](http://img.shields.io/badge/Platform-Android-brightgreen.svg?logo=android)
![badge-ios](http://img.shields.io/badge/Platform-iOS-orange.svg?logo=apple)
![badge-js](http://img.shields.io/badge/Platform-NodeJS-yellow.svg?logo=javascript)
![badge-jvm](http://img.shields.io/badge/Platform-JVM-red.svg?logo=openjdk)
![badge-linux](http://img.shields.io/badge/Platform-Linux-lightgrey.svg?logo=linux)
![badge-macos](http://img.shields.io/badge/Platform-macOS-orange.svg?logo=apple)
![badge-windows](http://img.shields.io/badge/Platform-Windows-blue.svg?logo=windows)

[//]: # (![badge-tvos](http://img.shields.io/badge/Platform-tvOS-orange.svg?logo=apple))

[//]: # (![badge-watchos](http://img.shields.io/badge/Platform-watchOS-orange.svg?logo=apple))

Base64 encoder/decoder for Kotlin/Multiplatform. Supports Android, iOS, Linux, JavaScript, Windows, watchOS, tvOS
and plain JVM environments.

**Supported encodings**

Expand Down
21 changes: 12 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
plugins {
kotlin("jvm") version "1.6.21" apply false
id("com.android.library") version "7.0.4" apply false
id("com.diffplug.spotless") version "6.7.2"
kotlin("jvm") version "1.7.10" apply false
id("com.android.library") version "7.2.1" apply false
id("com.diffplug.spotless") version "6.9.0"
id("com.github.ben-manes.versions") version "0.42.0"
}

spotless {
format("misc") {
target("*.md", "**/.gitignore")
target("**/*.gradle", "*.md", "**/.gitignore")
trimTrailingWhitespace()
endWithNewline()
}
freshmark {
target("*.md")
propertiesFile("gradle.properties")
}
kotlin {
target("*/src/**/*.kt")
targetExclude("*/build/**/*.kt")
ktlint().userData(mapOf("disabled_rules" to "no-wildcard-imports"))
target("source/**/src/**/*.kt")
targetExclude("**/build/**/*.kt")
ktlint().editorConfigOverride(
mapOf("disabled_rules" to "filename,no-wildcard-imports", "insert_final_newline" to false)
)
}
kotlinGradle {
target("**/*.gradle.kts")
ktlint()
ktlint().editorConfigOverride(mapOf("insert_final_newline" to false))
}
}

Expand All @@ -32,4 +35,4 @@ tasks {
!isStable(candidate.version) && isStable(currentVersion)
}
}
}
}
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ object Secrets {
}
}
named("assemble") { dependsOn(ensureSecretsExist) }
}
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Gradle
file.encoding=utf-8
org.gradle.caching=true
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true
org.gradle.vfs.watch=true

Expand All @@ -14,4 +14,4 @@ kotlin.native.ignoreDisabledTargets=true
android.enableJetifier=true
android.injected.testOnly=false
android.testConfig.useRelativePath=true
android.useAndroidX=true
android.useAndroidX=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
18 changes: 14 additions & 4 deletions kase64/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ plugins {

kotlin {
android { publishAllLibraryVariants() }
ios { binaries.framework("Kase64") }
iosSimulatorArm64 { binaries.framework("Kase64") }
ios()
iosSimulatorArm64()
js {
nodejs()
compilations.all {
Expand All @@ -17,14 +17,24 @@ kotlin {
}
}
jvm { testRuns["test"].executionTask.configure { useJUnitPlatform() } }
linuxX64()
macosArm64()
mingwX64() // Winwhat?!?
// tvos()
// watchos()

sourceSets["commonTest"].dependencies {
implementation(kotlin("test"))
}
sourceSets["iosSimulatorArm64Main"].dependsOn(sourceSets["iosMain"])
sourceSets["iosSimulatorArm64Test"].dependsOn(sourceSets["iosTest"])

sourceSets.remove(sourceSets["androidAndroidTestRelease"]) // https://issuetracker.google.com/issues/152187160
sourceSets { // https://issuetracker.google.com/issues/152187160
remove(sourceSets["androidAndroidTestRelease"])
remove(sourceSets["androidTestFixtures"])
remove(sourceSets["androidTestFixturesDebug"])
remove(sourceSets["androidTestFixturesRelease"])
}

targets.withType(org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithSimulatorTests::class.java) {
testRuns["test"].deviceId = "iPhone 13"
Expand Down Expand Up @@ -102,4 +112,4 @@ signing {
else -> useInMemoryPgpKeys(sonatypeGpgKey, sonatypeGpgKeyPassword)
}
sign(publishing.publications)
}
}
4 changes: 2 additions & 2 deletions scripts/inc.functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ function safe() {
}

function sed2() {
sed -i'.bak' "$1" ${@:2}
sed -i'.bak' "$1" "${@:2}"
for file in "${@:2}"; do
rm "${file}.bak"
done
}

function get_version_name() {
echo $(grep "version = " $1 | xargs | cut -d"=" -f2)
grep "version = " "${1}" | xargs | cut -d"=" -f2
}
4 changes: 2 additions & 2 deletions scripts/secret
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ case ${command} in
decrypt)
for file in "${files[@]}"; do
approve "Decrypting ${file}.enc"
safe gpg --batch --yes ${password} --output "${file}" --decrypt "${file}.gpg"
safe gpg --batch --yes "${password}" --output "${file}" --decrypt "${file}.gpg"
if [[ "$(file -b "${file}")" == "data" ]]; then
rm -f "${file}"
die "Failed to decrypt ${file}"
Expand All @@ -68,7 +68,7 @@ decrypt)
encrypt)
for file in "${files[@]}"; do
approve "Encrypting ${file}"
safe gpg --batch --yes ${password} --output "${file}.gpg" --symmetric "${file}"
safe gpg --batch --yes "${password}" --output "${file}.gpg" --symmetric "${file}"
done
;;
esac
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ dependencyResolutionManagement {

rootProject.name = "Kase64"

include(":kase64")
include(":kase64")