Skip to content

Commit 84561bb

Browse files
authored
Merge branch 'main' into fix/performance
2 parents 5ea3e2c + 3423e6f commit 84561bb

File tree

12 files changed

+124
-62
lines changed

12 files changed

+124
-62
lines changed

.github/workflows/npm_release.yml

+14-1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ jobs:
7777
with:
7878
name: npm-package
7979
path: dist/nativescript-android-${{steps.npm_version_output.outputs.NPM_VERSION}}.tgz
80+
- name: Upload debug symbols
81+
uses: actions/upload-artifact@v3
82+
with:
83+
name: debug-symbols
84+
path: test-app/runtime/build/intermediates/merged_native_libs/release/mergeReleaseNativeLibs/out/lib/*
85+
8086
test:
8187
name: Test
8288
runs-on: macos-13
@@ -174,10 +180,17 @@ jobs:
174180
with:
175181
name: npm-package
176182
path: dist
183+
- uses: actions/download-artifact@v3
184+
with:
185+
name: debug-symbols
186+
path: dist/debug-symbols
187+
- name: Zip debug symbols
188+
working-directory: dist/debug-symbols
189+
run: zip -r debug-symbols.zip .
177190
- name: Partial Changelog
178191
run: npx conventional-changelog -p angular -r2 > body.md
179192
- uses: ncipollo/release-action@v1
180193
with:
181-
artifacts: "dist/nativescript-android-*.tgz"
194+
artifacts: "dist/nativescript-android-*.tgz,dist/debug-symbols/debug-symbols.zip"
182195
bodyFile: "body.md"
183196
prerelease: ${{needs.build.outputs.npm_tag != 'latest'}}

.github/workflows/pull_request.yml

+5
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ jobs:
7474
with:
7575
name: npm-package
7676
path: dist/nativescript-android-${{steps.npm_version_output.outputs.NPM_VERSION}}.tgz
77+
- name: Upload debug symbols
78+
uses: actions/upload-artifact@v3
79+
with:
80+
name: debug-symbols
81+
path: test-app/runtime/build/intermediates/merged_native_libs/release/mergeReleaseNativeLibs/out/lib/*
7782
test:
7883
name: Test
7984
runs-on: macos-13

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## [8.8.6](https://github.com/NativeScript/android/compare/v8.8.5...v8.8.6) (2024-10-28)
2+
3+
4+
### Bug Fixes
5+
6+
* `exit(0)` causes ANR due to destroyed mutex ([#1820](https://github.com/NativeScript/android/issues/1820)) ([94ddb15](https://github.com/NativeScript/android/commit/94ddb159ccf368edebce76a8aa01d141d7297b1a))
7+
* gradle error when compileSdk or targetSdk is provided ([#1825](https://github.com/NativeScript/android/issues/1825)) ([a983931](https://github.com/NativeScript/android/commit/a983931cf5e9fcc7966a98a2f0ec4e24e040af5e))
8+
* **URL:** allow undefined 2nd args ([#1826](https://github.com/NativeScript/android/issues/1826)) ([2bab8f5](https://github.com/NativeScript/android/commit/2bab8f5be85c8764faafef4d6374dc8cfd257613))
9+
10+
11+
112
## [8.8.5](https://github.com/NativeScript/android/compare/v8.8.4...v8.8.5) (2024-09-30)
213

314

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@nativescript/android",
33
"description": "NativeScript for Android using v8",
4-
"version": "8.8.5",
4+
"version": "8.9.0",
55
"repository": {
66
"type": "git",
77
"url": "https://github.com/NativeScript/android.git"

test-app/app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ def METADATA_JAVA_OUT = "mdg-java-out.txt"
7777
def pluginsJarLibraries = new LinkedList<String>()
7878
def allJarLibraries = new LinkedList<String>()
7979

80-
def computeCompileSdkVersion = { -> project.hasProperty("compileSdk") ? compileSdk : NS_DEFAULT_COMPILE_SDK_VERSION as int }
81-
def computeTargetSdkVersion = { -> project.hasProperty("targetSdk") ? targetSdk : NS_DEFAULT_COMPILE_SDK_VERSION as int }
80+
def computeCompileSdkVersion = { -> project.hasProperty("compileSdk") ? compileSdk as int : NS_DEFAULT_COMPILE_SDK_VERSION as int }
81+
def computeTargetSdkVersion = { -> project.hasProperty("targetSdk") ? targetSdk as int : NS_DEFAULT_COMPILE_SDK_VERSION as int }
8282
def computeMinSdkVersion = { -> project.hasProperty("minSdk") ? minSdk : NS_DEFAULT_MIN_SDK_VERSION as int }
8383
def computeBuildToolsVersion = { ->
8484
project.hasProperty("buildToolsVersion") ? buildToolsVersion : NS_DEFAULT_BUILD_TOOLS_VERSION as String
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,62 @@
1-
describe("Test URL ", function () {
2-
3-
it("Test invalid URL parsing", function(){
4-
var exceptionCaught = false;
5-
try {
6-
const url = new URL('');
7-
}catch(e){
8-
exceptionCaught = true;
9-
}
10-
expect(exceptionCaught).toBe(true);
1+
describe("URL", function () {
2+
it("throws on invalid URL", function () {
3+
var exceptionCaught = false;
4+
try {
5+
const url = new URL("");
6+
} catch (e) {
7+
exceptionCaught = true;
8+
}
9+
expect(exceptionCaught).toBe(true);
1110
});
12-
13-
it("Test valid URL parsing", function(){
14-
var exceptionCaught = false;
15-
try {
16-
const url = new URL('https://google.com');
17-
}catch(e){
18-
exceptionCaught = true;
19-
}
20-
expect(exceptionCaught).toBe(false);
11+
12+
it("does not throw on valid URL", function () {
13+
var exceptionCaught = false;
14+
try {
15+
const url = new URL("https://google.com");
16+
} catch (e) {
17+
exceptionCaught = true;
18+
}
19+
expect(exceptionCaught).toBe(false);
2120
});
22-
23-
24-
it("Test URL fields", function(){
25-
var exceptionCaught = false;
26-
const url = new URL('https://google.com');
27-
expect(url.protocol).toBe('https:');
28-
expect(url.hostname).toBe('google.com');
21+
22+
it("parses simple urls", function () {
23+
const url = new URL("https://google.com");
24+
expect(url.protocol).toBe("https:");
25+
expect(url.hostname).toBe("google.com");
26+
expect(url.pathname).toBe("/");
27+
expect(url.port).toBe("");
28+
expect(url.search).toBe("");
29+
expect(url.hash).toBe("");
30+
expect(url.username).toBe("");
31+
expect(url.password).toBe("");
32+
expect(url.origin).toBe("https://google.com");
33+
expect(url.searchParams.size).toBe(0);
2934
});
30-
31-
});
35+
36+
it("parses with undefined base", function () {
37+
const url = new URL("https://google.com", undefined);
38+
expect(url.protocol).toBe("https:");
39+
expect(url.hostname).toBe("google.com");
40+
});
41+
42+
it("parses with null base", function () {
43+
const url = new URL("https://google.com", null);
44+
expect(url.protocol).toBe("https:");
45+
expect(url.hostname).toBe("google.com");
46+
});
47+
48+
it("parses query strings", function () {
49+
const url = new URL("https://google.com?q=hello");
50+
expect(url.search).toBe("?q=hello");
51+
expect(url.searchParams.get("q")).toBe("hello");
52+
expect(url.pathname).toBe("/");
53+
});
54+
55+
it("parses query strings with pathname", function () {
56+
const url = new URL("https://google.com/some/path?q=hello");
57+
expect(url.search).toBe("?q=hello");
58+
expect(url.searchParams.get("q")).toBe("hello");
59+
expect(url.pathname).toBe("/some/path");
60+
});
61+
});
62+

test-app/gradle.properties

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ android.enableJetifier=true
1919
android.useAndroidX=true
2020

2121
# Default versions used throughout the gradle configurations
22-
NS_DEFAULT_BUILD_TOOLS_VERSION=34.0.0
23-
NS_DEFAULT_COMPILE_SDK_VERSION=34
22+
NS_DEFAULT_BUILD_TOOLS_VERSION=35.0.0
23+
NS_DEFAULT_COMPILE_SDK_VERSION=35
2424
NS_DEFAULT_MIN_SDK_VERSION=17
25-
NS_DEFAULT_ANDROID_BUILD_TOOLS_VERSION=8.3.2
25+
NS_DEFAULT_ANDROID_BUILD_TOOLS_VERSION=8.5.0
2626

2727
ns_default_androidx_appcompat_version = 1.5.1
2828
ns_default_androidx_exifinterface_version = 1.3.7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

test-app/runtime/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@ if("${ANDROID_ABI}" MATCHES "armeabi-v7a$" OR "${ANDROID_ABI}" MATCHES "x86$")
183183
target_link_libraries(NativeScript ${ANDROID_NDK_ROOT}/sources/cxx-stl/llvm-libc++/libs/${ANDROID_ABI}/libandroid_support.a)
184184
endif()
185185

186+
187+
if("${ANDROID_ABI}" MATCHES "arm64-v8a$" OR "${ANDROID_ABI}" MATCHES "x86_64$")
188+
target_link_options(NativeScript PRIVATE "-Wl,-z,max-page-size=16384")
189+
endif()
190+
186191
# Command info: https://cmake.org/cmake/help/v3.4/command/find_library.html
187192
# Searches for a specified prebuilt library and stores the path as a
188193
# variable. Because CMake includes system libraries in the search path by

test-app/runtime/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ android {
114114
// arguments "-DANDROID_TOOLCHAIN=clang", "-DANDROID_STL=c++_static", "-DANDROID_NDK_ROOT=${NDK_PATH}"
115115

116116
cppFlags "-std=c++14"
117-
arguments "-DANDROID_STL=c++_shared", "-DANDROID_NDK_ROOT=${NDK_PATH}"
117+
arguments "-DANDROID_STL=c++_static", "-DANDROID_NDK_ROOT=${NDK_PATH}"
118118
}
119119
}
120120

test-app/runtime/src/main/cpp/MetadataNode.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1864,7 +1864,7 @@ void MetadataNode::BuildMetadata(const string& filesPath) {
18641864
// startup because the receiver is triggered. So even though we are exiting, the receiver will have
18651865
// done its job
18661866

1867-
exit(0);
1867+
_Exit(0);
18681868
}
18691869
else {
18701870
throw NativeScriptException(ss.str());

test-app/runtime/src/main/cpp/URLImpl.cpp

+21-24
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,16 @@ void URLImpl::Ctor(const v8::FunctionCallbackInfo<v8::Value> &args) {
131131

132132
auto result = ada::parse<ada::url_aggregator>(url_string, &base_url.value());
133133

134+
if (result) {
135+
url = result.value();
136+
} else {
137+
isolate->ThrowException(
138+
v8::Exception::TypeError(v8::String::Empty(isolate)));
139+
return;
140+
}
141+
} else {
142+
// treat 2nd arg as undefined otherwise.
143+
auto result = ada::parse<ada::url_aggregator>(url_string, nullptr);
134144
if (result) {
135145
url = result.value();
136146
} else {
@@ -139,7 +149,6 @@ void URLImpl::Ctor(const v8::FunctionCallbackInfo<v8::Value> &args) {
139149
return;
140150
}
141151
}
142-
143152
} else {
144153
auto result = ada::parse<ada::url_aggregator>(url_string, nullptr);
145154
if (result) {
@@ -149,7 +158,6 @@ void URLImpl::Ctor(const v8::FunctionCallbackInfo<v8::Value> &args) {
149158
v8::Exception::TypeError(v8::String::Empty(isolate)));
150159
return;
151160
}
152-
153161
}
154162

155163
auto ret = args.This();
@@ -162,7 +170,6 @@ void URLImpl::Ctor(const v8::FunctionCallbackInfo<v8::Value> &args) {
162170
urlImpl->BindFinalizer(isolate, ret);
163171

164172
args.GetReturnValue().Set(ret);
165-
166173
}
167174

168175

@@ -178,7 +185,6 @@ void URLImpl::GetHash(v8::Local<v8::String> property,
178185
auto value = ptr->GetURL()->get_hash();
179186
info.GetReturnValue().Set(
180187
ArgConverter::ConvertToV8String(isolate, value.data(), value.length()));
181-
182188
}
183189

184190
void URLImpl::SetHash(v8::Local<v8::String> property,
@@ -235,7 +241,6 @@ void URLImpl::GetHostName(v8::Local<v8::String> property,
235241

236242
info.GetReturnValue().Set(
237243
ArgConverter::ConvertToV8String(isolate, value.data(), value.length()));
238-
239244
}
240245

241246
void URLImpl::SetHostName(v8::Local<v8::String> property,
@@ -265,7 +270,6 @@ void URLImpl::GetHref(v8::Local<v8::String> property,
265270

266271
info.GetReturnValue().Set(
267272
ArgConverter::ConvertToV8String(isolate, value.data(), value.length()));
268-
269273
}
270274

271275
void URLImpl::SetHref(v8::Local<v8::String> property,
@@ -294,7 +298,6 @@ void URLImpl::GetOrigin(v8::Local<v8::String> property,
294298

295299
info.GetReturnValue().Set(
296300
ArgConverter::ConvertToV8String(isolate, value.data(), value.length()));
297-
298301
}
299302

300303
void URLImpl::GetPassword(v8::Local<v8::String> property,
@@ -310,7 +313,6 @@ void URLImpl::GetPassword(v8::Local<v8::String> property,
310313

311314
info.GetReturnValue().Set(
312315
ArgConverter::ConvertToV8String(isolate, value.data(), value.length()));
313-
314316
}
315317

316318
void URLImpl::SetPassword(v8::Local<v8::String> property,
@@ -339,7 +341,6 @@ void URLImpl::GetPathName(v8::Local<v8::String> property,
339341

340342
info.GetReturnValue().Set(
341343
ArgConverter::ConvertToV8String(isolate, value.data(), value.length()));
342-
343344
}
344345

345346
void URLImpl::SetPathName(v8::Local<v8::String> property,
@@ -368,7 +369,6 @@ void URLImpl::GetPort(v8::Local<v8::String> property,
368369

369370
info.GetReturnValue().Set(
370371
ArgConverter::ConvertToV8String(isolate, value.data(), value.length()));
371-
372372
}
373373

374374
void URLImpl::SetPort(v8::Local<v8::String> property,
@@ -397,7 +397,6 @@ void URLImpl::GetProtocol(v8::Local<v8::String> property,
397397

398398
info.GetReturnValue().Set(
399399
ArgConverter::ConvertToV8String(isolate, value.data(), value.length()));
400-
401400
}
402401

403402
void URLImpl::SetProtocol(v8::Local<v8::String> property,
@@ -427,7 +426,6 @@ void URLImpl::GetSearch(v8::Local<v8::String> property,
427426

428427
info.GetReturnValue().Set(
429428
ArgConverter::ConvertToV8String(isolate, value.data(), value.length()));
430-
431429
}
432430

433431
void URLImpl::SetSearch(v8::Local<v8::String> property,
@@ -457,7 +455,6 @@ void URLImpl::GetUserName(v8::Local<v8::String> property,
457455

458456
info.GetReturnValue().Set(
459457
ArgConverter::ConvertToV8String(isolate, value.data(), value.length()));
460-
461458
}
462459

463460
void URLImpl::SetUserName(v8::Local<v8::String> property,
@@ -474,36 +471,36 @@ void URLImpl::SetUserName(v8::Local<v8::String> property,
474471
}
475472

476473

477-
void URLImpl::ToString(const v8::FunctionCallbackInfo<v8::Value> &args) {
478-
URLImpl *ptr = GetPointer(args.This());
474+
void URLImpl::ToString(const v8::FunctionCallbackInfo<v8::Value> &info) {
475+
URLImpl *ptr = GetPointer(info.This());
479476
if (ptr == nullptr) {
480-
args.GetReturnValue().SetEmptyString();
477+
info.GetReturnValue().SetEmptyString();
481478
return;
482479
}
483-
auto isolate = args.GetIsolate();
480+
auto isolate = info.GetIsolate();
484481

485482

486483
auto value = ptr->GetURL()->get_href();
487484

488485
auto ret = ArgConverter::ConvertToV8String(isolate, value.data(), value.length());
489486

490-
args.GetReturnValue().Set(ret);
487+
info.GetReturnValue().Set(ret);
491488
}
492489

493490

494-
void URLImpl::CanParse(const v8::FunctionCallbackInfo<v8::Value> &args) {
491+
void URLImpl::CanParse(const v8::FunctionCallbackInfo<v8::Value> &info) {
495492
bool value;
496-
auto count = args.Length();
493+
auto count = info.Length();
497494

498495

499496
if (count > 1) {
500-
auto url_string = ArgConverter::ConvertToString(args[0].As<v8::String>());
501-
auto base_string = ArgConverter::ConvertToString(args[1].As<v8::String>());
497+
auto url_string = ArgConverter::ConvertToString(info[0].As<v8::String>());
498+
auto base_string = ArgConverter::ConvertToString(info[1].As<v8::String>());
502499
std::string_view base_string_view(base_string.data(), base_string.length());
503500
value = can_parse(url_string, &base_string_view);
504501
} else {
505-
value = can_parse(ArgConverter::ConvertToString(args[0].As<v8::String>()).c_str(), nullptr);
502+
value = can_parse(ArgConverter::ConvertToString(info[0].As<v8::String>()).c_str(), nullptr);
506503
}
507504

508-
args.GetReturnValue().Set(value);
505+
info.GetReturnValue().Set(value);
509506
}

0 commit comments

Comments
 (0)