Skip to content

Commit eb8379e

Browse files
committed
Merge branch 'master' of github.com:NativeScript/nativescript-cli
# Conflicts: # lib/definitions/android-plugin-migrator.d.ts # lib/services/android-plugin-build-service.ts # lib/services/android-project-service.ts # lib/services/ios-project-service.ts # vendor/gradle-plugin/build.gradle
2 parents 8365318 + bf722c2 commit eb8379e

28 files changed

+609
-380
lines changed

.github/workflows/npm_release_doctor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
run: npm --no-git-tag-version version $NPM_VERSION
3333

3434
- name: Build @nativescript/doctor
35-
run: npm run pack
35+
run: npm pack
3636

3737
- name: Publish @nativescript/doctor
3838
env:

CHANGELOG.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,60 @@
1+
## [8.2.2](https://github.com/NativeScript/nativescript-cli/compare/v8.2.1...v8.2.2) (2022-03-09)
2+
3+
4+
### Bug Fixes
5+
6+
* topological dependency sorting ([#5647](https://github.com/NativeScript/nativescript-cli/issues/5647)) ([9d8d967](https://github.com/NativeScript/nativescript-cli/commit/9d8d967096fba41325ee9082eed02a880cb803f6))
7+
8+
9+
### Features
10+
11+
* read gradle versions from local runtime first ([#5646](https://github.com/NativeScript/nativescript-cli/issues/5646)) ([1b9cde3](https://github.com/NativeScript/nativescript-cli/commit/1b9cde38f2272ae142520141469962fbe5f55954))
12+
13+
14+
15+
# [8.2.1](https://github.com/NativeScript/nativescript-cli/compare/v8.2.0...v8.2.1) (2022-03-08)
16+
17+
### Bug Fixes
18+
19+
* node17 debugger can't attach ([fc84d92](https://github.com/NativeScript/nativescript-cli/commit/fc84d92d9c102ddaca036c0cda1800b8e41fd653))
20+
21+
# [8.2.0](https://github.com/NativeScript/nativescript-cli/compare/v8.1.5...v8.2.0) (2022-03-08)
22+
23+
24+
### Bug Fixes
25+
26+
* remove deprecated property ([f7b4a74](https://github.com/NativeScript/nativescript-cli/commit/f7b4a74f58cb4b5fb8c6baa6f6b9d75512f21c1f))
27+
* **pnpm:** escape + in podfile path string ([#5638](https://github.com/NativeScript/nativescript-cli/issues/5638)) ([a11cace](https://github.com/NativeScript/nativescript-cli/commit/a11cace045856499a44637cd3052501ef34b5757))
28+
* add a missing newline to the clean command ([#5611](https://github.com/NativeScript/nativescript-cli/issues/5611)) ([46c396d](https://github.com/NativeScript/nativescript-cli/commit/46c396d6caecb88aae9774157e86d1f6bd7a6d1f))
29+
* correctly allow plugins build to detect before-plugins.gradle ([#5631](https://github.com/NativeScript/nativescript-cli/issues/5631)) ([3b42042](https://github.com/NativeScript/nativescript-cli/commit/3b420428e80594661968313ec63bd44089f960b0))
30+
* import performance from perf_hooks ([fade332](https://github.com/NativeScript/nativescript-cli/commit/fade3326765bac5cd9bbbda9efe54320e34360a9))
31+
* move additionalPathsToClean under cli object ([d16a932](https://github.com/NativeScript/nativescript-cli/commit/d16a932c1d660bf34f1bb0135899471f1de08260))
32+
* write project settings to gradle.properties ([#5640](https://github.com/NativeScript/nativescript-cli/issues/5640)) ([e0ed7f2](https://github.com/NativeScript/nativescript-cli/commit/e0ed7f2dd7e23d5fbb4fe3185e0b7f85534018d7))
33+
* **doctor:** Cannot read property 'toLowerCase' of null ([#5604](https://github.com/NativeScript/nativescript-cli/issues/5604)) ([0be52e9](https://github.com/NativeScript/nativescript-cli/commit/0be52e914540898fa0cdc679edfa303192c812f7))
34+
* **test:** exit test command if karma finishes execution ([#5618](https://github.com/NativeScript/nativescript-cli/issues/5618)) ([9f73e96](https://github.com/NativeScript/nativescript-cli/commit/9f73e9640357ebe6736dfd52e0ad5997c5c0b339))
35+
36+
37+
### Features
38+
39+
* --gradlePath argument support ([#5628](https://github.com/NativeScript/nativescript-cli/issues/5628)) ([387c7c0](https://github.com/NativeScript/nativescript-cli/commit/387c7c0f2eaefcf942e9d6087edaa2a9c42ce064))
40+
* `--gradleArgs` option to pass gradle parameters ([#5630](https://github.com/NativeScript/nativescript-cli/issues/5630)) ([02d179a](https://github.com/NativeScript/nativescript-cli/commit/02d179a358297d099f1e2d2377b042db374edcad))
41+
* build transient native dependencies ([#5643](https://github.com/NativeScript/nativescript-cli/issues/5643)) ([1435eef](https://github.com/NativeScript/nativescript-cli/commit/1435eef272aced36e7f97a355ff5c7ea936f94e7))
42+
* bump migrate versions for 8.2.0 ([#5645](https://github.com/NativeScript/nativescript-cli/issues/5645)) ([6726ccc](https://github.com/NativeScript/nativescript-cli/commit/6726ccc3816afd17369633eb94e2c28735984efa))
43+
* compute and log build time ([#5602](https://github.com/NativeScript/nativescript-cli/issues/5602)) ([fb0a7b8](https://github.com/NativeScript/nativescript-cli/commit/fb0a7b80a0710226b57627246df7470c67ad4c8a))
44+
* improved --json output from devices ([#5565](https://github.com/NativeScript/nativescript-cli/issues/5565)) ([8446795](https://github.com/NativeScript/nativescript-cli/commit/84467951331982cc001504e078df23865bb25f31))
45+
* reduce aar size by removing R.class and BuildConfig.class ([#5644](https://github.com/NativeScript/nativescript-cli/issues/5644)) ([9ad80bf](https://github.com/NativeScript/nativescript-cli/commit/9ad80bfedf1f9e8c726ef8a546da2132c2b40897))
46+
* **android:** add gradle 7+ support ([#5614](https://github.com/NativeScript/nativescript-cli/issues/5614)) ([be6706a](https://github.com/NativeScript/nativescript-cli/commit/be6706af99c89765f3773e7e324a70037b2ec7b8))
47+
* **clean:** allow overriding pathsToClean in config ([b33507d](https://github.com/NativeScript/nativescript-cli/commit/b33507d703ce416e0c89423d55a2ad9d8f085a31))
48+
* **typings:** support --aar inputs ([#5641](https://github.com/NativeScript/nativescript-cli/issues/5641)) ([67fdd0a](https://github.com/NativeScript/nativescript-cli/commit/67fdd0afd05492543e74584f54986a274131c723))
49+
* launch last used simulator instead of iPhone 6 ([289317d](https://github.com/NativeScript/nativescript-cli/commit/289317d3bc3e78fe31de477f01bd8f452dd68512))
50+
51+
52+
### Performance Improvements
53+
54+
* doctor cache runtimeVersion ([#5642](https://github.com/NativeScript/nativescript-cli/issues/5642)) ([3063550](https://github.com/NativeScript/nativescript-cli/commit/306355042065435348c77fefe163429c6164c643))
55+
56+
57+
158
## [8.1.5](https://github.com/NativeScript/nativescript-cli/compare/v8.1.4...v8.1.5) (2021-11-26)
259

360

lib/commands/clean.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,26 @@ export class CleanCommand implements ICommand {
1919
const spinner = this.$terminalSpinnerService.createSpinner();
2020
spinner.start("Cleaning project...\n");
2121

22-
const pathsToClean = [
22+
let pathsToClean = [
2323
constants.HOOKS_DIR_NAME,
2424
constants.PLATFORMS_DIR_NAME,
2525
constants.NODE_MODULES_FOLDER_NAME,
2626
constants.PACKAGE_LOCK_JSON_FILE_NAME,
2727
];
2828

2929
try {
30+
const overridePathsToClean = this.$projectConfigService.getValue(
31+
"cli.pathsToClean"
32+
);
3033
const additionalPaths = this.$projectConfigService.getValue(
31-
"additionalPathsToClean"
34+
"cli.additionalPathsToClean"
3235
);
36+
37+
// allow overriding default paths to clean
38+
if (Array.isArray(overridePathsToClean)) {
39+
pathsToClean = overridePathsToClean;
40+
}
41+
3342
if (Array.isArray(additionalPaths)) {
3443
pathsToClean.push(...additionalPaths);
3544
}

lib/commands/typings.ts

Lines changed: 50 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,16 @@ export class TypingsCommand implements ICommand {
1414
private $projectData: IProjectData,
1515
private $mobileHelper: Mobile.IMobileHelper,
1616
private $childProcess: IChildProcess,
17-
private $hostInfo: IHostInfo,
17+
private $hostInfo: IHostInfo
1818
) {}
1919

2020
public async execute(args: string[]): Promise<void> {
2121
const platform = args[0];
22-
22+
let result;
2323
if (this.$mobileHelper.isAndroidPlatform(platform)) {
24-
await this.handleAndroidTypings();
25-
}
26-
27-
if (this.$mobileHelper.isiOSPlatform(platform)) {
28-
await this.handleiOSTypings();
24+
result = await this.handleAndroidTypings();
25+
} else if (this.$mobileHelper.isiOSPlatform(platform)) {
26+
result = await this.handleiOSTypings();
2927
}
3028
let typingsFolder = "./typings";
3129
if (this.$options.copyTo) {
@@ -35,10 +33,13 @@ export class TypingsCommand implements ICommand {
3533
);
3634
typingsFolder = this.$options.copyTo;
3735
}
38-
this.$logger.info(
39-
"Typings have been generated in the following directory:",
40-
typingsFolder
41-
);
36+
37+
if (result !== false) {
38+
this.$logger.info(
39+
"Typings have been generated in the following directory:",
40+
typingsFolder
41+
);
42+
}
4243
}
4344

4445
public async canExecute(args: string[]): Promise<boolean> {
@@ -48,17 +49,15 @@ export class TypingsCommand implements ICommand {
4849
}
4950

5051
private async handleAndroidTypings() {
51-
if (this.$options.aar) {
52-
return this.$logger.warn(`Open the .aar archive
53-
Extract the classes.jar and any dependencies it may have inside libs/
54-
Rename classes.jar if necessary
55-
56-
ns typings android --jar classes.jar --jar dependency-of-classes-jar.jar
57-
`);
58-
} else if (!this.$options.jar) {
59-
return this.$logger.warn(
60-
"No .jar file specified. Please specify a .jar file with --jar <Jar>."
52+
if (!(this.$options.jar || this.$options.aar)) {
53+
this.$logger.warn(
54+
[
55+
"No .jar or .aar file specified. Please specify at least one of the following:",
56+
" - path to .jar file with --jar <jar>",
57+
" - path to .aar file with --aar <aar>",
58+
].join("\n")
6159
);
60+
return false;
6261
}
6362

6463
this.$fs.ensureDirectoryExists(
@@ -82,25 +81,36 @@ ns typings android --jar classes.jar --jar dependency-of-classes-jar.jar
8281
);
8382
}
8483

85-
if (this.$options.jar) {
86-
const jars: string[] =
87-
typeof this.$options.jar === "string"
88-
? [this.$options.jar]
89-
: this.$options.jar;
90-
await this.$childProcess.spawnFromEvent(
91-
"java",
92-
[
93-
"-jar",
94-
dtsGeneratorPath,
95-
"-input",
96-
...jars,
97-
"-output",
98-
path.resolve(this.$projectData.projectDir, "typings", "android"),
99-
],
100-
"exit",
101-
{ stdio: "inherit" }
102-
);
103-
}
84+
const asArray = (input: string | string[]) => {
85+
if (!input) {
86+
return [];
87+
}
88+
89+
if (typeof input === "string") {
90+
return [input];
91+
}
92+
93+
return input;
94+
};
95+
96+
const inputs: string[] = [
97+
...asArray(this.$options.jar),
98+
...asArray(this.$options.aar),
99+
];
100+
101+
await this.$childProcess.spawnFromEvent(
102+
"java",
103+
[
104+
"-jar",
105+
dtsGeneratorPath,
106+
"-input",
107+
...inputs,
108+
"-output",
109+
path.resolve(this.$projectData.projectDir, "typings", "android"),
110+
],
111+
"exit",
112+
{ stdio: "inherit" }
113+
);
104114
}
105115

106116
private async handleiOSTypings() {

lib/common/mobile/ios/simulator/ios-emulator-services.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ class IosEmulatorServices implements Mobile.IiOSSimulatorService {
6666
data: Mobile.IConnectToPortData
6767
): Promise<net.Socket> {
6868
try {
69-
const socket = net.connect(data.port);
69+
// node v17+ resolves localhost to ::1 (ipv6) instead of 127.0.0.1 (ipv4)
70+
// so we explicitly pass ipv4
71+
const socket = net.connect(data.port, "127.0.0.1");
7072
return socket;
7173
} catch (e) {
7274
this.$logger.debug(e);

lib/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,8 @@ export class Hooks {
328328
}
329329

330330
export class AndroidBuildDefaults {
331-
public static GradleVersion = "7.0.2";
332-
public static GradleAndroidPluginVersion = "7.0.4";
331+
public static GradleVersion = "7.4.0";
332+
public static GradleAndroidPluginVersion = "7.1.2";
333333
}
334334

335335
export const PACKAGE_PLACEHOLDER_NAME = "__PACKAGE__";

lib/controllers/migrate-controller.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export class MigrateController
115115
{
116116
packageName: "@nativescript/core",
117117
minVersion: "6.5.0",
118-
desiredVersion: "~8.1.1",
118+
desiredVersion: "~8.2.0",
119119
shouldAddIfMissing: true,
120120
},
121121
{
@@ -125,7 +125,7 @@ export class MigrateController
125125
{
126126
packageName: "@nativescript/types",
127127
minVersion: "7.0.0",
128-
desiredVersion: "~8.1.0",
128+
desiredVersion: "~8.2.0",
129129
isDev: true,
130130
},
131131
{
@@ -158,7 +158,7 @@ export class MigrateController
158158
{
159159
packageName: "nativescript-vue",
160160
minVersion: "2.7.0",
161-
desiredVersion: "~2.9.0",
161+
desiredVersion: "~2.9.1",
162162
async shouldMigrateAction(
163163
dependency: IMigrationDependency,
164164
projectData: IProjectData,
@@ -184,7 +184,7 @@ export class MigrateController
184184
{
185185
packageName: "@nativescript/angular",
186186
minVersion: "10.0.0",
187-
desiredVersion: "^12.2.0",
187+
desiredVersion: "^13.0.0",
188188
async shouldMigrateAction(
189189
dependency: IMigrationDependency,
190190
projectData: IProjectData,
@@ -256,7 +256,7 @@ export class MigrateController
256256
packageName: "typescript",
257257
isDev: true,
258258
minVersion: "3.7.0",
259-
desiredVersion: "~4.3.5",
259+
desiredVersion: "~4.5.5",
260260
},
261261
{
262262
packageName: "node-sass",
@@ -267,7 +267,7 @@ export class MigrateController
267267
{
268268
packageName: "sass",
269269
minVersion: "0.0.0", // ignore
270-
desiredVersion: "~1.39.0",
270+
desiredVersion: "~1.49.9",
271271
isDev: true,
272272
},
273273

@@ -287,13 +287,13 @@ export class MigrateController
287287
{
288288
packageName: "@nativescript/ios",
289289
minVersion: "6.5.3",
290-
desiredVersion: "~8.1.0",
290+
desiredVersion: "~8.2.0",
291291
isDev: true,
292292
},
293293
{
294294
packageName: "@nativescript/android",
295295
minVersion: "7.0.0",
296-
desiredVersion: "~8.1.1",
296+
desiredVersion: "~8.2.0",
297297
isDev: true,
298298
},
299299
];
@@ -1293,7 +1293,7 @@ export class MigrateController
12931293

12941294
private async migrateNativeScriptAngular(): Promise<IMigrationDependency[]> {
12951295
const minVersion = "10.0.0";
1296-
const desiredVersion = "^12.2.5";
1296+
const desiredVersion = "~13.2.0";
12971297

12981298
const dependencies: IMigrationDependency[] = [
12991299
{
@@ -1347,13 +1347,13 @@ export class MigrateController
13471347
{
13481348
packageName: "rxjs",
13491349
minVersion: "6.6.0",
1350-
desiredVersion: "~7.3.0",
1350+
desiredVersion: "~7.5.0",
13511351
shouldAddIfMissing: true,
13521352
},
13531353
{
13541354
packageName: "zone.js",
13551355
minVersion: "0.11.1",
1356-
desiredVersion: "~0.11.4",
1356+
desiredVersion: "~0.11.5",
13571357
shouldAddIfMissing: true,
13581358
},
13591359

@@ -1392,7 +1392,7 @@ export class MigrateController
13921392
{
13931393
packageName: "nativescript-vue-template-compiler",
13941394
minVersion: "2.7.0",
1395-
desiredVersion: "~2.9.0",
1395+
desiredVersion: "~2.9.1",
13961396
isDev: true,
13971397
shouldAddIfMissing: true,
13981398
},

lib/definitions/android-plugin-migrator.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ interface IBuildAndroidPluginData extends Partial<IProjectDir> {
4444
* Optional custom Gradle path.
4545
*/
4646
gradlePath?: string;
47-
48-
/**
47+
48+
/**
4949
* Optional custom Gradle arguments.
5050
*/
5151
gradleArgs?: string[],

0 commit comments

Comments
 (0)