nativescript 8.1.5 → 8.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/test-deps-versions-generated.json +1 -1
- package/lib/android-tools-info.js +2 -2
- package/lib/base-package-manager.js +3 -2
- package/lib/commands/appstore-list.js +1 -1
- package/lib/commands/build.js +1 -1
- package/lib/commands/clean.js +7 -3
- package/lib/commands/create-project.js +2 -2
- package/lib/commands/debug.js +3 -3
- package/lib/commands/deploy.js +1 -1
- package/lib/commands/fonts.js +1 -1
- package/lib/commands/generate.js +1 -1
- package/lib/commands/plugin/build-plugin.js +2 -0
- package/lib/commands/plugin/create-plugin.js +4 -4
- package/lib/commands/plugin/list-plugins.js +2 -2
- package/lib/commands/post-install.js +1 -1
- package/lib/commands/run.js +3 -3
- package/lib/commands/test-init.js +1 -1
- package/lib/commands/test.js +2 -1
- package/lib/commands/typings.js +35 -27
- package/lib/common/commands/device/list-devices.js +18 -7
- package/lib/common/commands/preuninstall.js +2 -2
- package/lib/common/commands/proxy/proxy-set.js +6 -6
- package/lib/common/dispatchers.js +1 -1
- package/lib/common/errors.js +2 -2
- package/lib/common/file-system.js +17 -17
- package/lib/common/helpers.js +6 -5
- package/lib/common/host-info.js +1 -1
- package/lib/common/http-client.js +1 -1
- package/lib/common/logger/layouts/cli-layout.js +1 -1
- package/lib/common/logger/logger.js +1 -1
- package/lib/common/mobile/android/android-application-manager.js +6 -6
- package/lib/common/mobile/android/android-debug-bridge.js +4 -4
- package/lib/common/mobile/android/android-device-file-system.js +3 -3
- package/lib/common/mobile/android/android-device-hash-service.js +4 -4
- package/lib/common/mobile/android/android-device.js +1 -1
- package/lib/common/mobile/android/android-emulator-services.js +6 -6
- package/lib/common/mobile/android/android-virtual-device-service.js +7 -7
- package/lib/common/mobile/android/genymotion/genymotion-service.js +3 -3
- package/lib/common/mobile/android/genymotion/virtualbox-service.js +2 -2
- package/lib/common/mobile/device-log-provider-base.js +1 -1
- package/lib/common/mobile/ios/device/ios-application-manager.js +2 -2
- package/lib/common/mobile/ios/device/ios-device-operations.js +2 -2
- package/lib/common/mobile/ios/device/ios-device.js +1 -1
- package/lib/common/mobile/ios/ios-device-base.js +1 -1
- package/lib/common/mobile/ios/simulator/ios-emulator-services.js +1 -1
- package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +3 -3
- package/lib/common/mobile/ios/simulator/ios-simulator-device.js +1 -1
- package/lib/common/mobile/mobile-core/android-process-service.js +1 -1
- package/lib/common/mobile/mobile-core/devices-service.js +22 -20
- package/lib/common/services/auto-completion-service.js +3 -3
- package/lib/common/services/hooks-service.js +2 -2
- package/lib/common/services/json-file-settings-service.js +1 -1
- package/lib/common/services/lock-service.js +2 -2
- package/lib/common/services/messages-service.js +1 -1
- package/lib/common/services/net-service.js +1 -1
- package/lib/common/services/qr.js +2 -2
- package/lib/common/services/settings-service.js +1 -1
- package/lib/common/services/xcode-select-service.js +1 -1
- package/lib/common/yok.js +2 -2
- package/lib/constants.js +8 -6
- package/lib/controllers/build-controller.js +6 -1
- package/lib/controllers/company-insights-controller.js +1 -1
- package/lib/controllers/debug-controller.js +3 -3
- package/lib/controllers/migrate-controller.js +16 -16
- package/lib/controllers/platform-controller.js +32 -6
- package/lib/controllers/prepare-controller.js +6 -6
- package/lib/controllers/preview-app-controller.js +3 -3
- package/lib/controllers/run-controller.js +4 -3
- package/lib/data/build-data.js +2 -0
- package/lib/declarations.d.ts +6 -0
- package/lib/definitions/android-plugin-migrator.d.ts +12 -0
- package/lib/definitions/build.d.ts +4 -1
- package/lib/definitions/gradle.d.ts +1 -0
- package/lib/definitions/platform.d.ts +12 -3
- package/lib/detached-processes/cleanup-js-subprocess.js +1 -1
- package/lib/detached-processes/file-log-service.js +1 -1
- package/lib/device-path-provider.js +1 -1
- package/lib/nativescript-cli.js +2 -2
- package/lib/node-package-manager.js +15 -10
- package/lib/options.js +4 -1
- package/lib/package-manager.js +17 -17
- package/lib/pnpm-package-manager.js +12 -8
- package/lib/project-data.js +3 -3
- package/lib/services/analytics/analytics-broker.js +1 -1
- package/lib/services/analytics/analytics-service.js +5 -5
- package/lib/services/analytics/google-analytics-provider.js +2 -2
- package/lib/services/analytics-settings-service.js +4 -4
- package/lib/services/android/android-bundle-tool-service.js +2 -2
- package/lib/services/android/gradle-build-args-service.js +3 -0
- package/lib/services/android/gradle-build-service.js +3 -1
- package/lib/services/android/gradle-command-service.js +2 -3
- package/lib/services/android-device-debug-service.js +3 -3
- package/lib/services/android-plugin-build-service.js +33 -13
- package/lib/services/android-project-service.js +35 -10
- package/lib/services/apple-portal/apple-portal-session-service.js +1 -1
- package/lib/services/assets-generation/assets-generation-service.js +2 -2
- package/lib/services/cleanup-service.js +2 -2
- package/lib/services/cocoapods-service.js +2 -1
- package/lib/services/doctor-service.js +3 -3
- package/lib/services/extensibility-service.js +4 -4
- package/lib/services/files-hash-service.js +1 -1
- package/lib/services/hmr-status-service.js +1 -1
- package/lib/services/ios-debugger-port-service.js +2 -2
- package/lib/services/ios-device-debug-service.js +4 -4
- package/lib/services/ios-project-service.js +6 -6
- package/lib/services/ios-provision-service.js +3 -3
- package/lib/services/ip-service.js +1 -1
- package/lib/services/itmstransporter-service.js +3 -3
- package/lib/services/karma-execution.js +1 -1
- package/lib/services/livesync/android-device-livesync-service.js +2 -2
- package/lib/services/livesync/android-livesync-service.js +2 -2
- package/lib/services/livesync/device-livesync-service-base.js +2 -2
- package/lib/services/livesync/ios-device-livesync-service.js +1 -1
- package/lib/services/livesync/ios-livesync-service.js +1 -1
- package/lib/services/livesync/platform-livesync-service-base.js +2 -2
- package/lib/services/livesync/playground/preview-app-files-service.js +1 -1
- package/lib/services/livesync/playground/preview-qr-code-service.js +1 -1
- package/lib/services/log-parser-service.js +1 -1
- package/lib/services/log-source-map-service.js +1 -1
- package/lib/services/pacote-service.js +1 -1
- package/lib/services/performance-service.js +1 -1
- package/lib/services/platform/add-platform-service.js +1 -1
- package/lib/services/platform/prepare-native-platform-service.js +2 -2
- package/lib/services/platform-environment-requirements.js +1 -1
- package/lib/services/plugins-service.js +2 -2
- package/lib/services/project-changes-service.js +2 -2
- package/lib/services/project-cleanup-service.js +3 -1
- package/lib/services/project-config-service.js +6 -6
- package/lib/services/project-data-service.js +9 -9
- package/lib/services/project-name-service.js +1 -1
- package/lib/services/project-service.js +7 -7
- package/lib/services/project-templates-service.js +1 -1
- package/lib/services/test-execution-service.js +1 -1
- package/lib/services/test-initialization-service.js +2 -2
- package/lib/services/webpack/webpack-compiler-service.js +6 -5
- package/lib/services/webpack/webpack.d.ts +1 -1
- package/lib/sys-info.js +5 -5
- package/lib/tools/node-modules/node-modules-builder.js +2 -2
- package/lib/tools/node-modules/node-modules-dependencies-builder.js +13 -6
- package/lib/yarn-package-manager.js +13 -8
- package/package.json +6 -6
- package/vendor/aab-tool/README.txt +1 -1
- package/vendor/aab-tool/bundletool.jar +0 -0
- package/vendor/gradle-plugin/build.gradle +127 -34
- package/vendor/gradle-plugin/gradle.properties +2 -0
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import groovy.json.JsonSlurper
|
|
2
2
|
import org.gradle.internal.logging.text.StyledTextOutputFactory
|
|
3
3
|
import static org.gradle.internal.logging.text.StyledTextOutput.Style
|
|
4
|
+
import java.nio.file.Paths
|
|
4
5
|
|
|
5
6
|
apply plugin: 'com.android.library'
|
|
6
7
|
apply plugin: 'kotlin-android'
|
|
7
|
-
apply plugin: 'kotlin-
|
|
8
|
-
|
|
8
|
+
apply plugin: 'kotlin-parcelize'
|
|
9
9
|
|
|
10
10
|
buildscript {
|
|
11
|
-
def
|
|
11
|
+
def getDepPlatformDir = { dep ->
|
|
12
|
+
file("${project.ext.USER_PROJECT_ROOT}/${project.ext.PLATFORMS_ANDROID}/${dep.directory}/$PLATFORMS_ANDROID")
|
|
13
|
+
}
|
|
14
|
+
def computeKotlinVersion = { -> project.hasProperty("kotlinVersion") ? kotlinVersion : "1.6.0" }
|
|
12
15
|
def kotlinVersion = computeKotlinVersion()
|
|
13
16
|
repositories {
|
|
14
17
|
google()
|
|
@@ -23,33 +26,62 @@ buildscript {
|
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
// Set up styled logger
|
|
29
|
+
project.ext.getDepPlatformDir = getDepPlatformDir
|
|
26
30
|
project.ext.outLogger = services.get(StyledTextOutputFactory).create("colouredOutputLogger")
|
|
27
31
|
|
|
28
|
-
|
|
29
|
-
project.ext.
|
|
32
|
+
project.ext.USER_PROJECT_ROOT = "$rootDir/../../.."
|
|
33
|
+
project.ext.PLATFORMS_ANDROID = "platforms/android"
|
|
34
|
+
project.ext.PLUGIN_NAME = "{{pluginName}}"
|
|
35
|
+
|
|
36
|
+
// the build script will not work with previous versions of the CLI (3.1 or earlier)
|
|
37
|
+
def dependenciesJson = file("${project.ext.USER_PROJECT_ROOT}/${project.ext.PLATFORMS_ANDROID}/dependencies.json")
|
|
38
|
+
def appDependencies = new JsonSlurper().parseText(dependenciesJson.text)
|
|
39
|
+
def pluginData = appDependencies.find { it.name == project.ext.PLUGIN_NAME }
|
|
40
|
+
project.ext.nativescriptDependencies = appDependencies.findAll{pluginData.dependencies.contains(it.name)}
|
|
41
|
+
project.ext.getAppPath = { ->
|
|
30
42
|
def relativePathToApp = "app"
|
|
31
|
-
def
|
|
32
|
-
def absolutePathToAppResources
|
|
33
|
-
def projectRoot = "$rootDir/../../.."
|
|
34
|
-
def nsConfigFile = file("$projectRoot/nsconfig.json")
|
|
43
|
+
def nsConfigFile = file("$USER_PROJECT_ROOT/nsconfig.json")
|
|
35
44
|
def nsConfig
|
|
36
45
|
|
|
37
46
|
if (nsConfigFile.exists()) {
|
|
38
47
|
nsConfig = new JsonSlurper().parseText(nsConfigFile.getText("UTF-8"))
|
|
39
48
|
}
|
|
40
49
|
|
|
41
|
-
if(
|
|
50
|
+
if (project.hasProperty("appPath")) {
|
|
51
|
+
// when appPath is passed through -PappPath=/path/to/app
|
|
52
|
+
// the path could be relative or absolute - either case will work
|
|
53
|
+
relativePathToApp = appPath
|
|
54
|
+
} else if (nsConfig != null && nsConfig.appPath != null) {
|
|
42
55
|
relativePathToApp = nsConfig.appPath
|
|
43
56
|
}
|
|
44
57
|
|
|
45
|
-
|
|
58
|
+
project.ext.appPath = Paths.get(USER_PROJECT_ROOT).resolve(relativePathToApp).toAbsolutePath()
|
|
59
|
+
|
|
60
|
+
return project.ext.appPath
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
project.ext.getAppResourcesPath = { ->
|
|
64
|
+
def relativePathToAppResources
|
|
65
|
+
def absolutePathToAppResources
|
|
66
|
+
def nsConfigFile = file("$USER_PROJECT_ROOT/nsconfig.json")
|
|
67
|
+
def nsConfig
|
|
68
|
+
|
|
69
|
+
if (nsConfigFile.exists()) {
|
|
70
|
+
nsConfig = new JsonSlurper().parseText(nsConfigFile.getText("UTF-8"))
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (project.hasProperty("appResourcesPath")) {
|
|
74
|
+
// when appResourcesPath is passed through -PappResourcesPath=/path/to/App_Resources
|
|
75
|
+
// the path could be relative or absolute - either case will work
|
|
76
|
+
relativePathToAppResources = appResourcesPath
|
|
77
|
+
absolutePathToAppResources = Paths.get(USER_PROJECT_ROOT).resolve(relativePathToAppResources).toAbsolutePath()
|
|
78
|
+
} else if (nsConfig != null && nsConfig.appResourcesPath != null) {
|
|
46
79
|
relativePathToAppResources = nsConfig.appResourcesPath
|
|
80
|
+
absolutePathToAppResources = Paths.get(USER_PROJECT_ROOT).resolve(relativePathToAppResources).toAbsolutePath()
|
|
47
81
|
} else {
|
|
48
|
-
|
|
82
|
+
absolutePathToAppResources = "${getAppPath()}/App_Resources"
|
|
49
83
|
}
|
|
50
84
|
|
|
51
|
-
absolutePathToAppResources = java.nio.file.Paths.get(projectRoot).resolve(relativePathToAppResources).toAbsolutePath()
|
|
52
|
-
|
|
53
85
|
project.ext.appResourcesPath = absolutePathToAppResources
|
|
54
86
|
|
|
55
87
|
return absolutePathToAppResources
|
|
@@ -64,6 +96,15 @@ buildscript {
|
|
|
64
96
|
apply from: pathToBuildScriptGradle, to: buildscript
|
|
65
97
|
}
|
|
66
98
|
|
|
99
|
+
nativescriptDependencies.each { dep ->
|
|
100
|
+
def pathToPluginBuildScriptGradle = "${getDepPlatformDir(dep)}/buildscript.gradle"
|
|
101
|
+
def pluginBuildScriptGradle = file(pathToPluginBuildScriptGradle)
|
|
102
|
+
if (pluginBuildScriptGradle.exists()) {
|
|
103
|
+
outLogger.withStyle(Style.SuccessHeader).println "\t + applying user-defined buildscript from dependency ${pluginBuildScriptGradle}"
|
|
104
|
+
apply from: pathToPluginBuildScriptGradle, to: buildscript
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
67
108
|
def pathToPluginBuildScriptGradle = "$rootDir/buildscript.gradle"
|
|
68
109
|
def pluginBuildScriptGradle = file(pathToPluginBuildScriptGradle)
|
|
69
110
|
if (pluginBuildScriptGradle.exists()) {
|
|
@@ -75,8 +116,19 @@ buildscript {
|
|
|
75
116
|
|
|
76
117
|
}
|
|
77
118
|
|
|
119
|
+
def pluginDependencies
|
|
120
|
+
|
|
78
121
|
allprojects {
|
|
79
122
|
repositories {
|
|
123
|
+
// used for local *.AAR files
|
|
124
|
+
pluginDependencies = nativescriptDependencies.collect {
|
|
125
|
+
getDepPlatformDir(it)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// some plugins may have their android dependencies in a /libs subdirectory
|
|
129
|
+
pluginDependencies.addAll(nativescriptDependencies.collect {
|
|
130
|
+
"${getDepPlatformDir(it)}/libs"
|
|
131
|
+
})
|
|
80
132
|
mavenLocal()
|
|
81
133
|
mavenCentral()
|
|
82
134
|
maven {
|
|
@@ -84,44 +136,42 @@ allprojects {
|
|
|
84
136
|
name 'Google'
|
|
85
137
|
}
|
|
86
138
|
jcenter()
|
|
139
|
+
if (pluginDependencies.size() > 0) {
|
|
140
|
+
flatDir {
|
|
141
|
+
dirs pluginDependencies
|
|
142
|
+
}
|
|
143
|
+
}
|
|
87
144
|
}
|
|
88
145
|
}
|
|
89
146
|
|
|
90
147
|
|
|
91
|
-
def computeCompileSdkVersion = { -> project.hasProperty("compileSdk") ? compileSdk :
|
|
148
|
+
def computeCompileSdkVersion = { -> project.hasProperty("compileSdk") ? compileSdk : 31 }
|
|
92
149
|
def computeBuildToolsVersion = { ->
|
|
93
|
-
project.hasProperty("buildToolsVersion") ? buildToolsVersion : "
|
|
150
|
+
project.hasProperty("buildToolsVersion") ? buildToolsVersion : "31.0.0"
|
|
94
151
|
}
|
|
95
152
|
|
|
96
153
|
android {
|
|
154
|
+
def applyPluginGradleConfigurations = { ->
|
|
155
|
+
nativescriptDependencies.each { dep ->
|
|
156
|
+
def includeGradlePath = "${getDepPlatformDir(dep)}/include.gradle"
|
|
157
|
+
if (file(includeGradlePath).exists()) {
|
|
158
|
+
apply from: includeGradlePath
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
97
162
|
applyBeforePluginGradleConfiguration()
|
|
163
|
+
applyPluginGradleConfigurations()
|
|
98
164
|
|
|
99
165
|
compileSdkVersion computeCompileSdkVersion()
|
|
100
166
|
buildToolsVersion computeBuildToolsVersion()
|
|
101
167
|
|
|
102
168
|
defaultConfig {
|
|
103
|
-
targetSdkVersion
|
|
169
|
+
targetSdkVersion 31
|
|
104
170
|
versionCode 1
|
|
105
171
|
versionName "1.0"
|
|
106
172
|
}
|
|
107
173
|
}
|
|
108
174
|
|
|
109
|
-
dependencies {
|
|
110
|
-
def supportVer = "28.0.0"
|
|
111
|
-
if (project.hasProperty("supportVersion")) {
|
|
112
|
-
supportVer = supportVersion
|
|
113
|
-
}
|
|
114
|
-
compileOnly "com.android.support:support-v4:$supportVer"
|
|
115
|
-
compileOnly "com.android.support:appcompat-v7:$supportVer"
|
|
116
|
-
|
|
117
|
-
configurations.all {
|
|
118
|
-
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
|
|
119
|
-
if (details.requested.group == "com.android.support" && !details.requested.name.startsWith("multidex")) {
|
|
120
|
-
details.useVersion supportVer
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
175
|
|
|
126
176
|
def applyBeforePluginGradleConfiguration() {
|
|
127
177
|
def appResourcesPath = getAppResourcesPath()
|
|
@@ -131,4 +181,47 @@ def applyBeforePluginGradleConfiguration() {
|
|
|
131
181
|
outLogger.withStyle(Style.SuccessHeader).println "\t ~ applying user-defined configuration from ${beforePluginGradle}"
|
|
132
182
|
apply from: pathToBeforePluginGradle
|
|
133
183
|
}
|
|
134
|
-
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
task addDependenciesFromNativeScriptPlugins {
|
|
187
|
+
nativescriptDependencies.each { dep ->
|
|
188
|
+
def aarFiles = fileTree(dir: getDepPlatformDir(dep), include: ["**/*.aar"])
|
|
189
|
+
aarFiles.each { aarFile ->
|
|
190
|
+
def length = aarFile.name.length() - 4
|
|
191
|
+
def fileName = aarFile.name[0..<length]
|
|
192
|
+
outLogger.withStyle(Style.SuccessHeader).println "\t + adding aar plugin dependency: " + aarFile.getAbsolutePath()
|
|
193
|
+
project.dependencies.add("implementation", [name: fileName, ext: "aar"])
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
def jarFiles = fileTree(dir: getDepPlatformDir(dep), include: ["**/*.jar"])
|
|
197
|
+
jarFiles.each { jarFile ->
|
|
198
|
+
def jarFileAbsolutePath = jarFile.getAbsolutePath()
|
|
199
|
+
outLogger.withStyle(Style.SuccessHeader).println "\t + adding jar plugin dependency: $jarFileAbsolutePath"
|
|
200
|
+
pluginsJarLibraries.add(jarFile.getAbsolutePath())
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
project.dependencies.add("implementation", jarFiles)
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
afterEvaluate {
|
|
208
|
+
def generateBuildConfig = project.hasProperty("generateBuildConfig") ? project.generateBuildConfig : false
|
|
209
|
+
def generateR = project.hasProperty("generateR") ? project.generateR : false
|
|
210
|
+
generateReleaseBuildConfig.enabled = generateBuildConfig
|
|
211
|
+
generateDebugBuildConfig.enabled = generateBuildConfig
|
|
212
|
+
generateReleaseResValues.enabled = generateR
|
|
213
|
+
generateDebugResValues.enabled = generateR
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
tasks.whenTaskAdded({ DefaultTask currentTask ->
|
|
217
|
+
if (currentTask.name == 'bundleRelease' || currentTask.name == 'bundleDebug') {
|
|
218
|
+
def generateBuildConfig = project.hasProperty("generateBuildConfig") ? project.generateBuildConfig : false
|
|
219
|
+
def generateR = project.hasProperty("generateR") ? project.generateR : false
|
|
220
|
+
if (!generateBuildConfig) {
|
|
221
|
+
currentTask.exclude '**/BuildConfig.class'
|
|
222
|
+
}
|
|
223
|
+
if (!generateR) {
|
|
224
|
+
currentTask.exclude '**/R.class', '**/R$*.class'
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
})
|