Skip to content

Commit

Permalink
bump version. gradle updates
Browse files Browse the repository at this point in the history
  • Loading branch information
abner committed Jun 24, 2023
1 parent 1e9a991 commit af8c96e
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.7.1
- async callback for JSC runtime
- upgraded jsc core in example app

# 0.7.0
- **Breaking**: require dart 3.0 and Flutter 3 and above
- now supports Flutter 3.10 and Dart 3.0
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ To debug JS code on iOS you need to set `javascriptRuntime.setInspectable(true);

On Android you could use JavascriptCore as well You just need add an Android dependency `implementation "com.github.fast-development.android-js-runtimes:fastdev-jsruntimes-jsc:0.3.4"` and pass `forceJavascriptCoreOnAndroid: true` to the function `getJavascriptRuntime`.


On MacOS the JavascriptCore, provided by the OSX is used. In Windows and Linux the engine used is the QuickJS. In the 0.4.0 version we borrowed the dart ffi source code from the flutter_qjs lib. `flutter_qjs` is a amazing package and they made a excelent work in build a good ffi bridge between Dart and JS, also doing the quickjs source code changes to allow it to run on WIndows. But, flutter_js take the approach to use JavascriptCore on IOS (mainly) to avoid refusals on the Apple Store, which state that `Apps may contain or run code that is not embedded in the binary (e.g. HTML5-based games, bots, etc.), as long as code distribution isn’t the main purpose of the app`. It also says `your app must use WebKit and JavaScript Core to run third-party software and should not attempt to extend or expose native platform APIs to third-party software;` Reference: https://developer.apple.com/app-store/review/guidelines/ [ Session 4.7]. So, we avoid to use quickjs in IOS apps, so flutter_js provides an abstraction called JavascriptRuntime which runs using JavascriptCore on Apple devices and Desktop and QuickJS in Android, Windows and Linux.

FLutterJS allows to use Javascript to execute validations logic of TextFormField, also we can execute rule engines or redux logic shared from our web applications. The opportunities are huge.
Expand Down
2 changes: 1 addition & 1 deletion android/.settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
connection.project.dir=../example/android
eclipse.preferences.version=1
gradle.user.home=
java.home=
Expand Down
28 changes: 26 additions & 2 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ android {
compileSdkVersion flutter.compileSdkVersion

ndkVersion "21.3.6528147"



compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
Expand All @@ -40,7 +41,10 @@ android {
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
main {
java.srcDirs += 'src/main/kotlin'
jniLibs.srcDirs = ['jniLibs']
}
}

defaultConfig {
Expand All @@ -52,6 +56,25 @@ android {
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName

// externalNativeBuild {
// cmake {
// cppFlags "-std=c++14 -fexceptions -frtti"
// arguments "-DANDROID_ARM_NEON=TRUE",'-DANDROID_STL=c++_shared'
// }
// }

externalNativeBuild {

cmake {

cppFlags ""

arguments "-DANDROID_STL=c++_shared", "-DANDROID_ARM_NEON=TRUE"

}

}
}

buildTypes {
Expand All @@ -74,5 +97,6 @@ flutter {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
// implementation "com.github.fast-development.android-js-runtimes:fastdev-jsruntimes-jsc-intl:0.3.4"
implementation "com.github.fast-development.android-js-runtimes:fastdev-jsruntimes-jsc:0.3.4"
}
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
8 changes: 7 additions & 1 deletion example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx1536M \
--add-exports=java.base/sun.nio.ch=ALL-UNNAMED \
--add-opens=java.base/java.lang=ALL-UNNAMED \
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED \
--add-opens=java.base/java.io=ALL-UNNAMED \
--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED

android.useAndroidX=true
android.enableJetifier=true
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.7.0"
version: "0.7.1"
flutter_lints:
dependency: "direct dev"
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: flutter_js
description: A Javascript engine to use with flutter.
It uses Quickjs on Android and JavascriptCore on IOS
version: 0.7.0
version: 0.7.1
homepage: https://github.com/abner/flutter_js
repository: https://github.com/abner/flutter_js

Expand Down

0 comments on commit af8c96e

Please sign in to comment.