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')
S
Sam Judd 已提交
13
    compile project(':third_party:gif_encoder')
14
    compile project(':third_party:disklrucache')
15
    compile 'com.android.support:support-v4:19.1.+'
16

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

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

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

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

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 已提交
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 84

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

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