@nativescript/android 8.4.0-alpha.5 → 8.4.0-alpha.7

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.
@@ -779,17 +779,18 @@ task buildMetadata(type: BuildToolTask) {
779
779
  def selectedBuildType = project.ext.selectedBuildType
780
780
 
781
781
  rootProject.subprojects {
782
+
782
783
  def projectClassesDir = new File("$it.buildDir/intermediates/javac")
783
784
  def projectKotlinClassesDir = new File("$it.buildDir/tmp/kotlin-classes")
784
-
785
- assert projectClassesDir.exists()
786
785
 
787
- def projectClassesSubDirs = projectClassesDir.listFiles()
788
- for (File subDir : projectClassesSubDirs) {
789
- if (!classesSubDirs.contains(subDir)) {
790
- classesSubDirs.add(subDir)
786
+ if (projectClassesDir.exists()) {
787
+ def projectClassesSubDirs = projectClassesDir.listFiles()
788
+ for (File subDir : projectClassesSubDirs) {
789
+ if (!classesSubDirs.contains(subDir)) {
790
+ classesSubDirs.add(subDir)
791
+ }
792
+ }
791
793
  }
792
- }
793
794
 
794
795
  if (projectKotlinClassesDir.exists()) {
795
796
  def projectKotlinClassesSubDirs = projectKotlinClassesDir.listFiles();
@@ -5,3 +5,74 @@ include ':app'//, ':runtime', ':runtime-binding-generator'
5
5
  //project(':runtime-binding-generator').projectDir = new File("${System.env.ANDROID_RUNTIME_HOME}/test-app/runtime-binding-generator")
6
6
 
7
7
  file("google-services.json").renameTo(file("./app/google-services.json"))
8
+
9
+ import org.gradle.internal.logging.text.StyledTextOutputFactory
10
+
11
+ import java.nio.file.Paths
12
+
13
+ import org.gradle.internal.logging.text.StyledTextOutputFactory
14
+ import groovy.json.JsonSlurper
15
+ import static org.gradle.internal.logging.text.StyledTextOutput.Style
16
+
17
+ def USER_PROJECT_ROOT = "$rootDir/../../"
18
+ def outLogger = services.get(StyledTextOutputFactory).create("colouredOutputLogger")
19
+ def ext = {
20
+ appResourcesPath = getProperty("appResourcesPath")
21
+ appPath = getProperty("appPath")
22
+ }
23
+
24
+ def getAppPath = { ->
25
+ def relativePathToApp = "app"
26
+ def nsConfigFile = file("$USER_PROJECT_ROOT/nsconfig.json")
27
+ def nsConfig
28
+
29
+ if (nsConfigFile.exists()) {
30
+ nsConfig = new JsonSlurper().parseText(nsConfigFile.getText("UTF-8"))
31
+ }
32
+
33
+ if (ext.appPath) {
34
+ // when appPath is passed through -PappPath=/path/to/app
35
+ // the path could be relative or absolute - either case will work
36
+ relativePathToApp = ext.appPath
37
+ } else if (nsConfig != null && nsConfig.appPath != null) {
38
+ relativePathToApp = nsConfig.appPath
39
+ }
40
+
41
+ return Paths.get(USER_PROJECT_ROOT).resolve(relativePathToApp).toAbsolutePath()
42
+ }
43
+
44
+
45
+ def getAppResourcesPath = { ->
46
+ def relativePathToAppResources
47
+ def absolutePathToAppResources
48
+ def nsConfigFile = file("$USER_PROJECT_ROOT/nsconfig.json")
49
+ def nsConfig
50
+
51
+ if (nsConfigFile.exists()) {
52
+ nsConfig = new JsonSlurper().parseText(nsConfigFile.getText("UTF-8"))
53
+ }
54
+ if (ext.appResourcesPath) {
55
+ // when appResourcesPath is passed through -PappResourcesPath=/path/to/App_Resources
56
+ // the path could be relative or absolute - either case will work
57
+ relativePathToAppResources = ext.appResourcesPath
58
+ absolutePathToAppResources = Paths.get(USER_PROJECT_ROOT).resolve(relativePathToAppResources).toAbsolutePath()
59
+ } else if (nsConfig != null && nsConfig.appResourcesPath != null) {
60
+ relativePathToAppResources = nsConfig.appResourcesPath
61
+ absolutePathToAppResources = Paths.get(USER_PROJECT_ROOT).resolve(relativePathToAppResources).toAbsolutePath()
62
+ } else {
63
+ absolutePathToAppResources = "${getAppPath()}/App_Resources"
64
+ }
65
+ return absolutePathToAppResources
66
+ }
67
+
68
+ def applySettingsGradleConfiguration = { ->
69
+ def appResourcesPath = getAppResourcesPath()
70
+ def pathToSettingsGradle = "$appResourcesPath/Android/settings.gradle"
71
+ def settingsGradle = file(pathToSettingsGradle)
72
+ if (settingsGradle.exists()) {
73
+ outLogger.withStyle(Style.SuccessHeader).println "\t + applying user-defined configuration from ${settingsGradle}"
74
+ apply from: pathToSettingsGradle
75
+ }
76
+ }
77
+
78
+ applySettingsGradleConfiguration()
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nativescript/android",
3
3
  "description": "NativeScript Runtime for Android",
4
- "version": "8.4.0-alpha.5",
4
+ "version": "8.4.0-alpha.7",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/NativeScript/android-runtime.git"