MobileNativeFoundation / MobileNativeFoundation/rules_xcodeproj

Feature Request: Add run scripts to the actual App Target instead of `BazelDependencies` target

Open
#2,108 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
Swift
Stars
626
Forks
124
PR merge metrics
No merged PRs in 30d

Description

Problem

Today when we add run scripts they get added to the BazelDependencies target instead of the actual Target. With this approach we lose on using some of Xcodebuild ENV variables such as TARGET_NAME & DERIVED_FILE_DIR in run scripts, so instead of adding these scripts to the BazelDependencies, is it possible to add them to the actual app target itself?

What I am trying to do

We have a script to copy some files to the generated app bundle, To do this I need to access TARGET_BUILD_DIR but that's not available when for BazelDependencies target.

Feature request

When we pass pre_build & post_build scripts to rules_xcodeproj, instead of adding them to BazelDependencies, is it possible to add them to the top_level_targets of type Application? This would ensure we have all Xcode's ENV vars available.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how rules_xcodeproj handles the pre_build and post_build scripts and how it creates the BazelDependencies target versus top_level_targets of type Application. Verify the behavior with an Xcode build; done means the scripts run on the app target and can access variables such as TARGET_BUILD_DIR, TARGET_NAME, and DERIVED_FILE_DIR.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.