diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c26e8210..a8906fa44 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,10 +1,10 @@ name: CI on: pull_request: - # Trigger on merges to `main` to allow `gradle/gradle-build-action` runs to write their caches. - # https://github.com/gradle/gradle-build-action#using-the-caches-read-only push: branches: + # Trigger on merges to `main` to allow `gradle/actions/setup-gradle` to write its caches. + # https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#using-the-cache-read-only - main jobs: @@ -24,8 +24,8 @@ jobs: - uses: actions/checkout@v7 - uses: actions/setup-java@v5 with: - distribution: 'temurin' - java-version: '17' + distribution: temurin + java-version: 17 - uses: gradle/actions/setup-gradle@v6 - run: ./gradlew :kable-core:compileKotlinJvm - run: unzip kable-btleplug-ffi.jar && rm -rf META-INF com *.jar @@ -50,8 +50,8 @@ jobs: merge-multiple: true - uses: actions/setup-java@v5 with: - distribution: 'temurin' - java-version: '17' + distribution: temurin + java-version: 17 - uses: gradle/actions/setup-gradle@v6 - run: ./gradlew assemble -PsuppressWarnings=true diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 8f5f461ae..2f1feb5ff 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -11,23 +11,38 @@ jobs: - uses: actions/checkout@v7 - uses: actions/setup-java@v5 with: - distribution: 'temurin' - java-version: '17' + distribution: temurin + java-version: 17 - uses: gradle/actions/setup-gradle@v6 with: cache-read-only: true - validate-wrappers: true - run: ./gradlew dokkaGenerate - run: > tar + --verbose --dereference --hard-dereference --directory build/dokkaHtmlMultiModule - -cvf '${{ runner.temp }}/artifact.tar' + --create --file '${{ runner.temp }}/artifact.tar' --exclude=.git --exclude=.github . + - run: ./gradlew :shared:wasmJsBrowserDistribution + working-directory: samples/sensortag + + - run: > + tar + --verbose + --dereference --hard-dereference + --directory shared/build/dist/wasmJs/productionExecutable + --transform 's|^|sensortag/|' + --append --file '${{ runner.temp }}/artifact.tar' + --exclude=.git + --exclude=.github + . + working-directory: samples/sensortag + - uses: actions/upload-artifact@v7 with: name: github-pages diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b62672712..823abae57 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,8 +21,8 @@ jobs: - uses: actions/checkout@v7 - uses: actions/setup-java@v5 with: - distribution: 'temurin' - java-version: '17' + distribution: temurin + java-version: 17 - uses: gradle/actions/setup-gradle@v6 - run: ./gradlew :kable-btleplug-ffi:assemble - run: unzip kable-btleplug-ffi.jar && rm -rf META-INF com *.jar @@ -47,8 +47,8 @@ jobs: merge-multiple: true - uses: actions/setup-java@v5 with: - distribution: 'temurin' - java-version: '17' + distribution: temurin + java-version: 17 - uses: gradle/actions/setup-gradle@v6 - run: ./gradlew check diff --git a/samples/sensortag/.github/workflows/android.yml b/.github/workflows/sensortag-android.yml similarity index 52% rename from samples/sensortag/.github/workflows/android.yml rename to .github/workflows/sensortag-android.yml index 1ef5dd645..8d6834209 100644 --- a/samples/sensortag/.github/workflows/android.yml +++ b/.github/workflows/sensortag-android.yml @@ -1,25 +1,23 @@ -name: Android +name: SensorTag / Android on: pull_request: - # Trigger on merges to `main` to allow `gradle/gradle-build-action` runs to write their caches. - # https://github.com/gradle/gradle-build-action#using-the-caches-read-only - push: - branches: - - main env: GRADLE_OPTS: -Dorg.gradle.daemon=false +defaults: + run: + working-directory: samples/sensortag + jobs: build: - name: Build runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - uses: actions/setup-java@v5 with: - distribution: 'temurin' - java-version: '17' + distribution: temurin + java-version: 17 - uses: gradle/actions/setup-gradle@v6 - run: ./gradlew :android:assemble - run: ./gradlew :android:check diff --git a/samples/sensortag/.github/workflows/ios.yml b/.github/workflows/sensortag-ios.yml similarity index 79% rename from samples/sensortag/.github/workflows/ios.yml rename to .github/workflows/sensortag-ios.yml index 777dad4c5..54ea60d9e 100644 --- a/samples/sensortag/.github/workflows/ios.yml +++ b/.github/workflows/sensortag-ios.yml @@ -1,4 +1,4 @@ -name: iOS +name: SensorTag / iOS on: pull_request: @@ -7,11 +7,10 @@ env: defaults: run: - working-directory: ios + working-directory: samples/sensortag jobs: build: - name: Build runs-on: macos-latest steps: - uses: actions/checkout@v7 @@ -20,11 +19,13 @@ jobs: xcode-version: latest-stable - uses: actions/setup-java@v5 with: - distribution: 'temurin' - java-version: '17' + distribution: temurin + java-version: 17 - uses: gradle/actions/setup-gradle@v6 + - run: brew install xcodegen - run: ./gradlew :ios:generateXcodeProject + - run: > xcodebuild -project SensorTag.xcodeproj @@ -33,3 +34,4 @@ jobs: -destination 'generic/platform=iOS' build CODE_SIGNING_ALLOWED='NO' + working-directory: samples/sensortag/ios diff --git a/samples/sensortag/.github/workflows/webapp.yml b/.github/workflows/sensortag-web.yml similarity index 68% rename from samples/sensortag/.github/workflows/webapp.yml rename to .github/workflows/sensortag-web.yml index fe47d2ebc..d1ae44240 100644 --- a/samples/sensortag/.github/workflows/webapp.yml +++ b/.github/workflows/sensortag-web.yml @@ -1,19 +1,22 @@ -name: Webapp +name: SensorTag / Web on: pull_request: env: GRADLE_OPTS: -Dorg.gradle.daemon=false +defaults: + run: + working-directory: samples/sensortag + jobs: build: - name: Browser Distribution runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - uses: actions/setup-java@v5 with: - distribution: 'temurin' - java-version: '17' + distribution: temurin + java-version: 17 - uses: gradle/actions/setup-gradle@v6 - run: ./gradlew :shared:wasmJsBrowserDistribution diff --git a/.github/workflows/signing.yml b/.github/workflows/signing.yml index eeed8d992..1b4e73cc7 100644 --- a/.github/workflows/signing.yml +++ b/.github/workflows/signing.yml @@ -12,9 +12,11 @@ jobs: - uses: actions/checkout@v7 - uses: actions/setup-java@v5 with: - distribution: 'temurin' - java-version: '17' + distribution: temurin + java-version: 17 - uses: gradle/actions/setup-gradle@v6 + with: + cache-read-only: true - name: publishToMavenLocal run: > diff --git a/.gitignore b/.gitignore index e6f55f481..b7a6e9a62 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,10 @@ +*.xcodeproj/ .DS_Store .gradle .idea .kotlin/ +.sdkmanrc build/ -local.properties +Info.plist kable-btleplug-ffi/target/ +local.properties diff --git a/README.md b/README.md index 460399369..d7a2e1ec3 100644 --- a/README.md +++ b/README.md @@ -659,7 +659,7 @@ limitations under the License. [Bluetooth permissions]: https://developer.android.com/develop/connectivity/bluetooth/bt-permissions [Coroutine scope]: https://kotlinlang.org/docs/reference/coroutines/coroutine-context-and-dispatchers.html#coroutine-scope [Coroutines with multithread support for Kotlin/Native]: https://github.com/Kotlin/kotlinx.coroutines/issues/462 -[SensorTag sample app]: https://github.com/JuulLabs/sensortag +[SensorTag sample app]: samples/sensortag [`Advertisement`]: https://juullabs.github.io/kable/kable-core/com.juul.kable/-advertisement/index.html [`Characteristic`]: https://juullabs.github.io/kable/kable-core/com.juul.kable/-characteristic/index.html [`Connected`]: https://juullabs.github.io/kable/kable-core/com.juul.kable/-state/-connected/index.html diff --git a/build.gradle.kts b/build.gradle.kts index b09478dee..0786e707b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,13 +6,13 @@ buildscript { } plugins { - alias(libs.plugins.kotlin.multiplatform) apply false + alias(libs.plugins.android.kotlin.multiplatform.library) apply false alias(libs.plugins.android.library) apply false - alias(libs.plugins.android.kmp.library) apply false + alias(libs.plugins.api) + alias(libs.plugins.dokka) + alias(libs.plugins.kotlin.multiplatform) apply false alias(libs.plugins.kotlinter) apply false alias(libs.plugins.maven.publish) apply false - alias(libs.plugins.dokka) - alias(libs.plugins.api) } dokka { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ee5e18f32..5b03f49cb 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,39 +2,76 @@ agp = "9.2.1" android-compile = "37" android-min = "21" +android-target = "33" +compose = "1.11.1" coroutines = "1.11.0" jna = "5.19.1" jvm-toolchain = "17" kotlin = "2.4.0" +krayon = "0.24.0" tuulbox = "8.1.0" +voyager = "2.2.21-1.10.3" [libraries] androidx-core = { module = "androidx.core:core-ktx", version = "1.19.0" } +androidx-lifecycle = { module = "androidx.lifecycle:lifecycle-common", version = "2.10.0" } androidx-startup = { module = "androidx.startup:startup-runtime", version = "1.2.0" } atomicfu = { module = "org.jetbrains.kotlinx:atomicfu", version = "0.33.0" } +compose-activity = { module = "androidx.activity:activity-compose", version = "1.13.0" } +compose-ui = { module = "androidx.compose.ui:ui", version = "1.11.2" } +datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version = "0.8.0-0.6.x-compat" } +desugar = { module = "com.android.tools:desugar_jdk_libs", version = "2.1.5" } equalsverifier = { module = "nl.jqno.equalsverifier:equalsverifier", version = "4.5" } jna = { module = "net.java.dev.jna:jna", version.ref = "jna" } +kable = { module = "com.juul.kable:kable-core" } +kable-permissions = { module = "com.juul.kable:kable-default-permissions" } khronicle = { module = "com.juul.khronicle:khronicle-core", version = "1.1.0" } kotlin-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } kotlinx-browser = { module = "org.jetbrains.kotlinx:kotlinx-browser", version = "0.5.0" } +kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" } kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" } -kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" } +kotlinx-coroutines-swing = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-swing", version.ref = "coroutines" } kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" } kotlinx-io = { module = "org.jetbrains.kotlinx:kotlinx-io-core", version = "0.9.0" } +krayon-axis = { module = "com.juul.krayon:axis", version.ref = "krayon" } +krayon-compose = { module = "com.juul.krayon:compose", version.ref = "krayon" } +krayon-scale = { module = "com.juul.krayon:scale", version.ref = "krayon" } +krayon-selection = { module = "com.juul.krayon:selection", version.ref = "krayon" } +krayon-shape = { module = "com.juul.krayon:shape", version.ref = "krayon" } mockk = { module = "io.mockk:mockk", version = "1.14.11" } robolectric = { module = "org.robolectric:robolectric", version = "4.16.1" } +serialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version = "1.11.0" } tomlkt = { module = "net.peanuuutz.tomlkt:tomlkt", version = "0.5.0" } -tuulbox-collections = { module = "com.juul.tuulbox:collections", version.ref = "tuulbox" } tuulbox-coroutines = { module = "com.juul.tuulbox:coroutines", version.ref = "tuulbox" } +voyager-navigator = { module = "cafe.adriel.voyager:voyager-navigator", version.ref = "voyager" } +voyager-screenmodel = { module = "cafe.adriel.voyager:voyager-screenmodel", version.ref = "voyager" } +voyager-transitions = { module = "cafe.adriel.voyager:voyager-transitions", version.ref = "voyager" } wrappers-bom = { module = "org.jetbrains.kotlin-wrappers:kotlin-wrappers-bom", version = "2026.6.5" } wrappers-browser = { module = "org.jetbrains.kotlin-wrappers:kotlin-browser" } wrappers-web = { module = "org.jetbrains.kotlin-wrappers:kotlin-web" } +[bundles] +krayon = [ + "krayon-axis", + "krayon-scale", + "krayon-selection", + "krayon-shape", +] +voyager = [ + "voyager-navigator", + "voyager-screenmodel", + "voyager-transitions", +] + [plugins] -android-kmp-library = { id = "com.android.kotlin.multiplatform.library", version.ref = "agp" } +android-application = { id = "com.android.application", version.ref = "agp" } +android-kotlin-multiplatform-library = { id = "com.android.kotlin.multiplatform.library", version.ref = "agp" } android-library = { id = "com.android.library", version.ref = "agp" } api = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.18.1" } +compose = { id = "org.jetbrains.compose", version.ref = "compose" } +compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } dokka = { id = "org.jetbrains.dokka", version = "2.2.0" } kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } kotlinter = { id = "org.jmailen.kotlinter", version = "5.5.0" } maven-publish = { id = "com.vanniktech.maven.publish", version = "0.36.0" } +serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } diff --git a/kable-btleplug-ffi/build.gradle.kts b/kable-btleplug-ffi/build.gradle.kts index ddd67c48a..ca146648b 100755 --- a/kable-btleplug-ffi/build.gradle.kts +++ b/kable-btleplug-ffi/build.gradle.kts @@ -9,7 +9,7 @@ kotlin { dependencies { api(libs.jna) - api(libs.kotlinx.coroutines.core) + api(libs.kotlinx.coroutines) } } diff --git a/kable-core/build.gradle.kts b/kable-core/build.gradle.kts index 465def255..316b6764a 100644 --- a/kable-core/build.gradle.kts +++ b/kable-core/build.gradle.kts @@ -1,7 +1,5 @@ -@file:OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class) - plugins { - alias(libs.plugins.android.kmp.library) + alias(libs.plugins.android.kotlin.multiplatform.library) alias(libs.plugins.maven.publish) alias(libs.plugins.dokka) alias(libs.plugins.kotlinter) @@ -11,6 +9,7 @@ plugins { fun isRunningOnMacOs() = System.getProperty("os.name").orEmpty().lowercase().startsWith("mac") +@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class) kotlin { explicitApi() jvmToolchain(libs.versions.jvm.toolchain.get().toInt()) @@ -67,7 +66,7 @@ kotlin { } commonMain.dependencies { - api(libs.kotlinx.coroutines.core) + api(libs.kotlinx.coroutines) api(libs.kotlinx.io) implementation(libs.atomicfu) } diff --git a/kable-log-engine-khronicle/build.gradle.kts b/kable-log-engine-khronicle/build.gradle.kts index c170457a8..4d861d511 100644 --- a/kable-log-engine-khronicle/build.gradle.kts +++ b/kable-log-engine-khronicle/build.gradle.kts @@ -1,5 +1,3 @@ -@file:OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class) - plugins { alias(libs.plugins.maven.publish) alias(libs.plugins.dokka) @@ -9,6 +7,7 @@ plugins { fun isRunningOnMacOs() = System.getProperty("os.name").orEmpty().lowercase().startsWith("mac") +@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class) kotlin { explicitApi() jvmToolchain(libs.versions.jvm.toolchain.get().toInt()) diff --git a/samples/sensortag/renovate.json b/renovate.json similarity index 100% rename from samples/sensortag/renovate.json rename to renovate.json diff --git a/samples/sensortag/.github/CODEOWNERS b/samples/sensortag/.github/CODEOWNERS deleted file mode 100644 index 7c70f5bbd..000000000 --- a/samples/sensortag/.github/CODEOWNERS +++ /dev/null @@ -1,3 +0,0 @@ -# https://help.github.com/articles/about-codeowners/ - -* @JuulLabs/conx-kotlin-reviewers @twyatt diff --git a/samples/sensortag/.github/workflows/pages.yml b/samples/sensortag/.github/workflows/pages.yml deleted file mode 100644 index 41ab5479a..000000000 --- a/samples/sensortag/.github/workflows/pages.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Webapp -on: - push: - branches: - - main - -env: - GRADLE_OPTS: -Dorg.gradle.daemon=false - -jobs: - build: - name: Package Browser Distribution - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v7 - - uses: actions/setup-java@v5 - with: - distribution: 'temurin' - java-version: '17' - - uses: gradle/actions/setup-gradle@v6 - - run: ./gradlew :shared:wasmJsBrowserDistribution - - run: > - tar - --dereference --hard-dereference - --directory shared/build/dist/wasmJs/productionExecutable - -cvf '${{ runner.temp }}/artifact.tar' - --exclude=.git - --exclude=.github - . - - uses: actions/upload-artifact@v7 - with: - name: github-pages - path: ${{ runner.temp }}/artifact.tar - retention-days: 1 - if-no-files-found: error - - deploy: - name: Deploy - runs-on: ubuntu-latest - needs: build - permissions: - pages: write - id-token: write - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - uses: actions/deploy-pages@v5 - id: deployment diff --git a/samples/sensortag/.gitignore b/samples/sensortag/.gitignore deleted file mode 100644 index d0cd409c5..000000000 --- a/samples/sensortag/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -*.xcodeproj/ -.DS_Store -.gradle -.idea -.kotlin/ -Info.plist -build/ -local.properties diff --git a/samples/sensortag/LICENSE.txt b/samples/sensortag/LICENSE.txt deleted file mode 100644 index 261eeb9e9..000000000 --- a/samples/sensortag/LICENSE.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - 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. diff --git a/samples/sensortag/README.md b/samples/sensortag/README.md index d3d490cac..e66ee1697 100644 --- a/samples/sensortag/README.md +++ b/samples/sensortag/README.md @@ -40,8 +40,8 @@ In Xcode, configure signing, then run. ### Web Assembly -A live demo can be viewed [here](https://juullabs.github.io/sensortag), or to build and launch the -demo within a browser window on your local machine, run: +A live demo can be viewed [here](https://juullabs.github.io/kable/sensortag), or to build and launch +the demo within a browser window on your local machine, run: ```shell ./gradlew :shared:wasmJsBrowserDevelopmentRun @@ -109,24 +109,6 @@ On Windows, the command is similar: .\gradlew.bat :shared:run ``` -# License - -``` -Copyright 2020 JUUL Labs, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -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. -``` - [SensorTag]: https://www.ti.com/tool/CC2650STK [Android Studio]: https://developer.android.com/studio diff --git a/samples/sensortag/android/build.gradle.kts b/samples/sensortag/android/build.gradle.kts index 52dc001fa..b1eee32ce 100644 --- a/samples/sensortag/android/build.gradle.kts +++ b/samples/sensortag/android/build.gradle.kts @@ -9,7 +9,7 @@ android { defaultConfig { applicationId = "com.juul.sensortag.android" - minSdk = libs.versions.android.min.get().toInt() + minSdk = 23 targetSdk = libs.versions.android.target.get().toInt() versionCode = 1 versionName = "1.0" diff --git a/samples/sensortag/bluetooth/build.gradle.kts b/samples/sensortag/bluetooth/build.gradle.kts index 229461103..d3b9f61a1 100644 --- a/samples/sensortag/bluetooth/build.gradle.kts +++ b/samples/sensortag/bluetooth/build.gradle.kts @@ -5,9 +5,10 @@ plugins { alias(libs.plugins.kotlin.multiplatform) } +@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class) kotlin { explicitApi() - jvmToolchain(libs.versions.jvm.get().toInt()) + jvmToolchain(libs.versions.jvm.toolchain.get().toInt()) android { namespace = "com.juul.sensortag.bluetooth" @@ -22,7 +23,7 @@ kotlin { sourceSets { commonMain.dependencies { - api(libs.coroutines) + api(libs.kotlinx.coroutines) api(projects.mokoPermissionsBluetooth) api(projects.mokoPermissionsCompose) } diff --git a/samples/sensortag/build.gradle.kts b/samples/sensortag/build.gradle.kts index a0ba86e3f..415c6cb15 100644 --- a/samples/sensortag/build.gradle.kts +++ b/samples/sensortag/build.gradle.kts @@ -8,7 +8,6 @@ buildscript { plugins { alias(libs.plugins.android.application) apply false alias(libs.plugins.android.kotlin.multiplatform.library) apply false - alias(libs.plugins.android.library) apply false alias(libs.plugins.compose) apply false alias(libs.plugins.compose.compiler) apply false alias(libs.plugins.kotlin.multiplatform) apply false diff --git a/samples/sensortag/gradle b/samples/sensortag/gradle new file mode 120000 index 000000000..1ce6c4c1e --- /dev/null +++ b/samples/sensortag/gradle @@ -0,0 +1 @@ +../../gradle \ No newline at end of file diff --git a/samples/sensortag/gradle/libs.versions.toml b/samples/sensortag/gradle/libs.versions.toml deleted file mode 100644 index 8213aac73..000000000 --- a/samples/sensortag/gradle/libs.versions.toml +++ /dev/null @@ -1,56 +0,0 @@ -[versions] -agp = "9.2.1" -android-compile = "36" -android-min = "23" -android-target = "33" -compose = "1.11.1" -jvm = "17" -kable = "0.43.1" -kotlin = "2.4.0" -kotlinx-coroutines = "1.11.0" -krayon = "0.24.0" -voyager = "2.2.21-1.10.3" - -[libraries] -androidx-lifecycle = { module = "androidx.lifecycle:lifecycle-common", version = "2.10.0" } -compose-activity = { module = "androidx.activity:activity-compose", version = "1.13.0" } -compose-ui = { module = "androidx.compose.ui:ui", version = "1.11.3" } -coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" } -coroutines-swing = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-swing", version.ref = "kotlinx-coroutines" } -datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version = "0.8.0-0.6.x-compat" } -desugar = { module = "com.android.tools:desugar_jdk_libs", version = "2.1.5" } -kable = { module = "com.juul.kable:kable-core", version.ref = "kable" } -kable-permissions = { module = "com.juul.kable:kable-default-permissions", version.ref = "kable" } -khronicle = { module = "com.juul.khronicle:khronicle-core", version = "1.1.0" } -krayon-axis = { module = "com.juul.krayon:axis", version.ref = "krayon" } -krayon-compose = { module = "com.juul.krayon:compose", version.ref = "krayon" } -krayon-scale = { module = "com.juul.krayon:scale", version.ref = "krayon" } -krayon-selection = { module = "com.juul.krayon:selection", version.ref = "krayon" } -krayon-shape = { module = "com.juul.krayon:shape", version.ref = "krayon" } -serialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version = "1.11.0" } -tuulbox-coroutines = { module = "com.juul.tuulbox:coroutines", version = "8.1.0" } -voyager-navigator = { module = "cafe.adriel.voyager:voyager-navigator", version.ref = "voyager" } -voyager-screenmodel = { module = "cafe.adriel.voyager:voyager-screenmodel", version.ref = "voyager" } -voyager-transitions = { module = "cafe.adriel.voyager:voyager-transitions", version.ref = "voyager" } - -[bundles] -krayon = [ - "krayon-axis", - "krayon-scale", - "krayon-selection", - "krayon-shape", -] -voyager = [ - "voyager-navigator", - "voyager-screenmodel", - "voyager-transitions", -] - -[plugins] -android-application = { id = "com.android.application", version.ref = "agp" } -android-kotlin-multiplatform-library = { id = "com.android.kotlin.multiplatform.library", version.ref = "agp" } -android-library = { id = "com.android.library", version.ref = "agp" } -compose = { id = "org.jetbrains.compose", version.ref = "compose" } -compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } -kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } -serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } diff --git a/samples/sensortag/gradle/wrapper/gradle-wrapper.jar b/samples/sensortag/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 61285a659..000000000 Binary files a/samples/sensortag/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/samples/sensortag/gradle/wrapper/gradle-wrapper.properties b/samples/sensortag/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 7e7d24f6f..000000000 --- a/samples/sensortag/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,7 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.0-bin.zip -networkTimeout=10000 -validateDistributionUrl=true -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/samples/sensortag/gradlew b/samples/sensortag/gradlew deleted file mode 100755 index adff685a0..000000000 --- a/samples/sensortag/gradlew +++ /dev/null @@ -1,248 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# 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. -# -# SPDX-License-Identifier: Apache-2.0 -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# 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/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=${0##*/} -# 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\n' "$PWD" ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -fi - -# Increase the maximum file descriptors if we can. -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=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=SC2039,SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -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 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" \ - -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/samples/sensortag/gradlew b/samples/sensortag/gradlew new file mode 120000 index 000000000..343e0d2ca --- /dev/null +++ b/samples/sensortag/gradlew @@ -0,0 +1 @@ +../../gradlew \ No newline at end of file diff --git a/samples/sensortag/gradlew.bat b/samples/sensortag/gradlew.bat deleted file mode 100644 index e509b2dd8..000000000 --- a/samples/sensortag/gradlew.bat +++ /dev/null @@ -1,93 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem -@rem SPDX-License-Identifier: Apache-2.0 -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:execute -@rem Setup the command line - - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/samples/sensortag/gradlew.bat b/samples/sensortag/gradlew.bat new file mode 120000 index 000000000..cb5a94645 --- /dev/null +++ b/samples/sensortag/gradlew.bat @@ -0,0 +1 @@ +../../gradlew.bat \ No newline at end of file diff --git a/samples/sensortag/kotlin-js-store/wasm/yarn.lock b/samples/sensortag/kotlin-js-store/wasm/yarn.lock new file mode 100644 index 000000000..5f4567d64 --- /dev/null +++ b/samples/sensortag/kotlin-js-store/wasm/yarn.lock @@ -0,0 +1,8 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@js-joda/core@3.2.0": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@js-joda/core/-/core-3.2.0.tgz#3e61e21b7b2b8a6be746df1335cf91d70db2a273" + integrity sha512-PMqgJ0sw5B7FKb2d5bWYIoxjri+QlW/Pys7+Rw82jSH0QN3rB05jZ/VrrsUdh1w4+i2kw9JOejXGq/KhDOX7Kg== diff --git a/samples/sensortag/moko-permissions-bluetooth/build.gradle.kts b/samples/sensortag/moko-permissions-bluetooth/build.gradle.kts index 90b3ef7fd..0ac76c5e4 100644 --- a/samples/sensortag/moko-permissions-bluetooth/build.gradle.kts +++ b/samples/sensortag/moko-permissions-bluetooth/build.gradle.kts @@ -7,8 +7,9 @@ plugins { alias(libs.plugins.kotlin.multiplatform) } +@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class) kotlin { - jvmToolchain(libs.versions.jvm.get().toInt()) + jvmToolchain(libs.versions.jvm.toolchain.get().toInt()) android { namespace = "dev.icerock.moko.permissions.bluetooth" @@ -35,7 +36,7 @@ kotlin { commonMain.dependencies { api(projects.mokoPermissions) - implementation(libs.coroutines) + implementation(libs.kotlinx.coroutines) } } } diff --git a/samples/sensortag/moko-permissions-compose/build.gradle.kts b/samples/sensortag/moko-permissions-compose/build.gradle.kts index 5ca66409b..c62e736a3 100644 --- a/samples/sensortag/moko-permissions-compose/build.gradle.kts +++ b/samples/sensortag/moko-permissions-compose/build.gradle.kts @@ -9,8 +9,9 @@ plugins { alias(libs.plugins.kotlin.multiplatform) } +@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class) kotlin { - jvmToolchain(libs.versions.jvm.get().toInt()) + jvmToolchain(libs.versions.jvm.toolchain.get().toInt()) android { namespace = "dev.icerock.moko.permissions.compose" diff --git a/samples/sensortag/moko-permissions/build.gradle.kts b/samples/sensortag/moko-permissions/build.gradle.kts index 04d3170ae..1fdccd969 100644 --- a/samples/sensortag/moko-permissions/build.gradle.kts +++ b/samples/sensortag/moko-permissions/build.gradle.kts @@ -3,8 +3,9 @@ plugins { alias(libs.plugins.kotlin.multiplatform) } +@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class) kotlin { - jvmToolchain(libs.versions.jvm.get().toInt()) + jvmToolchain(libs.versions.jvm.toolchain.get().toInt()) android { namespace = "dev.icerock.moko.permissions" @@ -30,7 +31,7 @@ kotlin { wasmJsMain.get().dependsOn(nopMain) commonMain.dependencies { - implementation(libs.coroutines) + implementation(libs.kotlinx.coroutines) } androidMain.dependencies { diff --git a/samples/sensortag/settings.gradle.kts b/samples/sensortag/settings.gradle.kts index 357403bb7..9ce65ddee 100644 --- a/samples/sensortag/settings.gradle.kts +++ b/samples/sensortag/settings.gradle.kts @@ -13,6 +13,8 @@ plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0" } +includeBuild("../..") + include( "android", "bluetooth", @@ -22,22 +24,3 @@ include( "moko-permissions-compose", "shared", ) - -// Configure sibling composite projects (`../`) by adding `composite.=true` to `local.properties`. -java.util.Properties() - .apply { - rootProject.projectDir - .resolve("local.properties") - .normalize() - .takeIf(File::exists) - ?.let { java.io.FileInputStream(it) } - ?.use(::load) - } - .run { - stringPropertyNames() - .filter { it.startsWith("composite.") && getProperty(it).toBoolean() } - .map { it.substringAfter('.') } - .onEach { logger.lifecycle("Including '$it' as a composite build") } - .map { "../$it" } - .forEach(::includeBuild) - } diff --git a/samples/sensortag/shared/build.gradle.kts b/samples/sensortag/shared/build.gradle.kts index 3ca3959fe..b0920e0ba 100644 --- a/samples/sensortag/shared/build.gradle.kts +++ b/samples/sensortag/shared/build.gradle.kts @@ -6,8 +6,9 @@ plugins { alias(libs.plugins.serialization) } +@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class) kotlin { - jvmToolchain(libs.versions.jvm.get().toInt()) + jvmToolchain(libs.versions.jvm.toolchain.get().toInt()) android { namespace = "com.juul.sensortag" @@ -20,7 +21,7 @@ kotlin { binaryOption("bundleId", "com.juul.sensortag.ios") binaryOption("bundleShortVersionString", "0.0.1") binaryOption("bundleVersion", "1") - export(libs.coroutines) + export(libs.kotlinx.coroutines) } } js { @@ -74,7 +75,7 @@ kotlin { jvmMain.get().dependsOn(notJsMain) commonMain.dependencies { - api(libs.coroutines) + api(libs.kotlinx.coroutines) implementation(compose.foundation) implementation(compose.material) implementation(compose.materialIconsExtended) @@ -100,7 +101,7 @@ kotlin { jvmMain.dependencies { implementation(compose.desktop.currentOs) - implementation(libs.coroutines.swing) + implementation(libs.kotlinx.coroutines.swing) } notJsMain.dependencies { diff --git a/settings.gradle.kts b/settings.gradle.kts index 8b13b4ca4..53e9fa137 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -9,6 +9,8 @@ pluginManagement { includeBuild("uniffi-plugin") } +includeBuild("samples/sensortag") + include( "kable-btleplug-ffi", "kable-core",