mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
Updated gradle build, allow to configure from file.
This commit is contained in:
@@ -1,4 +1,37 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
Properties properties = new Properties()
|
||||
File file = new File('release.properties')
|
||||
if (file.canRead()) {
|
||||
properties.load(new FileInputStream(file))
|
||||
}
|
||||
|
||||
def getVersionName = { ->
|
||||
def stdout = new ByteArrayOutputStream()
|
||||
exec {
|
||||
commandLine 'git', 'describe', '--tags'
|
||||
standardOutput = stdout
|
||||
}
|
||||
return stdout.toString().trim()
|
||||
}
|
||||
|
||||
ext {
|
||||
versionCode = properties.get('VERSION', "10").toInteger()
|
||||
minSdk = properties.get('MIN_SDK', "14").toInteger()
|
||||
targetSdk = properties.get('TARGET_SDK', "25").toInteger()
|
||||
compileSdk = properties.get('COMPILE_SDK', "25").toInteger()
|
||||
buildToolsVersion = properties.get('BUILD_TOOLS', "25.0.2")
|
||||
versionName = properties.get('VERSION_NAME', getVersionName())
|
||||
|
||||
println '----------------- Project configuration -------------------'
|
||||
println 'VERSION: ' + versionCode
|
||||
println 'MIN_SDK: ' + minSdk
|
||||
println 'TARGET_SDK: ' + targetSdk
|
||||
println 'COMPILE_SDK: ' + compileSdk
|
||||
println 'BUILD_TOOLS: ' + buildToolsVersion
|
||||
println 'VERSION_NAME: ' + versionName
|
||||
println '-----------------------------------------------------------'
|
||||
}
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
|
||||
Reference in New Issue
Block a user