var icons_found = false
- for path in app_files do
- var icon_dir = path / "ios" / "AppIcon.appiconset"
- if icon_dir.file_exists then
- icons_found = true
-
- # Prepare the `Assets.xcassets` folder
- var target_assets_dir = compile_dir / "Assets.xcassets"
- if not target_assets_dir.file_exists then target_assets_dir.mkdir
-
- """
+ # Prepare the `Assets.xcassets` folder
+ var target_assets_dir = compile_dir / "Assets.xcassets"
+ if not target_assets_dir.file_exists then target_assets_dir.mkdir
+ """
{
"info" : {
"version" : 1,
}
}""".write_to_file target_assets_dir / "Contents.json"
+ (compile_dir / "assets").mkdir
+
+ for path in app_files do
+
+ # Icon
+ var icon_dir = path / "ios" / "AppIcon.appiconset"
+ if icon_dir.file_exists then
+ icons_found = true
+
+
# copy the res folder to the compile dir
icon_dir = icon_dir.realpath
toolcontext.exec_and_check(["cp", "-R", icon_dir, target_assets_dir], "iOS project error")
end
- end
- # TODO Register asset files
+ # Assets
+ var assets_dir = path / "assets"
+ if assets_dir.file_exists then
+ assets_dir = assets_dir.realpath
+ toolcontext.exec_and_check(["cp", "-r", assets_dir, compile_dir], "iOS project error")
+ end
+ end
# ---
# project_folder.xcodeproj (projet meta data)
"""
add """
+ 0F4688411FDF8748004F34D4 /* assets in Resources */ = {isa = PBXBuildFile; fileRef = 0F4688401FDF8748004F34D4 /* assets */; };
0FDD07A21C6F8E0E006FF70E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0FDD07A11C6F8E0E006FF70E /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */
for file in files do add file.description
add """
+ 0F4688401FDF8748004F34D4 /* assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = assets; path = {{{name}}}/assets; sourceTree = SOURCE_ROOT; };
0FDD07A11C6F8E0E006FF70E /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
/* End PBXFileReference section */
AF9F83CE1A5F0D21004B62C0 /* {{{name}}} */ = {
isa = PBXGroup;
children = (
+ 0F4688401FDF8748004F34D4 /* assets */,
"""
# Reference all known files
for file in files do add """
add """
0FDD07A21C6F8E0E006FF70E /* LaunchScreen.storyboard in Resources */,
+ 0F4688411FDF8748004F34D4 /* assets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};