Merge commit '934c'

This commit is contained in:
CaiHQ 2022-04-22 13:48:48 +08:00
commit 7664c8018b
3 changed files with 96 additions and 11 deletions

View File

@ -1,13 +1,17 @@
plugins { plugins {
id 'java'
id 'java-library' id 'java-library'
id 'maven-publish'
id 'signing'
} }
group 'org.bdware.bdcontract'
group 'com.bdware.sc' version '1.0.0'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8 sourceCompatibility = 1.8
repositories { repositories {
mavenLocal()
maven { url 'https://maven.aliyun.com/repository/public' }
mavenCentral() mavenCentral()
} }
@ -31,11 +35,11 @@ sourceSets {
} }
dependencies { dependencies {
api project(":gmhelper") api 'com.google.code.gson:gson:2.8.8'
api 'org.bdware.bdcontract:gmhelper:0.1.0'
api 'javax.websocket:javax.websocket-api:1.1' api 'javax.websocket:javax.websocket-api:1.1'
api 'log4j:log4j:1.2.17' api 'org.apache.logging.log4j:log4j-core:2.17.2'
api 'org.apache.logging.log4j:log4j-core:2.14.1' api 'org.apache.logging.log4j:log4j-api:2.17.2'
api 'org.apache.logging.log4j:log4j-api:2.14.1'
api 'org.glassfish.tyrus.bundles:tyrus-standalone-client:1.17' api 'org.glassfish.tyrus.bundles:tyrus-standalone-client:1.17'
testImplementation 'junit:junit:4.13.2' testImplementation 'junit:junit:4.13.2'
} }
@ -69,4 +73,84 @@ task release(type: Zip, dependsOn: ["copyJar", "copyLibs"]) {
duplicatesStrategy = DuplicatesStrategy.INCLUDE duplicatesStrategy = DuplicatesStrategy.INCLUDE
archiveFileName = "java-client-${projectIds.version}.zip" archiveFileName = "java-client-${projectIds.version}.zip"
destinationDirectory = file('build/') destinationDirectory = file('build/')
}
task classJar(type: Jar, dependsOn: classes) {
classifier = "jar"
}
task sourceJar(type: Jar, dependsOn: classes) {
archiveClassifier = "sources"
classifier = "sources"
from sourceSets.main.allSource
}
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
classifier = "javadoc"
exclude {
details -> details.file.getAbsolutePath().contains("/gm/")
}
from javadoc.destinationDir
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId project.group
artifactId "sdk-java"
version "${version}"
from components.java
artifact sourceJar
artifact javadocJar
artifact classJar
pom {
name = "bdware-sdk-java"
description = "sdk-java"
url = "https://gitee.com/BDWare/sdk-java"
licenses {
license {
name = "Mulan PSL v2"
url = "http://license.coscl.org.cn/MulanPSL2"
}
}
developers {
developer {
id = "dataware"
email = "caihq@pku.edu.cn"
}
}
scm {
connection = "scm:git:https://gitee.com/BDWare/sdk-java.git"
developerConnection = "scm:git:https://gitee.com/BDWare/sdk-java.git"
url = "https://gitee.com/BDWare/sdk-java"
}
}
}
}
repositories {
maven {
name 'bdwareSnapshotRepository'
url 'https://oss.sonatype.org/content/repositories/snapshots'
credentials {
username = "${NEXUS_USERNAME}"
password = "${NEXUS_PASSWORD}"
}
}
maven {
name 'bdwareRepository'
url 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
credentials {
username = "${NEXUS_USERNAME}"
password = "${NEXUS_PASSWORD}"
}
}
}
}
signing {
sign publishing.publications.mavenJava
} }

View File

@ -4,7 +4,6 @@ import com.google.gson.JsonObject;
import org.bdware.client.ws.Action; import org.bdware.client.ws.Action;
import org.zz.gmhelper.SM2KeyPair; import org.zz.gmhelper.SM2KeyPair;
import org.zz.gmhelper.SM2Util; import org.zz.gmhelper.SM2Util;
public class Main { public class Main {
public static void main(String[] args) throws InterruptedException { public static void main(String[] args) throws InterruptedException {
if (args.length == 0 || args[0].equals("-h") || args[0].equals("--help")) { if (args.length == 0 || args[0].equals("-h") || args[0].equals("--help")) {

View File

@ -93,7 +93,7 @@ public abstract class SmartContractHandler implements Handler {
@Override @Override
public void handle(JsonObject obj) { public void handle(JsonObject obj) {
try { try {
// LOGGER.info("receive:" + obj); LOGGER.info("receive:" + obj);
if (!obj.has("action")) { if (!obj.has("action")) {
LOGGER.warn("can't handle message without action: " + obj); LOGGER.warn("can't handle message without action: " + obj);
} }
@ -104,10 +104,12 @@ public abstract class SmartContractHandler implements Handler {
} else { } else {
LOGGER.warn("can't handle action: " + methodName + " -> " + obj); LOGGER.warn("can't handle action: " + methodName + " -> " + obj);
} }
} catch (SecurityException e) { } catch (Exception e) {
onUndefined(obj); onUndefined(obj);
} catch (Throwable t) { } catch (Throwable t) {
t.printStackTrace(); t.printStackTrace();
} }
} }
} }