mirror of
https://github.com/openharmony/developtools_global_resource_tool.git
synced 2026-07-18 17:24:42 -04:00
+1
-1
@@ -105,7 +105,7 @@ restool -i out1 -i out2 -o out -p com.ohos.demo -r out/ResourceTable.txt -j entr
|
||||
|
||||
生成id_defined.json文件:
|
||||
```
|
||||
restool -i entry/src/main -j entry/src/main/module.json -p com.ohos.demo -o out -r out/ResourceTable.txt --ids out/id_defined.json -f
|
||||
restool -i entry/src/main -j entry/src/main/module.json -p com.ohos.demo -o out -r out/ResourceTable.txt --ids out -f
|
||||
```
|
||||
|
||||
指定资源ID固定的id_defined.json文件:
|
||||
|
||||
@@ -40,7 +40,7 @@ const static std::string LONG_PATH_HEAD = "\\\\?\\";
|
||||
const static std::string ID_DEFINED_INDENTATION = " ";
|
||||
const static int32_t VERSION_MAX_LEN = 128;
|
||||
const static int32_t INT_TO_BYTES = sizeof(uint32_t);
|
||||
static const int8_t RESTOOL_VERSION[VERSION_MAX_LEN] = { "Restool 4.104" };
|
||||
static const int8_t RESTOOL_VERSION[VERSION_MAX_LEN] = { "Restool 4.105" };
|
||||
const static int32_t TAG_LEN = 4;
|
||||
|
||||
enum class KeyType {
|
||||
|
||||
+10
-2
@@ -394,9 +394,17 @@ bool IdWorker::PushResourceId(const ResourceId &resourceId, bool isSystem)
|
||||
return false;
|
||||
}
|
||||
if (isSystem) {
|
||||
sysDefinedIds_.emplace(make_pair(resType, resourceId.name), resourceId);
|
||||
auto ret1 = sysDefinedIds_.emplace(make_pair(resType, resourceId.name), resourceId);
|
||||
if (!ret1.second) {
|
||||
cerr << "Error: the same type of '" << resourceId.name << "' exists in the id_defined.json. " << endl;
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
appDefinedIds_.emplace(make_pair(resType, resourceId.name), resourceId);
|
||||
auto ret2 = appDefinedIds_.emplace(make_pair(resType, resourceId.name), resourceId);
|
||||
if (!ret2.second) {
|
||||
cerr << "Error: the same type of '" << resourceId.name << "' exists in the id_defined.json. " << endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user