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

Generated xcodeproj improvements #77

Merged
merged 8 commits into from
Jun 17, 2020

Conversation

segiddins
Copy link
Member

  • Mark xcodeproj directories as generated

    This way, github will collapse diffs & have more accurate repo stats

  • Write all xcodeproj files into the tmp_dest

    This way, everything will get chmod’d

    This fixes back-to-back runs of the installer failing due to permission issues

  • Add a test that verifies that projects can regenerate without error

  • Add support for specifying additional (non-srcs) files to be included in the project

    This would allow a project to, for example, include a README as a file reference, even though it isnt a src belonging to any particular target

  • Download GitHub repos via http_archive

  • Add IDEWorkspaceChecks.plist to generated projects

    So opening the project in Xcode doesn’t add a new file

  • Include BUILD files in generated Xcode projects

  • Explicitly opt out of xcodeproj settings presets

    It avoids the warning of the presets not being found

This way, github will collapse diffs & have more accurate repo stats
This way, everything will get chmod’d

This fixes back-to-back runs of the installer failing due to permission issues
… in the project

This would allow a project to, for example, include a README as a file reference, even though it isnt a src belonging to any particular target
So opening the project in Xcode doesn’t add a new file
@segiddins segiddins requested review from ob, ndizazzo and amberdixon June 16, 2020 23:49
Copy link
Contributor

@ndizazzo ndizazzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one! Lots of goodies in here that help cycle time when working on Bazel projects.

rules/xcodeproj.bzl Outdated Show resolved Hide resolved
@segiddins segiddins force-pushed the segiddins/incremental-project-generation-works branch from db19402 to 8eee097 Compare June 17, 2020 00:01
@@ -163,6 +176,7 @@ def _xcodeproj_impl(ctx):
"createIntermediateGroups": True,
"defaultConfig": "Debug",
"groupSortPosition": "none",
"settingPresets": "none",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@ob ob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@@ -45,7 +45,11 @@ jobs:
- name: Select Xcode 11.2
run: sudo xcode-select -s /Applications/Xcode_11.2.app
- name: Generate Xcode projects and compare against existing record
run: (bazelisk query 'kind(xcodeproj, tests/macos/xcodeproj/...)' | xargs -n 1 bazelisk run) && git diff --exit-code tests/macos/xcodeproj
run: |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, more readable! Can we count on all the lines being run in the same shell? Otherwise the set -euo pipefail might not be taking effect...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole run string gets executed at once by the shell

set -euxo pipefail
rm -fr {package_name}/{target_name}.xcodeproj
bazel run {package_name}:{target_name}
bazel run {package_name}:{target_name}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is running it twice intentional?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it's testing re-generation (previously that was failing)

@@ -0,0 +1 @@
*.xcodeproj/ linguist-generated=true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be seeing diffs for the pbxproj files in this PR?

Should this say /*.xcodeproj/ instead?

@segiddins segiddins merged commit 4f96d7b into master Jun 17, 2020
@segiddins segiddins deleted the segiddins/incremental-project-generation-works branch June 17, 2020 00:33
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