Skip to content

Commit

Permalink
Merge branch 'main' into pr/409
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinSchildhorn committed Nov 13, 2024
2 parents c3f6fca + 20d2f1d commit 1eaca03
Show file tree
Hide file tree
Showing 44 changed files with 1,267 additions and 2,417 deletions.
30 changes: 4 additions & 26 deletions .github/workflows/build.yml → .github/workflows/build_mac.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build
name: build Mac
on:
pull_request:
push:
Expand All @@ -8,24 +8,14 @@ on:

jobs:
build:
strategy:
matrix:
os: [macOS-latest, windows-latest]
runs-on: ${{matrix.os}}
runs-on: macOS-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: "adopt"
java-version: "17"
- name: Install msys2
if: matrix.os == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: git mingw-w64-x86_64-toolchain
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Cache gradle
Expand All @@ -42,26 +32,15 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build for MacOS
if: matrix.os == 'macOS-latest'
- name: Build
run: ./gradlew build --no-daemon --stacktrace --build-cache
env:
S3_BUILD_CACHE_AWS_REGION: ${{ secrets.S3_BUILD_CACHE_AWS_REGION }}
S3_BUILD_CACHE_BUCKET_NAME: ${{ secrets.S3_BUILD_CACHE_BUCKET_NAME }}
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
CI: "true"
- name: Build for Windows
if: matrix.os == 'windows-latest'
run: ./gradlew kotlinUpgradeYarnLock build -PenableWasm=false --no-daemon --stacktrace --build-cache
env:
S3_BUILD_CACHE_AWS_REGION: ${{ secrets.S3_BUILD_CACHE_AWS_REGION }}
S3_BUILD_CACHE_BUCKET_NAME: ${{ secrets.S3_BUILD_CACHE_BUCKET_NAME }}
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
CI: "true"
- name: Local Publish For Samples
if: matrix.os == 'macOS-latest'
run: ./gradlew publishToMavenLocal --no-daemon --stacktrace --build-cache -PRELEASE_SIGNING_ENABLED=false
env:
S3_BUILD_CACHE_AWS_REGION: ${{ secrets.S3_BUILD_CACHE_AWS_REGION }}
Expand All @@ -70,7 +49,6 @@ jobs:
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
CI: "true"
- name: script
if: matrix.os == 'macOS-latest'
env:
S3_BUILD_CACHE_AWS_REGION: ${{ secrets.S3_BUILD_CACHE_AWS_REGION }}
S3_BUILD_CACHE_BUCKET_NAME: ${{ secrets.S3_BUILD_CACHE_BUCKET_NAME }}
Expand All @@ -81,4 +59,4 @@ jobs:
shell: bash

env:
GRADLE_OPTS: -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=512m"
GRADLE_OPTS: -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx4g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=512m"
51 changes: 51 additions & 0 deletions .github/workflows/build_win.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: build Windows
on:
pull_request:
push:
branches:
- main
workflow_dispatch:

jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: "adopt"
java-version: "17"
- name: Install msys2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: git mingw-w64-x86_64-toolchain
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Cache gradle
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Cache konan
uses: actions/cache@v2
with:
path: ~/.konan
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build
run: ./gradlew mingwX64Test --no-daemon --stacktrace --build-cache
env:
S3_BUILD_CACHE_AWS_REGION: ${{ secrets.S3_BUILD_CACHE_AWS_REGION }}
S3_BUILD_CACHE_BUCKET_NAME: ${{ secrets.S3_BUILD_CACHE_BUCKET_NAME }}
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
CI: "true"

env:
GRADLE_OPTS: -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx4g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=512m"
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ build/

local.properties

Pods
Pods

# Intermediate klibs
.kotlin
46 changes: 46 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributing to a Touchlab Project

## License
By contributing you agree for your contribution to be licensed under the same license as the project which can be found in the LICENSE file.
If no LICENSE file is present, all intellectual property rights for the project and contributions to the project are reserved by Touchlab.

