From 519d4866ab93149aff725ff977eb2ce49dc24bf0 Mon Sep 17 00:00:00 2001 From: CaiHQ Date: Thu, 21 Apr 2022 00:50:40 +0800 Subject: [PATCH] feat: grep jars within cp --- README.md | 5 ++- backend/build.gradle | 32 +++++++++--------- backend/buildlibs/simple-ypk-packer-0.3.0.jar | Bin 0 -> 6445 bytes backend/grepcp.list | 3 ++ 4 files changed, 21 insertions(+), 19 deletions(-) create mode 100644 backend/buildlibs/simple-ypk-packer-0.3.0.jar create mode 100644 backend/grepcp.list 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 0000000000000000000000000000000000000000..ea9fb086814c55d106f12f1833fb0dc6d572b94f GIT binary patch literal 6445 zcma)A1yq#nwkD)O5C#|+Nj^N0$Fbxe3*C?@% zb1tkdts?zGc8C9c)dzREJ;eOK7W{J!*1v0vOk52irvF$<@YhlkL#UyhDfGV}m<0WV zw8#hur6>ppRDTbVF?2ChHZ@^2wlQ>aN>{N~CQt`@E5yQrOh1P=SSWhPI9>@&)f%#)fMJTsXB!K}B1^Zc*YX_tktIMdfUJm#+4=hmC1 z1b^P{;v#&i+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4>qm4gZP{6{FgKLE90;B z&L51LsQ=9P+r0dh@7J082Or?>{Qhx=|DM3VGX8p#|6s%;{F{3XmPNVSI06FZ-6#L< KU*bq~|Lb34Lq$FS literal 0 HcmV?d00001 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