diff --git a/lib/services/android-plugin-build-service.ts b/lib/services/android-plugin-build-service.ts index 84757adbd1..2af2c8f1a4 100644 --- a/lib/services/android-plugin-build-service.ts +++ b/lib/services/android-plugin-build-service.ts @@ -13,7 +13,6 @@ import { Builder, parseString } from "xml2js"; import { IRuntimeGradleVersions, INodePackageManager, - IAndroidToolsInfo, IWatchIgnoreListService, } from "../declarations"; import { IPlatformsDataService } from "../definitions/platform"; @@ -47,7 +46,6 @@ export class AndroidPluginBuildService implements IAndroidPluginBuildService { private $fs: IFileSystem, private $childProcess: IChildProcess, private $hostInfo: IHostInfo, - private $androidToolsInfo: IAndroidToolsInfo, private $logger: ILogger, private $packageManager: INodePackageManager, private $projectData: IProjectData, @@ -423,6 +421,31 @@ export class AndroidPluginBuildService implements IAndroidPluginBuildService { ); this.replaceFileContent(buildGradlePath, "{{pluginName}}", pluginName); this.replaceFileContent(settingsGradlePath, "{{pluginName}}", pluginName); + + // gets the package from the AndroidManifest to use as the namespace or fallback to the `org.nativescript.${shortPluginName}` + const shortPluginName = getShortPluginName(pluginName); + + const manifestPath = path.join( + pluginTempDir, + "src", + "main", + "AndroidManifest.xml" + ); + const manifestContent = this.$fs.readText(manifestPath); + + let packageName = `org.nativescript.${shortPluginName}`; + const xml = await this.getXml(manifestContent); + if (xml["manifest"]) { + if (xml["manifest"]["$"]["package"]) { + packageName = xml["manifest"]["$"]["package"]; + } + } + + this.replaceFileContent( + buildGradlePath, + "{{pluginNamespace}}", + packageName + ); } private async getRuntimeGradleVersions( @@ -777,18 +800,6 @@ export class AndroidPluginBuildService implements IAndroidPluginBuildService { private async buildPlugin( pluginBuildSettings: IBuildAndroidPluginData ): Promise { - if (!pluginBuildSettings.androidToolsInfo) { - this.$androidToolsInfo.validateInfo({ - showWarningsAsErrors: true, - validateTargetSdk: true, - projectDir: pluginBuildSettings.projectDir, - }); - pluginBuildSettings.androidToolsInfo = - this.$androidToolsInfo.getToolsInfo({ - projectDir: pluginBuildSettings.projectDir, - }); - } - const gradlew = pluginBuildSettings.gradlePath ?? (this.$hostInfo.isWindows ? "gradlew.bat" : "./gradlew"); @@ -798,8 +809,6 @@ export class AndroidPluginBuildService implements IAndroidPluginBuildService { pluginBuildSettings.pluginDir, "assembleRelease", `-PtempBuild=true`, - `-PcompileSdk=android-${pluginBuildSettings.androidToolsInfo.compileSdkVersion}`, - `-PbuildToolsVersion=${pluginBuildSettings.androidToolsInfo.buildToolsVersion}`, `-PappPath=${this.$projectData.getAppDirectoryPath()}`, `-PappResourcesPath=${this.$projectData.getAppResourcesDirectoryPath()}`, ]; diff --git a/lib/services/android/gradle-build-args-service.ts b/lib/services/android/gradle-build-args-service.ts index d3c5dac1bc..2d0ce3ddec 100644 --- a/lib/services/android/gradle-build-args-service.ts +++ b/lib/services/android/gradle-build-args-service.ts @@ -1,7 +1,6 @@ import * as path from "path"; import { Configurations } from "../../common/constants"; import { IGradleBuildArgsService } from "../../definitions/gradle"; -import { IAndroidToolsInfo } from "../../declarations"; import { IAndroidBuildData } from "../../definitions/build"; import { IHooksService, IAnalyticsService } from "../../common/declarations"; import { injector } from "../../common/yok"; @@ -9,7 +8,6 @@ import { IProjectData } from "../../definitions/project"; export class GradleBuildArgsService implements IGradleBuildArgsService { constructor( - private $androidToolsInfo: IAndroidToolsInfo, private $hooksService: IHooksService, private $analyticsService: IAnalyticsService, private $staticConfig: Config.IStaticConfig, @@ -49,18 +47,10 @@ export class GradleBuildArgsService implements IGradleBuildArgsService { private getBaseTaskArgs(buildData: IAndroidBuildData): string[] { const args = this.getBuildLoggingArgs(); - const toolsInfo = this.$androidToolsInfo.getToolsInfo({ - projectDir: buildData.projectDir, - }); - // ensure we initialize project data this.$projectData.initializeProjectData(buildData.projectDir); args.push( - `-PcompileSdk=android-${toolsInfo.compileSdkVersion}`, - `-PtargetSdk=${toolsInfo.targetSdkVersion}`, - `-PbuildToolsVersion=${toolsInfo.buildToolsVersion}`, - `-PgenerateTypings=${toolsInfo.generateTypings}`, `-PappPath=${this.$projectData.getAppDirectoryPath()}`, `-PappResourcesPath=${this.$projectData.getAppResourcesDirectoryPath()}` ); diff --git a/package-lock.json b/package-lock.json index 329dba9e44..3c7dbc81c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -969,9 +969,9 @@ } }, "node_modules/@npmcli/arborist": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@npmcli/arborist/-/arborist-7.4.0.tgz", - "integrity": "sha512-VFsUaTrV8NR+0E2I+xhp6pPC5eAbMmSMSMZbS57aogLc6du6HWBPATFOaiNWwp1QTFVeP4aLhYixQM9hHfaAsA==", + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@npmcli/arborist/-/arborist-7.4.2.tgz", + "integrity": "sha512-13flK0DTIhG7VEmPtoKFoi+88hIjuZxuZAvnHUTthIFql1Kc51VlsMRpbJPIcDEZHaHkILwFjHRXtCUYdFWvAQ==", "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", "@npmcli/fs": "^3.1.0", @@ -982,6 +982,7 @@ "@npmcli/node-gyp": "^3.0.0", "@npmcli/package-json": "^5.0.0", "@npmcli/query": "^3.1.0", + "@npmcli/redact": "^1.1.0", "@npmcli/run-script": "^7.0.2", "bin-links": "^4.0.1", "cacache": "^18.0.0", @@ -989,12 +990,12 @@ "hosted-git-info": "^7.0.1", "json-parse-even-better-errors": "^3.0.0", "json-stringify-nice": "^1.1.4", - "minimatch": "^9.0.0", + "minimatch": "^9.0.4", "nopt": "^7.0.0", "npm-install-checks": "^6.2.0", "npm-package-arg": "^11.0.1", "npm-pick-manifest": "^9.0.0", - "npm-registry-fetch": "^16.0.0", + "npm-registry-fetch": "^16.2.0", "npmlog": "^7.0.1", "pacote": "^17.0.4", "parse-conflict-json": "^3.0.0", @@ -1015,11 +1016,11 @@ } }, "node_modules/@npmcli/arborist/node_modules/@sigstore/bundle": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-2.2.0.tgz", - "integrity": "sha512-5VI58qgNs76RDrwXNhpmyN/jKpq9evV/7f1XrcqcAfvxDl5SeVY/I5Rmfe96ULAV7/FK5dge9RBKGBJPhL1WsQ==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-2.3.1.tgz", + "integrity": "sha512-eqV17lO3EIFqCWK3969Rz+J8MYrRZKw9IBHpSo6DEcEX2c+uzDFOgHE9f2MnyDpfs48LFO4hXmk9KhQ74JzU1g==", "dependencies": { - "@sigstore/protobuf-specs": "^0.3.0" + "@sigstore/protobuf-specs": "^0.3.1" }, "engines": { "node": "^16.14.0 || >=18.0.0" @@ -1034,13 +1035,13 @@ } }, "node_modules/@npmcli/arborist/node_modules/@sigstore/sign": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/@sigstore/sign/-/sign-2.2.3.tgz", - "integrity": "sha512-LqlA+ffyN02yC7RKszCdMTS6bldZnIodiox+IkT8B2f8oRYXCB3LQ9roXeiEL21m64CVH1wyveYAORfD65WoSw==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@sigstore/sign/-/sign-2.3.0.tgz", + "integrity": "sha512-tsAyV6FC3R3pHmKS880IXcDJuiFJiKITO1jxR1qbplcsBkZLBmjrEw5GbC7ikD6f5RU1hr7WnmxB/2kKc1qUWQ==", "dependencies": { - "@sigstore/bundle": "^2.2.0", + "@sigstore/bundle": "^2.3.0", "@sigstore/core": "^1.0.0", - "@sigstore/protobuf-specs": "^0.3.0", + "@sigstore/protobuf-specs": "^0.3.1", "make-fetch-happen": "^13.0.0" }, "engines": { @@ -1134,9 +1135,9 @@ } }, "node_modules/@npmcli/arborist/node_modules/pacote": { - "version": "17.0.6", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-17.0.6.tgz", - "integrity": "sha512-cJKrW21VRE8vVTRskJo78c/RCvwJCn1f4qgfxL4w77SOWrTCRcmfkYHlHtS0gqpgjv3zhXflRtgsrUCX5xwNnQ==", + "version": "17.0.7", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-17.0.7.tgz", + "integrity": "sha512-sgvnoUMlkv9xHwDUKjKQFXVyUi8dtJGKp3vg6sYy+TxbDic5RjZCHF3ygv0EJgNRZ2GfRONjlKPUfokJ9lDpwQ==", "dependencies": { "@npmcli/git": "^5.0.0", "@npmcli/installed-package-contents": "^2.0.1", @@ -1149,7 +1150,7 @@ "npm-packlist": "^8.0.0", "npm-pick-manifest": "^9.0.0", "npm-registry-fetch": "^16.0.0", - "proc-log": "^3.0.0", + "proc-log": "^4.0.0", "promise-retry": "^2.0.1", "read-package-json": "^7.0.0", "read-package-json-fast": "^3.0.0", @@ -1164,6 +1165,14 @@ "node": "^16.14.0 || >=18.0.0" } }, + "node_modules/@npmcli/arborist/node_modules/pacote/node_modules/proc-log": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-4.1.0.tgz", + "integrity": "sha512-dmQ2iPw2nJMi9/4dpaG1wd0m1GE+K5kW7RGbjy5hoEEGnhPIzsm+klBO5RGGdcoYbWsNtU2KSNAdEldts+icLg==", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/@npmcli/arborist/node_modules/read-package-json": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-7.0.0.tgz", @@ -1179,16 +1188,16 @@ } }, "node_modules/@npmcli/arborist/node_modules/sigstore": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/sigstore/-/sigstore-2.2.2.tgz", - "integrity": "sha512-2A3WvXkQurhuMgORgT60r6pOWiCOO5LlEqY2ADxGBDGVYLSo5HN0uLtb68YpVpuL/Vi8mLTe7+0Dx2Fq8lLqEg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/sigstore/-/sigstore-2.3.0.tgz", + "integrity": "sha512-q+o8L2ebiWD1AxD17eglf1pFrl9jtW7FHa0ygqY6EKvibK8JHyq9Z26v9MZXeDiw+RbfOJ9j2v70M10Hd6E06A==", "dependencies": { - "@sigstore/bundle": "^2.2.0", + "@sigstore/bundle": "^2.3.1", "@sigstore/core": "^1.0.0", - "@sigstore/protobuf-specs": "^0.3.0", - "@sigstore/sign": "^2.2.3", + "@sigstore/protobuf-specs": "^0.3.1", + "@sigstore/sign": "^2.3.0", "@sigstore/tuf": "^2.3.1", - "@sigstore/verify": "^1.1.0" + "@sigstore/verify": "^1.2.0" }, "engines": { "node": "^16.14.0 || >=18.0.0" @@ -1219,14 +1228,14 @@ } }, "node_modules/@npmcli/git": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-5.0.4.tgz", - "integrity": "sha512-nr6/WezNzuYUppzXRaYu/W4aT5rLxdXqEFupbh6e/ovlYFQ8hpu1UUPV3Ir/YTl+74iXl2ZOMlGzudh9ZPUchQ==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-5.0.6.tgz", + "integrity": "sha512-4x/182sKXmQkf0EtXxT26GEsaOATpD7WVtza5hrYivWZeo6QefC6xq9KAXrnjtFKBZ4rZwR7aX/zClYYXgtwLw==", "dependencies": { "@npmcli/promise-spawn": "^7.0.0", "lru-cache": "^10.0.1", "npm-pick-manifest": "^9.0.0", - "proc-log": "^3.0.0", + "proc-log": "^4.0.0", "promise-inflight": "^1.0.1", "promise-retry": "^2.0.1", "semver": "^7.3.5", @@ -1236,6 +1245,14 @@ "node": "^16.14.0 || >=18.0.0" } }, + "node_modules/@npmcli/git/node_modules/proc-log": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-4.1.0.tgz", + "integrity": "sha512-dmQ2iPw2nJMi9/4dpaG1wd0m1GE+K5kW7RGbjy5hoEEGnhPIzsm+klBO5RGGdcoYbWsNtU2KSNAdEldts+icLg==", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/@npmcli/installed-package-contents": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-2.0.2.tgz", @@ -1252,9 +1269,9 @@ } }, "node_modules/@npmcli/map-workspaces": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@npmcli/map-workspaces/-/map-workspaces-3.0.4.tgz", - "integrity": "sha512-Z0TbvXkRbacjFFLpVpV0e2mheCh+WzQpcqL+4xp49uNJOxOnIAPZyXtUxZ5Qn3QBTGKA11Exjd9a5411rBrhDg==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@npmcli/map-workspaces/-/map-workspaces-3.0.6.tgz", + "integrity": "sha512-tkYs0OYnzQm6iIRdfy+LcLBjcKuQCeE5YLb8KnrIlutJfheNaPvPpgoFEyEFgbjzl5PLZ3IA/BWAwRU0eHuQDA==", "dependencies": { "@npmcli/name-from-folder": "^2.0.0", "glob": "^10.2.2", @@ -1309,25 +1326,42 @@ } }, "node_modules/@npmcli/metavuln-calculator": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/metavuln-calculator/-/metavuln-calculator-7.0.0.tgz", - "integrity": "sha512-Pw0tyX02VkpqlIQlG2TeiJNsdrecYeUU0ubZZa9pi3N37GCsxI+en43u4hYFdq+eSx1A9a9vwFAUyqEtKFsbHQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/metavuln-calculator/-/metavuln-calculator-7.1.0.tgz", + "integrity": "sha512-D4VZzVLZ4Mw+oUCWyQ6qzlm5SGlrLnhKtZscDwQXFFc1FUPvw69Ibo2E5ZpJAmjFSYkA5UlCievWmREW0JLC3w==", "dependencies": { "cacache": "^18.0.0", "json-parse-even-better-errors": "^3.0.0", - "pacote": "^17.0.0", + "pacote": "^18.0.0", + "proc-log": "^4.1.0", "semver": "^7.3.5" }, "engines": { "node": "^16.14.0 || >=18.0.0" } }, + "node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/run-script": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-8.0.0.tgz", + "integrity": "sha512-5noc+eCQmX1W9nlFUe65n5MIteikd3vOA2sEPdXtlUv68KWyHNFZnT/LDRXu/E4nZ5yxjciP30pADr/GQ97W1w==", + "dependencies": { + "@npmcli/node-gyp": "^3.0.0", + "@npmcli/package-json": "^5.0.0", + "@npmcli/promise-spawn": "^7.0.0", + "node-gyp": "^10.0.0", + "proc-log": "^4.0.0", + "which": "^4.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, "node_modules/@npmcli/metavuln-calculator/node_modules/@sigstore/bundle": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-2.2.0.tgz", - "integrity": "sha512-5VI58qgNs76RDrwXNhpmyN/jKpq9evV/7f1XrcqcAfvxDl5SeVY/I5Rmfe96ULAV7/FK5dge9RBKGBJPhL1WsQ==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-2.3.1.tgz", + "integrity": "sha512-eqV17lO3EIFqCWK3969Rz+J8MYrRZKw9IBHpSo6DEcEX2c+uzDFOgHE9f2MnyDpfs48LFO4hXmk9KhQ74JzU1g==", "dependencies": { - "@sigstore/protobuf-specs": "^0.3.0" + "@sigstore/protobuf-specs": "^0.3.1" }, "engines": { "node": "^16.14.0 || >=18.0.0" @@ -1342,13 +1376,13 @@ } }, "node_modules/@npmcli/metavuln-calculator/node_modules/@sigstore/sign": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/@sigstore/sign/-/sign-2.2.3.tgz", - "integrity": "sha512-LqlA+ffyN02yC7RKszCdMTS6bldZnIodiox+IkT8B2f8oRYXCB3LQ9roXeiEL21m64CVH1wyveYAORfD65WoSw==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@sigstore/sign/-/sign-2.3.0.tgz", + "integrity": "sha512-tsAyV6FC3R3pHmKS880IXcDJuiFJiKITO1jxR1qbplcsBkZLBmjrEw5GbC7ikD6f5RU1hr7WnmxB/2kKc1qUWQ==", "dependencies": { - "@sigstore/bundle": "^2.2.0", + "@sigstore/bundle": "^2.3.0", "@sigstore/core": "^1.0.0", - "@sigstore/protobuf-specs": "^0.3.0", + "@sigstore/protobuf-specs": "^0.3.1", "make-fetch-happen": "^13.0.0" }, "engines": { @@ -1442,14 +1476,14 @@ } }, "node_modules/@npmcli/metavuln-calculator/node_modules/pacote": { - "version": "17.0.6", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-17.0.6.tgz", - "integrity": "sha512-cJKrW21VRE8vVTRskJo78c/RCvwJCn1f4qgfxL4w77SOWrTCRcmfkYHlHtS0gqpgjv3zhXflRtgsrUCX5xwNnQ==", + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-18.0.0.tgz", + "integrity": "sha512-ma7uVt/q3Sb3XbLwUjOeClz+7feHjMOFegHn5whw++x+GzikZkAq/2auklSbRuy6EI2iJh1/ZqCpVaUcxRaeqQ==", "dependencies": { "@npmcli/git": "^5.0.0", "@npmcli/installed-package-contents": "^2.0.1", "@npmcli/promise-spawn": "^7.0.0", - "@npmcli/run-script": "^7.0.0", + "@npmcli/run-script": "^8.0.0", "cacache": "^18.0.0", "fs-minipass": "^3.0.0", "minipass": "^7.0.2", @@ -1457,7 +1491,7 @@ "npm-packlist": "^8.0.0", "npm-pick-manifest": "^9.0.0", "npm-registry-fetch": "^16.0.0", - "proc-log": "^3.0.0", + "proc-log": "^4.0.0", "promise-retry": "^2.0.1", "read-package-json": "^7.0.0", "read-package-json-fast": "^3.0.0", @@ -1472,6 +1506,14 @@ "node": "^16.14.0 || >=18.0.0" } }, + "node_modules/@npmcli/metavuln-calculator/node_modules/proc-log": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-4.1.0.tgz", + "integrity": "sha512-dmQ2iPw2nJMi9/4dpaG1wd0m1GE+K5kW7RGbjy5hoEEGnhPIzsm+klBO5RGGdcoYbWsNtU2KSNAdEldts+icLg==", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/@npmcli/metavuln-calculator/node_modules/read-package-json": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-7.0.0.tgz", @@ -1487,16 +1529,16 @@ } }, "node_modules/@npmcli/metavuln-calculator/node_modules/sigstore": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/sigstore/-/sigstore-2.2.2.tgz", - "integrity": "sha512-2A3WvXkQurhuMgORgT60r6pOWiCOO5LlEqY2ADxGBDGVYLSo5HN0uLtb68YpVpuL/Vi8mLTe7+0Dx2Fq8lLqEg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/sigstore/-/sigstore-2.3.0.tgz", + "integrity": "sha512-q+o8L2ebiWD1AxD17eglf1pFrl9jtW7FHa0ygqY6EKvibK8JHyq9Z26v9MZXeDiw+RbfOJ9j2v70M10Hd6E06A==", "dependencies": { - "@sigstore/bundle": "^2.2.0", + "@sigstore/bundle": "^2.3.1", "@sigstore/core": "^1.0.0", - "@sigstore/protobuf-specs": "^0.3.0", - "@sigstore/sign": "^2.2.3", + "@sigstore/protobuf-specs": "^0.3.1", + "@sigstore/sign": "^2.3.0", "@sigstore/tuf": "^2.3.1", - "@sigstore/verify": "^1.1.0" + "@sigstore/verify": "^1.2.0" }, "engines": { "node": "^16.14.0 || >=18.0.0" @@ -1558,16 +1600,16 @@ } }, "node_modules/@npmcli/package-json": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/package-json/-/package-json-5.0.0.tgz", - "integrity": "sha512-OI2zdYBLhQ7kpNPaJxiflofYIpkNLi+lnGdzqUOfRmCF3r2l1nadcjtCYMJKv/Utm/ZtlffaUuTiAktPHbc17g==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@npmcli/package-json/-/package-json-5.0.3.tgz", + "integrity": "sha512-cgsjCvld2wMqkUqvY+SZI+1ZJ7umGBYc9IAKfqJRKJCcs7hCQYxScUgdsyrRINk3VmdCYf9TXiLBHQ6ECTxhtg==", "dependencies": { "@npmcli/git": "^5.0.0", "glob": "^10.2.2", "hosted-git-info": "^7.0.0", "json-parse-even-better-errors": "^3.0.0", "normalize-package-data": "^6.0.0", - "proc-log": "^3.0.0", + "proc-log": "^4.0.0", "semver": "^7.5.3" }, "engines": { @@ -1617,6 +1659,14 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/@npmcli/package-json/node_modules/proc-log": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-4.1.0.tgz", + "integrity": "sha512-dmQ2iPw2nJMi9/4dpaG1wd0m1GE+K5kW7RGbjy5hoEEGnhPIzsm+klBO5RGGdcoYbWsNtU2KSNAdEldts+icLg==", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/@npmcli/promise-spawn": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-7.0.1.tgz", @@ -1639,6 +1689,14 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/@npmcli/redact": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/redact/-/redact-1.1.0.tgz", + "integrity": "sha512-PfnWuOkQgu7gCbnSsAisaX7hKOdZ4wSAhAzH3/ph5dSGau52kCRrMMGbiSQLwyTZpgldkZ49b0brkOr1AzGBHQ==", + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, "node_modules/@npmcli/run-script": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-7.0.4.tgz", @@ -1949,24 +2007,24 @@ } }, "node_modules/@sigstore/verify": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@sigstore/verify/-/verify-1.1.1.tgz", - "integrity": "sha512-BNANJms49rw9Q5J+fJjrDqOQSzjXDcOq/pgKDaVdDoIvQwqIfaoUriy+fQfh8sBX04hr4bkkrwu3EbhQqoQH7A==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@sigstore/verify/-/verify-1.2.0.tgz", + "integrity": "sha512-hQF60nc9yab+Csi4AyoAmilGNfpXT+EXdBgFkP9OgPwIBPwyqVf7JAWPtmqrrrneTmAT6ojv7OlH1f6Ix5BG4Q==", "dependencies": { - "@sigstore/bundle": "^2.2.0", + "@sigstore/bundle": "^2.3.1", "@sigstore/core": "^1.1.0", - "@sigstore/protobuf-specs": "^0.3.0" + "@sigstore/protobuf-specs": "^0.3.1" }, "engines": { "node": "^16.14.0 || >=18.0.0" } }, "node_modules/@sigstore/verify/node_modules/@sigstore/bundle": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-2.2.0.tgz", - "integrity": "sha512-5VI58qgNs76RDrwXNhpmyN/jKpq9evV/7f1XrcqcAfvxDl5SeVY/I5Rmfe96ULAV7/FK5dge9RBKGBJPhL1WsQ==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-2.3.1.tgz", + "integrity": "sha512-eqV17lO3EIFqCWK3969Rz+J8MYrRZKw9IBHpSo6DEcEX2c+uzDFOgHE9f2MnyDpfs48LFO4hXmk9KhQ74JzU1g==", "dependencies": { - "@sigstore/protobuf-specs": "^0.3.0" + "@sigstore/protobuf-specs": "^0.3.1" }, "engines": { "node": "^16.14.0 || >=18.0.0" @@ -2221,9 +2279,9 @@ } }, "node_modules/@types/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-87W6MJCKZYDhLAx/J1ikW8niMvmGRyY+rpUxWpL1cO7F8Uu5CHuQoFv+R0/L5pgNdW4jTyda42kv60uwVIPjLw==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-hulKeREDdLFesGQjl96+4aoJSHY5b2GRjagzzcqCfIrWhe5vkCqIvrLbqzBaI1q94Vg8DNJZZqTR5ocdWmWclg==", "dev": true }, "node_modules/@types/convert-source-map": { @@ -3265,9 +3323,9 @@ } }, "node_modules/builtins": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", - "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.1.0.tgz", + "integrity": "sha512-SW9lzGTLvWTP1AY8xeAMZimqDrIaSdLQUcVr9DMef51niJ022Ri87SwRRKYm4A6iHfkPaiVUu/Duw2Wc4J7kKg==", "dependencies": { "semver": "^7.0.0" } @@ -9725,12 +9783,12 @@ } }, "node_modules/npm-package-arg": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-11.0.1.tgz", - "integrity": "sha512-M7s1BD4NxdAvBKUPqqRW957Xwcl/4Zvo8Aj+ANrzvIPzGJZElrH7Z//rSaec2ORcND6FHHLnZeY8qgTpXDMFQQ==", + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-11.0.2.tgz", + "integrity": "sha512-IGN0IAwmhDJwy13Wc8k+4PEbTPhpJnMtfR53ZbOyjkvmEcLS4nCwp6mvMWjS5sUjeiW3mpx6cHmuhKEu9XmcQw==", "dependencies": { "hosted-git-info": "^7.0.0", - "proc-log": "^3.0.0", + "proc-log": "^4.0.0", "semver": "^7.3.5", "validate-npm-package-name": "^5.0.0" }, @@ -9738,6 +9796,14 @@ "node": "^16.14.0 || >=18.0.0" } }, + "node_modules/npm-package-arg/node_modules/proc-log": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-4.1.0.tgz", + "integrity": "sha512-dmQ2iPw2nJMi9/4dpaG1wd0m1GE+K5kW7RGbjy5hoEEGnhPIzsm+klBO5RGGdcoYbWsNtU2KSNAdEldts+icLg==", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/npm-packlist": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-7.0.4.tgz", @@ -9764,17 +9830,18 @@ } }, "node_modules/npm-registry-fetch": { - "version": "16.1.0", - "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-16.1.0.tgz", - "integrity": "sha512-PQCELXKt8Azvxnt5Y85GseQDJJlglTFM9L9U9gkv2y4e9s0k3GVDdOx3YoB6gm2Do0hlkzC39iCGXby+Wve1Bw==", + "version": "16.2.1", + "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-16.2.1.tgz", + "integrity": "sha512-8l+7jxhim55S85fjiDGJ1rZXBWGtRLi1OSb4Z3BPLObPuIaeKRlPRiYMSHU4/81ck3t71Z+UwDDl47gcpmfQQA==", "dependencies": { + "@npmcli/redact": "^1.1.0", "make-fetch-happen": "^13.0.0", "minipass": "^7.0.2", "minipass-fetch": "^3.0.0", "minipass-json-stream": "^1.0.1", "minizlib": "^2.1.2", "npm-package-arg": "^11.0.0", - "proc-log": "^3.0.0" + "proc-log": "^4.0.0" }, "engines": { "node": "^16.14.0 || >=18.0.0" @@ -9788,6 +9855,14 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/npm-registry-fetch/node_modules/proc-log": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-4.1.0.tgz", + "integrity": "sha512-dmQ2iPw2nJMi9/4dpaG1wd0m1GE+K5kW7RGbjy5hoEEGnhPIzsm+klBO5RGGdcoYbWsNtU2KSNAdEldts+icLg==", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/npm-run-path": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", @@ -11017,9 +11092,9 @@ } }, "node_modules/path-to-regexp": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz", - "integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.2.tgz", + "integrity": "sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw==", "dev": true }, "node_modules/path-type": { @@ -11367,9 +11442,9 @@ } }, "node_modules/qs": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.12.0.tgz", - "integrity": "sha512-trVZiI6RMOkO476zLGaBIzszOdFPnCCXHPG9kn0yuS1uz6xdVxPfZdB3vUig9pxPFDM9BRAgz/YUIVQ1/vuiUg==", + "version": "6.12.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.12.1.tgz", + "integrity": "sha512-zWmv4RSuB9r2mYQw3zxQuHWeU+42aKi1wWig/j4ele4ygELZ7PEO6MM7rim9oAQH2A5MWfsAVf/jPvTPgCbvUQ==", "dev": true, "dependencies": { "side-channel": "^1.0.6" @@ -12993,9 +13068,9 @@ } }, "node_modules/socks": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.1.tgz", - "integrity": "sha512-B6w7tkwNid7ToxjZ08rQMT8M9BJAf8DKx8Ft4NivzH0zBUfd6jldGcisJn/RLgxcX3FPNDdNQCUEMMT79b+oCQ==", + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz", + "integrity": "sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==", "dependencies": { "ip-address": "^9.0.5", "smart-buffer": "^4.2.0" diff --git a/package.json b/package.json index d74038d954..c591ab0368 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nativescript", "main": "./lib/nativescript-cli-lib.js", - "version": "8.7.2", + "version": "8.8.0-alpha.1", "author": "NativeScript ", "description": "Command-line interface for building NativeScript projects", "bin": { diff --git a/test/services/android/gradle-build-args-service.ts b/test/services/android/gradle-build-args-service.ts index e09a33478e..a0e2ff5cd6 100644 --- a/test/services/android/gradle-build-args-service.ts +++ b/test/services/android/gradle-build-args-service.ts @@ -62,10 +62,6 @@ const ksPath = temp.path({ prefix: "ksPath" }); const expectedInfoLoggingArgs = ["--quiet"]; const expectedTraceLoggingArgs = ["--stacktrace", "--debug"]; const expectedDebugBuildArgs = [ - "-PcompileSdk=android-28", - "-PtargetSdk=26", - "-PbuildToolsVersion=my-build-tools-version", - "-PgenerateTypings=true", "-PappPath=/path/to/projectDir/app".replace(/\//g, path.sep), "-PappResourcesPath=/path/to/projectDir/app/App_Resources".replace( /\//g, @@ -124,8 +120,7 @@ describe("GradleBuildArgsService", () => { .concat(expectedReleaseBuildArgs), }, { - name: - "should return correct args for debug build with info log and android bundle", + name: "should return correct args for debug build with info log and android bundle", buildConfig: { release: false, androidBundle: true }, logLevel: "INFO", expectedResult: ["bundleDebug"] @@ -133,8 +128,7 @@ describe("GradleBuildArgsService", () => { .concat(expectedDebugBuildArgs), }, { - name: - "should return correct args for debug build with trace log and android bundle", + name: "should return correct args for debug build with trace log and android bundle", buildConfig: { release: false, androidBundle: true }, logLevel: "TRACE", expectedResult: ["bundleDebug"] @@ -142,8 +136,7 @@ describe("GradleBuildArgsService", () => { .concat(expectedDebugBuildArgs), }, { - name: - "should return correct args for release build with info log and android bundle", + name: "should return correct args for release build with info log and android bundle", buildConfig: { ...releaseBuildConfig, androidBundle: true }, logLevel: "INFO", expectedResult: ["bundleRelease"] @@ -151,8 +144,7 @@ describe("GradleBuildArgsService", () => { .concat(expectedReleaseBuildArgs), }, { - name: - "should return correct args for release build with trace log and android bundle", + name: "should return correct args for release build with trace log and android bundle", buildConfig: { ...releaseBuildConfig, androidBundle: true }, logLevel: "TRACE", expectedResult: ["bundleRelease"] @@ -189,8 +181,7 @@ describe("GradleBuildArgsService", () => { .concat(expectedDebugBuildArgs), }, { - name: - "should return correct args for release clean build with info log", + name: "should return correct args for release clean build with info log", buildConfig: releaseBuildConfig, logLevel: "INFO", expectedResult: ["clean"] @@ -198,8 +189,7 @@ describe("GradleBuildArgsService", () => { .concat(expectedReleaseBuildArgs), }, { - name: - "should return correct args for release clean build with trace log", + name: "should return correct args for release clean build with trace log", buildConfig: releaseBuildConfig, logLevel: "TRACE", expectedResult: ["clean"] @@ -207,8 +197,7 @@ describe("GradleBuildArgsService", () => { .concat(expectedReleaseBuildArgs), }, { - name: - "should return correct args for debug clean build with info log and android bundle", + name: "should return correct args for debug clean build with info log and android bundle", buildConfig: { release: false, androidBundle: true }, logLevel: "INFO", expectedResult: ["clean"] @@ -216,8 +205,7 @@ describe("GradleBuildArgsService", () => { .concat(expectedDebugBuildArgs), }, { - name: - "should return correct args for debug clean build with trace log and android bundle", + name: "should return correct args for debug clean build with trace log and android bundle", buildConfig: { release: false, androidBundle: true }, logLevel: "TRACE", expectedResult: ["clean"] @@ -225,8 +213,7 @@ describe("GradleBuildArgsService", () => { .concat(expectedDebugBuildArgs), }, { - name: - "should return correct args for release clean build with info log and android bundle", + name: "should return correct args for release clean build with info log and android bundle", buildConfig: { ...releaseBuildConfig, androidBundle: true }, logLevel: "INFO", expectedResult: ["clean"] @@ -234,8 +221,7 @@ describe("GradleBuildArgsService", () => { .concat(expectedReleaseBuildArgs), }, { - name: - "should return correct args for release clean build with trace log and android bundle", + name: "should return correct args for release clean build with trace log and android bundle", buildConfig: { ...releaseBuildConfig, androidBundle: true }, logLevel: "TRACE", expectedResult: ["clean"] diff --git a/vendor/aab-tool/README.txt b/vendor/aab-tool/README.txt index 36cfe7cd3b..347e8774d3 100644 --- a/vendor/aab-tool/README.txt +++ b/vendor/aab-tool/README.txt @@ -1 +1 @@ -Downloaded from https://github.com/google/bundletool/releases/tag/1.8.2 \ No newline at end of file +Downloaded from https://github.com/google/bundletool/releases/tag/1.15.6 \ No newline at end of file diff --git a/vendor/aab-tool/bundletool.jar b/vendor/aab-tool/bundletool.jar index c4e0cc7372..6d7f4a2d2e 100644 Binary files a/vendor/aab-tool/bundletool.jar and b/vendor/aab-tool/bundletool.jar differ diff --git a/vendor/gradle-plugin/build.gradle b/vendor/gradle-plugin/build.gradle index 38092efde4..41d463f4be 100644 --- a/vendor/gradle-plugin/build.gradle +++ b/vendor/gradle-plugin/build.gradle @@ -11,11 +11,11 @@ buildscript { def getDepPlatformDir = { dep -> file("${project.ext.USER_PROJECT_ROOT}/${project.ext.PLATFORMS_ANDROID}/${dep.directory}/$PLATFORMS_ANDROID") } - def computeKotlinVersion = { -> project.hasProperty("kotlinVersion") ? kotlinVersion : "1.8.20" } + def computeKotlinVersion = { -> project.hasProperty("kotlinVersion") ? kotlinVersion : "2.0.0" } def kotlinVersion = computeKotlinVersion() repositories { google() - jcenter() + mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:{{runtimeAndroidPluginVersion}}' @@ -135,7 +135,6 @@ allprojects { url 'https://maven.google.com/' name 'Google' } - jcenter() if (pluginDependencies.size() > 0) { flatDir { dirs pluginDependencies @@ -145,13 +144,29 @@ allprojects { } -def computeCompileSdkVersion = { -> project.hasProperty("compileSdk") ? compileSdk : 31 } -def computeTargetSdkVersion = { -> project.hasProperty("targetSdk") ? targetSdk : 31 as int } +def computeCompileSdkVersion = { -> project.hasProperty("compileSdk") ? compileSdk : 34 } +def computeTargetSdkVersion = { -> project.hasProperty("targetSdk") ? targetSdk : 34 as int } def computeBuildToolsVersion = { -> - project.hasProperty("buildToolsVersion") ? buildToolsVersion : "31.0.0" + project.hasProperty("buildToolsVersion") ? buildToolsVersion : "34.0.0" } android { + namespace "{{pluginNamespace}}" + + kotlinOptions { + jvmTarget = '17' + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + + + if (project.hasProperty("ndkVersion")) { + ndkVersion project.ndkVersion + } + def applyPluginGradleConfigurations = { -> nativescriptDependencies.each { dep -> def includeGradlePath = "${getDepPlatformDir(dep)}/include.gradle" @@ -205,15 +220,6 @@ task addDependenciesFromNativeScriptPlugins { } } -afterEvaluate { - def generateBuildConfig = project.hasProperty("generateBuildConfig") ? project.generateBuildConfig : false - def generateR = project.hasProperty("generateR") ? project.generateR : false - generateReleaseBuildConfig.enabled = generateBuildConfig - generateDebugBuildConfig.enabled = generateBuildConfig - generateReleaseResValues.enabled = generateR - generateDebugResValues.enabled = generateR -} - tasks.whenTaskAdded({ DefaultTask currentTask -> if (currentTask.name == 'bundleRelease' || currentTask.name == 'bundleDebug') { def generateBuildConfig = project.hasProperty("generateBuildConfig") ? project.generateBuildConfig : false