Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .ci/ci_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ prepare_environment()
rm -rf src/integration-test/resources/bin
cp -r src/test/resources/ecdsa/abi src/integration-test/resources/abi
cp -r src/test/resources/ecdsa/bin src/integration-test/resources/bin
mkdir -p sdk-amop/src/test/resources
cp -r src/test/resources/ sdk-amop/src/test/resources

sed_cmd=$(get_sed_cmd)

Expand Down
2 changes: 1 addition & 1 deletion .ci/ci_check_commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

scan_code_script="cobra/cobra.py -f json -o /tmp/report.json -t "
ignore_files=(sh crt key json toml SignatureTest.java Ok.java bin abi ChannelTest.java ParallelOkDemo.java PerformanceAmop.java DagPrecompiledDemo.java KeyManagerTest.java CryptoInterface.java AmopMsgHandlerTest.java TopicManager.java PrivateTopicVerifyTest.java AmopMsgBuilder.java TopicManagerTest.java AmopSubscribe.java AmopPublisher.java AmopPublisherPrivate.java AmopSubscribePrivate.java AmopPublisherFile.java AmopPublisherPrivateFile.java DemoAmopCallback.java FileToByteArrayHelper.java OkD.java TableTest.java PerformanceTable.java HelloWorld.java PerformanceRPC.java)
ignore_files=(sh crt key json toml SignatureTest.java Ok.java bin abi ChannelTest.java ParallelOkDemo.java PerformanceAmop.java DagPrecompiledDemo.java KeyManagerTest.java CryptoInterface.java AmopMsgHandlerTest.java TopicManager.java PrivateTopicVerifyTest.java AmopMsgBuilder.java TopicManagerTest.java AmopSubscribe.java AmopPublisher.java AmopPublisherPrivate.java AmopSubscribePrivate.java AmopPublisherFile.java AmopPublisherPrivateFile.java DemoAmopCallback.java FileToByteArrayHelper.java OkD.java TableTest.java PerformanceTable.java HelloWorld.java PerformanceRPC.java CodecTest.java ResponseTest.java ConfigTest.java)
commit_limit=6

