Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't generate empty build phases #149

Merged
merged 1 commit into from
Nov 12, 2017
Merged

Conversation

yonaskolb
Copy link
Owner

No description provided.

@yonaskolb yonaskolb merged commit 12d9fcd into master Nov 12, 2017
@keith keith deleted the remove_empty_build_phases branch November 13, 2017 15:31
@keith
Copy link
Collaborator

keith commented Nov 13, 2017

🎉

@yonaskolb
Copy link
Owner Author

It seems this is causing issues. A framework with no Compile Sources phase is not linking properly

@rpassis
Copy link
Contributor

rpassis commented Jan 15, 2019

We are currently seeing an issue with sticker extensions where an empty compile sources phase is getting generated, and that in turn triggers a "Multiple commands produce" error message when building.

Apologies if this is documented elsewhere but Is there a way to force exclude a specific/empty build phase for a target?

  Stickers:
    type: app-extension.messages-sticker-pack
    platform: iOS
    configFiles:
      Debug: ...
      Release: ...
    settings:
      INFOPLIST_FILE: ...
    sources:       
      - path: Stickers.xcassets

screen shot 2019-01-15 at 3 11 52 pm

@keith
Copy link
Collaborator

keith commented Jan 15, 2019

It sounds like maybe for this specific target type we should never include this phase since no resources in it should ever have to be compiled?

@yonaskolb
Copy link
Owner Author

Hmm indeed. @rpassis could you open a new issue and list all the target types this is an issue for

@acecilia
Copy link
Collaborator

acecilia commented Aug 25, 2021

I am experiencing the same issue with a application.watchapp2 target, where the application.watchapp2 target has no sources, but a Compile Sources (0) build phase is created that results in a Multiple commands produce build time error.

  Watch:
    platform: watchOS
    type: application.watchapp2
    sources:
      - path: Watch
        includes:
          - "Assets.xcassets"
          - "Icon.xcassets"
          - "Interface.storyboard"
        buildPhase: resources
    dependencies:
      - target: WatchExtension

I could work around this issue because after xcodegen I run cocoapods. With a pre_install step I am removing the empty build phase:

def fix_watch_target(installer)
  main_pods_target = installer.analysis_result.targets.find { |t| t.name == "Pods-<Module>" }
  fail "Main pod target could not be found" if main_pods_target.nil?
  user_project = main_pods_target.user_project
  watch_target = user_project.targets.find { |t| t.name == "<WatchModule>" }
  fail "Target <WatchModule> could not be found" if watch_target.nil?
  watch_target.source_build_phase.remove_from_project
  user_project.save()
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants