merge
This commit is contained in:
commit
6c4a2f6275
3
backend/.gitignore
vendored
3
backend/.gitignore
vendored
@ -1,5 +1,7 @@
|
|||||||
/.DS_Store/
|
/.DS_Store/
|
||||||
/build/
|
/build/
|
||||||
|
/ContractDB/
|
||||||
|
debugconf.json
|
||||||
/cplibs/
|
/cplibs/
|
||||||
cplibs
|
cplibs
|
||||||
# Compiled class file
|
# Compiled class file
|
||||||
@ -25,3 +27,4 @@ cplibs
|
|||||||
|
|
||||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||||
hs_err_pid*
|
hs_err_pid*
|
||||||
|
deployconfig.json
|
@ -6,6 +6,8 @@ buildscript {
|
|||||||
dependencies {
|
dependencies {
|
||||||
classpath "org.bdware.bdcontract:simple-ypk-packer:0.3.0"
|
classpath "org.bdware.bdcontract:simple-ypk-packer:0.3.0"
|
||||||
classpath "org.bdware.bdcontract:ypk-deploy-tool:0.4.0"
|
classpath "org.bdware.bdcontract:ypk-deploy-tool:0.4.0"
|
||||||
|
classpath 'org.apache.logging.log4j:log4j-core:2.17.2'
|
||||||
|
classpath 'org.apache.logging.log4j:log4j-api:2.17.2'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,15 +41,24 @@ sourceSets {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// api 'org.apache.logging.log4j:log4j-core:2.14.1'
|
|
||||||
// api 'org.apache.logging.log4j:log4j-api:2.14.1'
|
|
||||||
implementation fileTree(dir: 'cplibs', include: '*.jar')
|
implementation fileTree(dir: 'cplibs', include: '*.jar')
|
||||||
// implementation fileTree(dir: 'cplibs/lib/', include: '*.jar')
|
implementation fileTree(dir: 'cplibs/libs/', include: '*.jar')
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
// api project(":datanet-search-engine-backend")
|
// api project(":datanet-search-engine-backend")
|
||||||
implementation 'org.postgresql:postgresql:42.3.1'
|
implementation 'org.postgresql:postgresql:42.3.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//task copyLibs(type: Copy) {
|
||||||
|
// from configurations.runtimeClasspath
|
||||||
|
// into "./build/output/libs/"
|
||||||
|
//}
|
||||||
|
def reltivePath = "./backend"
|
||||||
|
task grepCP(dependsOn: ["copyLibs"]) {
|
||||||
|
doLast {
|
||||||
|
org.bdware.datanet.YPKPacker.grepCPLibWithFilter("${reltivePath}/cplibs/libs", "${reltivePath}/build/output/libs", "${reltivePath}/grepcp.list")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//task copyLibs(type: Copy) {
|
//task copyLibs(type: Copy) {
|
||||||
// from configurations.runtimeClasspath
|
// from configurations.runtimeClasspath
|
||||||
// into "./build/output/libs/"
|
// into "./build/output/libs/"
|
||||||
@ -74,37 +85,32 @@ task copyAssets(type: Copy) {
|
|||||||
from "../front"
|
from "../front"
|
||||||
into "./build/output/assets/"
|
into "./build/output/assets/"
|
||||||
}
|
}
|
||||||
task mergeJar(dependsOn: ["sourcesJar", "jar"]) {
|
|
||||||
doLast {
|
|
||||||
org.bdware.datanet.YPKPacker.mergeJar("./backend/build/libs/$project.name-${project.version}.jar",
|
|
||||||
"./backend/build/libs/$project.name-${project.version}-sources.jar",
|
|
||||||
"./backend/build/libs/$project.name-${project.version}-all.jar")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
task copyJar(type: Copy, dependsOn: ["mergeJar", ":backend:copyLibs"]) {
|
def currVersion = "0.0.4"
|
||||||
from "./build/libs/$project.name-${project.version}-all.jar"
|
task copyJar(type: Copy, dependsOn: [":backend:copyLibs",":backend:jar"]) {
|
||||||
into "./build/output"
|
from "./build/libs/$project.name-${project.version}.jar"
|
||||||
rename { String fileName -> "sc-example.jar" }
|
into "./build/output/libs"
|
||||||
|
rename { String fileName -> "registry-${currVersion}.jar" }
|
||||||
doFirst {
|
doFirst {
|
||||||
println "copyJar start"
|
println "copyJar start"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task buildZip(type: Zip, dependsOn: ["copyAssets", "copyJar", "copyYJS"]) {
|
task buildZip(type: Zip, dependsOn: ["copyAssets", "copyJar", "copyYJS", "grepCP"]) {
|
||||||
from './build/output/'
|
from './build/output/'
|
||||||
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
||||||
archiveFileName = 'registry.zip'
|
archiveFileName = 'registry.zip'
|
||||||
destinationDirectory = file('build/')
|
destinationDirectory = file('build/')
|
||||||
}
|
}
|
||||||
def currVersion = "0.0.1"
|
|
||||||
task buildYPK(dependsOn: ["buildZip"]) {
|
task buildYPK(dependsOn: ["buildZip"]) {
|
||||||
doLast {
|
doLast {
|
||||||
org.bdware.datanet.YPKPacker.staticPack("./backend/build/registry.zip", "./backend/build/registry${currVersion}.ypk")
|
org.bdware.datanet.YPKPacker.staticPack("./backend/build/registry.zip", "./backend/build/registry-${currVersion}.ypk")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task deploy(dependsOn: ["buildYPK"]){
|
|
||||||
|
task deploy(dependsOn: ["buildYPK"]) {
|
||||||
doLast {
|
doLast {
|
||||||
org.bdware.ypkdeploy.HTTPTool.batchRun("./backend/deployconfig.json", true)
|
org.bdware.ypkdeploy.HTTPTool.batchRun("./backend/deployconfig.json", true)
|
||||||
}
|
}
|
||||||
|
16
backend/debugconf.json
Executable file
16
backend/debugconf.json
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"agentHttpAddr": "127.0.0.1:18000",
|
||||||
|
"privKey": "589d94ee5688358a1c5c18430dd9c75097ddddebf769f139da36a807911d20f8",
|
||||||
|
"pubKey": "04d1924329f72ced148f6f333fb985ccbaa31b1e3aacf10be5f43d4a4ff5ad88899a005e79e37fc06993e1d66ada8cf8b711cb36f59538bb7d3e39e70fa9360ddd",
|
||||||
|
"script": "./build/registry-0.0.1.ypk",
|
||||||
|
"killContract": "Registry",
|
||||||
|
"createParam": {
|
||||||
|
"privateKey": "4616ff0e2a4f982364914f9be30b51c6bc6ccb6602114a9ee8792f2ccf67465b",
|
||||||
|
"publicKey": "04f9b9b8f324908464f78a6235e2dd93e4dfdaf045e9b1b5cfd57374516cc61a79a86fc2b42d3321a5b49a0f25381a7bed61901b40b729f72354e716673d551e98",
|
||||||
|
"registerID": "DBTest.test.test/registry",
|
||||||
|
"auditURI": "tcp://127.0.0.1:2051",
|
||||||
|
"DBUrl": "jdbc:postgresql://iodlog.demo.internetapi.cn:5432/iodlog?useServerPrepStmts=true",
|
||||||
|
"username": "iodlog",
|
||||||
|
"password": "iodlog1107"
|
||||||
|
}
|
||||||
|
}
|
1
backend/grepcp.list
Executable file
1
backend/grepcp.list
Executable file
@ -0,0 +1 @@
|
|||||||
|
yjs.jar
|
0
backend/src/main/java/org/bdware/sc/registry/Hello.java
Normal file → Executable file
0
backend/src/main/java/org/bdware/sc/registry/Hello.java
Normal file → Executable file
@ -4,7 +4,6 @@ import com.google.gson.JsonElement;
|
|||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import org.bdware.sc.engine.JSONTool;
|
import org.bdware.sc.engine.JSONTool;
|
||||||
import wrp.jdk.nashorn.api.scripting.ScriptObjectMirror;
|
import wrp.jdk.nashorn.api.scripting.ScriptObjectMirror;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -17,12 +16,13 @@ public class RegistryDB {
|
|||||||
DBConnector.url = jsonData.get("DBUrl").getAsString();
|
DBConnector.url = jsonData.get("DBUrl").getAsString();
|
||||||
DBConnector.password = jsonData.get("password").getAsString();
|
DBConnector.password = jsonData.get("password").getAsString();
|
||||||
DBConnector.userName = jsonData.get("username").getAsString();
|
DBConnector.userName = jsonData.get("username").getAsString();
|
||||||
|
DBConnector.init();
|
||||||
DBConnector.connect();
|
DBConnector.connect();
|
||||||
|
|
||||||
Map<String, Object> item = new HashMap<>();
|
Map<String, Object> item = new HashMap<>();
|
||||||
item.put("pubkey", requester);
|
item.put("pubkey", requester);
|
||||||
item.put("type", "admin");
|
item.put("type", "admin");
|
||||||
item.put("username", "admin");
|
item.put("username", jsonData.get("adminName").getAsString());
|
||||||
DBConnector.insert("registry", "user", item);
|
DBConnector.insert("registry", "user", item);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
7
backend/src/test/java/StartRegistry.java
Normal file
7
backend/src/test/java/StartRegistry.java
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import org.bdware.sc.debugger.DebugMain;
|
||||||
|
|
||||||
|
public class StartRegistry {
|
||||||
|
public static void main(String[] args){
|
||||||
|
DebugMain.main(args);
|
||||||
|
}
|
||||||
|
}
|
0
backend/yjs/main.yjs
Normal file → Executable file
0
backend/yjs/main.yjs
Normal file → Executable file
0
backend/yjs/manifest.json
Normal file → Executable file
0
backend/yjs/manifest.json
Normal file → Executable file
Loading…
x
Reference in New Issue
Block a user