代码拉取完成,页面将自动刷新
import net.ltgt.gradle.errorprone.CheckSeverity
import java.util.regex.Pattern
/*
* Copyright Besu Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
*/
buildscript {
repositories {
maven {
url = uri("https://hyperledger.jfrog.io/hyperledger/besu-maven")
content { includeGroupByRegex('org\\.hyperledger\\..*') }
}
maven {
url "https://plugins.gradle.org/m2/"
}
mavenCentral()
}
}
plugins {
id 'java-library'
id 'maven-publish'
id 'net.ltgt.errorprone' version '4.0.0'
id 'io.spring.dependency-management' version '1.1.5'
id 'com.diffplug.spotless' version '6.25.0'
id 'com.jfrog.artifactory' version '5.2.2'
}
test {
useJUnitPlatform()
}
sourceSets {
test {
resources {
srcDirs = ['src/test/resources']
}
}
}
dependencies {
implementation 'com.github.ben-manes.caffeine:caffeine'
implementation 'com.google.guava:guava'
implementation 'net.java.dev.jna:jna'
implementation 'io.github.crate-crypto:java-verkle-cryptography'
implementation 'io.tmio:tuweni-bytes'
implementation 'io.tmio:tuweni-rlp'
implementation 'io.tmio:tuweni-units'
implementation 'org.apache.logging.log4j:log4j-api'
implementation 'org.apache.logging.log4j:log4j-core'
implementation 'org.hyperledger.besu.internal:rlp'
implementation 'org.hyperledger.besu.internal:trie'
testImplementation 'com.fasterxml.jackson.core:jackson-databind'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.apache.commons:commons-csv:1.10.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.jupiter:junit-jupiter-params'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}
allprojects {
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'net.ltgt.errorprone'
apply from: "${rootDir}/gradle/versions.gradle"
version = rootProject.version
sourceCompatibility = 21
targetCompatibility = 21
repositories {
mavenCentral()
mavenLocal()
maven {
url = uri("https://hyperledger.jfrog.io/hyperledger/besu-maven")
content { includeGroupByRegex('org\\.hyperledger\\..*') }
}
}
artifacts {
archives jar
}
jar {
archiveBaseName = 'besu-verkle.trie'
includeEmptyDirs = false
manifest {
attributes(
'Specification-Title': archiveBaseName,
'Specification-Version': project.version,
'Implementation-Title': archiveBaseName,
'Implementation-Version': project.version,
'Automatic-Module-Name': 'org.hyperledger.besu.verkle.trie'
)
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveBaseName = 'besu-verkle.trie'
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveBaseName = 'besu-verkle.trie'
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId = 'org.hyperledger.besu' // Updated groupId
artifactId = 'besu-verkle-trie' // Updated artifactId
version "${project.version}"
from components.java
artifact sourcesJar
artifact javadocJar
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = "Verkle Tries - ${project.name}"
description = 'VerkleTries'
url = 'https://github.com/hyperledger/besu-verkle-trie'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
scm {
connection = 'scm:git:git://github.com/hyperledger/besu-verkle-trie.git'
developerConnection = 'scm:git:ssh://github.com/hyperledger/besu-verkle-trie.git'
url = 'https://github.com/hyperledger/besu-verkle-trie'
}
}
}
}
}
def artifactoryUser = project.hasProperty('artifactoryUser') ? project.property('artifactoryUser') : System.getenv('ARTIFACTORY_USER')
def artifactoryKey = project.hasProperty('artifactoryApiKey') ? project.property('artifactoryApiKey') : System.getenv('ARTIFACTORY_KEY')
def artifactoryRepo = System.getenv('ARTIFACTORY_REPO') ?: 'besu-maven'
def artifactoryOrg = System.getenv('ARTIFACTORY_ORG') ?: 'hyperledger'
artifactory {
contextUrl = "https://hyperledger.jfrog.io/${artifactoryOrg}"
publish {
repository {
repoKey = artifactoryRepo
username = artifactoryUser
password = artifactoryKey
}
defaults {
publications('mavenJava')
publishArtifacts = true
publishPom = true
}
}
}
apply plugin: 'com.diffplug.spotless'
spotless {
java {
// This path needs to be relative to each project
target 'src/**/*.java'
targetExclude '**/src/reference-test/**', '**/src/main/generated/**', '**/src/test/generated/**', '**/src/jmh/generated/**'
removeUnusedImports()
googleJavaFormat('1.17.0')
importOrder 'org.hyperledger', 'java', ''
trimTrailingWhitespace()
endWithNewline()
licenseHeaderFile "${rootDir}/gradle/spotless.java.license"
}
groovyGradle {
target '*.gradle'
greclipse('4.30.0').configFile(rootProject.file('gradle/formatter.properties'))
endWithNewline()
}
// Below this line are currently only license header tasks
format 'groovy', { target '**/src/*/grovy/**/*.groovy' }
format 'bash', { target '**/*.sh' }
format 'sol', { target '**/*.sol' }
}
tasks.withType(JavaCompile) {
options.compilerArgs += [
'-Xlint:unchecked',
'-Xlint:cast',
'-Xlint:rawtypes',
'-Xlint:overloads',
'-Xlint:divzero',
'-Xlint:finally',
'-Xlint:static',
'-Werror',
]
options.errorprone {
excludedPaths = '.*/(generated/*.*|.*ReferenceTest_.*|build/.*/annotation-output/.*)'
// Our equals need to be symmetric, this checker doesn't respect that.
check('EqualsGetClass', CheckSeverity.OFF)
// We like to use futures with no return values.
check('FutureReturnValueIgnored', CheckSeverity.OFF)
// We use the JSR-305 annotations instead of the Google annotations.
check('ImmutableEnumChecker', CheckSeverity.OFF)
// This is a style check instead of an error-prone pattern.
check('UnnecessaryParentheses', CheckSeverity.OFF)
// This check is broken in Java 12. See https://github.com/google/error-prone/issues/1257
if (JavaVersion.current() == JavaVersion.VERSION_12) {
check('Finally', CheckSeverity.OFF)
}
// This check is broken after Java 12. See https://github.com/google/error-prone/issues/1352
if (JavaVersion.current() > JavaVersion.VERSION_12) {
check('TypeParameterUnusedInFormals', CheckSeverity.OFF)
}
check('FieldCanBeFinal', CheckSeverity.WARN)
check('InsecureCryptoUsage', CheckSeverity.WARN)
check('WildcardImport', CheckSeverity.WARN)
}
options.encoding = 'UTF-8'
}
}
def sep = Pattern.quote(File.separator)
dependencies {
errorprone 'com.google.errorprone:error_prone_core'
}
task checkSpdxHeader(type: CheckSpdxHeader) {
apply plugin: 'groovy'
rootPath = "${projectDir}"
spdxHeader = "* SPDX-License-Identifier: Apache-2.0"
filesRegex = "(.*.java)|(.*.groovy)"
excludeRegex = [
"(.*${sep}generalstate${sep}GeneralStateRegressionReferenceTest.*)",
"(.*${sep}generalstate${sep}GeneralStateReferenceTest.*)",
"(.*${sep}generalstate${sep}LegacyGeneralStateReferenceTest.*)",
"(.*${sep}blockchain${sep}BlockchainReferenceTest.*)",
"(.*${sep}blockchain${sep}LegacyBlockchainReferenceTest.*)",
"(.*${sep}.gradle${sep}.*)",
"(.*${sep}.idea${sep}.*)",
"(.*${sep}out${sep}.*)",
"(.*${sep}build${sep}.*)",
"(.*${sep}src${sep}[^${sep}]+${sep}generated${sep}.*)"
].join("|")
}
check.dependsOn checkSpdxHeader
build.dependsOn spotlessApply
build.dependsOn javadoc
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。