Browse Source

Projucer: Made the "Custom Launch Storyboard" setting in the iOS exporter take a path to the .storyboard file to be used relative to the project root folder and add this file as an Xcode resource directly

tags/2021-05-28
ed 6 years ago
parent
commit
2fd7c587ad
1 changed files with 23 additions and 9 deletions
  1. +23
    -9
      extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h

+ 23
- 9
extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h View File

@@ -217,9 +217,9 @@ public:
"a launch storyboard from being used."); "a launch storyboard from being used.");
props.add (new TextPropertyComponent (customLaunchStoryboardValue, "Custom Launch Storyboard", 256, false), props.add (new TextPropertyComponent (customLaunchStoryboardValue, "Custom Launch Storyboard", 256, false),
"If this field is not empty then the specified launch storyboard will be used for the app's launch screen, "
"otherwise a default blank launch storyboard will be generated. This should be the filename without the "
"\".storyboard\" extension and the file should be added to the project's Xcode resources.");
"If this field is not empty then the specified launch storyboard file will be added to the project as an Xcode "
"resource and will be used for the app's launch screen, otherwise a default blank launch storyboard will be used. "
"The file path should be relative to the project folder.");
} }
props.add (new TextPropertyComponent (customXcodeResourceFoldersValue, "Custom Xcode Resource Folders", 8192, true), props.add (new TextPropertyComponent (customXcodeResourceFoldersValue, "Custom Xcode Resource Folders", 8192, true),
@@ -1442,7 +1442,8 @@ public:
{ {
auto customStoryboard = owner.getCustomLaunchStoryboardString(); auto customStoryboard = owner.getCustomLaunchStoryboardString();
addPlistDictionaryKey (dict, "UILaunchStoryboardName", customStoryboard.isNotEmpty() ? customStoryboard
addPlistDictionaryKey (dict, "UILaunchStoryboardName", customStoryboard.isNotEmpty() ? customStoryboard.fromLastOccurrenceOf ("/", false, false)
.upToLastOccurrenceOf (".storyboard", false, false)
: owner.getDefaultLaunchStoryboardName()); : owner.getDefaultLaunchStoryboardName());
} }
} }
@@ -1911,8 +1912,17 @@ private:
{ {
addXcassets(); addXcassets();
if (getCustomXcassetsFolderString().isEmpty() && getCustomLaunchStoryboardString().isEmpty())
writeDefaultLaunchStoryboardFile();
if (getCustomXcassetsFolderString().isEmpty())
{
auto customLaunchStoryboard = getCustomLaunchStoryboardString();
if (customLaunchStoryboard.isEmpty())
writeDefaultLaunchStoryboardFile();
else if (getProject().getProjectFolder().getChildFile (customLaunchStoryboard).existsAsFile())
addLaunchStoryboardFileReference (RelativePath (customLaunchStoryboard, RelativePath::projectFolder)
.rebased (getProject().getProjectFolder(), getTargetFolder(), RelativePath::buildTargetFolder)
.toUnixStyle());
}
} }
else else
{ {
@@ -3515,9 +3525,13 @@ private:
overwriteFileIfDifferentOrThrow (storyboardFile, mo); overwriteFileIfDifferentOrThrow (storyboardFile, mo);
auto path = RelativePath (storyboardFile, getTargetFolder(), RelativePath::buildTargetFolder).toUnixStyle();
auto refID = addFileReference (path);
auto fileID = addBuildFile (path, refID, false, false);
addLaunchStoryboardFileReference (RelativePath (storyboardFile, getTargetFolder(), RelativePath::buildTargetFolder).toUnixStyle());
}
void addLaunchStoryboardFileReference (const String& relativePath) const
{
auto refID = addFileReference (relativePath);
auto fileID = addBuildFile (relativePath, refID, false, false);
resourceIDs.add (fileID); resourceIDs.add (fileID);
resourceFileRefs.add (refID); resourceFileRefs.add (refID);


Loading…
Cancel
Save