cocoaphony,
@cocoaphony@mastodon.social avatar

I have a local variable declared in my Package.swift for swiftSettings so I can use it in a couple of places. It seems that if I move the declaration to the bottom of the file, after let package =, it is simply ignored. It still compiles, but the options aren't passed to the compiler. If I move it to the top of the file, it works.

I'm currently moving to @mattiem's solution (https://github.com/mattmassicotte/PackageTemplate/blob/main/Package.swift#L35-L39). But is this a bug, or intentional behavior?

krzyzanowskim,
@krzyzanowskim@mastodon.social avatar

deleted_by_author

  • Loading...
  • cocoaphony,
    @cocoaphony@mastodon.social avatar

    @krzyzanowskim Not the linked one (that's what I'm moving to instead of moving the setting). This one: https://gist.github.com/rnapier/1bf7a85eea76dc76fc61ad6aa0808fd2

    krzyzanowskim,
    @krzyzanowskim@mastodon.social avatar

    deleted_by_author

  • Loading...
  • krzyzanowskim,
    @krzyzanowskim@mastodon.social avatar

    deleted_by_author

  • Loading...
  • cocoaphony,
    @cocoaphony@mastodon.social avatar
    uliwitness,
    @uliwitness@chaos.social avatar

    @cocoaphony I wonder if it's accidental hiding? Like, maybe there is an existing let swiftSettings in Swift’s package loading code in PackageDescription framework, and you're picking that one up? What happens if you rename it to robsSwiftSettings ?

    jsq,
    @jsq@mastodon.social avatar

    @cocoaphony

    Side note for @mattiem — GitHub has a proper “template repo” option you can use instead of creating a normal repo. Then you can create new ones from the template.

    mattiem,
    @mattiem@mastodon.social avatar

    @jsq @cocoaphony I actually was aware of this! Do you think it’s worth it though? I was more going for something as documentation + a bit of code. I was worried a real template would be too easy to use without understanding.

    cocoaphony,
    @cocoaphony@mastodon.social avatar

    @mattiem @jsq Agreed. I'd rather just copy the couple of lines than turn it into a formal template.

    jsq,
    @jsq@mastodon.social avatar

    @cocoaphony @mattiem From what I can tell, there isn’t much difference in the actual repos, it’s just that GH tags and filters it as a template — which is really convenient.

    I’ve been maintaining a similar kind of repo for years.

    https://github.com/jessesquires/template-iOS-macOS

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • ethstaker
  • DreamBathrooms
  • cubers
  • mdbf
  • everett
  • magazineikmin
  • Durango
  • Youngstown
  • rosin
  • slotface
  • modclub
  • kavyap
  • GTA5RPClips
  • ngwrru68w68
  • JUstTest
  • thenastyranch
  • cisconetworking
  • khanakhh
  • osvaldo12
  • InstantRegret
  • Leos
  • tester
  • tacticalgear
  • normalnudes
  • provamag3
  • anitta
  • megavids
  • lostlight
  • All magazines