Skip to content

Commit

Permalink
feat(gradle): apply jdeprscan and jdeps to all subprojects
Browse files Browse the repository at this point in the history
  • Loading branch information
halibobo1205 committed Jul 24, 2024
1 parent 6eca886 commit 750f480
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 12 deletions.
4 changes: 4 additions & 0 deletions actuator/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
id("org.kordamp.gradle.jdeps")
id("org.kordamp.gradle.jdeprscan")
}
description = "actuator – a series of transactions for blockchain."

dependencies {
Expand Down
14 changes: 10 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
plugins {
id("org.kordamp.gradle.jdeps") version "0.20.0" apply false
id("org.kordamp.gradle.jdeprscan") version "0.11.0" apply false
}

allprojects {
version = "1.0.0"
apply plugin: "java-library"
Expand Down Expand Up @@ -81,27 +86,28 @@ subprojects {
testImplementation "org.mockito:mockito-core:5.8.0"
}

task sourcesJar(type: Jar, dependsOn: classes) {
tasks.register('sourcesJar', Jar) {
dependsOn classes
classifier = "sources"
from sourceSets.main.allSource
duplicatesStrategy = DuplicatesStrategy.INCLUDE // allow duplicates
}


tasks.withType(AbstractArchiveTask) {
tasks.withType(AbstractArchiveTask).configureEach {
preserveFileTimestamps = false
reproducibleFileOrder = true
duplicatesStrategy = DuplicatesStrategy.INCLUDE // allow duplicates
}

configurations.all {
configurations.configureEach {
resolutionStrategy {
force group: 'com.google.guava', name: 'guava', version: '33.2.1-jre'
}
}
}

task copyToParent(type: Copy) {
tasks.register('copyToParent', Copy) {
into "$buildDir/libs"
subprojects {
from tasks.withType(Jar)
Expand Down
4 changes: 4 additions & 0 deletions chainbase/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
id("org.kordamp.gradle.jdeps")
id("org.kordamp.gradle.jdeprscan")
}
description = "chainbase – a decentralized database for blockchain."

// Dependency versions
Expand Down
2 changes: 2 additions & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
plugins {
id 'java'
id("org.kordamp.gradle.jdeps")
id("org.kordamp.gradle.jdeprscan")
}

version '1.0.0'
Expand Down
4 changes: 4 additions & 0 deletions consensus/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
id("org.kordamp.gradle.jdeps")
id("org.kordamp.gradle.jdeprscan")
}
description = "consensus – a distributed consensus arithmetic for blockchain."

dependencies {
Expand Down
2 changes: 2 additions & 0 deletions crypto/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
plugins {
id 'java'
id("org.kordamp.gradle.jdeps")
id("org.kordamp.gradle.jdeprscan")
}

version '1.0.0'
Expand Down
4 changes: 4 additions & 0 deletions example/actuator-example/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
id("org.kordamp.gradle.jdeps")
id("org.kordamp.gradle.jdeprscan")
}
description = "actuator-example – a example of actuator."

dependencies {
Expand Down
16 changes: 8 additions & 8 deletions framework/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ plugins {
id "org.gradle.test-retry" version "1.5.9"
id "org.sonarqube" version "2.6"
id "com.gorylenko.gradle-git-properties" version "2.4.1"
id("org.kordamp.gradle.jdeps") version "0.20.0"
id("org.kordamp.gradle.jdeprscan") version "0.11.0"
id("org.kordamp.gradle.jdeps")
id("org.kordamp.gradle.jdeprscan")
}

gitProperties.failOnNoGitDirectory = false;
Expand All @@ -27,15 +27,15 @@ configurations {

}

configurations.getByName('checkstyleConfig') {
configurations.named('checkstyleConfig') {
transitive = false
}

static def isWindows() {
return org.gradle.internal.os.OperatingSystem.current().isWindows()
}

task version(type: Exec) {
tasks.register('version', Exec) {
commandLine 'bash', '-c', '../ver.sh'
}

Expand Down Expand Up @@ -86,7 +86,7 @@ checkstyleMain {
source = 'src/main/java'
}

task lint(type: Checkstyle) {
tasks.register('lint', Checkstyle) {
// Cleaning the old log because of the creation of the new ones (not sure if totaly needed)
delete fileTree(dir: "${project.rootDir}/app/build/reports")
source 'src'
Expand All @@ -99,7 +99,7 @@ task lint(type: Checkstyle) {
ignoreFailures = false
}

tasks.matching { it instanceof Test }.all {
tasks.matching { it instanceof Test }.configureEach {
testLogging.events = ["failed", "passed", "skipped"]
}

Expand Down Expand Up @@ -152,7 +152,7 @@ jacocoTestReport {
}

def binaryRelease(taskName, jarName, mainClass) {
return tasks.create("${taskName}", Jar) {
return tasks.register("${taskName}", Jar) {
baseName = jarName
version = null
from(sourceSets.main.output) {
Expand Down Expand Up @@ -249,7 +249,7 @@ if (releaseBinary == 'true') {

}

task copyToParent(type: Copy) {
tasks.register('copyToParent', Copy) {
into "../build/distributions"
from "$buildDir/distributions"
include "*.zip"
Expand Down
2 changes: 2 additions & 0 deletions plugins/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
plugins {
id("org.kordamp.gradle.jdeps")
id("org.kordamp.gradle.jdeprscan")
id "org.sonarqube" version "2.6"
}

Expand Down
4 changes: 4 additions & 0 deletions protocol/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
id("org.kordamp.gradle.jdeps")
id("org.kordamp.gradle.jdeprscan")
}
apply plugin: 'com.google.protobuf'

def protobufVersion = '3.21.12'
Expand Down

0 comments on commit 750f480

Please sign in to comment.