build.gradle 2.1 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')
13
    compile project(':third_party:disklrucache')
14
    compile 'com.android.support:support-v4:19.1.+'
15

E
Emil Arfvidsson 已提交
16
    androidTestCompile 'org.hamcrest:hamcrest-core:1.3'
17
    androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
E
Emil Arfvidsson 已提交
18 19
    androidTestCompile 'junit:junit:4.11'
    androidTestCompile 'org.mockito:mockito-all:1.9.5'
S
Sam Judd 已提交
20
    androidTestCompile 'org.robolectric:robolectric:2.4-SNAPSHOT'
21 22
    // TODO: increase this to 2.0.+ when we compile against Java 7.
    androidTestCompile 'com.squareup.okhttp:mockwebserver:1.2.+'
S
Sam Judd 已提交
23 24 25
}

android {
S
Sam Judd 已提交
26
    compileSdkVersion 19
27
    buildToolsVersion '19.1.0'
S
Sam Judd 已提交
28

29
    defaultConfig {
30
        applicationId 'com.bumptech.glide'
31
        minSdkVersion 10
32

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

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 已提交
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83

    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 已提交
84
    }
S
Sam Judd 已提交
85 86

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