11import groovy.json.JsonSlurper
2- dependencies {
3- if (project. hasProperty(" tempBuild" )) {
4- implementation(name :' widgets-release' , ext :' aar' )
2+
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"
511 }
6- implementation " androidx.annotation:annotation:1.1.0"
712}
8- repositories {
13+
14+ dependencies {
15+ implementation " androidx.annotation:annotation:1.1.0"
16+
917 if (project. hasProperty(" tempBuild" )) {
10- def widgetsDir = " $USER_PROJECT_ROOT /node_modules/@nativescript/core/platforms/android"
11- def appPackageJsonFile = file(" $USER_PROJECT_ROOT /package.json" )
12- if (appPackageJsonFile. exists()) {
13- def appPackageJson = new JsonSlurper (). parseText(appPackageJsonFile. text)
14- if (appPackageJson. dependencies[' @akylas/nativescript' ] != null ) {
15- widgetsDir = " $USER_PROJECT_ROOT /node_modules/@akylas/nativescript/platforms/android"
16- }
18+ // if ui-mobile-base is provided as source the name is nativescript.aar
19+ if (file(" $widgetsDir /nativescript.aar" ). exists()) {
20+ implementation(name :' nativescript' , ext :' aar' )
1721 }
18- flatDir {
19- dirs " $widgetsDir "
22+ // if ui-mobile-base is provided as aar the name is widget-release.aar
23+ if (file(" $widgetsDir /widget-release.aar" ). exists()) {
24+ implementation(name :' widget-release' , ext :' aar' )
2025 }
2126 }
22- }
27+ }
28+ repositories {
29+ flatDir {
30+ dirs " $widgetsDir "
31+ }
32+ }
0 commit comments