Skip to content

Commit

Permalink
IOS: Create a separate for adding resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Bénony committed Jan 6, 2016
1 parent 51e5bb7 commit 283eac7
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 2 deletions.
5 changes: 5 additions & 0 deletions devtools/create_project/codeblocks.cpp
Expand Up @@ -200,6 +200,11 @@ void CodeBlocksProvider::createProjectFile(const std::string &name, const std::s

}

void CodeBlocksProvider::addResourceFiles(const BuildSetup &setup, StringList &includeList, StringList &excludeList) {
includeList.push_back(setup.srcDir + "/icons/" + setup.projectName + ".ico");
includeList.push_back(setup.srcDir + "/dists/" + setup.projectName + ".rc");
}

void CodeBlocksProvider::writeWarnings(const std::string &name, std::ofstream &output) const {

// Global warnings
Expand Down
2 changes: 2 additions & 0 deletions devtools/create_project/codeblocks.h
Expand Up @@ -37,6 +37,8 @@ class CodeBlocksProvider : public ProjectProvider {

void createOtherBuildFiles(const BuildSetup &) {}

void addResourceFiles(const BuildSetup &setup, StringList &includeList, StringList &excludeList);

void createProjectFile(const std::string &name, const std::string &uuid, const BuildSetup &setup, const std::string &moduleDir,
const StringList &includeList, const StringList &excludeList);

Expand Down
3 changes: 1 addition & 2 deletions devtools/create_project/create_project.cpp
Expand Up @@ -1334,8 +1334,7 @@ void ProjectProvider::createProject(BuildSetup &setup) {
createModuleList(setup.srcDir + "/image", setup.defines, setup.testDirs, in, ex);

// Resource files
in.push_back(setup.srcDir + "/icons/" + setup.projectName + ".ico");
in.push_back(setup.srcDir + "/dists/" + setup.projectName + ".rc");
addResourceFiles(setup, in, ex);

// Various text files
in.push_back(setup.srcDir + "/AUTHORS");
Expand Down
7 changes: 7 additions & 0 deletions devtools/create_project/create_project.h
Expand Up @@ -418,6 +418,13 @@ class ProjectProvider {
*/
virtual void createOtherBuildFiles(const BuildSetup &setup) = 0;

/**
* Add resources to the project
*
* @param setup Description of the desired build setup.
*/
virtual void addResourceFiles(const BuildSetup &setup, StringList &includeList, StringList &excludeList) = 0;

/**
* Create a project file for the specified list of files.
*
Expand Down
5 changes: 5 additions & 0 deletions devtools/create_project/msvc.cpp
Expand Up @@ -130,6 +130,11 @@ void MSVCProvider::createOtherBuildFiles(const BuildSetup &setup) {
createBuildProp(setup, false, true, "LLVM");
}

void MSVCProvider::addResourceFiles(const BuildSetup &setup, StringList &includeList, StringList &excludeList) {
includeList.push_back(setup.srcDir + "/icons/" + setup.projectName + ".ico");
includeList.push_back(setup.srcDir + "/dists/" + setup.projectName + ".rc");
}

void MSVCProvider::createGlobalProp(const BuildSetup &setup) {
std::ofstream properties((setup.outputDir + '/' + setup.projectDescription + "_Global" + getPropertiesExtension()).c_str());
if (!properties)
Expand Down
2 changes: 2 additions & 0 deletions devtools/create_project/msvc.h
Expand Up @@ -39,6 +39,8 @@ class MSVCProvider : public ProjectProvider {

void createOtherBuildFiles(const BuildSetup &setup);

void addResourceFiles(const BuildSetup &setup, StringList &includeList, StringList &excludeList);

/**
* Create the global project properties.
*
Expand Down
3 changes: 3 additions & 0 deletions devtools/create_project/xcode.cpp
Expand Up @@ -212,6 +212,9 @@ XcodeProvider::XcodeProvider(StringList &global_warnings, std::map<std::string,
_rootSourceGroup = NULL;
}

void XcodeProvider::addResourceFiles(const BuildSetup &setup, StringList &includeList, StringList &excludeList) {
}

void XcodeProvider::createWorkspace(const BuildSetup &setup) {
// Create project folder
std::string workspace = setup.outputDir + '/' + PROJECT_NAME ".xcodeproj";
Expand Down
2 changes: 2 additions & 0 deletions devtools/create_project/xcode.h
Expand Up @@ -40,6 +40,8 @@ class XcodeProvider : public ProjectProvider {

void createOtherBuildFiles(const BuildSetup &setup);

void addResourceFiles(const BuildSetup &setup, StringList &includeList, StringList &excludeList);

void createProjectFile(const std::string &name, const std::string &uuid, const BuildSetup &setup, const std::string &moduleDir,
const StringList &includeList, const StringList &excludeList);

Expand Down

0 comments on commit 283eac7

Please sign in to comment.