From 283eac7e5fe5a01dea1b0c3bf6efc0bd70b84e84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20Be=CC=81nony?= Date: Tue, 1 Dec 2015 21:00:32 +0100 Subject: [PATCH] IOS: Create a separate for adding resources --- devtools/create_project/codeblocks.cpp | 5 +++++ devtools/create_project/codeblocks.h | 2 ++ devtools/create_project/create_project.cpp | 3 +-- devtools/create_project/create_project.h | 7 +++++++ devtools/create_project/msvc.cpp | 5 +++++ devtools/create_project/msvc.h | 2 ++ devtools/create_project/xcode.cpp | 3 +++ devtools/create_project/xcode.h | 2 ++ 8 files changed, 27 insertions(+), 2 deletions(-) diff --git a/devtools/create_project/codeblocks.cpp b/devtools/create_project/codeblocks.cpp index 442a2b002500..e9dc8bf2347f 100644 --- a/devtools/create_project/codeblocks.cpp +++ b/devtools/create_project/codeblocks.cpp @@ -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 diff --git a/devtools/create_project/codeblocks.h b/devtools/create_project/codeblocks.h index f65604d92515..5baa21c24250 100644 --- a/devtools/create_project/codeblocks.h +++ b/devtools/create_project/codeblocks.h @@ -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); diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp index 0aba5114917f..914651d6b892 100644 --- a/devtools/create_project/create_project.cpp +++ b/devtools/create_project/create_project.cpp @@ -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"); diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h index 459342a67d44..b81576d4ed06 100644 --- a/devtools/create_project/create_project.h +++ b/devtools/create_project/create_project.h @@ -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. * diff --git a/devtools/create_project/msvc.cpp b/devtools/create_project/msvc.cpp index dbfbcc128dca..e6b47fe72400 100644 --- a/devtools/create_project/msvc.cpp +++ b/devtools/create_project/msvc.cpp @@ -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) diff --git a/devtools/create_project/msvc.h b/devtools/create_project/msvc.h index e75e131bd1f9..178ba8e21690 100644 --- a/devtools/create_project/msvc.h +++ b/devtools/create_project/msvc.h @@ -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. * diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index babd530ad7d6..7f2dc89218a8 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -212,6 +212,9 @@ XcodeProvider::XcodeProvider(StringList &global_warnings, std::map