Code Monkey home page Code Monkey logo

Comments (15)

yonaskolb avatar yonaskolb commented on May 18, 2024 1

@keith it's implemented here #100. Have a look and see if this suits your needs ๐Ÿ‘

from xcodegen.

yonaskolb avatar yonaskolb commented on May 18, 2024 1

@keith, I've added a followup PR #101 that allows you to fully control the setting presets. Setting this to none removes the need for the commit I noticed you have here:
lyft@3d2fe09

from xcodegen.

yonaskolb avatar yonaskolb commented on May 18, 2024

Interesting. This mirrors the thoughts in #77

from xcodegen.

keith avatar keith commented on May 18, 2024

Ah yes, I think that kind of only half captures the problem though, since even if you're not overriding the setting, you may not want it to be set in the project. This happens for us a lot in our all Swift app, where we don't really want Objective-C build settings to be set, since future developers won't know if we actually need it, or if it was just set by default by Xcode

from xcodegen.

yonaskolb avatar yonaskolb commented on May 18, 2024

What do you suggest as way to opt out of setting presets? There are presets for the project, debug and release configurations, each platform and each target

from xcodegen.

keith avatar keith commented on May 18, 2024

I guess maybe a top level attribute for this? In theory it could also be per-target, but that seems like overkill?

from xcodegen.

yonaskolb avatar yonaskolb commented on May 18, 2024

What about this?

options:
  clearBaseSettings: true

You can already clear debug and release settings by simply providing a different type other than debug or release

configs:
  Debug: none
  Release: none

from xcodegen.

keith avatar keith commented on May 18, 2024

You can already clear debug and release settings by simply providing a different type other than debug or release

Oh interesting, is that all that is used for?

from xcodegen.

yonaskolb avatar yonaskolb commented on May 18, 2024

Yep, that's all that does. It's documented in the Project spec

from xcodegen.

yonaskolb avatar yonaskolb commented on May 18, 2024

Another option is to not apply the base settings if the config type is cleared.
From this:

buildSettings += SettingsPresetFile.base.getBuildSettings()
if let type = config.type {
    buildSettings += SettingsPresetFile.config(type).getBuildSettings()
}

to this:

if let type = config.type {
    buildSettings += SettingsPresetFile.base.getBuildSettings()
    buildSettings += SettingsPresetFile.config(type).getBuildSettings()
}

from xcodegen.

pepicrft avatar pepicrft commented on May 18, 2024

I'm more for the clearBaseSettings solution. I think it's more explicit and the attribute is at the level of the project, where it's getting applied. Modifying the project configuration based on a target attribute might be too implicit for the developer who wouldn't expect the base settings to be cleared. This could be solved by adding some documentation though.

from xcodegen.

yonaskolb avatar yonaskolb commented on May 18, 2024

The configs arenโ€™t a target level attribute, they live on the top level project. Also those debug and release settings actually get applied to the project, not the target

from xcodegen.

pepicrft avatar pepicrft commented on May 18, 2024

Cool! then I'd go with the solution that you proposed.

from xcodegen.

yonaskolb avatar yonaskolb commented on May 18, 2024

There could still be another solution to clear all the presets including those in targets. Maybe an options.applySettingPresets which could be one of the following:

  • all (default)
  • targets (don't apply any project settings ie, base, debug or release)
  • none

What do you think?
Maybe if we had that #100 wouldn't be needed as it would be strange to set all here and none on the configs?

from xcodegen.

keith avatar keith commented on May 18, 2024

Awesome!!

from xcodegen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.