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

Updating Wasm implementation and Updating to Kotlin 2.0.21 #413

Merged
merged 7 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
28 changes: 3 additions & 25 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 Down
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="-Xmx3g -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
8 changes: 4 additions & 4 deletions convention-plugins/src/main/kotlin/wasm-setup.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* 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.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig

Expand Down Expand Up @@ -42,7 +42,7 @@ kotlin {
group("jsAndWasmJs") {
withJs()
if (wasmEnabled) {
withWasm()
withWasmJs()
}
}
}
Expand All @@ -51,7 +51,7 @@ kotlin {

if (project.findProperty("enableWasm") == "true") {
rootProject.the<NodeJsRootExtension>().apply {
nodeVersion = "21.0.0-v8-canary202309143a48826a08"
nodeDownloadBaseUrl = "https://nodejs.org/download/v8-canary"
version = "21.0.0-v8-canary202309143a48826a08"
downloadBaseUrl = "https://nodejs.org/download/v8-canary"
}
}
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ minSdk = "21"
compileSdk = "34"

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

androidx-core = "1.12.0"
Expand Down
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.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,9 @@ internal interface ConsoleIntf {
fun log(output: String)
}

internal expect object ConsoleActual : ConsoleIntf
internal expect object ConsoleActual : ConsoleIntf {
override fun error(output: String)
override fun warn(output: String)
override fun info(output: String)
override fun log(output: String)
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
package co.touchlab.kermit

internal actual object ConsoleActual : ConsoleIntf {
override fun error(output: String) {
actual override fun error(output: String) {
console.error(output)
}

override fun warn(output: String) {
actual override fun warn(output: String) {
console.warn(output)
}

override fun info(output: String) {
actual override fun info(output: String) {
console.info(output)
}

override fun log(output: String) {
actual override fun log(output: String) {
console.log(output)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ external fun consoleInfo(output: String)
external fun consoleLog(output: String)

internal actual object ConsoleActual : ConsoleIntf {
override fun error(output: String) {
actual override fun error(output: String) {
consoleError(output)
}

override fun warn(output: String) {
actual override fun warn(output: String) {
consoleWarn(output)
}

override fun info(output: String) {
actual override fun info(output: String) {
consoleInfo(output)
}

override fun log(output: String) {
actual override fun log(output: String) {
consoleLog(output)
}
}
Loading
Loading