jadx/build.gradle

165 lines
3.7 KiB
Groovy
Raw Normal View History

2017-05-26 08:31:56 +00:00
plugins {
2019-10-27 17:29:30 +00:00
id 'org.sonarqube' version '2.8'
2020-05-03 15:21:27 +00:00
id 'com.github.ben-manes.versions' version '0.28.0'
id "com.diffplug.gradle.spotless" version "3.28.1"
2017-05-26 08:31:56 +00:00
}
ext.jadxVersion = System.getenv('JADX_VERSION') ?: "dev"
2014-11-29 11:52:32 +00:00
version = jadxVersion
println("jadx version: ${jadxVersion}")
2014-11-29 11:52:32 +00:00
allprojects {
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'checkstyle'
version = jadxVersion
tasks.withType(JavaCompile) {
if (!"$it".contains(':jadx-samples:')) {
options.compilerArgs << '-Xlint' << '-Xlint:unchecked' << '-Xlint:deprecation'
}
}
compileJava {
options.encoding = "UTF-8"
}
jar {
version = jadxVersion
manifest {
mainAttributes('jadx-version': jadxVersion)
}
}
dependencies {
compile 'org.slf4j:slf4j-api:1.7.30'
compileOnly 'org.jetbrains:annotations:19.0.0'
testCompile 'ch.qos.logback:logback-classic:1.2.3'
2019-11-24 20:34:36 +00:00
testCompile 'org.hamcrest:hamcrest-library:2.2'
2020-05-03 15:21:27 +00:00
testCompile 'org.mockito:mockito-core:3.3.3'
testCompile 'org.assertj:assertj-core:3.15.0'
2020-05-03 15:21:27 +00:00
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.2'
testCompile 'org.eclipse.jdt.core.compiler:ecj:4.6.1'
testCompileOnly 'org.jetbrains:annotations:19.0.0'
}
test {
useJUnitPlatform()
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
google()
}
jacoco {
toolVersion = "0.8.2"
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
checkstyleMain {
// exclude all sources in samples module
exclude '**/samples/**'
}
}
2017-05-27 09:05:27 +00:00
sonarqube {
properties {
property 'sonar.exclusions', '**/jadx/samples/**/*,**/test-app/**/*'
property 'sonar.coverage.exclusions', '**/jadx/gui/**/*'
}
}
spotless {
java {
target fileTree(rootDir).matching {
include 'jadx-cli/src/**/java/**/*.java'
include 'jadx-core/src/**/java/**/*.java'
include 'jadx-gui/src/**/java/**/*.java'
include 'jadx-plugins/**/java/**/*.java'
}
importOrderFile 'config/code-formatter/eclipse.importorder'
eclipse().configFile 'config/code-formatter/eclipse.xml'
removeUnusedImports()
lineEndings(com.diffplug.spotless.LineEnding.UNIX)
encoding("UTF-8")
trimTrailingWhitespace()
endWithNewline()
}
format 'misc', {
target '**/*.gradle', '**/*.md', '**/*.xml', '**/.gitignore', '**/.properties'
targetExclude ".gradle/**", ".idea/**", "*/build/**"
lineEndings(com.diffplug.spotless.LineEnding.UNIX)
encoding("UTF-8")
trimTrailingWhitespace()
endWithNewline()
}
2017-05-27 09:05:27 +00:00
}
2018-02-10 19:56:53 +00:00
dependencyUpdates.resolutionStrategy = {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm', 'atlassian'].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
}
if (rejected) {
selection.reject('Release candidate')
}
}
}
2018-02-10 19:56:53 +00:00
}
2015-03-14 14:09:20 +00:00
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
}
2013-07-24 13:05:31 +00:00
}
2013-09-25 14:04:42 +00:00
task pack(type: Zip, dependsOn: copyArtifacts) {
destinationDir buildDir
archiveName "jadx-${jadxVersion}.zip"
from copyArtifacts.destinationDir
2013-07-24 13:05:31 +00:00
}
2018-03-27 15:55:33 +00:00
task copyExe(type: Copy, dependsOn: 'jadx-gui:createExe') {
group 'jadx'
description = 'Copy exe to build dir'
destinationDir buildDir
from tasks.getByPath('jadx-gui:createExe').outputs
include '*.exe'
2018-03-27 15:55:33 +00:00
}
task dist(dependsOn: [pack, copyExe]) {
group 'jadx'
description = 'Build jadx distribution zip'
2013-07-27 11:43:07 +00:00
}
2013-09-28 11:50:17 +00:00
task samples(dependsOn: 'jadx-samples:samples') {
group 'jadx'
2013-09-28 11:50:17 +00:00
}
2014-11-29 11:52:32 +00:00
task cleanBuildDir(type: Delete) {
group 'jadx'
delete buildDir
2013-07-24 13:05:31 +00:00
}
test.dependsOn(samples)
2014-11-29 11:52:32 +00:00
clean.dependsOn(cleanBuildDir)