mirror of
https://github.com/openharmony/developtools_global_resource_tool.git
synced 2026-07-21 06:55:24 -04:00
回退 'Pull Request !170 : 资源编译优化'
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <mutex>
|
||||
#include "restool_errors.h"
|
||||
|
||||
namespace OHOS {
|
||||
@@ -555,13 +556,9 @@ bool CompressionParser::CopyAndTranscode(const string &src, string &dst, const b
|
||||
string endStr = dst.substr(startIndex, index - startIndex);
|
||||
string output = outPath_ + SEPARATOR_FILE + CACHES_DIR + endStr;
|
||||
string originDst = dst;
|
||||
{
|
||||
// lock for multi-thread create the same dirs
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
if (!ResourceUtil::CreateDirs(output)) {
|
||||
cerr << "Error: create output dir failed. dir = " << output << endl;
|
||||
return false;
|
||||
}
|
||||
if (!ResourceUtil::CreateDirs(output)) {
|
||||
cerr << "Error: create output dir failed. dir = " << output << endl;
|
||||
return false;
|
||||
}
|
||||
for (const auto &compressFilter : compressFilters_) {
|
||||
if (!CheckAndTranscode(src, dst, output, compressFilter, extAppend)) {
|
||||
|
||||
Reference in New Issue
Block a user