From 4225dc9cb98f57ffcf056838dfa6d3d9274e3122 Mon Sep 17 00:00:00 2001 From: wangdengjia Date: Tue, 13 Jul 2021 19:56:52 +0800 Subject: [PATCH] IssueNo:#I40ICI Description:add --file-path Sig:startup Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: wangdengjia --- adapter/ohos/CommandParser.java | 5 +++++ adapter/ohos/Compressor.java | 4 ++++ adapter/ohos/Utility.java | 11 +++++++++++ 3 files changed, 20 insertions(+) diff --git a/adapter/ohos/CommandParser.java b/adapter/ohos/CommandParser.java index 6b67ea53..84b84b63 100644 --- a/adapter/ohos/CommandParser.java +++ b/adapter/ohos/CommandParser.java @@ -39,6 +39,7 @@ public class CommandParser { private static final String CMD_ABILITY_SO_PATH = "--ability-so-path"; private static final String CMD_DEX_PATH = "--dex-path"; private static final String CMD_ABC_PATH = "--abc-path"; + private static final String CMD_FILE_PATH = "--file-path"; private static final String CMD_LIB_PATH = "--lib-path"; private static final String CMD_RES_PATH = "--res-path"; private static final String CMD_RESOURCES_PATH = "--resources-path"; @@ -262,6 +263,10 @@ public class CommandParser { utility.setAbcPath(value); return true; } + case CMD_FILE_PATH: { + utility.setFilePath(value); + return true; + } case CMD_LIB_PATH: { utility.setLibPath(value); return true; diff --git a/adapter/ohos/Compressor.java b/adapter/ohos/Compressor.java index 3b1487e5..7f62d361 100644 --- a/adapter/ohos/Compressor.java +++ b/adapter/ohos/Compressor.java @@ -199,6 +199,10 @@ public class Compressor { pathToFile(utility, utility.getLibPath(), LIBS_DIR_NAME, utility.isCompressNativeLibs()); } + if (!utility.getFilePath().isEmpty()) { + pathToFile(utility, utility.getFilePath(), NULL_DIR_NAME, false); + } + if (!utility.getResPath().isEmpty() && !utility.getModuleName().isEmpty()) { String resPath = ASSETS_DIR_NAME + utility.getModuleName() + LINUX_FILE_SEPARATOR + RESOURCES_DIR_NAME; diff --git a/adapter/ohos/Utility.java b/adapter/ohos/Utility.java index bf68cb22..53757469 100644 --- a/adapter/ohos/Utility.java +++ b/adapter/ohos/Utility.java @@ -72,6 +72,7 @@ public class Utility { private String entryCardPath = ""; private String packRes = ""; private String packResPath = ""; + private String filePath = ""; private List formattedSoPathList = new ArrayList<>(); private List formattedAbilitySoPathList = new ArrayList<>(); @@ -164,6 +165,16 @@ public class Utility { } } + public String getFilePath() { + return filePath; + } + + public void setFilePath(String filePath) { + if (!filePath.startsWith(CMD_PREFIX)) { + this.filePath = filePath; + } + } + public String getIndexPath() { return indexPath; } -- Gitee