build.gradle 2.4 KB
Newer Older
S
Skylot 已提交
1 2 3 4 5 6 7 8
buildscript {
    repositories {
        mavenCentral()
        jcenter()
    }
}

plugins {
S
Skylot 已提交
9 10 11
    id "com.github.kt3k.coveralls" version "2.3.1"
    id "info.solidsoft.pitest" version "1.1.4"
//    id "com.github.ben-manes.versions" version "0.8"
S
Skylot 已提交
12
}
S
Skylot 已提交
13

S
Skylot 已提交
14 15
apply plugin: 'sonar-runner'

S
Skylot 已提交
16 17 18
ext.jadxVersion = file('version').readLines().get(0)
version = jadxVersion

S
Skylot 已提交
19 20
subprojects {
    apply plugin: 'java'
S
Skylot 已提交
21
    apply plugin: 'groovy'
S
Skylot 已提交
22
    apply plugin: 'jacoco'
S
Skylot 已提交
23
    apply plugin: 'com.github.kt3k.coveralls'
S
Skylot 已提交
24

S
Skylot 已提交
25 26
    version = jadxVersion

S
Skylot 已提交
27 28 29 30 31 32
    tasks.withType(JavaCompile) {
        sourceCompatibility = JavaVersion.VERSION_1_6
        targetCompatibility = JavaVersion.VERSION_1_6

        if (!"$it".contains(':jadx-samples:')) {
            options.compilerArgs << '-Xlint' << '-Xlint:unchecked' << '-Xlint:deprecation'
33
        }
S
Skylot 已提交
34 35
    }

S
Skylot 已提交
36 37
    jar {
        version = jadxVersion
S
Skylot 已提交
38
        manifest {
39
            mainAttributes('jadx-version': jadxVersion)
S
Skylot 已提交
40
        }
S
Skylot 已提交
41
    }
S
Skylot 已提交
42

S
Skylot 已提交
43
    dependencies {
S
Skylot 已提交
44
        compile 'org.slf4j:slf4j-api:1.7.10'
S
Skylot 已提交
45

S
Skylot 已提交
46
        testCompile 'ch.qos.logback:logback-classic:1.1.2'
S
Skylot 已提交
47
        testCompile 'junit:junit:4.12'
S
Skylot 已提交
48
        testCompile 'org.hamcrest:hamcrest-library:1.3'
S
Skylot 已提交
49
        testCompile 'org.mockito:mockito-core:1.10.19'
S
Skylot 已提交
50
        testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
S
Skylot 已提交
51
        testCompile 'cglib:cglib-nodep:3.1'
S
Skylot 已提交
52 53
    }

S
Skylot 已提交
54 55
    repositories {
        mavenCentral()
S
Skylot 已提交
56
        mavenLocal()
S
Skylot 已提交
57
        jcenter()
S
Skylot 已提交
58
    }
59 60 61 62 63 64 65 66 67

    jacocoTestReport {
        reports {
            xml.enabled = true // coveralls plugin depends on xml format report
            html.enabled = true
        }
    }
}

S
Skylot 已提交
68 69 70 71 72 73
/* Sonar runner configuration */
repositories {
    mavenCentral()
}
sonarRunner {
    toolVersion = '2.4'
S
Skylot 已提交
74 75
}

S
Skylot 已提交
76
task copyArtifacts(type: Sync, dependsOn: ['jadx-cli:installApp', 'jadx-gui:installApp']) {
S
Skylot 已提交
77 78 79 80 81 82
    destinationDir file("$buildDir/jadx")
    ['jadx-cli', 'jadx-gui'].each {
        from tasks.getByPath(":${it}:installApp").destinationDir
    }
}

S
Skylot 已提交
83
task pack(type: Zip, dependsOn: copyArtifacts) {
S
Skylot 已提交
84 85 86 87 88
    destinationDir buildDir
    archiveName "jadx-${jadxVersion}.zip"
    from copyArtifacts.destinationDir
}

S
Skylot 已提交
89
task dist(dependsOn: pack) {
S
Skylot 已提交
90 91 92
    description = 'Build jadx distribution zip'
}

S
Skylot 已提交
93 94 95
task samples(dependsOn: 'jadx-samples:samples') {
}

S
Skylot 已提交
96
task pitest(overwrite: true, dependsOn: 'jadx-core:pitest') {
S
Skylot 已提交
97 98
}

S
Skylot 已提交
99
task cleanBuildDir(type: Delete) {
100
    delete buildDir
S
Skylot 已提交
101 102
}

S
Skylot 已提交
103 104 105 106
build.dependsOn(dist, samples)

clean.dependsOn(cleanBuildDir)

S
Skylot 已提交
107
task wrapper(type: Wrapper) {
S
Skylot 已提交
108
    gradleVersion = '2.3'
S
Skylot 已提交
109
}