modify idgen,now any directory can be used as assets dir

This commit is contained in:
houzh 2023-03-22 03:19:18 +00:00
parent aa2c1bd866
commit 6916394e96
3 changed files with 4 additions and 7 deletions

View File

@ -12,7 +12,7 @@ endmacro()
function(CreatePAK project ResourceDIR PakPath rhpath)
add_custom_target(${project}_assets
COMMAND ${CMAKE_SOURCE_DIR}/scripts/idgen.py ${ResourceDIR} ${rhpath}
COMMAND zip -r -D -0 ${PakPath} ./
COMMAND zip -q -r -D -0 ${PakPath} ./
WORKING_DIRECTORY ${ResourceDIR}
COMMENT "Pckage Assets from ${ResourceDIR} to:${PakPath}")
add_dependencies(${project} ${project}_assets)

View File

@ -174,12 +174,9 @@ if ( __name__ == "__main__"):
idstart=10000
if len(sys.argv)<3:
print(sys.argv[0])#+'assetspath R.h_path ID.xml'
validassetsdir=['assets','res','resources']
print("arg1="+sys.argv[1])
segments=sys.argv[1].split('/')
for i in range(0,len(segments)):
if segments[i] in validassetsdir:
break
namespace=segments[i]
namespace=segments[len(segments)-2]
if sys.argv[2].find("widget/R.h")>=0 and (namespace=='gui'):
namespace='cdroid'
idstart=1000

View File

@ -383,7 +383,7 @@ ColorStateList* Assets::getColorStateList(const std::string&fullresid){
if(it->second->colors)return new ColorStateList(*it->second->colors);
else return ColorStateList::valueOf(it->second->icolor);
}
LOGV("%s not found",fullresid.c_str());
LOGV_IF(!fullresid.empty(),"%s not found",fullresid.c_str());
return nullptr;
}