Merge branch 'main' into 7311-add-peertask-foundation-code

pull/7628/head
Matilda-Clerke 2 months ago committed by GitHub
commit bdd96ba0a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      .github/workflows/sonarcloud.yml
  2. 20
      build.gradle
  3. 61
      ethereum/api/build.gradle
  4. 4
      testutil/build.gradle

@ -38,4 +38,4 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_ORGANIZATION: ${{ vars.SONAR_ORGANIZATION }} SONAR_ORGANIZATION: ${{ vars.SONAR_ORGANIZATION }}
SONAR_PROJECT_KEY: ${{ vars.SONAR_PROJECT_KEY }} SONAR_PROJECT_KEY: ${{ vars.SONAR_PROJECT_KEY }}
run: ./gradlew build sonarqube --continue --info -Dorg.gradle.parallel=true -Dorg.gradle.caching=true run: ./gradlew build sonar --continue -Dorg.gradle.parallel=true -Dorg.gradle.caching=true

@ -31,6 +31,8 @@ plugins {
id 'me.champeau.jmh' version '0.7.2' apply false id 'me.champeau.jmh' version '0.7.2' apply false
id 'net.ltgt.errorprone' version '4.0.1' id 'net.ltgt.errorprone' version '4.0.1'
id 'maven-publish' id 'maven-publish'
id 'jacoco'
id 'jacoco-report-aggregation'
id 'org.sonarqube' version '5.1.0.4882' id 'org.sonarqube' version '5.1.0.4882'
} }
@ -40,12 +42,12 @@ sonarqube {
property "sonar.organization", "$System.env.SONAR_ORGANIZATION" property "sonar.organization", "$System.env.SONAR_ORGANIZATION"
property "sonar.gradle.skipCompile", "true" property "sonar.gradle.skipCompile", "true"
property "sonar.host.url", "https://sonarcloud.io" property "sonar.host.url", "https://sonarcloud.io"
property "sonar.coverage.jacoco.xmlReportPaths", "${buildDir}/reports/jacoco/jacocoRootReport/jacocoRootReport.xml" property "sonar.coverage.jacoco.xmlReportPaths", "${buildDir}/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml"
property "sonar.coverage.exclusions", "acceptance-tests/**/*" property "sonar.coverage.exclusions", "acceptance-tests/**/*"
} }
} }
project.tasks["sonarqube"].dependsOn "jacocoRootReport" project.tasks["sonar"].dependsOn "testCodeCoverageReport"
if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_21)) { if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_21)) {
throw new GradleException("Java 21 or later is required to build Besu.\n" + throw new GradleException("Java 21 or later is required to build Besu.\n" +
@ -360,6 +362,7 @@ allprojects {
} }
} }
useJUnitPlatform {} useJUnitPlatform {}
finalizedBy jacocoTestReport // report is always generated after tests run
} }
javadoc { javadoc {
@ -962,19 +965,6 @@ jacocoTestReport {
} }
} }
task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
additionalSourceDirs.from files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories.from files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories.from files(subprojects.sourceSets.main.output).asFileTree.matching { exclude 'org/hyperledger/besu/tests/acceptance/**' }
executionData.from fileTree(dir: '.', includes: ['**/jacoco/*.exec'])
reports {
xml.required = true
csv.required = true
html.destination file("build/reports/jacocoHtml")
}
onlyIf = { true }
}
// http://label-schema.org/rc1/ // http://label-schema.org/rc1/
// using the RFC3339 format "2016-04-12T23:20:50.52Z" // using the RFC3339 format "2016-04-12T23:20:50.52Z"
def buildTime() { def buildTime() {

@ -130,41 +130,44 @@ artifacts { testSupportArtifacts testSupportJar }
tasks.register('generateTestBlockchain') { tasks.register('generateTestBlockchain') {
def srcFiles = 'src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/chain-data' def srcFiles = 'src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/chain-data'
def dataPath = "$buildDir/generated/data" def dataPath = new File("$buildDir/generated/data")
def blocksBin = "$buildDir/resources/test/org/hyperledger/besu/ethereum/api/jsonrpc/trace/chain-data/blocks.bin" def blocksBin = "$buildDir/resources/test/org/hyperledger/besu/ethereum/api/jsonrpc/trace/chain-data/blocks.bin"
inputs.dir(srcFiles) inputs.dir(srcFiles)
outputs.file(blocksBin) outputs.file(blocksBin)
dependsOn(configurations.testResourceGeneration) dependsOn(configurations.testResourceGeneration)
dependsOn(processTestResources) dependsOn(processTestResources)
doLast { doLast {
mkdir(dataPath) if(!dataPath.exists()) {
javaexec { mkdir(dataPath)
main = 'org.hyperledger.besu.Besu'
classpath = configurations.testResourceGeneration javaexec {
args = [ main = 'org.hyperledger.besu.Besu'
"--logging=ERROR", classpath = configurations.testResourceGeneration
"--data-path=$dataPath", args = [
"--genesis-file=$srcFiles/genesis.json", "--logging=ERROR",
"blocks", "--data-path=$dataPath",
"import", "--genesis-file=$srcFiles/genesis.json",
"--format=JSON", "blocks",
"--from=$srcFiles/blocks.json", "import",
"--start-time=1438269971" "--format=JSON",
] "--from=$srcFiles/blocks.json",
} "--start-time=1438269971"
javaexec { ]
main = 'org.hyperledger.besu.Besu' }
classpath = configurations.testResourceGeneration javaexec {
args = [ main = 'org.hyperledger.besu.Besu'
"--logging=ERROR", classpath = configurations.testResourceGeneration
"--data-path=$dataPath", args = [
"--genesis-file=$srcFiles/genesis.json", "--logging=ERROR",
"blocks", "--data-path=$dataPath",
"export", "--genesis-file=$srcFiles/genesis.json",
"--format=RLP", "blocks",
"--start-block=0", "export",
"--to=$blocksBin" "--format=RLP",
] "--start-block=0",
"--to=$blocksBin"
]
}
} }
} }
} }

@ -28,6 +28,10 @@ jar {
} }
} }
sonarqube {
skipProject = true
}
dependencies { dependencies {
implementation project(':ethereum:eth') implementation project(':ethereum:eth')
implementation project(':plugin-api') implementation project(':plugin-api')

Loading…
Cancel
Save