Skip to content
Merged

Release #1467

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
abf71d7
Remove usage of non-public value field (#1434)
vmutafov Jul 29, 2019
3e12f7d
Merge branch 'release'
vtrifonov Aug 7, 2019
d3d6470
bump versions
vtrifonov Aug 7, 2019
397cf61
Remove usage of deprecated DexFile api (#1438)
vmutafov Aug 8, 2019
7ba2cdf
Update V8 to 7.6.303.28
darind Jul 25, 2019
9087341
feat: unify stack trace format
vtrifonov Aug 9, 2019
2847dda
Merge pull request #1440 from NativeScript/darind/v8-7.6.303.28
Aug 12, 2019
ab1ae81
Merge pull request #1444 from NativeScript/trifonov/remove-frame-stac…
vtrifonov Aug 13, 2019
ca66602
Fix typo (#1447)
thomas-alrek Aug 20, 2019
bc4365f
Added x86_64 architecture (#1449)
darind Aug 20, 2019
bb727d0
Update sdk and build tools version to 29 (#1450)
vmutafov Aug 21, 2019
5932faa
chore: update android gradle to latest version
vtrifonov Aug 26, 2019
8320d47
libzip.a with all optimizations
darind Aug 26, 2019
7bd7b51
Merge pull request #1455 from NativeScript/darind/libzip_release
vtrifonov Aug 26, 2019
5ab02e8
Merge pull request #1454 from NativeScript/trifonov/gradle-update
vtrifonov Aug 26, 2019
2d0d198
Add initial Kotlin support (#1457)
vmutafov Aug 27, 2019
30cc53c
Update CHANGELOG.md (#1460)
vmutafov Aug 28, 2019
d3e16ef
Merge branch 'release' into darind/release
darind Aug 29, 2019
6bad2c0
Merge pull request #1462 from NativeScript/darind/release
darind Aug 29, 2019
ad6a775
Add gradle.properties support
vmutafov Aug 29, 2019
274ad96
Bumping version
vtrifonov Aug 29, 2019
8d666a9
Update v8-versions.json
vtrifonov Aug 29, 2019
b13a13b
Merge branch 'release'
vtrifonov Aug 29, 2019
0148715
Revert "Bumping version"
vtrifonov Aug 29, 2019
46ba252
Revert "Update v8-versions.json"
vtrifonov Aug 29, 2019
218ceb7
Merge pull request #1464 from NativeScript/vmutafov/add-gradle-proper…
Aug 29, 2019
c3ce0c2
Update CHANGELOG.
Aug 29, 2019
abc97d0
Merge pull request #1466 from NativeScript/vhristov/update-change-log
Aug 29, 2019
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ bin/
.settings

.classpath
android-runtime.iml
android-runtime.iml
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
env:
global:
- NODE_VERSION=10
- NDK_VERSION=r19c
- NDK_VERSION=r20
- DATE=$(date +%Y-%m-%d)
- PACKAGE_VERSION=next-$DATE-$TRAVIS_BUILD_NUMBER
- EMULATOR_API_LEVEL=21
- ANDROID_ABI=armeabi-v7a
- EMULATOR_NAME=runtime-emu
- BUILD_TOOLS=28.0.3
- ANDROID_API=28
- BUILD_TOOLS=29.0.2
- ANDROID_API=29

matrix:
include:
Expand Down
21 changes: 19 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
6.1.0
==

## What's New
- [Runtime Binding Generator depends on deprecated APIs #1441)](https://github.com/NativeScript/android-runtime/issues/1441)
- [The runtime depends on accessing a hidden value field (#1458)](https://github.com/NativeScript/android-runtime/issues/1458)
- [Upgrade v8 to 7.6.303.28 (#1439)](https://github.com/NativeScript/android-runtime/issues/1439)
- [Unify JS stack trace when exception is thrown #1443](https://github.com/NativeScript/android-runtime/issues/1443)
- [Update androidSdk, targetSdk and build tools to 29 (#1452)](https://github.com/NativeScript/android-runtime/issues/1452)
- [Upgrade android gradle plugin to the latest 3.5.0 version (#1456)](https://github.com/NativeScript/android-runtime/issues/1456)
- [Add initial Kotlin support (#1459)](https://github.com/NativeScript/android-runtime/issues/1459)
- [Add support for user defined gradle.properties (#1463)](https://github.com/NativeScript/android-runtime/issues/1463)


## Bug Fixes

- [SIGSEGV in libNativeScript.so on callback from java with console.log when displaying an object. #1366](https://github.com/NativeScript/android-runtime/issues/1366)

6.0.2
==

## What's New

- [Include x86_64 architecture](https://github.com/NativeScript/android-runtime/issues/1419)
- [Include x86_64 architecture](https://github.com/NativeScript/android-runtime/issues/1419)

6.0.1
==
Expand All @@ -16,7 +34,6 @@
- [Upgrade android gradle plugin to the latest 3.4.2 version (#1425)](https://github.com/NativeScript/android-runtime/issues/1425)



6.0.0
==

Expand Down
2 changes: 1 addition & 1 deletion build-artifacts/project-template-gradle/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"v8Version": "7.5.288.22",
"v8Version": "7.6.303.28",
"mksnapshotParams": "--profile_deserialization --turbo_instruction_scheduling --target_os=android --no-native-code-counters"
}
8 changes: 8 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,14 @@ task copyFilesToProjectTemeplate {
from "$TEST_APP_PATH/build.gradle"
into "$DIST_FRAMEWORK_PATH"
}
copy {
from "$TEST_APP_PATH/paths.gradle"
into "$DIST_FRAMEWORK_PATH"
}
copy {
from "$TEST_APP_PATH/user_properties_reader.gradle"
into "$DIST_FRAMEWORK_PATH"
}
copy {
from "$TEST_APP_PATH/gradle"
into "$DIST_FRAMEWORK_PATH/gradle"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tns-android",
"description": "NativeScript Runtime for Android",
"version": "6.0.2",
"version": "6.1.0",
"repository": {
"type": "git",
"url": "https://github.com/NativeScript/android-runtime.git"
Expand All @@ -10,8 +10,8 @@
"**/*"
],
"gradle": {
"version": "5.1.1",
"android": "3.4.2"
"version": "5.4.1",
"android": "3.5.0"
},
"android_ndk_version": "19c"
"android_ndk_version": "20"
}
56 changes: 47 additions & 9 deletions test-app/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,25 @@
* -PandroidXMaterial=[androidx_material_version]
*/


import groovy.io.FileType
import groovy.json.JsonSlurper

import javax.inject.Inject
import java.nio.file.Files
import java.nio.file.Paths
import java.nio.file.StandardCopyOption
import groovy.io.FileType
import java.security.MessageDigest
import javax.inject.Inject

apply plugin: "com.android.application"

def enableKotlin = (project.hasProperty("useKotlin") && project.useKotlin == "true")

if (enableKotlin) {
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
}

def onlyX86 = project.hasProperty("onlyX86")
if (onlyX86) {
println "OnlyX86 build triggered."
Expand Down Expand Up @@ -61,10 +71,11 @@ def METADATA_OUT_PATH = "$projectDir/src/main/assets/metadata"
def pluginsJarLibraries = new LinkedList<String>()
def allJarLibraries = new LinkedList<String>()

def computeCompileSdkVersion = { -> project.hasProperty("compileSdk") ? compileSdk : 28 }
def computeTargetSdkVersion = { -> project.hasProperty("targetSdk") ? targetSdk : 28 }
def computeKotlinVersion = { -> project.hasProperty("kotlinVersion") ? kotlinVersion : "1.3.41" }
def computeCompileSdkVersion = { -> project.hasProperty("compileSdk") ? compileSdk : 29 }
def computeTargetSdkVersion = { -> project.hasProperty("targetSdk") ? targetSdk : 29 }
def computeBuildToolsVersion = { ->
project.hasProperty("buildToolsVersion") ? buildToolsVersion : "28.0.3"
project.hasProperty("buildToolsVersion") ? buildToolsVersion : "29.0.2"
}

project.ext.selectedBuildType = project.hasProperty("release") ? "release" : "debug"
Expand Down Expand Up @@ -217,6 +228,13 @@ def setAppIdentifier = { ->
}

android {

if (enableKotlin) {
kotlinOptions {
jvmTarget = '1.8'
}
}

compileSdkVersion computeCompileSdkVersion()
buildToolsVersion computeBuildToolsVersion()

Expand Down Expand Up @@ -302,6 +320,7 @@ repositories {
dirs pluginDependencies
}
}
mavenCentral()
}

dependencies {
Expand All @@ -320,9 +339,9 @@ dependencies {
androidXMaterialVersion = androidXMaterial
}

println "\t + using andorid X library androidx.legacy:legacy-support-v4:$androidXLegacyVersion"
println "\t + using android X library androidx.legacy:legacy-support-v4:$androidXLegacyVersion"

implementation "androidx.multidex:multidex:2.0.0"
implementation "androidx.multidex:multidex:2.0.1"
implementation "androidx.legacy:legacy-support-v4:$androidXLegacyVersion"
implementation "androidx.appcompat:appcompat:$androidXAppCompatVersion"
implementation "com.google.android.material:material:$androidXMaterialVersion"
Expand Down Expand Up @@ -361,6 +380,11 @@ dependencies {
implementation project(':runtime')
}

def kotlinVersion = computeKotlinVersion()
if (enableKotlin) {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
}

}

////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -545,7 +569,7 @@ afterEvaluate { project ->
// if there's a project dependency search for its result jar file in the build/intermediates/runtime_library_classes folder
// this is the output folder in gradle 5.1.1, but it can be changed in the future versions of gradle
def jarDir = new File("${it.getBuildDir()}/intermediates/runtime_library_classes/${buildType.toLowerCase()}")
if(jarDir.exists()) {
if (jarDir.exists()) {
jarDir.eachFileRecurse(FileType.FILES) { file ->
if (file.path.endsWith(".jar")) {
processJar(file, jars)
Expand Down Expand Up @@ -574,7 +598,7 @@ def processJar(File jar, jars) {
// directory is a randomly generated string)
cleanupAllJars.inputs.files jar

task "${taskName}" (type: WorkerTask) {
task "${taskName}"(type: WorkerTask) {
dependsOn cleanupAllJars
extractAllJars.dependsOn it

Expand Down Expand Up @@ -683,6 +707,11 @@ task buildMetadata(type: JavaExec) {
def classesDir = "$buildDir/intermediates/javac"
inputs.dir(classesDir)

def kotlinClassesDir = "$buildDir/tmp/kotlin-classes"
if (file(kotlinClassesDir).exists()) {
inputs.dir(kotlinClassesDir)
}

outputs.files("$METADATA_OUT_PATH/treeNodeStream.dat", "$METADATA_OUT_PATH/treeStringsStream.dat", "$METADATA_OUT_PATH/treeValueStream.dat")

doFirst {
Expand All @@ -700,6 +729,15 @@ task buildMetadata(type: JavaExec) {
}
}

if (file(kotlinClassesDir).exists()) {
def kotlinClassesSubDirs = new File(kotlinClassesDir).listFiles()
for (File subDir : kotlinClassesSubDirs) {
if (subDir.getName() == selectedBuildType) {
generatedClasses.add(subDir.getAbsolutePath())
}
}
}

new File("$BUILD_TOOLS_PATH/$MDG_OUTPUT_DIR").withWriter { out ->
out.println "$METADATA_OUT_PATH"
}
Expand Down
7 changes: 6 additions & 1 deletion test-app/app/src/main/assets/app/mainpage.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,9 @@ require("./tests/dex-interface-implementation");
require("./tests/testInterfaceImplementation");
require("./tests/testRuntimeImplementedAPIs");
require("./tests/testsInstanceOfOperator");
require("./tests/testReleaseNativeCounterpart");
require("./tests/testReleaseNativeCounterpart");
require("./tests/kotlin/companions/testCompanionObjectsSupport");
require("./tests/kotlin/properties/testPropertiesSupport");
require("./tests/kotlin/delegation/testDelegationSupport");
require("./tests/kotlin/objects/testObjectsSupport");
require("./tests/kotlin/functions/testTopLevelFunctionsSupport");
Binary file modified test-app/app/src/main/assets/app/modules/libCalc-arm.so
Binary file not shown.
Binary file modified test-app/app/src/main/assets/app/modules/libCalc-arm64.so
Binary file not shown.
Binary file modified test-app/app/src/main/assets/app/modules/libCalc-x86.so
Binary file not shown.
Binary file modified test-app/app/src/main/assets/app/modules/libCalc-x86_64.so
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
describe("Tests Kotlin companion objects support", function () {
it("Test Kotlin companion object without a name should be supported", function () {
var stringFromCompanion = com.tns.tests.kotlin.companions.KotlinClassWithCompanion.Companion.getStringFromCompanion();
expect(stringFromCompanion).toBe("testCompanion");

var providedStringFromCompanion = com.tns.tests.kotlin.companions.KotlinClassWithCompanion.Companion.getProvidedStringFromCompanion("providedString");
expect(providedStringFromCompanion).toBe("providedString");

var simpleObjectFromCompanion = com.tns.tests.kotlin.companions.KotlinClassWithCompanion.Companion.getSimpleObjectFromCompanion();
expect(simpleObjectFromCompanion.getSomeString()).toBe("test");

var simpleKotlinObject = new com.tns.tests.kotlin.SimpleKotlinObject();
var providedSimpleObjectFromCompanion = com.tns.tests.kotlin.companions.KotlinClassWithCompanion.Companion.getProvidedSimpleObjectFromCompanion(simpleKotlinObject);
expect(simpleKotlinObject.equals(providedSimpleObjectFromCompanion)).toBe(true);

var stringJvmStaticFromCompanion = com.tns.tests.kotlin.companions.KotlinClassWithCompanion.getStringJvmStaticFromCompanion();
expect(stringJvmStaticFromCompanion).toBe("testCompanion");

var providedStringJvmStaticFromCompanion = com.tns.tests.kotlin.companions.KotlinClassWithCompanion.getProvidedStringJvmStaticFromCompanion("providedString");
expect(providedStringJvmStaticFromCompanion).toBe("providedString");
});

it("Test Kotlin named companion object without a name should be supported", function () {
var stringFromCompanion = com.tns.tests.kotlin.companions.KotlinClassWithNamedCompanion.NamedCompanion.getStringFromNamedCompanion();
expect(stringFromCompanion).toBe("testCompanion");

var providedStringFromCompanion = com.tns.tests.kotlin.companions.KotlinClassWithNamedCompanion.NamedCompanion.getProvidedStringFromNamedCompanion("providedString");
expect(providedStringFromCompanion).toBe("providedString");

var simpleObjectFromCompanion = com.tns.tests.kotlin.companions.KotlinClassWithNamedCompanion.NamedCompanion.getSimpleObjectFromNamedCompanion();
expect(simpleObjectFromCompanion.getSomeString()).toBe("test");

var simpleKotlinObject = new com.tns.tests.kotlin.SimpleKotlinObject();
var providedSimpleObjectFromCompanion = com.tns.tests.kotlin.companions.KotlinClassWithNamedCompanion.NamedCompanion.getProvidedSimpleObjectFromNamedCompanion(simpleKotlinObject);
expect(simpleKotlinObject.equals(providedSimpleObjectFromCompanion)).toBe(true);

var stringJvmStaticFromCompanion = com.tns.tests.kotlin.companions.KotlinClassWithNamedCompanion.getStringJvmStaticFromNamedCompanion();
expect(stringJvmStaticFromCompanion).toBe("testCompanion");

var providedStringJvmStaticFromCompanion = com.tns.tests.kotlin.companions.KotlinClassWithNamedCompanion.getProvidedStringJvmStaticFromNamedCompanion("providedString");
expect(providedStringJvmStaticFromCompanion).toBe("providedString");
});


it("Test Kotlin interface companion object without a name should be supported", function () {
var stringFromCompanion = com.tns.tests.kotlin.companions.KotlinInterfaceWithCompanion.Companion.getStringFromCompanion();
expect(stringFromCompanion).toBe("testCompanion");

var providedStringFromCompanion = com.tns.tests.kotlin.companions.KotlinInterfaceWithCompanion.Companion.getProvidedStringFromCompanion("providedString");
expect(providedStringFromCompanion).toBe("providedString");

var simpleObjectFromCompanion = com.tns.tests.kotlin.companions.KotlinInterfaceWithCompanion.Companion.getSimpleObjectFromCompanion();
expect(simpleObjectFromCompanion.getSomeString()).toBe("test");

var simpleKotlinObject = new com.tns.tests.kotlin.SimpleKotlinObject();
var providedSimpleObjectFromCompanion = com.tns.tests.kotlin.companions.KotlinInterfaceWithCompanion.Companion.getProvidedSimpleObjectFromCompanion(simpleKotlinObject);
expect(simpleKotlinObject.equals(providedSimpleObjectFromCompanion)).toBe(true);

var stringJvmStaticFromCompanion = com.tns.tests.kotlin.companions.KotlinInterfaceWithCompanion.getStringJvmStaticFromCompanion();
expect(stringJvmStaticFromCompanion).toBe("testCompanion");

var providedStringJvmStaticFromCompanion = com.tns.tests.kotlin.companions.KotlinInterfaceWithCompanion.getProvidedStringJvmStaticFromCompanion("providedString");
expect(providedStringJvmStaticFromCompanion).toBe("providedString");
});

it("Test Kotlin interface named companion object without a name should be supported", function () {
var stringFromCompanion = com.tns.tests.kotlin.companions.KotlinInterfaceWithNamedCompanion.NamedCompanion.getStringFromNamedCompanion();
expect(stringFromCompanion).toBe("testCompanion");

var providedStringFromCompanion = com.tns.tests.kotlin.companions.KotlinInterfaceWithNamedCompanion.NamedCompanion.getProvidedStringFromNamedCompanion("providedString");
expect(providedStringFromCompanion).toBe("providedString");

var simpleObjectFromCompanion = com.tns.tests.kotlin.companions.KotlinInterfaceWithNamedCompanion.NamedCompanion.getSimpleObjectFromNamedCompanion();
expect(simpleObjectFromCompanion.getSomeString()).toBe("test");

var simpleKotlinObject = new com.tns.tests.kotlin.SimpleKotlinObject();
var providedSimpleObjectFromCompanion = com.tns.tests.kotlin.companions.KotlinInterfaceWithNamedCompanion.NamedCompanion.getProvidedSimpleObjectFromNamedCompanion(simpleKotlinObject);
expect(simpleKotlinObject.equals(providedSimpleObjectFromCompanion)).toBe(true);

var stringJvmStaticFromCompanion = com.tns.tests.kotlin.companions.KotlinInterfaceWithNamedCompanion.getStringJvmStaticFromNamedCompanion();
expect(stringJvmStaticFromCompanion).toBe("testCompanion");

var providedStringJvmStaticFromCompanion = com.tns.tests.kotlin.companions.KotlinInterfaceWithNamedCompanion.getProvidedStringJvmStaticFromNamedCompanion("providedString");
expect(providedStringJvmStaticFromCompanion).toBe("providedString");
});

it("Test Kotlin class whose parent class contains a companion should work", function () {
var child = new com.tns.tests.kotlin.companions.ChildKotlinClass();
var str = child.getStringFromCompanion();
expect(str).toBe("someString");
});

});
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
describe("Tests Kotlin delegation support", function () {
it("Test Kotlin class implementation delegation should work", function () {
var delegationObject = new com.tns.tests.kotlin.delegation.DelegationClass();
expect(delegationObject.getString()).toBe("some string");
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
describe("Tests Kotlin top level functions support", function () {
it("Test Kotlin top level functions in an unnamed class should work", function () {
var res = com.tns.tests.kotlin.functions.TopLevelFunctionsKt.getRandomNumber();
expect(res).toBe(42);
});

it("Test Kotlin top level functions in a named class should work", function () {
var res = com.tns.tests.kotlin.functions.DemoUtils.getRandomString();
expect(res).toBe("42");
});

it("Test Kotlin top level functions in a named multifile class should work", function () {
var res1 = com.tns.tests.kotlin.multifiles.Utils.getNewString();
expect(res1).toBe("new string");

var res2 = com.tns.tests.kotlin.multifiles.Utils.getOldString();
expect(res2).toBe("old string");
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
describe("Tests Kotlin objects support", function () {
it("Test Kotlin object instances should be the same reference", function () {
var kotlinClass = com.tns.tests.kotlin.objects.KotlinSingleton.INSTANCE;
var kotlinClass2 = com.tns.tests.kotlin.objects.KotlinSingleton.INSTANCE;
expect(com.tns.EqualityComparator.areReferencesEqual(kotlinClass, kotlinClass2)).toBe(true);
});
});
Loading