Skip to content

Commit ae0c415

Browse files
authored
Refactor widget directory logic in include.gradle
Refactor widget directory handling for better clarity and maintainability.
1 parent 6988afe commit ae0c415

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

packages/image/platforms/android/include.gradle

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
import groovy.json.JsonSlurper
22

3-
// for now we support only @nativescript/core and @akylas/nativescript
4-
// we should have a more generic way
5-
def widgetsDir = "$USER_PROJECT_ROOT/node_modules/@nativescript/core/platforms/android"
6-
def appPackageJsonFile = file("$USER_PROJECT_ROOT/package.json")
7-
if (appPackageJsonFile.exists()) {
8-
def appPackageJson = new JsonSlurper().parseText(appPackageJsonFile.text)
9-
if (appPackageJson.dependencies['@akylas/nativescript'] != null) {
10-
widgetsDir = "$USER_PROJECT_ROOT/node_modules/@akylas/nativescript/platforms/android"
11-
}
12-
}
3+
134

145
dependencies {
156
def frescoVersion = project.hasProperty("frescoVersion") ? project.frescoVersion : "3.1.3"
@@ -29,6 +20,9 @@ dependencies {
2920
// }
3021

3122
if (project.hasProperty("tempBuild")) {
23+
// we need to copy the code in both places as N main gradle system does not support top level code
24+
// for now we support only @nativescript/core and @akylas/nativescript
25+
// we should have a more generic way
3226
def widgetsDir = "$USER_PROJECT_ROOT/node_modules/@nativescript/core/platforms/android"
3327
def appPackageJsonFile = file("$USER_PROJECT_ROOT/package.json")
3428
if (appPackageJsonFile.exists()) {

0 commit comments

Comments
 (0)