From ac7ab72bad76a222a35a2a1ac9052eba2c1d95a7 Mon Sep 17 00:00:00 2001 From: CaiHQ Date: Fri, 17 Nov 2023 17:32:56 +0800 Subject: [PATCH] refactor moduleNames --- README.md | 34 +---------------- backend/grepcp.list | 1 - build.gradle | 2 +- {backend => control-proxy-backend}/.gitignore | 0 {backend => control-proxy-backend}/LICENSE | 0 .../build.gradle | 35 +++++++++--------- .../debugconf.json | 0 .../deployconfig.json | 0 .../deployconfig.json.backup | 0 .../org/bdware/sc/controlproxy/DebugRun.java | 0 .../org/bdware/sc/controlproxy/RepoProxy.java | 0 .../sc/controlproxy/TopologyCollector.java | 0 .../bdware/sc/controlproxy/TopologyGraph.java | 0 .../src/main/resources/log4j2.properties | 0 .../src/test/java/AuditConfigTest.java | 0 .../src/test/java/DeployTestNet.java | 0 {backend => control-proxy-backend}/todo.md | 0 .../yjs/ControlProxy.yjs | 0 .../yjs/ControlProxy接口.md | 0 .../yjs/DAC.yjs | 0 .../yjs/README.md | 0 .../yjs/ShanxiAuditPRoxy.yjs | 0 .../yjs/ShanxiDataRepo.yjs | 0 .../yjs/ShanxiGlobalRouter.yjs | 0 .../yjs/ShanxiRegistry.yjs | 0 .../yjs/assets/logo.png | Bin .../yjs/audit.yjs | 0 .../yjs/manifest.json | 0 .../yjs/networking.yjs | 0 .../yjs/repodetail.yjs | 0 .../yjs/search.yjs | 0 .../yjs/union.yjs | 0 gradle.properties | 7 +++- gradle/wrapper/gradle-wrapper.properties | 7 ++++ grepcp.list | 18 +++++++++ settings.gradle | 2 +- 36 files changed, 53 insertions(+), 53 deletions(-) delete mode 100644 backend/grepcp.list rename {backend => control-proxy-backend}/.gitignore (100%) rename {backend => control-proxy-backend}/LICENSE (100%) rename {backend => control-proxy-backend}/build.gradle (57%) rename {backend => control-proxy-backend}/debugconf.json (100%) rename {backend => control-proxy-backend}/deployconfig.json (100%) rename {backend => control-proxy-backend}/deployconfig.json.backup (100%) rename {backend => control-proxy-backend}/src/main/java/org/bdware/sc/controlproxy/DebugRun.java (100%) rename {backend => control-proxy-backend}/src/main/java/org/bdware/sc/controlproxy/RepoProxy.java (100%) rename {backend => control-proxy-backend}/src/main/java/org/bdware/sc/controlproxy/TopologyCollector.java (100%) rename {backend => control-proxy-backend}/src/main/java/org/bdware/sc/controlproxy/TopologyGraph.java (100%) rename {backend => control-proxy-backend}/src/main/resources/log4j2.properties (100%) rename {backend => control-proxy-backend}/src/test/java/AuditConfigTest.java (100%) rename {backend => control-proxy-backend}/src/test/java/DeployTestNet.java (100%) rename {backend => control-proxy-backend}/todo.md (100%) rename {backend => control-proxy-backend}/yjs/ControlProxy.yjs (100%) rename {backend => control-proxy-backend}/yjs/ControlProxy接口.md (100%) rename {backend => control-proxy-backend}/yjs/DAC.yjs (100%) rename {backend => control-proxy-backend}/yjs/README.md (100%) rename {backend => control-proxy-backend}/yjs/ShanxiAuditPRoxy.yjs (100%) rename {backend => control-proxy-backend}/yjs/ShanxiDataRepo.yjs (100%) rename {backend => control-proxy-backend}/yjs/ShanxiGlobalRouter.yjs (100%) rename {backend => control-proxy-backend}/yjs/ShanxiRegistry.yjs (100%) rename {backend => control-proxy-backend}/yjs/assets/logo.png (100%) rename {backend => control-proxy-backend}/yjs/audit.yjs (100%) rename {backend => control-proxy-backend}/yjs/manifest.json (100%) rename {backend => control-proxy-backend}/yjs/networking.yjs (100%) rename {backend => control-proxy-backend}/yjs/repodetail.yjs (100%) rename {backend => control-proxy-backend}/yjs/search.yjs (100%) rename {backend => control-proxy-backend}/yjs/union.yjs (100%) create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100644 grepcp.list diff --git a/README.md b/README.md index 7fcf942..0f97731 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,2 @@ -# contract-java-example - -#### 介绍 -idea开发合约的示例。 - -#### 软件架构 -软件架构说明 - -#### 配置cp 的lib -做一个软链接,将cp-bundle的build/output 软链接到 -backend/cplibs。 - - - -#### 前端sdk说明 -1. 如何使用javascript sdk -2. 如何使用typescript sdk -3. 示例:使用vite/vue/...等框架 -3. 如何配置成前后端独立连接的 -4. 如何配置成前后端一体化 - -##### 模拟后端数据 - - -#### 后端常用方法说明 - -##### 调用相同CP的yjs代码 -参考: -Hello.callYJSInSameCP -##### 调用其他CP的yjs代码 -参考: -Hello.callYJSInOtherCP +# 初始化配置说明 +1. clone之后使用`git submodule update --init `初始化子仓库。 diff --git a/backend/grepcp.list b/backend/grepcp.list deleted file mode 100644 index a481ccb..0000000 --- a/backend/grepcp.list +++ /dev/null @@ -1 +0,0 @@ -yjs.jar \ No newline at end of file diff --git a/build.gradle b/build.gradle index ccebf68..793ec53 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ repositories { mavenCentral() } -project(':backend') { +project(':control-proxy-backend') { repositories { mavenLocal() mavenCentral() diff --git a/backend/.gitignore b/control-proxy-backend/.gitignore similarity index 100% rename from backend/.gitignore rename to control-proxy-backend/.gitignore diff --git a/backend/LICENSE b/control-proxy-backend/LICENSE similarity index 100% rename from backend/LICENSE rename to control-proxy-backend/LICENSE diff --git a/backend/build.gradle b/control-proxy-backend/build.gradle similarity index 57% rename from backend/build.gradle rename to control-proxy-backend/build.gradle index 63ff5cc..051f666 100644 --- a/backend/build.gradle +++ b/control-proxy-backend/build.gradle @@ -4,9 +4,8 @@ buildscript { mavenLocal() } dependencies { - classpath "org.bdware.bdcontract:simple-ypk-packer:0.5.5" - classpath "org.bdware.bdcontract:ypk-deploy-tool:0.7.1" - + classpath "org.bdware.bdcontract:simple-ypk-packer:${YPKPackerVersion}" + classpath "org.bdware.bdcontract:ypk-deploy-tool:${DeployToolVersion}" } } @@ -16,6 +15,8 @@ plugins { } version = "1.4.0" group = 'org.bdware.sc.controlproxy' +var moduleName = "control-proxy-backend" + tasks.withType(JavaCompile) { options.compilerArgs << '-Xlint:none' @@ -45,11 +46,11 @@ dependencies { api 'org.apache.logging.log4j:log4j-core:2.17.2' api 'org.apache.logging.log4j:log4j-api:2.17.2' api 'com.google.code.gson:gson:2.8.8' - implementation 'org.bdware.sc:cp:1.6.8' - implementation 'org.bdware.doip:doip-audit-tool:1.1.3' + implementation "org.bdware.sc:cp:${CPVersion}" + implementation "org.bdware.doip:doip-audit-tool:${AuditToolVersion}" implementation 'org.bdware.bdcontract:sdk-java:1.0.2' testImplementation 'junit:junit:4.13.2' - testImplementation 'org.bdware.bdcontract:ypk-deploy-tool:0.7.1' + testImplementation "org.bdware.bdcontract:ypk-deploy-tool:${DeployToolVersion}" } task copyLibs(type: Copy) { @@ -71,7 +72,7 @@ task copyAssets(type: Copy) { from "../front" into "./build/output/assets/" } -task copyJar(type: Copy, dependsOn: [":backend:jar", ":backend:copyLibs"]) { +task copyJar(type: Copy, dependsOn: [":jar", ":${moduleName}:copyLibs"]) { from "./build/libs/$project.name-${project.version}.jar" into "./build/output" rename { String fileName -> "controlproxy-${project.version}.jar" } @@ -82,37 +83,37 @@ task copyJar(type: Copy, dependsOn: [":backend:jar", ":backend:copyLibs"]) { } tasks.processResources.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE) tasks.processTestResources.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE) -task grepCP(dependsOn: [":backend:copyJar"]) { +task grepCP(dependsOn: [":${moduleName}:copyJar"]) { doLast { - org.bdware.datanet.YPKPacker.grepJarByCPVersion("./backend/build/output/libs", org.bdware.datanet.CPVersion.cp_1_6_8) - // org.bdware.datanet.YPKPacker.grepCPLibWithFilter("./backend/cplibs/libs/", "./backend/build/output/libs", "./backend/grepcp.list") + org.bdware.datanet.YPKPacker.grepJarByCPVersion("./${moduleName}/build/output/libs", org.bdware.datanet.CPVersion.cp_1_6_8) + org.bdware.datanet.YPKPacker.grepJarByListFile("./${moduleName}/build/output/libs", "./grepcp.list") } } -task buildZip(type: Zip, dependsOn: ["copyAssets", "grepCP", "copyJar", "copyYJS"]) { +task buildControlProxyZip(type: Zip, dependsOn: ["copyAssets", "grepCP", "copyJar", "copyYJS"]) { from './build/output/' duplicatesStrategy = DuplicatesStrategy.INCLUDE archiveFileName = 'ControlProxy.zip' destinationDirectory = file('build/') } -task buildYPK(dependsOn: ["buildZip", "grepCP"]) { +task buildControlProxyYPK(dependsOn: ["buildControlProxyZip", "grepCP"]) { doLast { - org.bdware.datanet.YPKPacker.staticPack("./backend/build/ControlProxy.zip", "./backend/build/ShanxiControlProxy-${project.version}.ypk") + org.bdware.datanet.YPKPacker.staticPack("./${moduleName}/build/ControlProxy.zip", "./${moduleName}/build/ShanxiControlProxy-${project.version}.ypk") } } -task deploy(dependsOn: ["buildYPK"]) { +task deployControlProxy(dependsOn: ["buildControlProxyYPK"]) { doLast { - org.bdware.ypkdeploy.HTTPTool.deployWithYpk("./backend/deployconfig.json","./backend/build/ShanxiControlProxy-${project.version}.ypk") + org.bdware.ypkdeploy.HTTPTool.deployWithYpk("./${moduleName}/deployconfig.json", "./${moduleName}/build/ShanxiControlProxy-${project.version}.ypk") //org.bdware.ypkdeploy.HTTPTool.batchRun("./backend/deployconfig.json", true) } } -task putPackage(type: Exec, dependsOn: ["buildYPK"]) { +task putPackage(type: Exec, dependsOn: ["buildControlProxyYPK"]) { workingDir "./build" commandLine "pwd" - commandLine "curl", "--user", "${REPO_USRNAME}:${REPO_PASSWORD}", "--upload-file", "./ControlProxy-${project.version}.ypk","${REPO_HOST}api/packages/iod/generic/ControlProxy/${project.version}/ControlProxy-${project.version}.ypk" + commandLine "curl", "--user", "${REPO_USRNAME}:${REPO_PASSWORD}", "--upload-file", "./ShanxiControlProxy-${project.version}.ypk", "${REPO_HOST}api/packages/iod/generic/ShanxiControlProxy/${project.version}/ShanxiControlProxy-${project.version}.ypk" doLast { println "Executed!" } diff --git a/backend/debugconf.json b/control-proxy-backend/debugconf.json similarity index 100% rename from backend/debugconf.json rename to control-proxy-backend/debugconf.json diff --git a/backend/deployconfig.json b/control-proxy-backend/deployconfig.json similarity index 100% rename from backend/deployconfig.json rename to control-proxy-backend/deployconfig.json diff --git a/backend/deployconfig.json.backup b/control-proxy-backend/deployconfig.json.backup similarity index 100% rename from backend/deployconfig.json.backup rename to control-proxy-backend/deployconfig.json.backup diff --git a/backend/src/main/java/org/bdware/sc/controlproxy/DebugRun.java b/control-proxy-backend/src/main/java/org/bdware/sc/controlproxy/DebugRun.java similarity index 100% rename from backend/src/main/java/org/bdware/sc/controlproxy/DebugRun.java rename to control-proxy-backend/src/main/java/org/bdware/sc/controlproxy/DebugRun.java diff --git a/backend/src/main/java/org/bdware/sc/controlproxy/RepoProxy.java b/control-proxy-backend/src/main/java/org/bdware/sc/controlproxy/RepoProxy.java similarity index 100% rename from backend/src/main/java/org/bdware/sc/controlproxy/RepoProxy.java rename to control-proxy-backend/src/main/java/org/bdware/sc/controlproxy/RepoProxy.java diff --git a/backend/src/main/java/org/bdware/sc/controlproxy/TopologyCollector.java b/control-proxy-backend/src/main/java/org/bdware/sc/controlproxy/TopologyCollector.java similarity index 100% rename from backend/src/main/java/org/bdware/sc/controlproxy/TopologyCollector.java rename to control-proxy-backend/src/main/java/org/bdware/sc/controlproxy/TopologyCollector.java diff --git a/backend/src/main/java/org/bdware/sc/controlproxy/TopologyGraph.java b/control-proxy-backend/src/main/java/org/bdware/sc/controlproxy/TopologyGraph.java similarity index 100% rename from backend/src/main/java/org/bdware/sc/controlproxy/TopologyGraph.java rename to control-proxy-backend/src/main/java/org/bdware/sc/controlproxy/TopologyGraph.java diff --git a/backend/src/main/resources/log4j2.properties b/control-proxy-backend/src/main/resources/log4j2.properties similarity index 100% rename from backend/src/main/resources/log4j2.properties rename to control-proxy-backend/src/main/resources/log4j2.properties diff --git a/backend/src/test/java/AuditConfigTest.java b/control-proxy-backend/src/test/java/AuditConfigTest.java similarity index 100% rename from backend/src/test/java/AuditConfigTest.java rename to control-proxy-backend/src/test/java/AuditConfigTest.java diff --git a/backend/src/test/java/DeployTestNet.java b/control-proxy-backend/src/test/java/DeployTestNet.java similarity index 100% rename from backend/src/test/java/DeployTestNet.java rename to control-proxy-backend/src/test/java/DeployTestNet.java diff --git a/backend/todo.md b/control-proxy-backend/todo.md similarity index 100% rename from backend/todo.md rename to control-proxy-backend/todo.md diff --git a/backend/yjs/ControlProxy.yjs b/control-proxy-backend/yjs/ControlProxy.yjs similarity index 100% rename from backend/yjs/ControlProxy.yjs rename to control-proxy-backend/yjs/ControlProxy.yjs diff --git a/backend/yjs/ControlProxy接口.md b/control-proxy-backend/yjs/ControlProxy接口.md similarity index 100% rename from backend/yjs/ControlProxy接口.md rename to control-proxy-backend/yjs/ControlProxy接口.md diff --git a/backend/yjs/DAC.yjs b/control-proxy-backend/yjs/DAC.yjs similarity index 100% rename from backend/yjs/DAC.yjs rename to control-proxy-backend/yjs/DAC.yjs diff --git a/backend/yjs/README.md b/control-proxy-backend/yjs/README.md similarity index 100% rename from backend/yjs/README.md rename to control-proxy-backend/yjs/README.md diff --git a/backend/yjs/ShanxiAuditPRoxy.yjs b/control-proxy-backend/yjs/ShanxiAuditPRoxy.yjs similarity index 100% rename from backend/yjs/ShanxiAuditPRoxy.yjs rename to control-proxy-backend/yjs/ShanxiAuditPRoxy.yjs diff --git a/backend/yjs/ShanxiDataRepo.yjs b/control-proxy-backend/yjs/ShanxiDataRepo.yjs similarity index 100% rename from backend/yjs/ShanxiDataRepo.yjs rename to control-proxy-backend/yjs/ShanxiDataRepo.yjs diff --git a/backend/yjs/ShanxiGlobalRouter.yjs b/control-proxy-backend/yjs/ShanxiGlobalRouter.yjs similarity index 100% rename from backend/yjs/ShanxiGlobalRouter.yjs rename to control-proxy-backend/yjs/ShanxiGlobalRouter.yjs diff --git a/backend/yjs/ShanxiRegistry.yjs b/control-proxy-backend/yjs/ShanxiRegistry.yjs similarity index 100% rename from backend/yjs/ShanxiRegistry.yjs rename to control-proxy-backend/yjs/ShanxiRegistry.yjs diff --git a/backend/yjs/assets/logo.png b/control-proxy-backend/yjs/assets/logo.png similarity index 100% rename from backend/yjs/assets/logo.png rename to control-proxy-backend/yjs/assets/logo.png diff --git a/backend/yjs/audit.yjs b/control-proxy-backend/yjs/audit.yjs similarity index 100% rename from backend/yjs/audit.yjs rename to control-proxy-backend/yjs/audit.yjs diff --git a/backend/yjs/manifest.json b/control-proxy-backend/yjs/manifest.json similarity index 100% rename from backend/yjs/manifest.json rename to control-proxy-backend/yjs/manifest.json diff --git a/backend/yjs/networking.yjs b/control-proxy-backend/yjs/networking.yjs similarity index 100% rename from backend/yjs/networking.yjs rename to control-proxy-backend/yjs/networking.yjs diff --git a/backend/yjs/repodetail.yjs b/control-proxy-backend/yjs/repodetail.yjs similarity index 100% rename from backend/yjs/repodetail.yjs rename to control-proxy-backend/yjs/repodetail.yjs diff --git a/backend/yjs/search.yjs b/control-proxy-backend/yjs/search.yjs similarity index 100% rename from backend/yjs/search.yjs rename to control-proxy-backend/yjs/search.yjs diff --git a/backend/yjs/union.yjs b/control-proxy-backend/yjs/union.yjs similarity index 100% rename from backend/yjs/union.yjs rename to control-proxy-backend/yjs/union.yjs diff --git a/gradle.properties b/gradle.properties index 158b703..93e1bc6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,8 @@ REPO_USRNAME=caihuaqian@internetapi.cn REPO_PASSWORD=527e259ef952a450d157fdb51ac4915154cea317 -REPO_HOST=https://gitea.internetapi.cn/ \ No newline at end of file +REPO_HOST=https://gitea.internetapi.cn/ +YPKPackerVersion=0.6.5 +DeployToolVersion=0.7.4 +CPVersion=1.9.9 +AuditToolVersion=1.4.0 +DOIPVersion=1.5.0 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..62f495d --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/grepcp.list b/grepcp.list new file mode 100644 index 0000000..2d942d4 --- /dev/null +++ b/grepcp.list @@ -0,0 +1,18 @@ +yjs.jar +checker-qual-3.31.0.jar +common-1.7.9.jar +cp-1.9.9.jar +delta-crdts-1.2.0.jar +doip-audit-tool-1.4.0.jar +doip-encrypt-tool-0.1.0.jar +doip-sdk-1.5.0.jar +gson-2.10.1.jar +irp-sdk-1.1.6.jar +mysql-connector-j-8.0.33.jar +netty-buffer-4.1.86.Final.jar +netty-codec-4.1.86.Final.jar +netty-common-4.1.86.Final.jar +netty-resolver-4.1.86.Final.jar +netty-transport-4.1.86.Final.jar +postgresql-42.6.0.jar +protobuf-java-3.21.9.jar \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 03b5fb8..80286fa 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,2 @@ rootProject.name = 'ControlProxy' -include 'backend' +include 'control-proxy-backend'