prune: update modules for mvn repository

This commit is contained in:
CaiHQ 2022-05-13 23:51:26 +08:00
parent 6064882843
commit 4318162fa8
3 changed files with 107 additions and 10 deletions

View File

@ -1,10 +1,14 @@
plugins {
id 'java'
id 'java-library'
id 'application'
//id 'application'
id 'com.github.johnrengelman.shadow' version '4.0.2'
id 'maven-publish'
id 'signing'
}
mainClassName = 'org.bdware.sc.ContractProcess'
//mainClassName = 'org.bdware.sc.ContractProcess'
repositories {
mavenLocal()
mavenCentral()
@ -41,21 +45,29 @@ dependencies {
implementation 'com.sun.mail:javax.mail:1.6.2'
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
implementation 'org.bdware.bdcontract:sdk-java:1.0.0'
implementation 'org.bdware.doip:doip-audit-tool:0.9.3'
api fileTree(dir: 'lib', include: '*.jar')
implementation 'org.bdware.doip:doip-audit-tool:0.9.4'
compile fileTree(dir: 'lib', include: '*.jar')
testImplementation 'junit:junit:4.13.2'
}
task classJar(type: Jar, dependsOn: classes) {
classifier = "jar"
}
//jar {
// classifier = ""
//}
jar {
String libs = ''
configurations.runtimeClasspath.each {
libs = libs + " libs/" + it.name
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
manifest {
attributes 'Manifest-Version': project.version
attributes 'Main-Class': mainClassName
// attributes 'Main-Class': mainClassName
attributes 'Class-Path': libs
}
}
@ -79,3 +91,88 @@ task buildBundle(dependsOn: [":cp:copyLibs", ":cp:copyJar"]) {
println "buildBundle in ./build/output/ successfully"
}
}
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
}
//shadowJar {
// classifier = "jar"
// dependencies {
// include(dependency(fileTree(dir: 'lib', include: '*.jar')))
//// exclude(dependency('com.google.code.gson:gson:2.8.6'))
//// relocate 'com.google.code.gson', 'irs.com.google.code.gson'
// }
//}
publishing {
publications {
mavenJava(MavenPublication) {
groupId project.group
artifactId "cp"
version "${version}"
from components.java
artifact sourceJar
artifact javadocJar
artifact classJar
pom {
name = "bdware-cp"
description = "cp"
url = "https://gitee.com/BDWare/cp"
licenses {
license {
name = "GPL v2"
url = "https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt"
}
}
developers {
developer {
id = "dataware"
email = "caihq@pku.edu.cn"
}
}
scm {
connection = "scm:git:https://gitee.com/BDWare/cp.git"
developerConnection = "scm:git:https://gitee.com/BDWare/cp.git"
url = "https://gitee.com/BDWare/cp"
}
}
}
}
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

@ -2,8 +2,8 @@ package org.bdware.sc.debugger;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bdware.client.SmartContractClient;
import org.bdware.sc.ContractProcess;
import org.bdware.sc.bean.Contract;

View File

@ -133,7 +133,7 @@ public class JSONTool {
recorded.add(arr);
JsonObject jsonObject = new JsonObject();
for (Object k : arr.keySet()) {
jsonObject.add(k.toString(), convertMirrorToJsonInternal(k, recorded));
jsonObject.add(k.toString(), convertMirrorToJsonInternal(arr.get(k), recorded));
}
return jsonObject;
} else if (obj.getClass() == jdk.internal.dynalink.beans.StaticClass.class) {