mirror of
https://github.com/openharmony/developtools_global_resource_tool.git
synced 2026-07-21 06:55:24 -04:00
增量编译场景下,针对占用的目录删除不了时,继续编译。
Signed-off-by: fangyunzhong <fangyunzhong2@huawei.com>
This commit is contained in:
+6
-1
@@ -280,7 +280,12 @@ bool FileEntry::IsIgnore(const string &filename) const
|
|||||||
bool FileEntry::RemoveAllDirInner(const FileEntry &entry)
|
bool FileEntry::RemoveAllDirInner(const FileEntry &entry)
|
||||||
{
|
{
|
||||||
if (entry.IsFile()) {
|
if (entry.IsFile()) {
|
||||||
return remove(entry.GetFilePath().GetPath().c_str()) == 0;
|
bool result = remove(entry.GetFilePath().GetPath().c_str()) == 0;
|
||||||
|
if (!result) {
|
||||||
|
cerr << "Error: " << entry.GetFilePath().GetPath() << "remove fail !" << endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto &iter : entry.GetChilds()) {
|
for (const auto &iter : entry.GetChilds()) {
|
||||||
|
|||||||
@@ -125,6 +125,7 @@ uint32_t ResourcePack::InitOutput() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool forceWrite = packageParser_.GetForceWrite();
|
bool forceWrite = packageParser_.GetForceWrite();
|
||||||
|
bool combine = packageParser_.GetCombine();
|
||||||
string output = packageParser_.GetOutput();
|
string output = packageParser_.GetOutput();
|
||||||
string resourcesPath = FileEntry::FilePath(output).Append(RESOURCES_DIR).GetPath();
|
string resourcesPath = FileEntry::FilePath(output).Append(RESOURCES_DIR).GetPath();
|
||||||
if (ResourceUtil::FileExist(resourcesPath)) {
|
if (ResourceUtil::FileExist(resourcesPath)) {
|
||||||
@@ -134,7 +135,7 @@ uint32_t ResourcePack::InitOutput() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!ResourceUtil::RmoveAllDir(resourcesPath)) {
|
if (!ResourceUtil::RmoveAllDir(resourcesPath)) {
|
||||||
return RESTOOL_ERROR;
|
return combine ? RESTOOL_SUCCESS : RESTOOL_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return RESTOOL_SUCCESS;
|
return RESTOOL_SUCCESS;
|
||||||
|
|||||||
Reference in New Issue
Block a user