import groovy.json.JsonSlurper buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.6.4' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { mavenLocal() mavenCentral() maven { url 'https://maven.google.com/' name 'Google' } jcenter() } } apply plugin: 'com.android.library' def computeCompileSdkVersion = { -> project.hasProperty("compileSdk") ? compileSdk : 28 } def computeBuildToolsVersion = { -> project.hasProperty("buildToolsVersion") ? buildToolsVersion : "28.0.3" } android { applyBeforePluginGradleConfiguration() compileSdkVersion computeCompileSdkVersion() buildToolsVersion computeBuildToolsVersion() defaultConfig { targetSdkVersion 26 versionCode 1 versionName "1.0" } } dependencies { def supportVer = "28.0.0" if (project.hasProperty("supportVersion")) { supportVer = supportVersion } compileOnly "com.android.support:support-v4:$supportVer" compileOnly "com.android.support:appcompat-v7:$supportVer" configurations.all { resolutionStrategy.eachDependency { DependencyResolveDetails details -> if (details.requested.group == "com.android.support" && !details.requested.name.startsWith("multidex")) { details.useVersion supportVer } } } } def getAppResourcesPath() { def relativePathToApp = "app" def relativePathToAppResources def absolutePathToAppResources def projectRoot = "$rootDir/../../.." def nsConfigFile = file("$projectRoot/nsconfig.json") def nsConfig if (nsConfigFile.exists()) { nsConfig = new JsonSlurper().parseText(nsConfigFile.getText("UTF-8")) } if(nsConfig != null && nsConfig.appPath != null){ relativePathToApp = nsConfig.appPath } if(nsConfig != null && nsConfig.appResourcesPath != null ) { relativePathToAppResources = nsConfig.appResourcesPath } else { relativePathToAppResources = "$relativePathToApp/App_Resources" } absolutePathToAppResources = java.nio.file.Paths.get(projectRoot).resolve(relativePathToAppResources).toAbsolutePath() project.ext.appResourcesPath = absolutePathToAppResources return absolutePathToAppResources } def applyBeforePluginGradleConfiguration() { def appResourcesPath = getAppResourcesPath() def pathToBeforePluginGradle = "$appResourcesPath/Android/before-plugins.gradle" def beforePluginGradle = file(pathToBeforePluginGradle) if (beforePluginGradle.exists()) { println "\t + applying user-defined configuration from ${beforePluginGradle}" apply from: pathToBeforePluginGradle } } repositories { jcenter() maven { url "https://jitpack.io" } } dependencies { implementation 'com.github.yalantis:ucrop:2.2.3' }