plugins { id 'com.github.ksoichiro.console.reporter' version '0.5.0' id 'org.sonarqube' version '2.4' } ext.jadxVersion = file('version').readLines().get(0) version = jadxVersion allprojects { apply plugin: 'java' apply plugin: 'groovy' apply plugin: 'jacoco' apply plugin: 'com.github.ksoichiro.console.reporter' version = jadxVersion tasks.withType(JavaCompile) { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 if (!"$it".contains(':jadx-samples:')) { options.compilerArgs << '-Xlint' << '-Xlint:unchecked' << '-Xlint:deprecation' } } jar { version = jadxVersion manifest { mainAttributes('jadx-version': jadxVersion) } } dependencies { compile 'org.slf4j:slf4j-api:1.7.10' testCompile 'ch.qos.logback:logback-classic:1.1.2' testCompile 'junit:junit:4.12' testCompile 'org.hamcrest:hamcrest-library:1.3' testCompile 'org.mockito:mockito-core:1.10.19' testCompile 'org.spockframework:spock-core:1.0-groovy-2.4' testCompile 'cglib:cglib-nodep:3.1' } repositories { mavenLocal() mavenCentral() jcenter() } jacocoTestReport { reports { xml.enabled = true html.enabled = true } } } sonarqube { properties { property 'sonar.exclusions', '**/jadx/samples/**/*,**/test-app/**/*' property 'sonar.coverage.exclusions', '**/jadx/gui/**/*' } } task copyArtifacts(type: Sync, dependsOn: ['jadx-cli:installDist', 'jadx-gui:installDist']) { destinationDir file("$buildDir/jadx") ['jadx-cli', 'jadx-gui'].each { from tasks.getByPath(":${it}:installDist").destinationDir } } task pack(type: Zip, dependsOn: copyArtifacts) { destinationDir buildDir archiveName "jadx-${jadxVersion}.zip" from copyArtifacts.destinationDir } task dist(dependsOn: pack) { description = 'Build jadx distribution zip' } task samples(dependsOn: 'jadx-samples:samples') { } task testAppCheck(dependsOn: 'jadx-test-app:testAppCheck') { } task cleanBuildDir(type: Delete) { delete buildDir } build.dependsOn(dist, samples) clean.dependsOn(cleanBuildDir)