1 Star 0 Fork 0

WeBankOpenSource/WeCross-Fabric2-Stub

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
build.gradle 7.78 KB
一键复制 编辑 原始数据 按行查看 历史
Kyon 提交于 2024-03-05 10:23 . (project): update 1.4.0 changelog. (#35)
plugins {
id 'com.github.sherter.google-java-format' version '0.8'
id 'com.github.johnrengelman.shadow' version '6.1.0'
id 'maven-publish'
}
// Apply the java-library plugin to add support for Java Library
apply plugin: 'maven'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'java'
//apply plugin: 'war'
apply plugin: 'jacoco'
apply plugin: 'com.github.johnrengelman.shadow'
group 'com.webank.wecross'
version '1.4.0'
sourceCompatibility = 1.8
// In this section you declare where to find the dependencies of your project
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url 'https://dl.bintray.com/ethereum/maven/' }
mavenCentral()
}
googleJavaFormat {
options style: 'AOSP'
source = sourceSets*.allJava
include '**/*.java'
exclude '**/temp/*.java'
}
verifyGoogleJavaFormat {
source = sourceSets*.allJava
include '**/*.java'
exclude '**/temp/*.java'
}
def log4j_version = "2.19.0"
List logger = [
"org.apache.logging.log4j:log4j-api:$log4j_version",
//"org.apache.logging.log4j:log4j-core:$log4j_version",
//"org.apache.logging.log4j:log4j-slf4j-impl:$log4j_version",
//"org.apache.logging.log4j:log4j-to-slf4j:$log4j_version",
//"org.apache.logging.log4j:log4j-web:$log4j_version",
//"org.apache.logging.log4j:log4j-jul:$log4j_version"
]
dependencies {
compile logger
implementation('com.moandjiezana.toml:toml4j:0.7.2') {
exclude group: 'com.google.code.gson', module: 'gson'
}
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'org.slf4j:slf4j-api:1.7.32'
implementation 'org.yaml:snakeyaml:2.0'
// Fabric
implementation 'javassist:javassist:3.12.1.GA'
implementation("org.hyperledger.fabric-sdk-java:fabric-sdk-java:2.0.0") {
exclude group: 'io.netty'
exclude group: 'org.apache.logging.log4j'
exclude group: 'log4j'
exclude group: 'com.google.guava'
}
implementation 'com.google.guava:guava:32.0.1-jre'
implementation "com.google.protobuf:protobuf-java:3.25.3"
implementation 'org.apache.commons:commons-compress:1.26.0'
// implementation 'io.netty:netty-tcnative-boringssl-static:2.0.27.Final'
// WeCross
implementation('com.webank:wecross-java-stub:1.4.0') {
exclude group: 'org.fisco-bcos', module: 'tcnative'
}
configurations.compile.exclude(group: 'ch.qos.logback')
configurations.compile.exclude(group: 'org.apache.logging.log4j')
// Use JUnit test framework
testImplementation 'junit:junit:4.13.1'
}
sourceSets {
main {
resources {
exclude '**/*.toml'
exclude '**/*.xml'
exclude '**/*.properties'
exclude '**/*.yml'
exclude '**/*.crt'
exclude '**/*.key'
include 'chaincode-fabric2.0/WeCrossProxy/**'
include 'chaincode-fabric2.0/WeCrossHub/**'
}
}
}
jar.enabled = false
project.tasks.assemble.dependsOn project.tasks.shadowJar
//task prepareProxyVendor(type: Exec) {
// workingDir "src/main/resources/chaincode-fabric2.0/WeCrossProxy"
// if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
// commandLine 'cmd', '/c', 'go get'
// commandLine 'cmd', '/c', 'go mod vendor'
// } else {
// commandLine 'bash', '-c', 'go get'
// commandLine 'bash', '-c', 'go mod vendor'
// }
//}
//
//task prepareHubVendor(type: Exec) {
// workingDir "src/main/resources/chaincode-fabric2.0/WeCrossHub"
// if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
// commandLine 'cmd', '/c', 'go get'
// commandLine 'cmd', '/c', 'go mod vendor'
// } else {
// commandLine 'bash', '-c', 'go get'
// commandLine 'bash', '-c', 'go mod vendor'
// }
//}
//
//project.tasks.shadowJar.dependsOn(project.tasks.prepareProxyVendor, project.tasks.prepareHubVendor)
shadowJar {
// exec {
// workingDir "src/main/resources/chaincode-fabric2.0/WeCrossProxy"
// if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
// commandLine 'cmd', '/c', 'go get'
// commandLine 'cmd', '/c', 'go mod vendor'
// } else {
// commandLine 'bash', '-c', 'go get'
// commandLine 'bash', '-c', 'go mod vendor'
// }
// }
// exec {
// workingDir "src/main/resources/chaincode-fabric2.0/WeCrossHub"
// if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
// commandLine 'cmd', '/c', 'go get'
// commandLine 'cmd', '/c', 'go mod vendor'
// } else {
// commandLine 'bash', '-c', 'go get'
// commandLine 'bash', '-c', 'go mod vendor'
// }
// }
destinationDir file('dist/apps')
archiveName project.name + "-" + project.version + '.jar'
manifest {
attributes(
'Main-Class': 'com.webank.wecross.stub.fabric2.FabricStubFactory',
'version': project.version,
)
}
doLast {
copy {
from file('src/main/resources/')
into 'dist/conf'
}
copy {
from file('.').listFiles().findAll { File f -> (f.name.endsWith('.sh') || f.name.endsWith('.env')) }
into 'dist'
}
copy {
from file('scripts/')
into 'dist'
}
}
dependencies {
exclude(dependency('io.netty:.*'))
}
// minimize() // Enable this leads to tcnative core
relocate 'org.hyperledger.fabric.', 'org.hyperledger.fabric2.'
}
test {
testLogging.showStandardStreams = true
classpath = project.sourceSets.test.runtimeClasspath + files("${projectDir}/src/main/resources")
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId = 'com.webank'
artifactId = 'wecross-fabric-stub'
from components.java
artifacts = [shadowJar]
// https://docs.gradle.org/current/dsl/org.gradle.api.publish.maven.MavenPublication.html
pom {
name = "WeCross-Fabric-Stub"
description = "Fabric Stub for WeCross"
url = "https://github.com/WeBankBlockchain/WeCross"
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "Shareong"
name = "Shareong"
email = "740310627@qq.com"
}
}
scm {
connection = "scm:git:git://github.com/WeBankBlockchain/WeCross.git"
developerConnection = "scm:git:ssh://github.com/WeBankBlockchain/WeCross.git"
url = "https://github.com/WeBankBlockchain/WeCross"
}
}
}
}
repositories {
maven {
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
//*
def NEXUS_USERNAME = ''
def NEXUS_PASSWORD = ''
//*/
credentials {
username = NEXUS_USERNAME
password = NEXUS_PASSWORD
}
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/WeBankOS/WeCross-Fabric2-Stub.git
git@gitee.com:WeBankOS/WeCross-Fabric2-Stub.git
WeBankOS
WeCross-Fabric2-Stub
WeCross-Fabric2-Stub
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385