build.gradle 2.4 KB
Newer Older
S
Sam Judd 已提交
1
apply plugin: 'com.android.library'
2
apply plugin: 'robolectric'
3
apply plugin: 'maven'
S
Sam Judd 已提交
4
apply plugin: 'findbugs'
S
Sam Judd 已提交
5 6
apply plugin: 'pmd'

S
Sam Judd 已提交
7 8 9
findbugs {
    toolVersion = "2.0.3"
}
S
Sam Judd 已提交
10 11

dependencies {
E
Emil Arfvidsson 已提交
12
    compile project(':third_party:gif_decoder')
S
Sam Judd 已提交
13
    compile project(':third_party:gif_encoder')
14
    compile project(':third_party:disklrucache')
15
    compile "com.android.support:support-v4:${SUPPORT_V4_VERSION}"
16

17 18 19 20 21 22
    androidTestCompile "com.android.support:support-v4:${SUPPORT_V4_VERSION}"
    androidTestCompile "org.hamcrest:hamcrest-core:${HAMCREST_VERSION}"
    androidTestCompile "org.hamcrest:hamcrest-library:${HAMCREST_VERSION}"
    androidTestCompile "junit:junit:${JUNIT_VERSION}"
    androidTestCompile "org.mockito:mockito-all:${MOCKITO_VERSION}"
    androidTestCompile "org.robolectric:robolectric:${ROBOLECTRIC_VERSION}"
23
    // TODO: increase this to 2.0.+ when we compile against Java 7.
24
    androidTestCompile "com.squareup.okhttp:mockwebserver:${MOCKWEBSERVER_VERSION}"
S
Sam Judd 已提交
25 26 27
}

android {
28 29
    compileSdkVersion COMPILE_SDK_VERSION as int
    buildToolsVersion BUILD_TOOLS_VERSION
S
Sam Judd 已提交
30

31
    defaultConfig {
32
        applicationId 'com.bumptech.glide'
33 34
        minSdkVersion MIN_SDK_VERSION as int
        targetSdkVersion TARGET_SDK_VERSION as int
35

S
Sam Judd 已提交
36 37
        versionCode = VERSION_CODE
        versionName = VERSION_NAME
38
    }
E
Emil Arfvidsson 已提交
39
}
S
Sam Judd 已提交
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59

afterEvaluate {
    task findbugs(type: FindBugs, dependsOn: assembleDebug) {

        description 'Run findbugs'
        group 'verification'

        classes = fileTree('build/intermediates/classes/debug/')
        source = fileTree('src/main/java')
        classpath = files(project.configurations.compile.asPath)

        effort = 'max'

        excludeFilter = file("findbugs-exclude.xml")

        reports {
            xml.enabled = false
            html.enabled = true
        }
    }
S
Sam Judd 已提交
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85

    findbugsTestDebug {
        enabled = false
    }

    check.dependsOn('findbugs')

    task pmd(type: Pmd) {

        description 'Run pmd'
        group 'verification'

        // If ruleSets is not empty, it seems to contain some
        // defaults which override rules in the ruleset file...
        ruleSets = []
        ruleSetFiles = files('pmd-ruleset.xml')
        source = fileTree('src/main/java')

        reports {
            xml.enabled = false
            html.enabled = true
        }
    }

    pmdTestDebug {
        enabled = false
S
Sam Judd 已提交
86
    }
S
Sam Judd 已提交
87 88

    check.dependsOn('pmd')
S
Sam Judd 已提交
89
}