78 lines
1.9 KiB
Groovy
78 lines
1.9 KiB
Groovy
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
|
buildscript {
|
|
repositories {
|
|
jcenter()
|
|
}
|
|
dependencies {
|
|
classpath 'com.android.tools.build:gradle:2.1.2'
|
|
}
|
|
}
|
|
|
|
allprojects {
|
|
repositories {
|
|
jcenter()
|
|
}
|
|
}
|
|
|
|
apply plugin: 'com.android.application'
|
|
|
|
android {
|
|
lintOptions {
|
|
disable 'MissingTranslation'
|
|
disable 'ExtraTranslation'
|
|
}
|
|
|
|
compileSdkVersion 25
|
|
buildToolsVersion "25.0.2"
|
|
|
|
defaultConfig {
|
|
applicationId "ch.blinkenlights.android.vanilla"
|
|
minSdkVersion 15
|
|
targetSdkVersion 25
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
manifest.srcFile 'AndroidManifest.xml'
|
|
java.srcDirs = ['src']
|
|
aidl.srcDirs = ['src']
|
|
res.srcDirs = ['res']
|
|
assets.srcDirs = ['assets']
|
|
}
|
|
|
|
nightly {
|
|
res.srcDirs = ['resNightly']
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
nightly {
|
|
def buildId = 'date +%s'.execute().in.readLines()[0]
|
|
def buildDate = 'date'.execute().in.readLines()[0]
|
|
def buildHost = 'hostname'.execute().in.readLines()[0]
|
|
|
|
versionNameSuffix '-' + buildId
|
|
applicationIdSuffix '.nightly'
|
|
|
|
preBuild.finalizedBy 'customPrepareResources'
|
|
|
|
task ('customPrepareResources') {
|
|
doLast {
|
|
println 'Replacing `about` info to nightly...'
|
|
def about = file('assets/about.html')
|
|
about.text = about.text.replaceAll('<b>Version.*', "<b>Nightly build ID:</b> ${buildId}<br><i>Built on ${buildHost} at ${buildDate}</i><br><br>")
|
|
}
|
|
}
|
|
}
|
|
|
|
release {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
|
|
}
|
|
}
|
|
|
|
lintOptions {
|
|
abortOnError false
|
|
}
|
|
}
|