1
0
mirror of https://github.com/TwidereProject/Twidere-Android synced 2024-12-16 02:35:55 +01:00
Twidere-App-Android-Twitter.../build.gradle
2015-11-22 23:29:00 +08:00

137 lines
5.1 KiB
Groovy

import com.android.build.gradle.AppPlugin
import com.android.build.gradle.LibraryPlugin
apply plugin: 'com.github.ben-manes.versions'
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'com.github.ben-manes:gradle-versions-plugin:0.11.3'
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath('fr.avianey.androidsvgdrawable:gradle-plugin:2.0.0') {
// should be excluded to avoid conflict
exclude group: 'xerces'
}
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://jitpack.io' }
}
}
subprojects {
plugins.withType(LibraryPlugin) {
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
lintOptions {
abortOnError false
lintConfig rootProject.file('lint.xml')
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
}
}
}
plugins.withType(AppPlugin) {
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
lintOptions {
abortOnError false
lintConfig rootProject.file('lint.xml')
}
signingConfigs {
debug {
File signingPropFile = rootProject.file('signing.properties')
if (signingPropFile.exists()) {
Properties signingProp = new Properties()
signingProp.load(signingPropFile.newDataInputStream())
storeFile file(signingProp.get("debug.storeFile"))
storePassword signingProp.get("debug.storePassword")
keyAlias signingProp.get("debug.keyAlias")
keyPassword signingProp.get("debug.keyPassword")
} else if (System.getenv('DEBUG_KEYSTORE_BASE64') != null) {
storeFile decodeKeyStoreFileFromBase64Env('DEBUG_KEYSTORE_BASE64')
storePassword System.getenv('DEBUG_KEYSTORE_PASSWORD')
keyAlias System.getenv('DEBUG_KEYSTORE_KEY_ALIAS')
keyPassword System.getenv('DEBUG_KEYSTORE_KEY_PASSWORD')
}
}
release {
File signingPropFile = rootProject.file('signing.properties')
if (signingPropFile.exists()) {
Properties signingProp = new Properties()
signingProp.load(signingPropFile.newDataInputStream())
storeFile file(signingProp.get("release.storeFile"))
storePassword signingProp.get("release.storePassword")
keyAlias signingProp.get("release.keyAlias")
keyPassword signingProp.get("release.keyPassword")
} else if (System.getenv('RELEASE_KEYSTORE_BASE64') != null) {
storeFile decodeKeyStoreFileFromBase64Env('RELEASE_KEYSTORE_BASE64')
storePassword System.getenv('RELEASE_KEYSTORE_PASSWORD')
keyAlias System.getenv('RELEASE_KEYSTORE_KEY_ALIAS')
keyPassword System.getenv('RELEASE_KEYSTORE_KEY_PASSWORD')
}
}
}
buildTypes {
debug {
if (rootProject.file('signing.properties').exists()
|| System.getenv('DEBUG_KEYSTORE_BASE64') != null) {
signingConfig signingConfigs.debug
}
}
release {
if (rootProject.file('signing.properties').exists()
|| System.getenv('RELEASE_KEYSTORE_BASE64') != null) {
signingConfig signingConfigs.release
}
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
}
}
}
}
task clean(type: Delete) {
delete(rootProject.buildDir)
}
task wrapper(type: Wrapper) {
gradleVersion = '2.9'
}