Darin726 closed pull request #1369: check ndk version URL: https://github.com/apache/incubator-weex/pull/1369
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/android/sdk/build.gradle b/android/sdk/build.gradle index e2b7871c4f..8c23d3cafd 100755 --- a/android/sdk/build.gradle +++ b/android/sdk/build.gradle @@ -223,3 +223,48 @@ if(file('../license/LICENSE').exists()){ } preBuild.dependsOn licenseFormat } + +task checkNdkVersion() { + def rootDir = project.rootDir + def localProperties = new File(rootDir, "local.properties") + def ndkDir = '' + if (localProperties.exists()) { + Properties properties = new Properties() + localProperties.withInputStream { instr -> + properties.load(instr) + } + ndkDir = properties.getProperty('ndk.dir') + } + + if(!ndkDir.isEmpty()) { + def sourcePropertiesFile = new File(ndkDir,"source.properties") + def ndkVersion = '' + println("sourcePropertiesFile" + sourcePropertiesFile.absolutePath) + if(sourcePropertiesFile.exists()) { + Properties properties = new Properties() + sourcePropertiesFile.withInputStream { instr -> + properties.load(instr) + } + + ndkVersion = properties.getProperty('Pkg.Revision') + } + + if(ndkVersion.length() > 2) { + def substring = ndkVersion.substring(0, 2) + try { + if(substring.toInteger() != 16) { + throw new StopActionException("Ndk Version 16 supported only") + } + } catch (Exception ignored) { + println("Ndk Version 16 supported only") + } + + } else { + println("Ndk Version 16 supported only") + } + } else { + println("Ndk Version 16 supported only") + } +} + +preBuild.dependsOn checkNdkVersion \ No newline at end of file ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services