Created
March 27, 2014 08:54
-
-
Save simekadam/9803241 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
maven { url 'http://repo1.maven.org/maven2' } | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:0.9.1' | |
} | |
} | |
repositories { | |
mavenCentral() | |
} | |
tasks.withType(Compile) { | |
options.encoding = "UTF-8" | |
} | |
apply plugin: 'idea' | |
apply plugin: 'android' | |
dependencies { | |
compile group: 'com.github.chrisbanes.actionbarpulltorefresh', name: 'library', version: '0.7.+' | |
compile files( | |
'libs/libGoogleAnalyticsServices.jar', | |
'libs/volley.jar' | |
) | |
compile 'com.android.support:support-v4:18.0.0' | |
compile 'com.android.support:support-v13:13.0.0' | |
compile 'com.fasterxml.jackson.core:jackson-databind:2.3.0' | |
compile 'com.fasterxml.jackson.core:jackson-core:2.3.0' | |
compile 'org.apache.commons:commons-collections4:4.0' | |
} | |
def PROVIDER_DEBUG = "\"cz.cvut.kosapp.debug\"" | |
def PROVIDER_RELEASE = "\"cz.cvut.kosapp\"" | |
def ACCOUNT_TYPE_DEBUG = "\"cz.cvut.kos.auth.login.debug\"" | |
def ACCOUNT_TYPE_RELEASE = "\"cz.cvut.kos.auth.login\"" | |
android { | |
compileSdkVersion 19 | |
buildToolsVersion "19.0.3" | |
defaultConfig { | |
minSdkVersion 15 | |
targetSdkVersion 19 | |
versionName "1.4.2" | |
resValue "string", "versionName", "\"1.4.2\"" | |
resValue "string", "accountType", "\"cz.cvut.kos.auth.login\"" | |
} | |
signingConfigs { | |
debug { | |
} | |
release { | |
def Properties props = new Properties() | |
def propFile = new File('signing.properties') | |
if (propFile.canRead()){ | |
props.load(new FileInputStream(propFile)) | |
if (props!=null && props.containsKey('STORE_FILE') && props.containsKey('STORE_PASSWORD') && | |
props.containsKey('KEY_ALIAS') && props.containsKey('KEY_PASSWORD')) { | |
android.signingConfigs.release.storeFile = file(props['STORE_FILE']) | |
android.signingConfigs.release.storePassword = props['STORE_PASSWORD'] | |
android.signingConfigs.release.keyAlias = props['KEY_ALIAS'] | |
android.signingConfigs.release.keyPassword = props['KEY_PASSWORD'] | |
} else { | |
println 'signing.properties found but some entries are missing' | |
android.buildTypes.release.signingConfig = null | |
} | |
}else { | |
println 'signing.properties not found' | |
android.buildTypes.release.signingConfig = null | |
} | |
} | |
} | |
buildTypes { | |
release { | |
signingConfig signingConfigs.release | |
buildConfigField "String", "PROVIDER_AUTHORITY", PROVIDER_RELEASE | |
buildConfigField "String", "ACCOUNT_TYPE", ACCOUNT_TYPE_RELEASE | |
} | |
debug { | |
packageNameSuffix ".debug" | |
versionNameSuffix "-debug" | |
signingConfig signingConfigs.debug | |
buildConfigField "String", "PROVIDER_AUTHORITY", PROVIDER_DEBUG | |
buildConfigField "String", "ACCOUNT_TYPE", ACCOUNT_TYPE_DEBUG | |
resValue "string", "accountType", ACCOUNT_TYPE_DEBUG | |
} | |
} | |
lintOptions { | |
abortOnError false | |
} | |
packagingOptions { | |
exclude 'META-INF/notice.txt' | |
exclude 'META-INF/license.txt' | |
exclude 'META-INF/LICENSE' | |
exclude 'META-INF/NOTICE' | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment