diff --git a/README.md b/README.md index 7fcf942..aeefeb6 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,12 @@ #### 介绍 idea开发合约的示例。 -#### 软件架构 -软件架构说明 - #### 配置cp 的lib 做一个软链接,将cp-bundle的build/output 软链接到 backend/cplibs。 +#### 配置grepcp.list +用于手动指定不打包的jar。 格式为每行一个jar名。 #### 前端sdk说明 diff --git a/backend/build.gradle b/backend/build.gradle index ac97704..4630380 100644 --- a/backend/build.gradle +++ b/backend/build.gradle @@ -1,9 +1,8 @@ buildscript { dependencies { - classpath files("buildlibs/simpleypkpacker.jar") + classpath files("buildlibs/simple-ypk-packer-0.3.0.jar") } } - plugins { id 'java' id 'java-library' @@ -34,8 +33,8 @@ sourceSets { } dependencies { - api 'org.apache.logging.log4j:log4j-core:2.14.1' - api 'org.apache.logging.log4j:log4j-api:2.14.1' + api 'org.apache.logging.log4j:log4j-core:2.17.2' + api 'org.apache.logging.log4j:log4j-api:2.17.2' implementation fileTree(dir: 'cplibs', include: '*.jar') implementation fileTree(dir: 'cplibs/lib/', include: '*.jar') testImplementation 'junit:junit:4.13.2' @@ -59,24 +58,25 @@ task copyAssets(type: Copy) { from "../front" 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"]) { - from "./build/libs/$project.name-${project.version}-all.jar" +task copyJar(type: Copy, dependsOn: [":backend:jar", ":backend:copyLibs"]) { + from "./build/libs/$project.name-${project.version}.jar" into "./build/output" rename { String fileName -> "sc-example.jar" } doFirst { println "copyJar start" } } +def reltivePath = "./backend" +//reltivePath="." +def currVersion = "0.1.0" +task grepCP (dependsOn:["copyJar"]){ + doLast { + org.bdware.datanet.YPKPacker.grepCPLibWithFilter("${reltivePath}/cplibs/libs","${reltivePath}/build/output/libs","${reltivePath}/grepcp.list") + } +} -task buildZip(type: Zip, dependsOn: ["copyAssets", "copyJar", "copyYJS"]) { +task buildZip(type: Zip, dependsOn: ["copyAssets", "copyJar", "copyYJS","grepCP"]) { from './build/output/' duplicatesStrategy = DuplicatesStrategy.INCLUDE archiveFileName = 'contractexample.zip' @@ -85,6 +85,6 @@ task buildZip(type: Zip, dependsOn: ["copyAssets", "copyJar", "copyYJS"]) { task buildYPK(dependsOn: ["buildZip"]) { doLast { - org.bdware.datanet.YPKPacker.staticPack("./backend/build/contractexample.zip", "./backend/build/contractexample.ypk") + org.bdware.datanet.YPKPacker.staticPack("${reltivePath}/build/contractexample.zip", "${reltivePath}/build/contractexample-${currVersion}.ypk") } -} +} \ No newline at end of file diff --git a/backend/buildlibs/simple-ypk-packer-0.3.0.jar b/backend/buildlibs/simple-ypk-packer-0.3.0.jar new file mode 100644 index 0000000..ea9fb08 Binary files /dev/null and b/backend/buildlibs/simple-ypk-packer-0.3.0.jar differ diff --git a/backend/grepcp.list b/backend/grepcp.list new file mode 100644 index 0000000..2a31198 --- /dev/null +++ b/backend/grepcp.list @@ -0,0 +1,3 @@ +log4j-core-2.14.1.jar +log4j-api-2.14.1.jar +yjs.jar \ No newline at end of file