Browse Source

Introjucer: made the Xcode exporter treat swift files as source code

tags/2021-05-28
jules 9 years ago
parent
commit
fd7a36a177
2 changed files with 16 additions and 14 deletions
  1. +15
    -13
      extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h
  2. +1
    -1
      extras/Introjucer/Source/Utility/jucer_RelativePath.h

+ 15
- 13
extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h View File

@@ -605,7 +605,7 @@ private:
}
addPlistDictionaryKey (dict, "CFBundleExecutable", "${EXECUTABLE_NAME}");
addPlistDictionaryKey (dict, "CFBundleIconFile", iconFile.exists() ? iconFile.getFileName() : String::empty);
addPlistDictionaryKey (dict, "CFBundleIconFile", iconFile.exists() ? iconFile.getFileName() : String());
addPlistDictionaryKey (dict, "CFBundleIdentifier", project.getBundleIdentifier().toString());
addPlistDictionaryKey (dict, "CFBundleName", projectName);
addPlistDictionaryKey (dict, "CFBundlePackageType", xcodePackageType);
@@ -617,7 +617,7 @@ private:
StringArray documentExtensions;
documentExtensions.addTokens (replacePreprocessorDefs (getAllPreprocessorDefs(), settings ["documentExtensions"]),
",", String::empty);
",", StringRef());
documentExtensions.trim();
documentExtensions.removeEmptyStrings (true);
@@ -1171,7 +1171,7 @@ private:
projectItem.shouldInhibitWarnings());
}
return String::empty;
return String();
}
void addFramework (const String& frameworkName) const
@@ -1211,17 +1211,19 @@ private:
void addMainBuildProduct() const
{
jassert (xcodeFileType.isNotEmpty());
jassert (xcodeBundleExtension.isEmpty() || xcodeBundleExtension.startsWithChar('.'));
ProjectExporter::BuildConfiguration::Ptr config = getConfiguration(0);
jassert (config != nullptr);
String productName (replacePreprocessorTokens (*config, config->getTargetBinaryNameString()));
jassert (xcodeBundleExtension.isEmpty() || xcodeBundleExtension.startsWithChar ('.'));
if (xcodeFileType == "archive.ar")
productName = getLibbedFilename (productName);
else
productName += xcodeBundleExtension;
if (ProjectExporter::BuildConfiguration::Ptr config = getConfiguration(0))
{
String productName (replacePreprocessorTokens (*config, config->getTargetBinaryNameString()));
addBuildProduct (xcodeFileType, productName);
if (xcodeFileType == "archive.ar")
productName = getLibbedFilename (productName);
else
productName += xcodeBundleExtension;
addBuildProduct (xcodeFileType, productName);
}
}
void addBuildProduct (const String& fileType, const String& binaryName) const
@@ -1495,7 +1497,7 @@ private:
bool shouldFileBeCompiledByDefault (const RelativePath& file) const override
{
return file.hasFileExtension (sourceFileExtensions);
return file.hasFileExtension (sourceFileExtensions) || file.hasFileExtension ("swift");
}
static String getOSXVersionName (int version)


+ 1
- 1
extras/Introjucer/Source/Utility/jucer_RelativePath.h View File

@@ -65,7 +65,7 @@ public:
String getFileNameWithoutExtension() const { return getFakeFile().getFileNameWithoutExtension(); }
String getFileExtension() const { return getFakeFile().getFileExtension(); }
bool hasFileExtension (const String& extension) const { return getFakeFile().hasFileExtension (extension); }
bool hasFileExtension (StringRef extension) const { return getFakeFile().hasFileExtension (extension); }
bool isAbsolute() const { return FileHelpers::isAbsolutePath (path); }
RelativePath withFileExtension (const String& extension) const


Loading…
Cancel
Save