@@ -16,6 +16,11 @@ import groovy.json.JsonOutput
1616
1717def onlyX86 = project. hasProperty(" onlyX86" )
1818def useCCache = ! project. hasProperty(" noCCache" )
19+ def hasNdkVersion = project. hasProperty(" ndkVersion" )
20+
21+ if (hasNdkVersion) {
22+ println " Using NDK version " + ndkVersion
23+ }
1924
2025def isWinOs = System . properties[' os.name' ]. toLowerCase(). contains(' windows' )
2126def pVersion = " no package version was provided by build.gradle build"
@@ -36,6 +41,11 @@ task checkEnvironmentVariables {
3641 throw new GradleException (" Set ANDROID_HOME to point to the correct Android SDK location\n " )
3742 }
3843
44+ if (" $System . env . ANDROID_NDK_HOME " == " " || " $System . env . ANDROID_NDK_HOME " == " null" && ! project. hasProperty(" ndkVersion" )) {
45+ logger. warn(" Warning: The ANDROID_NDK_HOME is not set nor the ndkVersion project property. The build might fail if a ndk cannot be found.\n " )
46+ }
47+
48+
3949 if (" $System . env . GIT_COMMIT " == " null" && ! project. hasProperty(" gitCommitVersion" )) {
4050 logger. warn(" Warning: The GIT_COMMIT is not set. This NativeScript Android Runtime will not be tagged with the git commit it is build from\n " )
4151 }
@@ -185,6 +195,9 @@ def getAssembleReleaseBuildArguments = { ->
185195 if (useCCache) {
186196 arguments. add(" -PuseCCache" )
187197 }
198+ if (hasNdkVersion) {
199+ arguments. add(" -PndkVersion=" + ndkVersion)
200+ }
188201 arguments + = [" --warning-mode" , " all" ]
189202 return arguments
190203}
@@ -286,6 +299,10 @@ task copyFilesToProjectTemeplate {
286299 from " $TEST_APP_PATH /build.gradle"
287300 into " $DIST_FRAMEWORK_PATH "
288301 }
302+ copy {
303+ from " $TEST_APP_PATH /gradle.properties"
304+ into " $DIST_FRAMEWORK_PATH "
305+ }
289306 copy {
290307 from " $TEST_APP_PATH /gradle-helpers/paths.gradle"
291308 into " $DIST_FRAMEWORK_PATH /gradle-helpers"
0 commit comments