Vous êtes sur la page 1sur 4

import org.apache.tools.ant.taskdefs.condition.

Os

apply plugin: 'com.android.application'


apply plugin: 'findbugs'

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.trickyandroid:jacoco-everywhere:0.2.1'
classpath 'com.google.gms:google-services:3.0.0'
}
}

def getAnalyticsApiKey() {
def versionPropsFile = file('apiKeys.txt')
def GCMProjectNumber
if (versionPropsFile.canRead()) {

def Properties versionProps = new Properties()


versionProps.load(new FileInputStream(versionPropsFile))
GCMProjectNumber = versionProps['GOOGLE_ANALYTICS_API_KEY'].toString()
return GCMProjectNumber

} else {
throw new GradleException("Could not read apiKeys.txt!")
}
}

def getTestFairyKey() {
def versionPropsFile = file('apiKeys.txt')
def GCMProjectNumber
if (versionPropsFile.canRead()) {

def Properties versionProps = new Properties()


versionProps.load(new FileInputStream(versionPropsFile))
GCMProjectNumber = versionProps['TEST_FAIRY_API_KEY'].toString()
return GCMProjectNumber

} else {
throw new GradleException("Could not read apiKeys.txt!")
}
}

String analyticsApiKey = System.env.GOOGLE_ANALYTICS_API_KEY ?:


getAnalyticsApiKey();
String testFairyApiKey = System.env.TEST_FAIRY_API_KEY ?: getTestFairyKey();

task customFindbugs(type: FindBugs) {


ignoreFailures = false
effort = "max"
reportLevel = "low"
classes =
files("$project.buildDir/intermediates/classes/debug/com/ruckuswireless/unleashed")
excludeFilter = file("$rootProject.rootDir/config/findbugs/exclude.xml")

source = fileTree('src/main/java/')
classpath = files()

reports {
xml.enabled = false
xml.withMessages = true
html.enabled = !xml.isEnabled()
xml.destination "$project.buildDir/outputs/findbugs/findbugs-output.xml"
html.destination "$project.buildDir/outputs/findbugs/findbugs-output.html"
}
}
//assembleDebug.dependsOn customFindbugs
//task findbugs(type: FindBugs, dependsOn: "assembleDebug")

android {
signingConfigs {
config {
keyAlias 'android'
keyPassword 'android'
storeFile file('/Users/ravish/.android/debug.keystore')
storePassword 'android'
}
}
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
lintOptions {
htmlReport true
htmlOutput file("./static_analysis/index.html")
warningsAsErrors true
abortOnError false
}
sourceSets.main {
jniLibs.srcDir 'src/main/libs'
jni.srcDirs = [] //disable automatic ndk-build call
}
// call regular ndk-build(.cmd) script from app directory
task ndkBuild(type: Exec) {
def ndkDir = android.ndkDirectory
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine "$ndkDir" + '/ndk-build.cmd', '-C',
file('src/main').absolutePath
} else {
commandLine "$ndkDir" + '/ndk-build', '-C',
file('src/main').absolutePath
}
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn ndkBuild
}
dexOptions {
javaMaxHeapSize "4g"
}
compileSdkVersion 25
buildToolsVersion '25.0.2'
def versionPropsFile = file('versionProperties.txt')
if (versionPropsFile.canRead()) {

def Properties versionProps = new Properties()


versionProps.load(new FileInputStream(versionPropsFile))
def code = versionProps['VERSION_CODE'].toInteger()
def name = versionProps['VERSION_NAME'].toString()
defaultConfig {
applicationId "com.ruckuswireless.unleashed"
minSdkVersion 17
targetSdkVersion 19
multiDexEnabled true
versionCode code
versionName name
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
} else {
throw new GradleException("Could not read versionProperties.txt!")
}
buildTypes {
debug {
resValue "string", "google_analytics_key", analyticsApiKey
resValue "string", "test_fairy_key", testFairyApiKey
testCoverageEnabled true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
resValue "string", "google_analytics_key", analyticsApiKey
resValue "string", "test_fairy_key", testFairyApiKey
}
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.twitter.sdk.android:twitter-core:3.0.0'
compile 'com.daimajia.swipelayout:library:1.2.0@aar'
compile 'com.daimajia.easing:library:1.0.0@aar'
compile 'com.daimajia.androidanimations:library:1.1.2@aar'
compile 'com.nineoldandroids:library:2.4.0'
compile 'me.leolin:ShortcutBadger:1.1.16@aar'
// compile 'com.twitter.sdk.android:tweet-ui:3.0.0'

//compile 'com.twitter.sdk.android:tweet-composer:3.0.0'

//compile 'com.twitter.sdk.android:twitter-mopub:3.0.0'
compile 'com.github.PhilJay:MPAndroidChart:v3.0.1'
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
compile files('libs/mycom-client-1.0.0.jar')
compile files('libs/pass-v1.2.1.jar')
compile files('libs/sdk-v1.0.0.jar')
testCompile 'junit:junit:4.12'
compile project(path: ':rMF')
compile project(path: ':Custom Progress')
compile 'com.android.support:multidex:1.0.1'
testCompile 'org.mockito:mockito-core:1.10.19'
compile 'com.google.firebase:firebase-messaging:10.2.6'
compile 'commons-net:commons-net:3.3'
compile 'com.android.support.test:runner:0.5'
//comment rmoved by Arpit
compile 'com.pubnub:pubnub-gson:4.6.3'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.android.support.test:rules:0.5'
compile 'com.google.api-client:google-api-client:1.22.0'
compile 'com.google.api-client:google-api-client-android:1.22.0'
compile 'com.jaredrummler:android-processes:1.0.9'
//comment rmoved by Arpit

// Espresso support
androidTestCompile('com.android.support.test:runner:0.5', {
exclude group: 'com.android.support', module: 'support-annotations'
})
androidTestCompile('com.android.support.test:rules:0.5', {
exclude group: 'com.android.support', module: 'support-annotations'
})
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2.2',
{
exclude group: 'com.android.support', module: 'support-annotations'
}
compile project(':linkedin-sdk')
compile 'com.github.simbiose:Encryption:2.0.0'
}

apply plugin: 'com.android.application'


apply plugin: 'jacoco-everywhere'
apply plugin: 'com.google.gms.google-services'

Vous aimerez peut-être aussi