build.gradle 1.5 KB
Newer Older
S
Skylot 已提交
1
ext.jadxVersion = file('version').readLines().get(0)
S
Skylot 已提交
2

S
Skylot 已提交
3 4 5 6
subprojects {
    apply plugin: 'java'
    apply plugin: 'idea'
    apply plugin: 'eclipse'
S
Skylot 已提交
7

S
Skylot 已提交
8 9
    sourceCompatibility = 1.6
    targetCompatibility = 1.6
S
Skylot 已提交
10

S
Skylot 已提交
11 12
    version = jadxVersion

13 14
    gradle.projectsEvaluated {
        tasks.withType(Compile) {
S
Skylot 已提交
15 16 17
            if (!"${it}".contains(":jadx-samples:")) {
                options.compilerArgs << "-Xlint" << "-Xlint:unchecked" << "-Xlint:deprecation"
            }
18
        }
S
Skylot 已提交
19 20
    }

S
Skylot 已提交
21 22
    jar {
        version = jadxVersion
S
Skylot 已提交
23 24 25
        manifest {
            mainAttributes('jadx-version' : jadxVersion)
        }
S
Skylot 已提交
26
    }
S
Skylot 已提交
27

S
Skylot 已提交
28 29 30
    dependencies {
        compile 'org.slf4j:slf4j-api:1.7.5'
        testCompile 'junit:junit:4.11'
S
Skylot 已提交
31
        testCompile "org.mockito:mockito-core:1.9.5"
S
Skylot 已提交
32 33
    }

S
Skylot 已提交
34 35
    repositories {
        mavenCentral()
S
Skylot 已提交
36 37 38
    }
}

S
Skylot 已提交
39
task copyArtifacts(type: Sync, dependsOn: ['jadx-cli:installApp', 'jadx-gui:installApp']) {
S
Skylot 已提交
40 41 42 43 44 45
    destinationDir file("$buildDir/jadx")
    ['jadx-cli', 'jadx-gui'].each {
        from tasks.getByPath(":${it}:installApp").destinationDir
    }
}

S
Skylot 已提交
46
task pack(type: Zip, dependsOn: copyArtifacts) {
S
Skylot 已提交
47 48 49 50 51
    destinationDir buildDir
    archiveName "jadx-${jadxVersion}.zip"
    from copyArtifacts.destinationDir
}

S
Skylot 已提交
52
task dist(dependsOn: pack) {
S
Skylot 已提交
53 54 55
    description = 'Build jadx distribution zip'
}

S
Skylot 已提交
56 57 58 59 60 61
task samples(dependsOn: 'jadx-samples:samples') {
}

task build(dependsOn: [dist, samples]) {
}

S
Skylot 已提交
62
task clean(type: Delete) {
63
    delete buildDir
S
Skylot 已提交
64 65
}

S
Skylot 已提交
66
task wrapper(type: Wrapper) {
S
Skylot 已提交
67
    gradleVersion = '1.8'
S
Skylot 已提交
68
}