jensmeder / Phoenx

A ruby gem to automate Xcode project generation.
https://rubygems.org/gems/phoenx
MIT License
18 stars 3 forks source link

target support_files should be project support_files #24

Closed karstenlitsche closed 7 years ago

karstenlitsche commented 7 years ago

On a logical view support_files are not target specific.

Example:

Phoenx::Project.new do |project|

    project.project_name = "Test"
    project.config_files["Debug"] = "Configuration/Project/debug.xcconfig"
    project.config_files["Release"] = "Configuration/Project/release.xcconfig"

    project.target "TestApp", :application, :osx, '10.11' do |target|
        target.config_files["Debug"] = "Configuration/App/debug.xcconfig"
        target.config_files["Release"] = "Configuration/App/release.xcconfig"
        target.sources = ["SourcesApp/**/*.{h,m,c,swift}"]
        target.resources = ["SourcesApp/**/*.{json,png,storyboard,strings,xib}"]
        target.support_files = ["Configuration/**/*.{xcconfig,plist,entitlements}","*.{pxproject}","Makefile",".gitignore"]
    end

    project.target "TestFramework", :framework, :osx, '10.11' do |target|
        target.config_files["Debug"] = "Configuration/Framework/debug.xcconfig"
        target.config_files["Release"] = "Configuration/Framework/release.xcconfig"
        target.sources = ["SourcesFramework/**/*.{h,m,c,swift}"]
        target.resources = ["SourcesFramework/**/*.{json,png,storyboard,strings,xib}"]
        target.support_files = ["Configuration/**/*.{xcconfig,plist,entitlements}","*.{pxproject}","Makefile",".gitignore"]
    end

end

In this example the support files are defined twice, but I only need them once. Adding them to the app or the framework only seems not right. The correct solution should be

project.support_files = ["Configuration/**/*.{xcconfig,plist,entitlements}","*.{pxproject}","Makefile",".gitignore"]

Maybe there are support_files that a user wants to add to a specific target (e.g. the configuration files in the example). So my suggestion is to support both solutions.