aboutsummaryrefslogtreecommitdiff
path: root/devtools/create_project
diff options
context:
space:
mode:
authorVincent Bénony2016-01-06 16:19:03 +0100
committerVincent Bénony2016-01-06 16:19:03 +0100
commit64f50761ec22243fe9964271a8554c9f3356a6b5 (patch)
treec4aa7991cad01deaa5f8a7683938d4899ff450d0 /devtools/create_project
parentfae79955e5ce6e215dcf457059c5744a85c76a80 (diff)
parent3fab9056296fbf491372f66f7fbb23d6312ad2ad (diff)
downloadscummvm-rg350-64f50761ec22243fe9964271a8554c9f3356a6b5.tar.gz
scummvm-rg350-64f50761ec22243fe9964271a8554c9f3356a6b5.tar.bz2
scummvm-rg350-64f50761ec22243fe9964271a8554c9f3356a6b5.zip
IOS: Merge master
Diffstat (limited to 'devtools/create_project')
-rw-r--r--devtools/create_project/create_project.h4
-rw-r--r--devtools/create_project/xcode.cpp345
-rw-r--r--devtools/create_project/xcode.h162
3 files changed, 249 insertions, 262 deletions
diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h
index fdcc629382..fb207f3f59 100644
--- a/devtools/create_project/create_project.h
+++ b/devtools/create_project/create_project.h
@@ -23,8 +23,8 @@
#ifndef TOOLS_CREATE_PROJECT_H
#define TOOLS_CREATE_PROJECT_H
-#ifndef __has_feature // Optional of course.
- #define __has_feature(x) 0 // Compatibility with non-clang compilers.
+#ifndef __has_feature // Optional of course.
+#define __has_feature(x) 0 // Compatibility with non-clang compilers.
#endif
#include <map>
diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp
index 9fddf8af3f..5a433f1dd0 100644
--- a/devtools/create_project/xcode.cpp
+++ b/devtools/create_project/xcode.cpp
@@ -49,42 +49,42 @@ namespace CreateProjectTool {
(std::find(defines.begin(), defines.end(), name) != defines.end())
#define ADD_SETTING(config, key, value) \
- config.settings[key] = Setting(value, "", SettingsNoQuote);
+ config._settings[key] = Setting(value, "", kSettingsNoQuote);
#define ADD_SETTING_ORDER(config, key, value, order) \
config.settings[key] = Setting(value, "", SettingsNoQuote, 0, order);
#define ADD_SETTING_ORDER_NOVALUE(config, key, comment, order) \
- config.settings[key] = Setting("", comment, SettingsNoValue, 0, order);
+ config._settings[key] = Setting("", comment, kSettingsNoValue, 0, order);
#define ADD_SETTING_QUOTE(config, key, value) \
- config.settings[key] = Setting(value);
+ config._settings[key] = Setting(value);
#define ADD_SETTING_QUOTE_VAR(config, key, value) \
- config.settings[key] = Setting(value, "", SettingsQuoteVariable);
+ config._settings[key] = Setting(value, "", kSettingsQuoteVariable);
#define ADD_SETTING_LIST(config, key, values, flags, indent) \
- config.settings[key] = Setting(values, flags, indent);
+ config._settings[key] = Setting(values, flags, indent);
#define REMOVE_SETTING(config, key) \
- config.settings.erase(key);
+ config._settings.erase(key);
#define ADD_BUILD_FILE(id, name, fileRefId, comment) { \
Object *buildFile = new Object(this, id, name, "PBXBuildFile", "PBXBuildFile", comment); \
- buildFile->addProperty("fileRef", fileRefId, name, SettingsNoValue); \
+ buildFile->addProperty("fileRef", fileRefId, name, kSettingsNoValue); \
_buildFile.add(buildFile); \
- _buildFile.flags = SettingsSingleItem; \
+ _buildFile._flags = kSettingsSingleItem; \
}
#define ADD_FILE_REFERENCE(id, name, properties) { \
Object *fileRef = new Object(this, id, name, "PBXFileReference", "PBXFileReference", name); \
- if (!properties.fileEncoding.empty()) fileRef->addProperty("fileEncoding", properties.fileEncoding, "", SettingsNoValue); \
- if (!properties.lastKnownFileType.empty()) fileRef->addProperty("lastKnownFileType", properties.lastKnownFileType, "", SettingsNoValue|SettingsQuoteVariable); \
- if (!properties.fileName.empty()) fileRef->addProperty("name", properties.fileName, "", SettingsNoValue|SettingsQuoteVariable); \
- if (!properties.filePath.empty()) fileRef->addProperty("path", properties.filePath, "", SettingsNoValue|SettingsQuoteVariable); \
- if (!properties.sourceTree.empty()) fileRef->addProperty("sourceTree", properties.sourceTree, "", SettingsNoValue); \
+ if (!properties._fileEncoding.empty()) fileRef->addProperty("fileEncoding", properties._fileEncoding, "", kSettingsNoValue); \
+ if (!properties._lastKnownFileType.empty()) fileRef->addProperty("lastKnownFileType", properties._lastKnownFileType, "", kSettingsNoValue|kSettingsQuoteVariable); \
+ if (!properties._fileName.empty()) fileRef->addProperty("name", properties._fileName, "", kSettingsNoValue|kSettingsQuoteVariable); \
+ if (!properties._filePath.empty()) fileRef->addProperty("path", properties._filePath, "", kSettingsNoValue|kSettingsQuoteVariable); \
+ if (!properties._sourceTree.empty()) fileRef->addProperty("sourceTree", properties._sourceTree, "", kSettingsNoValue); \
_fileReference.add(fileRef); \
- _fileReference.flags = SettingsSingleItem; \
+ _fileReference._flags = kSettingsSingleItem; \
}
bool producesObjectFileOnOSX(const std::string &fileName) {
@@ -152,11 +152,11 @@ bool shouldSkipFileForTarget(const std::string &fileID, const std::string &targe
XcodeProvider::Group::Group(XcodeProvider *objectParent, const std::string &groupName, const std::string &uniqueName, const std::string &path) : Object(objectParent, uniqueName, groupName, "PBXGroup", "", groupName) {
bool path_is_absolute = (path.length() > 0 && path.at(0) == '/');
- addProperty("name", name, "", SettingsNoValue|SettingsQuoteVariable);
- addProperty("sourceTree", path_is_absolute ? "<absolute>" : "<group>", "", SettingsNoValue|SettingsQuoteVariable);
+ addProperty("name", _name, "", kSettingsNoValue | kSettingsQuoteVariable);
+ addProperty("sourceTree", path_is_absolute ? "<absolute>" : "<group>", "", kSettingsNoValue | kSettingsQuoteVariable);
if (path != "") {
- addProperty("path", path, "", SettingsNoValue|SettingsQuoteVariable);
+ addProperty("path", path, "", kSettingsNoValue | kSettingsQuoteVariable);
}
_childOrder = 0;
_treeName = uniqueName;
@@ -165,43 +165,43 @@ XcodeProvider::Group::Group(XcodeProvider *objectParent, const std::string &grou
void XcodeProvider::Group::ensureChildExists(const std::string &name) {
std::map<std::string, Group*>::iterator it = _childGroups.find(name);
if (it == _childGroups.end()) {
- Group *child = new Group(parent, name, this->_treeName + '/' + name, name);
+ Group *child = new Group(_parent, name, this->_treeName + '/' + name, name);
_childGroups[name] = child;
addChildGroup(child);
- parent->_groups.add(child);
+ _parent->_groups.add(child);
}
}
void XcodeProvider::Group::addChildInternal(const std::string &id, const std::string &comment) {
- if (properties.find("children") == properties.end()) {
+ if (_properties.find("children") == _properties.end()) {
Property children;
- children.hasOrder = true;
- children.flags = SettingsAsList;
- properties["children"] = children;
+ children._hasOrder = true;
+ children._flags = kSettingsAsList;
+ _properties["children"] = children;
}
- properties["children"].settings[id] = Setting("", comment + " in Sources", SettingsNoValue, 0, _childOrder++);
+ _properties["children"]._settings[id] = Setting("", comment + " in Sources", kSettingsNoValue, 0, _childOrder++);
if (_childOrder == 1) {
// Force children to use () even when there is only 1 child.
// Also this enforces the use of "," after the single item, instead of ; (see writeProperty)
- properties["children"].flags |= SettingsSingleItem;
+ _properties["children"]._flags |= kSettingsSingleItem;
} else {
- properties["children"].flags ^= SettingsSingleItem;
+ _properties["children"]._flags ^= kSettingsSingleItem;
}
}
-void XcodeProvider::Group::addChildGroup(const Group* group) {
- addChildInternal(parent->getHash(group->_treeName), group->_treeName);
+void XcodeProvider::Group::addChildGroup(const Group *group) {
+ addChildInternal(_parent->getHash(group->_treeName), group->_treeName);
}
void XcodeProvider::Group::addChildFile(const std::string &name) {
std::string id = "FileReference_" + _treeName + "/" + name;
- addChildInternal(parent->getHash(id), name);
+ addChildInternal(_parent->getHash(id), name);
FileProperty property = FileProperty(name, name, name, "\"<group>\"");
- parent->addFileReference(id, name, property);
+ _parent->addFileReference(id, name, property);
if (producesObjectFileOnOSX(name)) {
- parent->addBuildFile(_treeName + "/" + name, name, parent->getHash(id), name + " in Sources");
+ _parent->addBuildFile(_treeName + "/" + name, name, _parent->getHash(id), name + " in Sources");
}
}
@@ -210,14 +210,14 @@ void XcodeProvider::Group::addChildByHash(const std::string &hash, const std::st
}
XcodeProvider::Group *XcodeProvider::Group::getChildGroup(const std::string &name) {
- std::map<std::string, Group*>::iterator it = _childGroups.find(name);
+ std::map<std::string, Group *>::iterator it = _childGroups.find(name);
assert(it != _childGroups.end());
return it->second;
}
XcodeProvider::Group *XcodeProvider::touchGroupsForPath(const std::string &path) {
if (_rootSourceGroup == NULL) {
- assert (path == _projectRoot);
+ assert(path == _projectRoot);
_rootSourceGroup = new Group(this, "Sources", path, path);
_groups.add(_rootSourceGroup);
return _rootSourceGroup;
@@ -239,31 +239,31 @@ XcodeProvider::Group *XcodeProvider::touchGroupsForPath(const std::string &path)
void XcodeProvider::addFileReference(const std::string &id, const std::string &name, FileProperty properties) {
Object *fileRef = new Object(this, id, name, "PBXFileReference", "PBXFileReference", name);
- if (!properties.fileEncoding.empty()) fileRef->addProperty("fileEncoding", properties.fileEncoding, "", SettingsNoValue);
- if (!properties.lastKnownFileType.empty()) fileRef->addProperty("lastKnownFileType", properties.lastKnownFileType, "", SettingsNoValue|SettingsQuoteVariable);
- if (!properties.fileName.empty()) fileRef->addProperty("name", properties.fileName, "", SettingsNoValue|SettingsQuoteVariable);
- if (!properties.filePath.empty()) fileRef->addProperty("path", properties.filePath, "", SettingsNoValue|SettingsQuoteVariable);
- if (!properties.sourceTree.empty()) fileRef->addProperty("sourceTree", properties.sourceTree, "", SettingsNoValue);
+ if (!properties._fileEncoding.empty()) fileRef->addProperty("fileEncoding", properties._fileEncoding, "", kSettingsNoValue);
+ if (!properties._lastKnownFileType.empty()) fileRef->addProperty("lastKnownFileType", properties._lastKnownFileType, "", kSettingsNoValue | kSettingsQuoteVariable);
+ if (!properties._fileName.empty()) fileRef->addProperty("name", properties._fileName, "", kSettingsNoValue | kSettingsQuoteVariable);
+ if (!properties._filePath.empty()) fileRef->addProperty("path", properties._filePath, "", kSettingsNoValue | kSettingsQuoteVariable);
+ if (!properties._sourceTree.empty()) fileRef->addProperty("sourceTree", properties._sourceTree, "", kSettingsNoValue);
_fileReference.add(fileRef);
- _fileReference.flags = SettingsSingleItem;
+ _fileReference._flags = kSettingsSingleItem;
}
void XcodeProvider::addProductFileReference(const std::string &id, const std::string &name) {
Object *fileRef = new Object(this, id, name, "PBXFileReference", "PBXFileReference", name);
- fileRef->addProperty("explicitFileType", "wrapper.application", "", SettingsNoValue|SettingsQuoteVariable);
- fileRef->addProperty("includeInIndex", "0", "", SettingsNoValue);
- fileRef->addProperty("path", name, "", SettingsNoValue|SettingsQuoteVariable);
- fileRef->addProperty("sourceTree", "BUILT_PRODUCTS_DIR", "", SettingsNoValue);
+ fileRef->addProperty("explicitFileType", "wrapper.application", "", kSettingsNoValue | kSettingsQuoteVariable);
+ fileRef->addProperty("includeInIndex", "0", "", kSettingsNoValue);
+ fileRef->addProperty("path", name, "", kSettingsNoValue | kSettingsQuoteVariable);
+ fileRef->addProperty("sourceTree", "BUILT_PRODUCTS_DIR", "", kSettingsNoValue);
_fileReference.add(fileRef);
- _fileReference.flags = SettingsSingleItem;
+ _fileReference._flags = kSettingsSingleItem;
}
void XcodeProvider::addBuildFile(const std::string &id, const std::string &name, const std::string &fileRefId, const std::string &comment) {
Object *buildFile = new Object(this, id, name, "PBXBuildFile", "PBXBuildFile", comment);
- buildFile->addProperty("fileRef", fileRefId, name, SettingsNoValue);
+ buildFile->addProperty("fileRef", fileRefId, name, kSettingsNoValue);
_buildFile.add(buildFile);
- _buildFile.flags = SettingsSingleItem;
+ _buildFile._flags = kSettingsSingleItem;
}
XcodeProvider::XcodeProvider(StringList &global_warnings, std::map<std::string, StringList> &project_warnings, const int version)
@@ -289,7 +289,7 @@ void XcodeProvider::createWorkspace(const BuildSetup &setup) {
createDirectory(workspace);
_projectRoot = setup.srcDir;
touchGroupsForPath(_projectRoot);
-
+
// Setup global objects
setupDefines(setup);
_targets.push_back(PROJECT_DESCRIPTION "-iOS");
@@ -341,10 +341,10 @@ void XcodeProvider::ouputMainProjectFile(const BuildSetup &setup) {
// Header
project << "// !$*UTF8*$!\n"
"{\n"
- "\t" << writeSetting("archiveVersion", "1", "", SettingsNoQuote) << ";\n"
+ "\t" << writeSetting("archiveVersion", "1", "", kSettingsNoQuote) << ";\n"
"\tclasses = {\n"
"\t};\n"
- "\t" << writeSetting("objectVersion", "46", "", SettingsNoQuote) << ";\n"
+ "\t" << writeSetting("objectVersion", "46", "", kSettingsNoQuote) << ";\n"
"\tobjects = {\n";
//////////////////////////////////////////////////////////////////////////
@@ -364,7 +364,7 @@ void XcodeProvider::ouputMainProjectFile(const BuildSetup &setup) {
//////////////////////////////////////////////////////////////////////////
// Footer
project << "\t};\n"
- "\t" << writeSetting("rootObject", getHash("PBXProject"), "Project object", SettingsNoQuote) << ";\n"
+ "\t" << writeSetting("rootObject", getHash("PBXProject"), "Project object", kSettingsNoQuote) << ";\n"
"}\n";
}
@@ -416,14 +416,14 @@ void XcodeProvider::setupCopyFilesBuildPhase() {
* (each native target has different build rules)
*/
void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) {
- _frameworksBuildPhase.comment = "PBXFrameworksBuildPhase";
+ _frameworksBuildPhase._comment = "PBXFrameworksBuildPhase";
// Just use a hardcoded id for the Frameworks-group
Group *frameworksGroup = new Group(this, "Frameworks", "PBXGroup_CustomTemplate_Frameworks_", "");
Property children;
- children.hasOrder = true;
- children.flags = SettingsAsList;
+ children._hasOrder = true;
+ children._flags = kSettingsAsList;
// Setup framework file properties
std::map<std::string, FileProperty> properties;
@@ -476,7 +476,7 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) {
DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libfluidsynth.a", "libfluidsynth", true);
DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libglib.a", "libglib", true);
- frameworksGroup->properties["children"] = children;
+ frameworksGroup->_properties["children"] = children;
_groups.add(frameworksGroup);
// Force this to be added as a sub-group in the root.
_rootSourceGroup->addChildGroup(frameworksGroup);
@@ -489,13 +489,13 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) {
// ScummVM-iOS
Object *framework_iPhone = new Object(this, "PBXFrameworksBuildPhase_" + _targets[IOS_TARGET], "PBXFrameworksBuildPhase", "PBXFrameworksBuildPhase", "", "Frameworks");
- framework_iPhone->addProperty("buildActionMask", "2147483647", "", SettingsNoValue);
- framework_iPhone->addProperty("runOnlyForDeploymentPostprocessing", "0", "", SettingsNoValue);
+ framework_iPhone->addProperty("buildActionMask", "2147483647", "", kSettingsNoValue);
+ framework_iPhone->addProperty("runOnlyForDeploymentPostprocessing", "0", "", kSettingsNoValue);
// List of frameworks
Property iOS_files;
- iOS_files.hasOrder = true;
- iOS_files.flags = SettingsAsList;
+ iOS_files._hasOrder = true;
+ iOS_files._flags = kSettingsAsList;
ValueList frameworks_iOS;
frameworks_iOS.push_back("CoreAudio.framework");
@@ -539,7 +539,7 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) {
ADD_FILE_REFERENCE(*framework, *framework, properties[*framework]);
}
- framework_iPhone->properties["files"] = iOS_files;
+ framework_iPhone->_properties["files"] = iOS_files;
_frameworksBuildPhase.add(framework_iPhone);
@@ -547,13 +547,13 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) {
// ScummVM-OS X
Object *framework_OSX = new Object(this, "PBXFrameworksBuildPhase_" + _targets[OSX_TARGET], "PBXFrameworksBuildPhase", "PBXFrameworksBuildPhase", "", "Frameworks");
- framework_OSX->addProperty("buildActionMask", "2147483647", "", SettingsNoValue);
- framework_OSX->addProperty("runOnlyForDeploymentPostprocessing", "0", "", SettingsNoValue);
+ framework_OSX->addProperty("buildActionMask", "2147483647", "", kSettingsNoValue);
+ framework_OSX->addProperty("runOnlyForDeploymentPostprocessing", "0", "", kSettingsNoValue);
// List of frameworks
Property osx_files;
- osx_files.hasOrder = true;
- osx_files.flags = SettingsAsList;
+ osx_files._hasOrder = true;
+ osx_files._flags = kSettingsAsList;
ValueList frameworks_osx;
frameworks_osx.push_back("CoreFoundation.framework");
@@ -581,13 +581,13 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) {
ADD_FILE_REFERENCE(*framework, *framework, properties[*framework]);
}
- framework_OSX->properties["files"] = osx_files;
+ framework_OSX->_properties["files"] = osx_files;
_frameworksBuildPhase.add(framework_OSX);
}
void XcodeProvider::setupNativeTarget() {
- _nativeTarget.comment = "PBXNativeTarget";
+ _nativeTarget._comment = "PBXNativeTarget";
// Just use a hardcoded id for the Products-group
Group *productsGroup = new Group(this, "Products", "PBXGroup_CustomTemplate_Products_" , "");
@@ -595,26 +595,26 @@ void XcodeProvider::setupNativeTarget() {
for (unsigned int i = 0; i < _targets.size(); i++) {
Object *target = new Object(this, "PBXNativeTarget_" + _targets[i], "PBXNativeTarget", "PBXNativeTarget", "", _targets[i]);
- target->addProperty("buildConfigurationList", getHash("XCConfigurationList_" + _targets[i]), "Build configuration list for PBXNativeTarget \"" + _targets[i] + "\"", SettingsNoValue);
+ target->addProperty("buildConfigurationList", getHash("XCConfigurationList_" + _targets[i]), "Build configuration list for PBXNativeTarget \"" + _targets[i] + "\"", kSettingsNoValue);
Property buildPhases;
- buildPhases.hasOrder = true;
- buildPhases.flags = SettingsAsList;
- buildPhases.settings[getHash("PBXResourcesBuildPhase_" + _targets[i])] = Setting("", "Resources", SettingsNoValue, 0, 0);
- buildPhases.settings[getHash("PBXSourcesBuildPhase_" + _targets[i])] = Setting("", "Sources", SettingsNoValue, 0, 1);
- buildPhases.settings[getHash("PBXFrameworksBuildPhase_" + _targets[i])] = Setting("", "Frameworks", SettingsNoValue, 0, 2);
- target->properties["buildPhases"] = buildPhases;
+ buildPhases._hasOrder = true;
+ buildPhases._flags = kSettingsAsList;
+ buildPhases._settings[getHash("PBXResourcesBuildPhase_" + _targets[i])] = Setting("", "Resources", kSettingsNoValue, 0, 0);
+ buildPhases._settings[getHash("PBXSourcesBuildPhase_" + _targets[i])] = Setting("", "Sources", kSettingsNoValue, 0, 1);
+ buildPhases._settings[getHash("PBXFrameworksBuildPhase_" + _targets[i])] = Setting("", "Frameworks", kSettingsNoValue, 0, 2);
+ target->_properties["buildPhases"] = buildPhases;
- target->addProperty("buildRules", "", "", SettingsNoValue|SettingsAsList);
+ target->addProperty("buildRules", "", "", kSettingsNoValue | kSettingsAsList);
- target->addProperty("dependencies", "", "", SettingsNoValue|SettingsAsList);
+ target->addProperty("dependencies", "", "", kSettingsNoValue | kSettingsAsList);
- target->addProperty("name", _targets[i], "", SettingsNoValue|SettingsQuoteVariable);
- target->addProperty("productName", PROJECT_NAME, "", SettingsNoValue);
+ target->addProperty("name", _targets[i], "", kSettingsNoValue | kSettingsQuoteVariable);
+ target->addProperty("productName", PROJECT_NAME, "", kSettingsNoValue);
addProductFileReference("PBXFileReference_" PROJECT_DESCRIPTION ".app_" + _targets[i], PROJECT_DESCRIPTION ".app");
productsGroup->addChildByHash(getHash("PBXFileReference_" PROJECT_DESCRIPTION ".app_" + _targets[i]), PROJECT_DESCRIPTION ".app");
- target->addProperty("productReference", getHash("PBXFileReference_" PROJECT_DESCRIPTION ".app_" + _targets[i]), PROJECT_DESCRIPTION ".app", SettingsNoValue);
- target->addProperty("productType", "com.apple.product-type.application", "", SettingsNoValue|SettingsQuoteVariable);
+ target->addProperty("productReference", getHash("PBXFileReference_" PROJECT_DESCRIPTION ".app_" + _targets[i]), PROJECT_DESCRIPTION ".app", kSettingsNoValue);
+ target->addProperty("productType", "com.apple.product-type.application", "", kSettingsNoValue | kSettingsQuoteVariable);
_nativeTarget.add(target);
}
@@ -623,38 +623,38 @@ void XcodeProvider::setupNativeTarget() {
}
void XcodeProvider::setupProject() {
- _project.comment = "PBXProject";
+ _project._comment = "PBXProject";
Object *project = new Object(this, "PBXProject", "PBXProject", "PBXProject", "", "Project object");
- project->addProperty("buildConfigurationList", getHash("XCConfigurationList_scummvm"), "Build configuration list for PBXProject \"" PROJECT_NAME "\"", SettingsNoValue);
- project->addProperty("compatibilityVersion", "Xcode 3.2", "", SettingsNoValue|SettingsQuoteVariable);
- project->addProperty("developmentRegion", "English", "", SettingsNoValue);
- project->addProperty("hasScannedForEncodings", "1", "", SettingsNoValue);
+ project->addProperty("buildConfigurationList", getHash("XCConfigurationList_scummvm"), "Build configuration list for PBXProject \"" PROJECT_NAME "\"", kSettingsNoValue);
+ project->addProperty("compatibilityVersion", "Xcode 3.2", "", kSettingsNoValue | kSettingsQuoteVariable);
+ project->addProperty("developmentRegion", "English", "", kSettingsNoValue);
+ project->addProperty("hasScannedForEncodings", "1", "", kSettingsNoValue);
// List of known regions
Property regions;
- regions.flags = SettingsAsList;
+ regions._flags = kSettingsAsList;
ADD_SETTING_ORDER_NOVALUE(regions, "English", "", 0);
ADD_SETTING_ORDER_NOVALUE(regions, "Japanese", "", 1);
ADD_SETTING_ORDER_NOVALUE(regions, "French", "", 2);
ADD_SETTING_ORDER_NOVALUE(regions, "German", "", 3);
- project->properties["knownRegions"] = regions;
+ project->_properties["knownRegions"] = regions;
- project->addProperty("mainGroup", _rootSourceGroup->getHashRef(), "CustomTemplate", SettingsNoValue);
- project->addProperty("productRefGroup", getHash("PBXGroup_CustomTemplate_Products_"), "" , SettingsNoValue);
- project->addProperty("projectDirPath", _projectRoot, "", SettingsNoValue|SettingsQuoteVariable);
- project->addProperty("projectRoot", "", "", SettingsNoValue|SettingsQuoteVariable);
+ project->addProperty("mainGroup", _rootSourceGroup->getHashRef(), "CustomTemplate", kSettingsNoValue);
+ project->addProperty("productRefGroup", getHash("PBXGroup_CustomTemplate_Products_"), "" , kSettingsNoValue);
+ project->addProperty("projectDirPath", _projectRoot, "", kSettingsNoValue | kSettingsQuoteVariable);
+ project->addProperty("projectRoot", "", "", kSettingsNoValue | kSettingsQuoteVariable);
// List of targets
Property targets;
- targets.flags = SettingsAsList;
- targets.settings[getHash("PBXNativeTarget_" + _targets[IOS_TARGET])] = Setting("", _targets[IOS_TARGET], SettingsNoValue, 0, 0);
- targets.settings[getHash("PBXNativeTarget_" + _targets[OSX_TARGET])] = Setting("", _targets[OSX_TARGET], SettingsNoValue, 0, 1);
- project->properties["targets"] = targets;
+ targets._flags = kSettingsAsList;
+ targets._settings[getHash("PBXNativeTarget_" + _targets[IOS_TARGET])] = Setting("", _targets[IOS_TARGET], kSettingsNoValue, 0, 0);
+ targets._settings[getHash("PBXNativeTarget_" + _targets[OSX_TARGET])] = Setting("", _targets[OSX_TARGET], kSettingsNoValue, 0, 1);
+ project->_properties["targets"] = targets;
// Force list even when there is only a single target
- project->properties["targets"].flags |= SettingsSingleItem;
+ project->_properties["targets"]._flags |= kSettingsSingleItem;
_project.add(project);
}
@@ -684,7 +684,7 @@ XcodeProvider::ValueList& XcodeProvider::getResourceFiles() const {
}
void XcodeProvider::setupResourcesBuildPhase() {
- _resourcesBuildPhase.comment = "PBXResourcesBuildPhase";
+ _resourcesBuildPhase._comment = "PBXResourcesBuildPhase";
ValueList &files_list = getResourceFiles();
@@ -692,12 +692,12 @@ void XcodeProvider::setupResourcesBuildPhase() {
for (unsigned int i = 0; i < _targets.size(); i++) {
Object *resource = new Object(this, "PBXResourcesBuildPhase_" + _targets[i], "PBXResourcesBuildPhase", "PBXResourcesBuildPhase", "", "Resources");
- resource->addProperty("buildActionMask", "2147483647", "", SettingsNoValue);
+ resource->addProperty("buildActionMask", "2147483647", "", kSettingsNoValue);
// Add default files
Property files;
- files.hasOrder = true;
- files.flags = SettingsAsList;
+ files._hasOrder = true;
+ files._flags = kSettingsAsList;
int order = 0;
for (ValueList::iterator file = files_list.begin(); file != files_list.end(); file++) {
@@ -712,46 +712,46 @@ void XcodeProvider::setupResourcesBuildPhase() {
ADD_SETTING_ORDER_NOVALUE(files, getHash(resourceAbsolutePath), comment, order++);
}
- resource->properties["files"] = files;
+ resource->_properties["files"] = files;
- resource->addProperty("runOnlyForDeploymentPostprocessing", "0", "", SettingsNoValue);
+ resource->addProperty("runOnlyForDeploymentPostprocessing", "0", "", kSettingsNoValue);
_resourcesBuildPhase.add(resource);
}
}
void XcodeProvider::setupSourcesBuildPhase() {
- _sourcesBuildPhase.comment = "PBXSourcesBuildPhase";
+ _sourcesBuildPhase._comment = "PBXSourcesBuildPhase";
// Same as for containers: a rule for each native target
for (unsigned int i = 0; i < _targets.size(); i++) {
const std::string &targetName = _targets[i];
Object *source = new Object(this, "PBXSourcesBuildPhase_" + _targets[i], "PBXSourcesBuildPhase", "PBXSourcesBuildPhase", "", "Sources");
- source->addProperty("buildActionMask", "2147483647", "", SettingsNoValue);
+ source->addProperty("buildActionMask", "2147483647", "", kSettingsNoValue);
Property files;
- files.hasOrder = true;
- files.flags = SettingsAsList;
+ files._hasOrder = true;
+ files._flags = kSettingsAsList;
int order = 0;
- for (std::vector<Object*>::iterator file = _buildFile.objects.begin(); file !=_buildFile.objects.end(); ++file) {
- const std::string &fileName = (*file)->name;
- if (shouldSkipFileForTarget((*file)->id, targetName, fileName)) {
+ for (std::vector<Object *>::iterator file = _buildFile._objects.begin(); file != _buildFile._objects.end(); ++file) {
+ const std::string &fileName = (*file)->_name;
+ if (shouldSkipFileForTarget((*file)->_id, targetName, fileName)) {
continue;
}
if (!producesObjectFileOnOSX(fileName)) {
continue;
}
std::string comment = fileName + " in Sources";
- ADD_SETTING_ORDER_NOVALUE(files, getHash((*file)->id), comment, order++);
+ ADD_SETTING_ORDER_NOVALUE(files, getHash((*file)->_id), comment, order++);
}
setupAdditionalSources(targetName, files, order);
- source->properties["files"] = files;
+ source->_properties["files"] = files;
- source->addProperty("runOnlyForDeploymentPostprocessing", "0", "", SettingsNoValue);
+ source->addProperty("runOnlyForDeploymentPostprocessing", "0", "", kSettingsNoValue);
_sourcesBuildPhase.add(source);
}
@@ -760,8 +760,8 @@ void XcodeProvider::setupSourcesBuildPhase() {
// Setup all build configurations
void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
- _buildConfiguration.comment = "XCBuildConfiguration";
- _buildConfiguration.flags = SettingsAsList;
+ _buildConfiguration._comment = "XCBuildConfiguration";
+ _buildConfiguration._flags = kSettingsAsList;
std::string projectOutputDirectory;
#ifdef POSIX
@@ -792,7 +792,7 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
REMOVE_DEFINE(scummvm_defines, "IPHONE");
REMOVE_DEFINE(scummvm_defines, "IPHONE_OFFICIAL");
REMOVE_DEFINE(scummvm_defines, "SDL_BACKEND");
- ADD_SETTING_LIST(scummvm_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, SettingsNoQuote|SettingsAsList, 5);
+ ADD_SETTING_LIST(scummvm_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, kSettingsNoQuote | kSettingsAsList, 5);
ADD_SETTING(scummvm_Debug, "GCC_THUMB_SUPPORT", "NO");
ADD_SETTING(scummvm_Debug, "GCC_USE_GCC3_PFE_SUPPORT", "NO");
ADD_SETTING(scummvm_Debug, "GCC_WARN_ABOUT_RETURN_TYPE", "YES");
@@ -801,7 +801,7 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
scummvm_HeaderPaths.push_back("include/");
scummvm_HeaderPaths.push_back("$(SRCROOT)/engines/");
scummvm_HeaderPaths.push_back("$(SRCROOT)");
- ADD_SETTING_LIST(scummvm_Debug, "HEADER_SEARCH_PATHS", scummvm_HeaderPaths, SettingsQuoteVariable|SettingsAsList, 5);
+ ADD_SETTING_LIST(scummvm_Debug, "HEADER_SEARCH_PATHS", scummvm_HeaderPaths, kSettingsQuoteVariable | kSettingsAsList, 5);
ADD_SETTING_QUOTE(scummvm_Debug, "LIBRARY_SEARCH_PATHS", "");
ADD_SETTING(scummvm_Debug, "ONLY_ACTIVE_ARCH", "YES");
ADD_SETTING_QUOTE(scummvm_Debug, "OTHER_CFLAGS", "");
@@ -809,8 +809,8 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
ADD_SETTING(scummvm_Debug, "PREBINDING", "NO");
ADD_SETTING(scummvm_Debug, "ENABLE_TESTABILITY", "YES");
- scummvm_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue);
- scummvm_Debug_Object->properties["buildSettings"] = scummvm_Debug;
+ scummvm_Debug_Object->addProperty("name", "Debug", "", kSettingsNoValue);
+ scummvm_Debug_Object->_properties["buildSettings"] = scummvm_Debug;
// Release
Object *scummvm_Release_Object = new Object(this, "XCBuildConfiguration_" PROJECT_NAME "_Release", PROJECT_NAME, "XCBuildConfiguration", "PBXProject", "Release");
@@ -821,8 +821,8 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
REMOVE_SETTING(scummvm_Release, "ONLY_ACTIVE_ARCH");
REMOVE_SETTING(scummvm_Release, "ENABLE_TESTABILITY");
- scummvm_Release_Object->addProperty("name", "Release", "", SettingsNoValue);
- scummvm_Release_Object->properties["buildSettings"] = scummvm_Release;
+ scummvm_Release_Object->addProperty("name", "Release", "", kSettingsNoValue);
+ scummvm_Release_Object->_properties["buildSettings"] = scummvm_Release;
_buildConfiguration.add(scummvm_Debug_Object);
_buildConfiguration.add(scummvm_Release_Object);
@@ -842,7 +842,7 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
ValueList iPhone_FrameworkSearchPaths;
iPhone_FrameworkSearchPaths.push_back("$(inherited)");
iPhone_FrameworkSearchPaths.push_back("\"$(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"");
- ADD_SETTING_LIST(iPhone_Debug, "FRAMEWORK_SEARCH_PATHS", iPhone_FrameworkSearchPaths, SettingsAsList, 5);
+ ADD_SETTING_LIST(iPhone_Debug, "FRAMEWORK_SEARCH_PATHS", iPhone_FrameworkSearchPaths, kSettingsAsList, 5);
ADD_SETTING(iPhone_Debug, "GCC_DYNAMIC_NO_PIC", "NO");
ADD_SETTING(iPhone_Debug, "GCC_ENABLE_CPP_EXCEPTIONS", "NO");
ADD_SETTING(iPhone_Debug, "GCC_ENABLE_FIX_AND_CONTINUE", "NO");
@@ -858,12 +858,12 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
iPhone_HeaderSearchPaths.push_back("$(SRCROOT)");
iPhone_HeaderSearchPaths.push_back("\"" + projectOutputDirectory + "\"");
iPhone_HeaderSearchPaths.push_back("\"" + projectOutputDirectory + "/include\"");
- ADD_SETTING_LIST(iPhone_Debug, "HEADER_SEARCH_PATHS", iPhone_HeaderSearchPaths, SettingsAsList|SettingsQuoteVariable, 5);
+ ADD_SETTING_LIST(iPhone_Debug, "HEADER_SEARCH_PATHS", iPhone_HeaderSearchPaths, kSettingsAsList | kSettingsQuoteVariable, 5);
ADD_SETTING_QUOTE(iPhone_Debug, "INFOPLIST_FILE", "$(SRCROOT)/dists/ios7/Info.plist");
ValueList iPhone_LibPaths;
iPhone_LibPaths.push_back("$(inherited)");
iPhone_LibPaths.push_back("\"" + projectOutputDirectory + "/lib\"");
- ADD_SETTING_LIST(iPhone_Debug, "LIBRARY_SEARCH_PATHS", iPhone_LibPaths, SettingsAsList, 5);
+ ADD_SETTING_LIST(iPhone_Debug, "LIBRARY_SEARCH_PATHS", iPhone_LibPaths, kSettingsAsList, 5);
ADD_SETTING(iPhone_Debug, "ONLY_ACTIVE_ARCH", "YES");
ADD_SETTING(iPhone_Debug, "PREBINDING", "NO");
ADD_SETTING(iPhone_Debug, "PRODUCT_NAME", PROJECT_NAME);
@@ -877,12 +877,12 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
ADD_DEFINE(scummvmIOS_defines, "\"$(inherited)\"");
ADD_DEFINE(scummvmIOS_defines, "IPHONE");
ADD_DEFINE(scummvmIOS_defines, "IPHONE_OFFICIAL");
- ADD_SETTING_LIST(iPhone_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmIOS_defines, SettingsNoQuote|SettingsAsList, 5);
+ ADD_SETTING_LIST(iPhone_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmIOS_defines, kSettingsNoQuote | kSettingsAsList, 5);
ADD_SETTING(iPhone_Debug, "ASSETCATALOG_COMPILER_APPICON_NAME", "AppIcon");
ADD_SETTING(iPhone_Debug, "ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME", "LaunchImage");
- iPhone_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue);
- iPhone_Debug_Object->properties["buildSettings"] = iPhone_Debug;
+ iPhone_Debug_Object->addProperty("name", "Debug", "", kSettingsNoValue);
+ iPhone_Debug_Object->_properties["buildSettings"] = iPhone_Debug;
// Release
Object *iPhone_Release_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-iPhone_Release", _targets[IOS_TARGET] /* ScummVM-iPhone */, "XCBuildConfiguration", "PBXNativeTarget", "Release");
@@ -894,8 +894,8 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
REMOVE_SETTING(iPhone_Release, "DEBUG_INFORMATION_FORMAT");
ADD_SETTING_QUOTE(iPhone_Release, "DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym");
- iPhone_Release_Object->addProperty("name", "Release", "", SettingsNoValue);
- iPhone_Release_Object->properties["buildSettings"] = iPhone_Release;
+ iPhone_Release_Object->addProperty("name", "Release", "", kSettingsNoValue);
+ iPhone_Release_Object->_properties["buildSettings"] = iPhone_Release;
_buildConfiguration.add(iPhone_Debug_Object);
_buildConfiguration.add(iPhone_Release_Object);
@@ -925,7 +925,7 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
ADD_DEFINE(scummvmOSX_defines, "\"$(inherited)\"");
ADD_DEFINE(scummvmOSX_defines, "SDL_BACKEND");
ADD_DEFINE(scummvmOSX_defines, "MACOSX");
- ADD_SETTING_LIST(scummvmOSX_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmOSX_defines, SettingsNoQuote|SettingsAsList, 5);
+ ADD_SETTING_LIST(scummvmOSX_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmOSX_defines, kSettingsNoQuote | kSettingsAsList, 5);
ADD_SETTING_QUOTE(scummvmOSX_Debug, "GCC_VERSION", "");
ValueList scummvmOSX_HeaderPaths;
scummvmOSX_HeaderPaths.push_back("/opt/local/include/SDL");
@@ -934,14 +934,14 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
scummvmOSX_HeaderPaths.push_back("include/");
scummvmOSX_HeaderPaths.push_back("$(SRCROOT)/engines/");
scummvmOSX_HeaderPaths.push_back("$(SRCROOT)");
- ADD_SETTING_LIST(scummvmOSX_Debug, "HEADER_SEARCH_PATHS", scummvmOSX_HeaderPaths, SettingsQuoteVariable|SettingsAsList, 5);
+ ADD_SETTING_LIST(scummvmOSX_Debug, "HEADER_SEARCH_PATHS", scummvmOSX_HeaderPaths, kSettingsQuoteVariable | kSettingsAsList, 5);
ADD_SETTING_QUOTE(scummvmOSX_Debug, "INFOPLIST_FILE", "$(SRCROOT)/dists/macosx/Info.plist");
ValueList scummvmOSX_LibPaths;
scummvmOSX_LibPaths.push_back("/sw/lib");
scummvmOSX_LibPaths.push_back("/opt/local/lib");
scummvmOSX_LibPaths.push_back("\"$(inherited)\"");
scummvmOSX_LibPaths.push_back("\"\\\\\\\"$(SRCROOT)/lib\\\\\\\"\""); // mmmh, all those slashes, it's almost Christmas \o/
- ADD_SETTING_LIST(scummvmOSX_Debug, "LIBRARY_SEARCH_PATHS", scummvmOSX_LibPaths, SettingsNoQuote|SettingsAsList, 5);
+ ADD_SETTING_LIST(scummvmOSX_Debug, "LIBRARY_SEARCH_PATHS", scummvmOSX_LibPaths, kSettingsNoQuote | kSettingsAsList, 5);
ADD_SETTING_QUOTE(scummvmOSX_Debug, "OTHER_CFLAGS", "");
ValueList scummvmOSX_LdFlags;
scummvmOSX_LdFlags.push_back("-lSDLmain");
@@ -956,12 +956,12 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
scummvmOSX_LdFlags.push_back("-lFLAC");
scummvmOSX_LdFlags.push_back("-lSDL");
scummvmOSX_LdFlags.push_back("-lz");
- ADD_SETTING_LIST(scummvmOSX_Debug, "OTHER_LDFLAGS", scummvmOSX_LdFlags, SettingsAsList, 5);
+ ADD_SETTING_LIST(scummvmOSX_Debug, "OTHER_LDFLAGS", scummvmOSX_LdFlags, kSettingsAsList, 5);
ADD_SETTING(scummvmOSX_Debug, "PREBINDING", "NO");
ADD_SETTING(scummvmOSX_Debug, "PRODUCT_NAME", PROJECT_NAME);
- scummvmOSX_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue);
- scummvmOSX_Debug_Object->properties["buildSettings"] = scummvmOSX_Debug;
+ scummvmOSX_Debug_Object->addProperty("name", "Debug", "", kSettingsNoValue);
+ scummvmOSX_Debug_Object->_properties["buildSettings"] = scummvmOSX_Debug;
// Release
Object *scummvmOSX_Release_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-OSX_Release", _targets[OSX_TARGET] /* ScummVM-OS X */, "XCBuildConfiguration", "PBXNativeTarget", "Release");
@@ -973,27 +973,27 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
REMOVE_SETTING(scummvmOSX_Release, "DEBUG_INFORMATION_FORMAT");
ADD_SETTING_QUOTE(scummvmOSX_Release, "DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym");
- scummvmOSX_Release_Object->addProperty("name", "Release", "", SettingsNoValue);
- scummvmOSX_Release_Object->properties["buildSettings"] = scummvmOSX_Release;
+ scummvmOSX_Release_Object->addProperty("name", "Release", "", kSettingsNoValue);
+ scummvmOSX_Release_Object->_properties["buildSettings"] = scummvmOSX_Release;
_buildConfiguration.add(scummvmOSX_Debug_Object);
_buildConfiguration.add(scummvmOSX_Release_Object);
// Warning: This assumes we have all configurations with a Debug & Release pair
- for (std::vector<Object *>::iterator config = _buildConfiguration.objects.begin(); config != _buildConfiguration.objects.end(); config++) {
+ for (std::vector<Object *>::iterator config = _buildConfiguration._objects.begin(); config != _buildConfiguration._objects.end(); config++) {
- Object *configList = new Object(this, "XCConfigurationList_" + (*config)->name, (*config)->name, "XCConfigurationList", "", "Build configuration list for " + (*config)->refType + " \"" + (*config)->name + "\"");
+ Object *configList = new Object(this, "XCConfigurationList_" + (*config)->_name, (*config)->_name, "XCConfigurationList", "", "Build configuration list for " + (*config)->_refType + " \"" + (*config)->_name + "\"");
Property buildConfigs;
- buildConfigs.flags = SettingsAsList;
+ buildConfigs._flags = kSettingsAsList;
- buildConfigs.settings[getHash((*config)->id)] = Setting("", "Debug", SettingsNoValue, 0, 0);
- buildConfigs.settings[getHash((*(++config))->id)] = Setting("", "Release", SettingsNoValue, 0, 1);
+ buildConfigs._settings[getHash((*config)->_id)] = Setting("", "Debug", kSettingsNoValue, 0, 0);
+ buildConfigs._settings[getHash((*(++config))->_id)] = Setting("", "Release", kSettingsNoValue, 0, 1);
- configList->properties["buildConfigurations"] = buildConfigs;
+ configList->_properties["buildConfigurations"] = buildConfigs;
- configList->addProperty("defaultConfigurationIsVisible", "0", "", SettingsNoValue);
- configList->addProperty("defaultConfigurationName", "Release", "", SettingsNoValue);
+ configList->addProperty("defaultConfigurationIsVisible", "0", "", kSettingsNoValue);
+ configList->addProperty("defaultConfigurationName", "Release", "", kSettingsNoValue);
_configurationList.add(configList);
}
@@ -1023,7 +1023,7 @@ void XcodeProvider::setupAdditionalSources(std::string targetName, Property &fil
void XcodeProvider::setupDefines(const BuildSetup &setup) {
for (StringList::const_iterator i = setup.defines.begin(); i != setup.defines.end(); ++i) {
- if (*i == "HAVE_NASM") // Not supported on Mac (TODO: change how it's handled in main class or add it only in MSVC/CodeBlocks providers?)
+ if (*i == "HAVE_NASM") // Not supported on Mac (TODO: change how it's handled in main class or add it only in MSVC/CodeBlocks providers?)
continue;
ADD_DEFINE(_defines, *i);
@@ -1066,7 +1066,7 @@ std::string XcodeProvider::getHash(std::string key) {
#endif
}
-bool isSeparator (char s) { return (s == '-'); }
+bool isSeparator(char s) { return (s == '-'); }
#ifdef MACOSX
std::string XcodeProvider::md5(std::string key) {
@@ -1102,10 +1102,10 @@ std::string replace(std::string input, const std::string find, std::string repla
std::string::size_type findLen = find.length();
std::string::size_type replaceLen = replaceStr.length();
- if (findLen == 0 )
+ if (findLen == 0)
return input;
- for (;(pos = input.find(find, pos)) != std::string::npos;) {
+ for (; (pos = input.find(find, pos)) != std::string::npos;) {
input.replace(pos, findLen, replaceStr);
pos += replaceLen;
}
@@ -1116,30 +1116,30 @@ std::string replace(std::string input, const std::string find, std::string repla
std::string XcodeProvider::writeProperty(const std::string &variable, Property &prop, int flags) const {
std::string output;
- output += (flags & SettingsSingleItem ? "" : "\t\t\t") + variable + " = ";
+ output += (flags & kSettingsSingleItem ? "" : "\t\t\t") + variable + " = ";
- if (prop.settings.size() > 1 || (prop.flags & SettingsSingleItem))
- output += (prop.flags & SettingsAsList) ? "(\n" : "{\n";
+ if (prop._settings.size() > 1 || (prop._flags & kSettingsSingleItem))
+ output += (prop._flags & kSettingsAsList) ? "(\n" : "{\n";
OrderedSettingList settings = prop.getOrderedSettingList();
for (OrderedSettingList::const_iterator setting = settings.begin(); setting != settings.end(); ++setting) {
- if (settings.size() > 1 || (prop.flags & SettingsSingleItem))
- output += (flags & SettingsSingleItem ? " " : "\t\t\t\t");
+ if (settings.size() > 1 || (prop._flags & kSettingsSingleItem))
+ output += (flags & kSettingsSingleItem ? " " : "\t\t\t\t");
output += writeSetting((*setting).first, (*setting).second);
- // The combination of SettingsAsList, and SettingsSingleItem should use "," and not ";" (i.e children
+ // The combination of SettingsAsList, and kSettingsSingleItem should use "," and not ";" (i.e children
// in PBXGroup, so we special case that case here.
- if ((prop.flags & SettingsAsList) && (prop.settings.size() > 1 || (prop.flags & SettingsSingleItem))) {
- output += (prop.settings.size() > 0) ? ",\n" : "\n";
+ if ((prop._flags & kSettingsAsList) && (prop._settings.size() > 1 || (prop._flags & kSettingsSingleItem))) {
+ output += (prop._settings.size() > 0) ? ",\n" : "\n";
} else {
output += ";";
- output += (flags & SettingsSingleItem ? " " : "\n");
+ output += (flags & kSettingsSingleItem ? " " : "\n");
}
}
- if (prop.settings.size() > 1 || (prop.flags & SettingsSingleItem))
- output += (prop.flags & SettingsAsList) ? "\t\t\t);\n" : "\t\t\t};\n";
+ if (prop._settings.size() > 1 || (prop._flags & kSettingsSingleItem))
+ output += (prop._flags & kSettingsAsList) ? "\t\t\t);\n" : "\t\t\t};\n";
return output;
}
@@ -1152,32 +1152,31 @@ std::string XcodeProvider::writeSetting(const std::string &variable, std::string
// XCode project generator pbuilder_pbx.cpp, writeSettings() (under LGPL 2.1)
std::string XcodeProvider::writeSetting(const std::string &variable, const Setting &setting) const {
std::string output;
- const std::string quote = (setting.flags & SettingsNoQuote) ? "" : "\"";
+ const std::string quote = (setting._flags & kSettingsNoQuote) ? "" : "\"";
const std::string escape_quote = quote.empty() ? "" : "\\" + quote;
std::string newline = "\n";
// Get indent level
- for (int i = 0; i < setting.indent; ++i)
+ for (int i = 0; i < setting._indent; ++i)
newline += "\t";
// Setup variable
- std::string var = (setting.flags & SettingsQuoteVariable) ? "\"" + variable + "\"" : variable;
+ std::string var = (setting._flags & kSettingsQuoteVariable) ? "\"" + variable + "\"" : variable;
// Output a list
- if (setting.flags & SettingsAsList) {
-
- output += var + ((setting.flags & SettingsNoValue) ? "(" : " = (") + newline;
+ if (setting._flags & kSettingsAsList) {
+ output += var + ((setting._flags & kSettingsNoValue) ? "(" : " = (") + newline;
- for (unsigned int i = 0, count = 0; i < setting.entries.size(); ++i) {
+ for (unsigned int i = 0, count = 0; i < setting._entries.size(); ++i) {
- std::string value = setting.entries.at(i).value;
+ std::string value = setting._entries.at(i)._value;
if (!value.empty()) {
if (count++ > 0)
output += "," + newline;
output += quote + replace(value, quote, escape_quote) + quote;
- std::string comment = setting.entries.at(i).comment;
+ std::string comment = setting._entries.at(i)._comment;
if (!comment.empty())
output += " /* " + comment + " */";
}
@@ -1185,24 +1184,24 @@ std::string XcodeProvider::writeSetting(const std::string &variable, const Setti
}
// Add closing ")" on new line
newline.resize(newline.size() - 1);
- output += (setting.flags & SettingsNoValue) ? "\t\t\t)" : "," + newline + ")";
+ output += (setting._flags & kSettingsNoValue) ? "\t\t\t)" : "," + newline + ")";
} else {
output += var;
- output += (setting.flags & SettingsNoValue) ? "" : " = " + quote;
+ output += (setting._flags & kSettingsNoValue) ? "" : " = " + quote;
- for(unsigned int i = 0; i < setting.entries.size(); ++i) {
- std::string value = setting.entries.at(i).value;
- if(i)
+ for (unsigned int i = 0; i < setting._entries.size(); ++i) {
+ std::string value = setting._entries.at(i)._value;
+ if (i)
output += " ";
output += value;
- std::string comment = setting.entries.at(i).comment;
+ std::string comment = setting._entries.at(i)._comment;
if (!comment.empty())
output += " /* " + comment + " */";
}
- output += (setting.flags & SettingsNoValue) ? "" : quote;
+ output += (setting._flags & kSettingsNoValue) ? "" : quote;
}
return output;
}
diff --git a/devtools/create_project/xcode.h b/devtools/create_project/xcode.h
index c97e31064b..698b02e651 100644
--- a/devtools/create_project/xcode.h
+++ b/devtools/create_project/xcode.h
@@ -49,24 +49,23 @@ protected:
const StringList &duplicate, const std::string &objPrefix, const std::string &filePrefix);
private:
enum {
- SettingsAsList = 0x01,
- SettingsSingleItem = 0x02,
- SettingsNoQuote = 0x04,
- SettingsQuoteVariable = 0x08,
- SettingsNoValue = 0x10
+ kSettingsAsList = 0x01,
+ kSettingsSingleItem = 0x02,
+ kSettingsNoQuote = 0x04,
+ kSettingsQuoteVariable = 0x08,
+ kSettingsNoValue = 0x10
};
// File properties
struct FileProperty {
- std::string fileEncoding;
- std::string lastKnownFileType;
- std::string fileName;
- std::string filePath;
- std::string sourceTree;
-
- FileProperty(std::string fileType = "", std::string name = "", std::string path = "", std::string source = "") :
- fileEncoding(""), lastKnownFileType(fileType), fileName(name), filePath(path), sourceTree(source)
- {
+ std::string _fileEncoding;
+ std::string _lastKnownFileType;
+ std::string _fileName;
+ std::string _filePath;
+ std::string _sourceTree;
+
+ FileProperty(std::string fileType = "", std::string name = "", std::string path = "", std::string source = "")
+ : _fileEncoding(""), _lastKnownFileType(fileType), _fileName(name), _filePath(path), _sourceTree(source) {
}
};
@@ -75,33 +74,33 @@ private:
typedef std::vector<std::string> ValueList;
struct Entry {
- std::string value;
- std::string comment;
+ std::string _value;
+ std::string _comment;
- Entry(std::string val, std::string cmt) : value(val), comment(cmt) {}
+ Entry(std::string val, std::string cmt) : _value(val), _comment(cmt) {}
};
typedef std::vector<Entry> EntryList;
struct Setting {
- EntryList entries;
- int flags;
- int indent;
- int order;
+ EntryList _entries;
+ int _flags;
+ int _indent;
+ int _order;
- explicit Setting(std::string value = "", std::string comment = "", int flgs = 0, int idt = 0, int ord = -1) : flags(flgs), indent(idt), order(ord) {
- entries.push_back(Entry(value, comment));
+ Setting(std::string value = "", std::string comment = "", int flgs = 0, int idt = 0, int ord = -1) : _flags(flgs), _indent(idt), _order(ord) {
+ _entries.push_back(Entry(value, comment));
}
- explicit Setting(ValueList values, int flgs = 0, int idt = 0, int ord = -1) : flags(flgs), indent(idt), order(ord) {
+ Setting(ValueList values, int flgs = 0, int idt = 0, int ord = -1) : _flags(flgs), _indent(idt), _order(ord) {
for (unsigned int i = 0; i < values.size(); i++)
- entries.push_back(Entry(values[i], ""));
+ _entries.push_back(Entry(values[i], ""));
}
- explicit Setting(EntryList ents, int flgs = 0, int idt = 0, int ord = -1) : entries(ents), flags(flgs), indent(idt), order(ord) {}
+ Setting(EntryList ents, int flgs = 0, int idt = 0, int ord = -1) : _entries(ents), _flags(flgs), _indent(idt), _order(ord) {}
void addEntry(std::string value, std::string comment = "") {
- entries.push_back(Entry(value, comment));
+ _entries.push_back(Entry(value, comment));
}
};
@@ -109,46 +108,36 @@ private:
typedef std::pair<std::string, Setting> SettingPair;
typedef std::vector<SettingPair> OrderedSettingList;
- static bool OrderSortPredicate(const SettingPair& s1, const SettingPair& s2) {
- return s1.second.order < s2.second.order;
+ static bool OrderSortPredicate(const SettingPair &s1, const SettingPair &s2) {
+ return s1.second._order < s2.second._order;
}
struct Property {
public:
- SettingList settings;
- int flags;
- bool hasOrder;
+ SettingList _settings;
+ int _flags;
+ bool _hasOrder;
- Property() : flags(0), hasOrder(false) {}
+ Property() : _flags(0), _hasOrder(false) {}
// Constructs a simple Property
- explicit Property(std::string name, std::string value = "", std::string comment = "", int flgs = 0, int indent = 0, bool order = false) : flags(flgs), hasOrder(order) {
- Setting setting(value, comment, flags, indent);
-
- settings[name] = setting;
+ Property(std::string name, std::string value = "", std::string comment = "", int flgs = 0, int indent = 0, bool order = false) : _flags(flgs), _hasOrder(order) {
+ _settings[name] = Setting(value, comment, _flags, indent);
}
- Property(std::string name, ValueList values, int flgs = 0, int indent = 0, bool order = false) : flags(flgs), hasOrder(order) {
- Setting setting(values, flags, indent);
-
- settings[name] = setting;
- }
-
- // Copy constructor
- Property(const Property &rhs) {
- settings = rhs.settings;
- flags = rhs.flags;
+ Property(std::string name, ValueList values, int flgs = 0, int indent = 0, bool order = false) : _flags(flgs), _hasOrder(order) {
+ _settings[name] = Setting(values, _flags, indent);
}
OrderedSettingList getOrderedSettingList() {
OrderedSettingList list;
// Prepare vector to sort
- for (SettingList::const_iterator setting = settings.begin(); setting != settings.end(); ++setting)
+ for (SettingList::const_iterator setting = _settings.begin(); setting != _settings.end(); ++setting)
list.push_back(SettingPair(setting->first, setting->second));
// Sort vector using setting order
- if (hasOrder)
+ if (_hasOrder)
std::sort(list.begin(), list.end(), OrderSortPredicate);
return list;
@@ -162,48 +151,48 @@ private:
// be overkill since we only have to generate a single project
struct Object {
public:
- std::string id; // Unique identifier for this object
- std::string name; // Name (may not be unique - for ex. configuration entries)
- std::string refType; // Type of object this references (if any)
- std::string comment; // Main comment (empty for no comment)
+ std::string _id; // Unique identifier for this object
+ std::string _name; // Name (may not be unique - for ex. configuration entries)
+ std::string _refType; // Type of object this references (if any)
+ std::string _comment; // Main comment (empty for no comment)
- PropertyList properties; // List of object properties, including output configuration
+ PropertyList _properties; // List of object properties, including output configuration
// Constructs an object and add a default type property
Object(XcodeProvider *objectParent, std::string objectId, std::string objectName, std::string objectType, std::string objectRefType = "", std::string objectComment = "")
- : id(objectId), name(objectName), refType(objectRefType), comment(objectComment), parent(objectParent) {
+ : _id(objectId), _name(objectName), _refType(objectRefType), _comment(objectComment), _parent(objectParent) {
assert(objectParent);
assert(!objectId.empty());
assert(!objectName.empty());
assert(!objectType.empty());
- addProperty("isa", objectType, "", SettingsNoQuote|SettingsNoValue);
+ addProperty("isa", objectType, "", kSettingsNoQuote | kSettingsNoValue);
}
// Add a simple Property with just a name and a value
void addProperty(std::string propName, std::string propValue, std::string propComment = "", int propFlags = 0, int propIndent = 0) {
- properties[propName] = Property(propValue, "", propComment, propFlags, propIndent);
+ _properties[propName] = Property(propValue, "", propComment, propFlags, propIndent);
}
std::string toString(int flags = 0) {
std::string output;
- output = "\t\t" + parent->getHash(id) + (comment.empty() ? "" : " /* " + comment + " */") + " = {";
+ output = "\t\t" + _parent->getHash(_id) + (_comment.empty() ? "" : " /* " + _comment + " */") + " = {";
- if (flags & SettingsAsList)
+ if (flags & kSettingsAsList)
output += "\n";
// Special case: always output the isa property first
- output += parent->writeProperty("isa", properties["isa"], flags);
+ output += _parent->writeProperty("isa", _properties["isa"], flags);
// Write each property
- for (PropertyList::iterator property = properties.begin(); property != properties.end(); ++property) {
- if ((*property).first == "isa")
+ for (PropertyList::iterator property = _properties.begin(); property != _properties.end(); ++property) {
+ if (property->first == "isa")
continue;
- output += parent->writeProperty((*property).first, (*property).second, flags);
+ output += _parent->writeProperty(property->first, property->second, flags);
}
- if (flags & SettingsAsList)
+ if (flags & kSettingsAsList)
output += "\t\t";
output += "};\n";
@@ -211,37 +200,36 @@ private:
return output;
}
- // Slight hack, to allow Group access to parent.
+ // Slight hack, to allow Group access to parent.
protected:
- XcodeProvider *parent;
+ XcodeProvider *_parent;
private:
// Returns the type property (should always be the first in the properties map)
std::string getType() {
- assert(!properties.empty());
- assert(!properties["isa"].settings.empty());
-
- SettingList::iterator it = properties["isa"].settings.begin();
+ assert(!_properties.empty());
+ assert(!_properties["isa"]._settings.empty());
- return (*it).first;
+ SettingList::iterator it = _properties["isa"]._settings.begin();
+ return it->first;
}
};
struct ObjectList {
private:
- std::map<std::string, bool> objectMap;
+ std::map<std::string, bool> _objectMap;
public:
- std::vector<Object *> objects;
- std::string comment;
- int flags;
+ std::vector<Object *> _objects;
+ std::string _comment;
+ int _flags;
void add(Object *obj) {
- std::map<std::string, bool>::iterator it = objectMap.find(obj->id);
- if (it != objectMap.end() && it->second == true)
+ std::map<std::string, bool>::iterator it = _objectMap.find(obj->_id);
+ if (it != _objectMap.end() && it->second == true)
return;
- objects.push_back(obj);
- objectMap[obj->id] = true;
+ _objects.push_back(obj);
+ _objectMap[obj->_id] = true;
}
Object *find(std::string id) {
@@ -256,14 +244,14 @@ private:
std::string toString() {
std::string output;
- if (!comment.empty())
- output = "\n/* Begin " + comment + " section */\n";
+ if (!_comment.empty())
+ output = "\n/* Begin " + _comment + " section */\n";
- for (std::vector<Object *>::iterator object = objects.begin(); object != objects.end(); ++object)
- output += (*object)->toString(flags);
+ for (std::vector<Object *>::iterator object = _objects.begin(); object != _objects.end(); ++object)
+ output += (*object)->toString(_flags);
- if (!comment.empty())
- output += "/* End " + comment + " section */\n";
+ if (!_comment.empty())
+ output += "/* End " + _comment + " section */\n";
return output;
}
@@ -282,10 +270,10 @@ private:
void addChildFile(const std::string &name);
void addChildByHash(const std::string &hash, const std::string &name);
// Should be passed the hash for the entry
- void addChildGroup(const Group* group);
+ void addChildGroup(const Group *group);
void ensureChildExists(const std::string &name);
Group *getChildGroup(const std::string &name);
- std::string getHashRef() const { return parent->getHash(id); }
+ std::string getHashRef() const { return _parent->getHash(_id); }
};
// The path used by the root-source group