Skip to content

Commit 2c91cfa

Browse files
authored
Merge pull request #10 from anton6tak/#9-update-to-kotlin-1.5.20-and-gradle-0.7.2
#9 update to kotlin 1.5.20 and gradle 0.7.2
2 parents e188ab7 + 990edc9 commit 2c91cfa

25 files changed

+251
-216
lines changed

.github/workflows/compilation-check.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@ jobs:
1212

1313
steps:
1414
- uses: actions/checkout@v1
15-
- name: Set up JDK 1.8
15+
- name: Set up JDK 11
1616
uses: actions/setup-java@v1
1717
with:
18-
java-version: 1.8
18+
java-version: 11
1919
- name: Build and test
20-
run: ./gradlew build publishToMavenLocal
20+
run: ./gradlew build publishToMavenLocal syncMultiPlatformLibraryDebugFrameworkIosX64
21+
- name: Install pods with kotlin
22+
run: cd sample/ios-app && pod install
23+
- name: build ios sample
24+
run: cd sample/ios-app && xcodebuild -scheme TestProj -workspace TestProj.xcworkspace -configuration Debug -sdk iphonesimulator -arch x86_64 build CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | xcpretty

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121

2222
steps:
2323
- uses: actions/checkout@v1
24-
- name: Set up JDK 1.8
24+
- name: Set up JDK 11
2525
uses: actions/setup-java@v1
2626
with:
27-
java-version: 1.8
27+
java-version: 11
2828
- name: Publish library
2929
run: ./gradlew publish
3030
release:
@@ -40,6 +40,6 @@ jobs:
4040
with:
4141
commitish: ${{ github.ref }}
4242
tag_name: release/${{ github.event.inputs.version }}
43-
release_name: Release ${{ github.event.inputs.version }}
43+
release_name: ${{ github.event.inputs.version }}
4444
body: "Will be filled later"
4545
draft: true

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) [![Download](https://img.shields.io/maven-central/v/dev.icerock.moko/javascript) ](https://repo1.maven.org/maven2/dev/icerock/moko/javascript) ![kotlin-version](https://img.shields.io/badge/kotlin-1.4.32-orange)
1+
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) [![Download](https://img.shields.io/maven-central/v/dev.icerock.moko/javascript) ](https://repo1.maven.org/maven2/dev/icerock/moko/javascript) ![kotlin-version](https://kotlin-version.aws.icerock.dev/kotlin-version?group=dev.icerock.moko&name=javascript)
22

33
# Mobile Kotlin javascript
44
This is a Kotlin MultiPlatform library that allows you to run JavaScript code from common Kotlin code
@@ -22,10 +22,6 @@ This is a Kotlin MultiPlatform library that allows you to run JavaScript code fr
2222
- Android API 16+
2323
- iOS version 9.0+
2424

25-
## Versions
26-
- kotlin 1.4.32
27-
- 0.1.0
28-
2925
## Installation
3026
root build.gradle
3127
```groovy
@@ -39,17 +35,22 @@ allprojects {
3935
project build.gradle
4036
```groovy
4137
dependencies {
42-
commonMainApi("dev.icerock.moko:javascript:0.1.0")
38+
commonMainApi("dev.icerock.moko:javascript:0.2.0")
4339
}
4440
```
4541

4642
## Usage
4743
```kotlin
4844
val javaScriptEngine = JavaScriptEngine()
49-
val result: JsType = javaScriptEngine.evaluate(
50-
context = emptyMap(),
51-
script = """ "Hello" + "World" """.trimIndent()
52-
)
45+
val result: JsType = try {
46+
javaScriptEngine.evaluate(
47+
context = emptyMap(),
48+
script = """ "Hello" + "World" """.trimIndent()
49+
)
50+
} catch (ex: JavaScriptEvaluationException) {
51+
// Handle script evaluation error
52+
JsType.Null
53+
}
5354
if (result is JsType.Str) {
5455
println(result.value)
5556
}
@@ -83,4 +84,4 @@ More detailed guide for contributers see in [contributing guide](CONTRIBUTING.md
8384
distributed under the License is distributed on an "AS IS" BASIS,
8485
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8586
See the License for the specific language governing permissions and
86-
limitations under the License.
87+
limitations under the License.

build.gradle

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
5+
buildscript {
6+
repositories {
7+
mavenCentral()
8+
google()
9+
}
10+
dependencies {
11+
classpath(":javascript-build-logic")
12+
}
13+
}
14+
15+
allprojects {
16+
plugins.withId("org.gradle.maven-publish") {
17+
group = "dev.icerock.moko"
18+
version = libs.versions.mokoJavascriptVersion.get()
19+
}
20+
}

buildSrc/build.gradle.kts

Lines changed: 0 additions & 19 deletions
This file was deleted.

buildSrc/src/main/kotlin/Deps.kt

Lines changed: 0 additions & 58 deletions
This file was deleted.

buildSrc/src/main/kotlin/android-base-convention.gradle.kts

Lines changed: 0 additions & 10 deletions
This file was deleted.

buildSrc/src/main/kotlin/android-library-convention.gradle.kts

Lines changed: 0 additions & 4 deletions
This file was deleted.

buildSrc/src/main/kotlin/mpp-library-convention.gradle.kts

Lines changed: 0 additions & 5 deletions
This file was deleted.

gradle/libs.versions.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[versions]
2+
kotlinTestVersion = "1.5.20"
3+
androidAppCompatVersion = "1.2.0"
4+
materialDesignVersion = "1.0.0"
5+
androidLifecycleVersion = "2.1.0"
6+
androidCoreTestingVersion = "1.3.0"
7+
testJUnitExtVersion = "1.1.2"
8+
quickjsVersion = "0.9.0"
9+
coroutinesVersion = "1.5.0-native-mt"
10+
kotlinxSerializationVersion = "1.1.0"
11+
mokoTestVersion = "0.4.0"
12+
mokoJavascriptVersion = "0.2.0"
13+
14+
15+
[libraries]
16+
appCompat = { module = "androidx.appcompat:appcompat", version.ref = "androidAppCompatVersion" }
17+
material = { module = "com.google.android.material:material", version.ref = "materialDesignVersion" }
18+
lifecycle = { module = "androidx.lifecycle:lifecycle-extensions", version.ref = "androidLifecycleVersion" }
19+
kotlinTestJUnit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlinTestVersion" }
20+
testRunner = { module = "androidx.test:runner", version.ref = "androidCoreTestingVersion" }
21+
testRules = { module = "androidx.test:rules", version.ref = "androidCoreTestingVersion" }
22+
testJUnitExt = { module = "androidx.test.ext:junit", version.ref = "testJUnitExtVersion" }
23+
testJUnitExtKtx = { module = "androidx.test.ext:junit-ktx", version.ref = "testJUnitExtVersion" }
24+
quickjs = { module = "app.cash.quickjs:quickjs-android", version.ref = "quickjsVersion" }
25+
coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutinesVersion" }
26+
kotlinSerialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationVersion" }
27+
kotlinTest = { module = "org.jetbrains.kotlin:kotlin-test-common", version.ref = "kotlinTestVersion" }
28+
kotlinTestAnnotations = { module = "org.jetbrains.kotlin:kotlin-test-annotations-common", version.ref = "kotlinTestVersion" }
29+
mokoTest = { module = "dev.icerock.moko:test-core", version.ref = "mokoTestVersion" }

0 commit comments

Comments
 (0)