forked from iod/ControlProxy
refactor moduleNames
This commit is contained in:
parent
b0b3274a53
commit
ac7ab72bad
34
README.md
34
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 `初始化子仓库。
|
||||
|
@ -1 +0,0 @@
|
||||
yjs.jar
|
@ -12,7 +12,7 @@ repositories {
|
||||
mavenCentral()
|
||||
|
||||
}
|
||||
project(':backend') {
|
||||
project(':control-proxy-backend') {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
|
@ -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!"
|
||||
}
|
Before Width: | Height: | Size: 352 B After Width: | Height: | Size: 352 B |
@ -1,3 +1,8 @@
|
||||
REPO_USRNAME=caihuaqian@internetapi.cn
|
||||
REPO_PASSWORD=527e259ef952a450d157fdb51ac4915154cea317
|
||||
REPO_HOST=https://gitea.internetapi.cn/
|
||||
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
|
7
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
7
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@ -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
|
18
grepcp.list
Normal file
18
grepcp.list
Normal file
@ -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
|
@ -1,2 +1,2 @@
|
||||
rootProject.name = 'ControlProxy'
|
||||
include 'backend'
|
||||
include 'control-proxy-backend'
|
||||
|
Loading…
Reference in New Issue
Block a user