mirror of
https://github.com/openharmony/developtools_global_resource_tool.git
synced 2026-07-18 09:14:48 -04:00
@@ -60,6 +60,7 @@ private:
|
||||
uint32_t ParseCommand(int argc, char *argv[]);
|
||||
uint32_t CheckError(int argc, char *argv[], int c, int optIndex);
|
||||
uint32_t AddInput(const std::string &argValue);
|
||||
bool IsOverlapInput(const std::string& inputPath);
|
||||
uint32_t AddPackageName(const std::string &argValue);
|
||||
uint32_t AddOutput(const std::string &argValue);
|
||||
uint32_t AddResourceHeader(const std::string &argValue);
|
||||
@@ -111,6 +112,7 @@ private:
|
||||
std::vector<std::string> sysIdDefinedPaths_;
|
||||
std::string compressionPath_;
|
||||
size_t threadCount_{ 0 };
|
||||
bool isOverlap_{ false };
|
||||
};
|
||||
} // namespace Restool
|
||||
} // namespace Global
|
||||
|
||||
@@ -139,9 +139,7 @@ uint32_t PackageParser::AddInput(const string& argValue)
|
||||
return RESTOOL_ERROR;
|
||||
}
|
||||
|
||||
string indexPath = FileEntry::FilePath(inputPath).Append(RESOURCE_INDEX_FILE).GetPath();
|
||||
string indexPathJson = ResourceUtil::GetMainPath(inputPath).Append(RESOURCE_INDEX_FILE).GetPath();
|
||||
if (ResourceUtil::FileExist(indexPath) || ResourceUtil::FileExist(indexPathJson)) {
|
||||
if (IsOverlapInput(inputPath)) {
|
||||
inputs_.emplace(inputs_.begin(), inputPath);
|
||||
} else {
|
||||
inputs_.push_back(inputPath);
|
||||
@@ -149,6 +147,33 @@ uint32_t PackageParser::AddInput(const string& argValue)
|
||||
return RESTOOL_SUCCESS;
|
||||
}
|
||||
|
||||
bool PackageParser::IsOverlapInput(const string& inputPath)
|
||||
{
|
||||
if (isOverlap_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
string indexPath = FileEntry::FilePath(inputPath).Append(RESOURCE_INDEX_FILE).GetPath();
|
||||
if (ResourceUtil::FileExist(indexPath)) {
|
||||
isOverlap_ = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
string jsonIndexPath = ResourceUtil::GetMainPath(inputPath).Append(RESOURCE_INDEX_FILE).GetPath();
|
||||
string txtResHeaderPath = ResourceUtil::GetMainPath(inputPath).Append("ResourceTable.txt").GetPath();
|
||||
string jsResHeaderPath = ResourceUtil::GetMainPath(inputPath).Append("ResourceTable.js").GetPath();
|
||||
string hResJsHeaderPath = ResourceUtil::GetMainPath(inputPath).Append("ResourceTable.h").GetPath();
|
||||
if (ResourceUtil::FileExist(jsonIndexPath) &&
|
||||
!ResourceUtil::FileExist(txtResHeaderPath) &&
|
||||
!ResourceUtil::FileExist(jsResHeaderPath) &&
|
||||
!ResourceUtil::FileExist(hResJsHeaderPath)) {
|
||||
isOverlap_ = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32_t PackageParser::AddSysIdDefined(const std::string& argValue)
|
||||
{
|
||||
string sysIdDefinedPath = ResourceUtil::RealPath(argValue);
|
||||
@@ -481,11 +506,7 @@ const std::string &PackageParser::GetCompressionPath() const
|
||||
|
||||
bool PackageParser::IsOverlap() const
|
||||
{
|
||||
string indexPath = ResourceUtil::GetMainPath(inputs_[0]).Append(RESOURCE_INDEX_FILE).GetPath();
|
||||
if (ResourceUtil::FileExist(indexPath)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return isOverlap_;
|
||||
}
|
||||
|
||||
void PackageParser::InitCommand()
|
||||
|
||||
Reference in New Issue
Block a user