## Opening an issue
Issues can be useful for reporting bugs and requesting features.
If you simply have a question about the project or how to use it, please instead reach out in the [Kotlinlang touchlab-tools channel](https://kotlinlang.slack.com/archives/CTJB58X7X)

### Reporting a Bug
When reporting a problem with the project please provide as much detail as possible including:
- The version of the project used as well as other relevant versions (eg: Kotlin, Android, iOS)
- What behavior was expected
- Steps to reproduce

#### Sample Project
Sharing a simple sample project which reproduces the issue is **immensely** helpful.
Issues are often caused by project specific configurations and uses which are not practical for us to derive from a bug report.
A reproducing project is often the first thing we ask for on difficult bugs and going through the process will help you make a more informed bug report.

### Requesting an Enhancement
We get a lot of great feedback from the community about how they use our projects and what can make them better.
If you'd like to suggest an improvement that is not fixing a defect, please label it as an Enhancement.
Share as much info as you can about your use case and how you would expect the enhancement might work.
Please understand that even great ideas might not fit in with our vision for the project and, even if we don't implement them, we greatly appreciate your input

## Submitting a PR
We appreciate community members who are excited for our projects and willing to help improve them!

### Before Submitting a PR
If you are considering making a significant change, **please get in contact with us** before commiting a significant amount of time and effort.
Even well thought out and constructed PRs sometimes do not fit into the current goals of the project and we would hate for anyone to feel their time is wasted.
To discuss changes you can first [submit an issue](#opening-an-issue) documenting the bug or enhancement. Alternatively you can reach out in the [Kotlinlang touchlab-tools channel](https://kotlinlang.slack.com/archives/CTJB58X7X)

### When Submitting a PR
Please be sure to check that no tests are broken and relevant tests have been added.
Include documentation updates for any changes to behavior or usage.
Be as detailed as possible in your PR comments about what has changed and how to test it.

## Other Ways To Help
- Test and comment on other's contributions
- Review PR's
- Confirm issues and provide reproducers
- Star the repository
- Share the project with other developers
5 changes: 0 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ plugins {

}
apiValidation {
@OptIn(kotlinx.validation.ExperimentalBCVApi::class)
klib {
enabled = true
}

nonPublicMarkers.add("co.touchlab.kermit.ExperimentalKermitApi")
// ignoredProjects.addAll(listOf("kermit-gradle-plugin", "kermit-ir-plugin", "kermit-ir-plugin-native"))
}
Expand Down
25 changes: 6 additions & 19 deletions convention-plugins/src/main/kotlin/wasm-setup.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

plugins {
kotlin("multiplatform")
Expand All @@ -21,18 +20,7 @@ kotlin {
if (wasmEnabled) {
@OptIn(ExperimentalWasmDsl::class)
wasmJs {
browser {
commonWebpackConfig {
devServer = (devServer ?: KotlinWebpackConfig.DevServer()).apply {
static = (static ?: mutableListOf()).apply {
add(project.rootDir.path)
}
}
}
}
nodejs()
d8()
binaries.executable()
}
}

Expand All @@ -42,16 +30,15 @@ kotlin {
group("jsAndWasmJs") {
withJs()
if (wasmEnabled) {
withWasm()
withWasmJs()
}
}
}
}
}

if (project.findProperty("enableWasm") == "true") {
rootProject.the<NodeJsRootExtension>().apply {
nodeVersion = "21.0.0-v8-canary202309143a48826a08"
nodeDownloadBaseUrl = "https://nodejs.org/download/v8-canary"
tasks.withType(KotlinCompilationTask::class).configureEach {
compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
}
}
8 changes: 0 additions & 8 deletions extensions/kermit-bugsnag/api/kermit-bugsnag.klib.api

This file was deleted.

8 changes: 0 additions & 8 deletions extensions/kermit-crashlytics/api/kermit-crashlytics.klib.api

This file was deleted.

16 changes: 0 additions & 16 deletions extensions/kermit-koin/api/kermit-koin.klib.api

This file was deleted.

3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ POM_DEVELOPER_URL=https://touchlab.co/

kotlin.js.ir.output.granularity=whole-program
enableWasm=true
kotlin.mpp.enableCInteropCommonization=true
kotlin.mpp.enableCInteropCommonization=true
kotlin.mpp.commonizerLogLevel=info
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ minSdk = "21"
compileSdk = "34"

# Dependencies
kotlin = "1.9.22"
binaryCompatability = "0.16.3"
kotlin = "2.0.21"
binaryCompatability = "0.13.2"

androidx-core = "1.12.0"
androidx-appcompat = "1.6.1"
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
22 changes: 13 additions & 9 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -83,7 +85,9 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -144,15 +148,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -201,11 +205,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
Loading

0 comments on commit 1eaca03

Please sign in to comment.