LOG_ERROR() {
Expand Down
186 changes: 126 additions & 60 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,48 +1,137 @@
// Apply the java-library plugin to add support for Java Library
plugins {
id 'com.github.sherter.google-java-format' version '0.8'
id 'maven'
id 'maven-publish'
id 'signing'
id 'idea'
id 'eclipse'
id 'java'
id 'jacoco'
}
println("Notice: current gradle version is " + gradle.gradleVersion)
// Additional attribute definition
ext {
if (!project.hasProperty("ossrhUsername")) {
ossrhUsername="xxx"
}

// In this section you declare where to find the dependencies of your project
repositories {
maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
mavenCentral()
if (!project.hasProperty("ossrhPassword")) {
ossrhPassword="xxx"
}
// jackson version
jacksonVersion = "2.11.0"
commonsIOVersion = "2.4"
commonsLang3Version = "3.1"
javapoetVersion = "1.7.0"
picocliVersion = "3.6.0"
nettyVersion = "4.1.50.Final"
nettySMSSLContextVersion = "1.1.0"
toml4jVersion = "0.7.2"
bcprovJDK15onVersion = "1.60"
keyMiniToolkit = "1.0-SNAPSHOT"
}

sourceCompatibility = '1.8'
version = '3.0.0'
// check.dependsOn integrationTest
// integrationTest.mustRunAfter test
allprojects {
group = 'org.fisco-bcos'
version = '0.1.0-SNAPSHOT'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'java'
apply plugin: 'jacoco'

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

googleJavaFormat {
options style: 'AOSP'
source = sourceSets*.allJava
include '**/*.java'
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}
sourceCompatibility = '1.8'

verifyGoogleJavaFormat {
source = sourceSets*.allJava
include '**/*.java'
// In this section you declare where to find the dependencies of your project
repositories {
maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
mavenCentral()
}

dependencies {
compile 'org.slf4j:slf4j-api:1.7.30'
testCompile 'junit:junit:4.12'
}

clean.doLast {
file("dist/apps/").deleteDir()
file("dist/conf/").deleteDir()
file("dist/lib/").deleteDir()
}
}

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

resources {
srcDir 'src/main/resources'
}
}
}
jar {
destinationDir file("dist/apps")
archiveName project.name + "-" + version + ".jar"

exclude "**/*.xml"
exclude "**/*.properties"

doLast {
copy {
from file("src/test/resources/")
into "dist/conf"
}
copy {
from configurations.runtime
into "dist/lib"
}
copy {
from file("build/libs/")
into "dist/apps"
}
}
}

// for upload to maven
task sourcesJar(type: Jar) {
classifier = "sources"
from sourceSets.main.allSource
}

jacocoTestReport {
reports {
xml.enabled true
html.enabled false
/*task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = "javadoc"
from javadoc.destinationDir
}*/
artifacts {
archives jar
archives sourcesJar
//archives javadocJar
}
}

sourceSets {
main {
java {
srcDir 'src/main/java'
srcDir 'src/demo/java'
srcDir "sdk-core/src/main/java"
srcDir "sdk-crypto/src/main/java"
srcDir "sdk-abi/src/main/java"
srcDir "sdk-amop/src/main/java"
srcDir "sdk-service/src/main/java"
srcDir "sdk-transaction/src/main/java"
srcDir "sdk-codegen/src/main/java"
}

resources {
Expand All @@ -54,11 +143,11 @@ sourceSets {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test/java')
srcDir file('sdk-demo/src/main')
}
resources.srcDir file('src/integration-test/resources')
}
}

configurations {
integrationTestCompile.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
Expand All @@ -70,7 +159,7 @@ task integrationTest(type: Test) {
}

dependencies {
compile 'org.bouncycastle:bcprov-jdk15on:1.60'
compile 'org.bouncycastle:bcprov-jdk15on:1.60'
compile 'org.apache.commons:commons-lang3:3.1'
compile 'io.netty:netty-all:4.1.50.Final'
compile 'org.fisco-bcos:netty-sm-ssl-context:1.0.0'
Expand All @@ -90,25 +179,15 @@ dependencies {
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:2.23.0'
}
googleJavaFormat {
options style: 'AOSP'
source = sourceSets*.allJava
include '**/*.java'
}

// check.dependsOn integrationTest
// integrationTest.mustRunAfter test

archivesBaseName = 'java-sdk'
group = 'org.fisco-bcos'
version = '1.0.0-SNAPSHOT'


// Additional attribute definition

ext {
if (!project.hasProperty("ossrhUsername")) {
ossrhUsername="xxx"
}

if (!project.hasProperty("ossrhPassword")) {
ossrhPassword="xxx"
}
verifyGoogleJavaFormat {
source = sourceSets*.allJava
include '**/*.java'
}

javadoc {
Expand Down Expand Up @@ -138,7 +217,6 @@ publishing {
from components.java
artifact sourcesJar
artifact javadocJar

pom {
name = 'fisco-bcos'
description = 'fisco-bcos java-sdk'
Expand Down Expand Up @@ -182,18 +260,6 @@ publishing {
}
}


jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}

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

jar {
// destinationDir file('dist/apps')
// archiveName project.name + '-' + project.version + '.jar'
Expand Down
8 changes: 8 additions & 0 deletions sdk-abi/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Apply the java-library plugin to add support for Java Library
plugins {
id 'java'
}
dependencies {
compile project(':sdk-crypto')
compile ("org.apache.commons:commons-lang3:${commonsLang3Version}")
}
9 changes: 9 additions & 0 deletions sdk-amop/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Apply the java-library plugin to add support for Java Library
plugins {
id 'java'
}
dependencies {
compile project(':sdk-core')
compile project(':sdk-crypto')
compile ("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-----BEGIN PRIVATE KEY-----
MIGEAgEAMBAGByqGSM49AgEGBSuBBAAKBG0wawIBAQQgvFFrJgDuw6IW9FfcFM+D
oB7SLQ/CFJ/JEdwuxIb+V6OhRANCAATbv+5PdvWjvD28LmEnxKH1C3YUv/QTikSn
mu09QvZ/nHqnBXAgX5tgpYiMZBW2qDABJne0QVp5zNFTP+VjeGHf
-----END PRIVATE KEY-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-----BEGIN PUBLIC KEY-----
MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE17ngD1bT95MFNZ+i19sWYCHnMIa9zS56
KNbtJzReHy3ez4XbdDjoRX/UdO+cTOuJq7fV+mCiLykC7CbcpSrV5Q==
-----END PUBLIC KEY-----
Binary file not shown.
5 changes: 5 additions & 0 deletions sdk-amop/src/test/resources/keystore/ecdsa/invalid.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-----BEGIN PRIVATE KEY-----
MIGEAgEAMBAGByqGSM49AgEGBSuBBAAKBG0wawIBAQQgvFFrJgDuw6IW9FfcFM+D
oB7SLQ/CFJ/JEdwuxIb+V6OhRANCAATbv+5PdvWjvD28LmEnxKH1C3YUv/QTikSn
mu09QvZ/nHqnBXAgX5tgpYiMZBW2qDABJne0QVp5zNFTP+VjeGf
-----END PRIVATE KEY-----
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-----BEGIN PRIVATE KEY-----
MIGHAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBG0wawIBAQQgkBdEw04q3/yf1/sS
6Mui2Ip5qvVL6bThFmAVModInxOhRANCAAQ7cs0oJEyFbT2Jtn0cX/IuHyaDW6/N
Y+mkrTQkoqV/K3WRSfRsaW3wi52Uc2hmdfxtredE0Mgr3FWY11ngFf2W
-----END PRIVATE KEY-----
Binary file not shown.
Binary file added sdk-amop/src/test/resources/keystore/gm/invalid.p12
Binary file not shown.
5 changes: 5 additions & 0 deletions sdk-amop/src/test/resources/keystore/gm/invalid.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-----BEGIN PRIVATE KEY-----
MIGHAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBG0wawIBAQQgkBdEw04q3/yf1/sS
6Mui2Ip5qvVL6bThFmAVModInxOhRANCAAQ7cs0oJEyFbT2Jtn0cX/IuHyaDW6/N
Y+mkrTQkoqV/K3WRSfRsaW3wi52Uc2hmdfxtredE0Mgr3FWY11ngFf2
-----END PRIVATE KEY-----
16 changes: 16 additions & 0 deletions sdk-codegen/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Apply the java-library plugin to add support for Java Library
plugins {
id 'maven'
id 'maven-publish'
id 'signing'
id 'idea'
id 'eclipse'
id 'java'
id 'jacoco'
}
dependencies {
compile project(':sdk-transaction')
compile ("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}")
compile ("com.squareup:javapoet:${javapoetVersion}")
compile ("info.picocli:picocli:${picocliVersion}")
}
11 changes: 11 additions & 0 deletions sdk-core/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Apply the java-library plugin to add support for Java Library
plugins {
id 'java'
}
dependencies {
compile ("org.apache.commons:commons-lang3:${commonsLang3Version}")
compile ("io.netty:netty-all:${nettyVersion}")
compile ("org.fisco-bcos:netty-sm-ssl-context:${nettySMSSLContextVersion}")
compile ("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}")
compile ("com.moandjiezana.toml:toml4j:${toml4jVersion}")
}
Loading