6 Star 2 Fork 4

WeBank/WeCross-Java-SDK

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.gradle 6.99 KB
一键复制 编辑 原始数据 按行查看 历史
Kyon 提交于 2024-03-05 09:42 . (project): update 1.4.0 changelog. (#150)
plugins {
id 'com.github.sherter.google-java-format' version '0.8'
id 'com.github.johnrengelman.shadow' version '5.2.0'
id 'maven-publish'
id 'org.ajoberstar.grgit' version '4.0.1'
}
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'java'
apply plugin: 'jacoco'
group = 'com.webank'
sourceCompatibility = '1.8'
version = '1.4.0'
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
classifier = 'sources'
}
task javadocJar(type: Jar) {
from javadoc
classifier = 'javadoc'
}
javadoc {
options {
encoding 'UTF-8'
charSet 'UTF-8'
}
}
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://maven.aliyun.com/repository/public' }
}
googleJavaFormat {
options style: 'AOSP'
source = sourceSets*.allJava
include '**/*.java'
exclude '**/temp/*.java'
}
verifyGoogleJavaFormat {
source = sourceSets*.allJava
include '**/*.java'
exclude '**/temp/*.java'
}
configurations.all {
exclude module: "spring-boot-starter-logging"
exclude group: 'org.yaml', module: 'snakeyaml'
}
sourceSets {
main {
java {
srcDir 'src/main/java'
srcDir 'src/test/java'
}
resources {
srcDir 'src/test/resources'
}
}
}
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
compile 'com.moandjiezana.toml:toml4j:0.7.2'
compile 'com.google.code.gson:gson:2.8.9'
compile 'com.fasterxml.jackson.core:jackson-databind:2.14.2'
compile ('org.springframework.boot:spring-boot-starter-web:2.7.18'){
exclude group: 'org.springframework', module: 'spring-core'
exclude group: 'org.springframework', module: 'spring-web'
exclude group: 'org.springframework', module: 'spring-webmvc'
exclude group: 'org.yaml', module: 'snakeyaml'
}
compile 'org.springframework.boot:spring-boot-starter-aop:2.7.18'
compile 'org.springframework.boot:spring-boot-starter-security:2.7.18'
compile 'org.springframework:spring-aspects:5.3.32'
compile 'org.springframework:spring-core:5.3.32'
compile 'org.springframework:spring-aop:5.3.32'
implementation ('org.asynchttpclient:async-http-client:2.12.3'){
exclude group : 'io.netty'
}
compile 'io.netty:netty-all:4.1.101.Final'
compile 'com.google.guava:guava:32.0.1-jre'
compile 'commons-codec:commons-codec:1.14'
compile 'org.bouncycastle:bcprov-jdk18on:1.77'
compile 'junit:junit:4.13.1'
compile 'org.aspectj:aspectjrt:1.9.7'
compile 'org.aspectj:aspectjweaver:1.9.7'
}
configurations.compile.exclude(group: 'ch.qos.logback')
jar {
destinationDir file('dist/apps')
archiveName project.name + "-" + project.version + '.jar'
exclude '**/*.xml'
exclude '**/*.toml'
exclude '**/*.properties'
exclude '**/*.yml'
exclude '**/*.crt'
exclude '**/*.key'
manifest {
attributes(
'Main-Class': 'com.webank.wecrosssdk.TestMain',
'version': project.version,
)
try {
def repo = grgit.open(dir: file('.').canonicalPath)
if (repo != null) {
def date = new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
def branch = repo.branch.getCurrent().getName()
def commit = repo.head().getAbbreviatedId(40)
attributes(["Implementation-Timestamp": date,
"Git-Branch" : branch,
"Git-Commit" : commit
])
logger.info(" Commit : ")
logger.info(" => date: {}", date)
logger.info(" => branch: {}", branch)
logger.info(" => commit: {}", commit)
}
} catch (Exception e) {
// logger.warn(' .git not exist, cannot found commit info')
}
}
doLast {
copy {
from file('src/main/resources/')
into 'dist/conf'
}
copy {
from configurations.runtime
into 'dist/lib'
}
copy {
from file('.').listFiles().findAll { File f -> (f.name.endsWith('.sh') || f.name.endsWith('.env')) }
into 'dist'
}
}
}
ext {
if (!project.hasProperty("NEXUS_USERNAME")) {
NEXUS_USERNAME = "xxx"
}
if (!project.hasProperty("NEXUS_PASSWORD")) {
NEXUS_PASSWORD = "xxx"
}
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId = 'com.webank'
artifactId = 'wecross-java-sdk'
from components.java
artifact sourcesJar
artifact javadocJar
// https://docs.gradle.org/current/dsl/org.gradle.api.publish.maven.MavenPublication.html
pom {
name = "WeCross-Java-SDK"
description = "Java SDK for WeCross"
url = "https://github.com/WeBankBlockchain/WeCross-Java-SDK"
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-Java-SDK.git"
developerConnection = "scm:git:ssh://github.com/WeBankBlockchain/WeCross-Java-SDK.git"
url = "https://github.com/WeBankBlockchain/WeCross-Java-SDK"
}
}
}
}
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
credentials {
username = NEXUS_USERNAME
password = NEXUS_PASSWORD
}
}
}
signing {
sign publishing.publications.mavenJava
}
}
test {
testLogging.showStandardStreams = true
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/WeBank/WeCross-Java-SDK.git
git@gitee.com:WeBank/WeCross-Java-SDK.git
WeBank
WeCross-Java-SDK
WeCross-Java-SDK
master

搜索帮助