Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

解决centos7环境下编译错误的问题 #737

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 152 additions & 0 deletions build-hsm.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
// Apply the java-library plugin to add support for Java Library
plugins {
id 'java'
id 'idea'
id 'java-library'
id 'jacoco'
//id 'com.github.sherter.google-java-format' version '0.8'
id 'maven-publish'
id 'org.ajoberstar.grgit' version '4.1.1'
}
println("Notice: current gradle version is " + gradle.gradleVersion)
// Additional attribute definition
ext {
// jackson version
javaSDKVersion="2.8.0-hsm"
solcJVersion = "0.4.25.1"
//solcJVersion = "0.5.2.0"
//solcJVersion = "0.6.10.0"
guavaVersion = "29.0-jre"
commonsCollections4Version = "4.4"
}

archivesBaseName = 'java-sdk-demo'
version = '1.0.0'

sourceCompatibility = 1.8
targetCompatibility = 1.8

// In this section you declare where to find the dependencies of your project
repositories {
mavenCentral()
maven { url "https://maven.aliyun.com/nexus/content/groups/public/" }
maven { url "https://repo1.maven.org/maven2/" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}

sourceSets {
main {
java {
srcDir 'src/main/java'
}

resources {
srcDir 'src/main/resources'
}
}
integrationTest {
copy {
from file('src/test/resources/amop/')
into 'conf/amop'
}
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test/java')
}
resources.srcDir file('src/integration-test/resources')
}
}




//googleJavaFormat {
// options style: 'AOSP'
//source = sourceSets*.allJava
// include '**/*.java'
//}


//build.dependsOn(tasks.googleJavaFormat)
//verifyGoogleJavaFormat.mustRunAfter(tasks.googleJavaFormat)

//verifyGoogleJavaFormat.dependsOn(tasks.googleJavaFormat)

configurations {
integrationTestCompile.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
}

configurations.all {
resolutionStrategy.cacheChangingModulesFor 30, 'seconds'
}

task integrationTest(type: Test) {
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
}

def spring_version = "5.3.17"
List spring = [
"org.springframework:spring-core:$spring_version",
"org.springframework:spring-beans:$spring_version",
"org.springframework:spring-context:$spring_version",
"org.springframework:spring-tx:$spring_version",
]

dependencies {
implementation ("org.fisco-bcos.java-sdk:fisco-bcos-java-sdk:${javaSDKVersion}")
implementation ("org.fisco-bcos:solcJ:${solcJVersion}")
implementation ("com.google.guava:guava:${guavaVersion}")
implementation ("org.apache.commons:commons-collections4:${commonsCollections4Version}")
implementation spring
}

configurations.all {
resolutionStrategy.cacheChangingModulesFor 30, 'seconds'
}

javadoc {
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('charSet', 'UTF-8')
}

task sourcesJar(type: Jar) {
from sourceSets.main.allJava
archiveClassifier = 'sources'
}

task javadocJar(type: Jar) {
from javadoc
archiveClassifier = 'javadoc'
}

jar {
// destinationDir file('dist/apps')
// archiveName project.name + '-' + project.version + '.jar'
exclude '**/*.xml'
exclude '**/*.properties'
doLast {
copy {
from file('build/libs/')
into 'dist/apps'
}
copy {
from configurations.runtimeClasspath
into 'dist/lib'
}
copy {
from file('src/test/resources/')
into 'dist/conf'
}
}
}
jacocoTestReport {
reports {
//xml.enabled true
//html.enabled false
}
}
check.dependsOn jacocoTestReport
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
#distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists