mobilenativefoundation / rules_xcodeproj Goto Github PK
View Code? Open in Web Editor NEWBazel rules for generating Xcode projects.
License: MIT License
Bazel rules for generating Xcode projects.
License: MIT License
ios_ui_test
tvos_ui_test
(need to check, might be supported)watchos_ui_test
(need to check, might be supported)app_icons
: #730codesignopts
: #593entitlements
: #367executable_name
: #721exported_symbols_lists
: #649frameworks
: #78infoplists
: #225provisioning_profile
resources
: #208sdk_frameworks
strings
: #1176version
: #74bazel_commands
in the buildbuddy.yml
file to execute the check Bazel target.There are a number of # buildifier: disable=bzl-visibility
directives sprinkled throughout the codebase. The primary issue is that by convention code under private
or internal
directories should not be accessible in other parts of the codebase. We should discuss how we want visibility to work in the repository and then update the code so that these directives can be removed.
https://bazel.build/reference/be/c-cpp#cc_library
alwayslink
defines
include_prefix
: #1656includes
: #310implementation_deps
: #1664linkstatic
local_defines
nocopts
(support removed in Bazel, so not doing anything for it un rules_xcodeproj)strip_include_prefix
: #1656Related to #115.
Moving the fixtures files allows the rules to be accessible to child workspaces.
https://github.com/buildbuddy-io/rules_xcodeproj/blob/main/xcodeproj/internal/target.bzl has grown to be quite large. While everything in there doesn't really belong in any of the other .bzl
files, it can still be split up a bit more.
Currently the path of produced products in the Products group is set to target.product.path.lastComponent
. This means that targets with the same output name at different parts in the build graph will collide:
Multiple commands produce '/Users/brentley/Library/Developer/Xcode/DerivedData/cc_binary-ddhijfwpfdtklsexaboctfhzpnhc/Build/Products/Debug/liblib.a':
- Target 'cc_example__lib' (project 'cc_binary'): Libtool /Users/brentley/Library/Developer/Xcode/DerivedData/cc_binary-ddhijfwpfdtklsexaboctfhzpnhc/Build/Products/Debug/liblib.a normal
- Target 'examples_cc_binary_lib_lib' (project 'cc_binary'): Libtool /Users/brentley/Library/Developer/Xcode/DerivedData/cc_binary-ddhijfwpfdtklsexaboctfhzpnhc/Build/Products/Debug/liblib.a normal
Just like how target names are disambiguated, product paths should be as well. In the above example, I think they should fall back to libcc_example__lib.a
and libexamples_cc_binary_lib_lib.a
. I haven't checked, but I assume there will be an issue when there are multiple configurations of the same product as well, and in that case the config hash should be added as well.
This is where the path is currently set:
https://github.com/buildbuddy-io/rules_xcodeproj/blob/d778db82f56e3e29f3a0bfc2b39334b43654cf55/tools/generator/src/Generator%2BCreateProducts.swift#L14
It can be set to anything here, and the rest of the system references that value, so this is the only place (besides tests) that needs to have an effective change.
We should probably leverage DisambiguatedTarget
, as it's already responsible for providing a unique target name, and the logic to unique the product name can probably live in Generator.disambiguateTargets()
:
https://github.com/buildbuddy-io/rules_xcodeproj/blob/d778db82f56e3e29f3a0bfc2b39334b43654cf55/tools/generator/src/Generator%2BDisambiguateTargets.swift#L4-L12
Currently we let Xcode create the schemes for us. This is finicky, and we will want to customize how the schemes are created, especially when Building with Bazel.
Implement Bazel integration tests that confirm that the functionality in this project works with select versions of Bazel.
examples/ios_app
in a similar manner to the existing fixture tests.I will put together one or more PRs with the above functionality. I will reference this issue.
https://bazel.build/reference/be/c-cpp#cc_binary
additional_linker_inputs
includes
linkshared
linkstatic
local_defines
malloc
?While working on #115, the spec diff tests began failing (see below . After inspection most of the issues are related to the sort order for the required_links and the Xcode targets.
|| ==================== Test output for //test:xcodeproj_generator:
|| Spec doesn't match expected:
|| 25d24
|| < "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/tools/generator/libgenerator.library.a",
|| 27c26,27
|| < "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/external/com_github_pointfreeco_xctest_dynamic_overlay/libXCTestDynamicOverlay.a"
|| ---
|| > "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/external/com_github_pointfreeco_xctest_dynamic_overlay/libXCTestDynamicOverlay.a",
|| > "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/tools/generator/libgenerator.library.a"
|| 30c30
|| < "@com_github_kylef_pathkit//:PathKit darwin_x86_64-fastbuild-ST-1b9bd654f600",
|| ---
|| > "@com_github_tadija_aexml//:AEXML darwin_x86_64-fastbuild-ST-1b9bd654f600",
|| 72,73c72,73
|| < "PRODUCT_MODULE_NAME": "PathKit",
|| < "PRODUCT_NAME": "PathKit",
|| ---
|| > "PRODUCT_MODULE_NAME": "AEXML",
|| > "PRODUCT_NAME": "AEXML",
|| 83c83
|| < "label": "@com_github_kylef_pathkit//:PathKit",
|| ---
|| > "label": "@com_github_tadija_aexml//:AEXML",
|| 85c85
|| < "name": "PathKit",
|| ---
|| > "name": "AEXML",
|| 88,91c88,91
|| < "name": "PathKit.swiftmodule",
|| < "swiftdoc": "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/external/com_github_kylef_pathkit/PathKit.swiftdoc",
|| < "swiftmodule": "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/external/com_github_kylef_pathkit/PathKit.swiftmodule",
|| < "swiftsourceinfo": "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/external/com_github_kylef_pathkit/PathKit.swiftsourceinfo"
|| ---
|| > "name": "AEXML.swiftmodule",
|| > "swiftdoc": "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/external/com_github_tadija_aexml/AEXML.swiftdoc",
|| > "swiftmodule": "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/external/com_github_tadija_aexml/AEXML.swiftmodule",
|| > "swiftsourceinfo": "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/external/com_github_tadija_aexml/AEXML.swiftsourceinfo"
|| 100,101c100,101
|| < "name": "PathKit",
|| < "path": "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/external/com_github_kylef_pathkit/libPathKit.a",
|| ---
|| > "name": "AEXML",
|| > "path": "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/external/com_github_tadija_aexml/libAEXML.a",
|| 105c105,109
|| < "external/com_github_kylef_pathkit/Sources/PathKit.swift"
|| ---
|| > "external/com_github_tadija_aexml/Sources/AEXML/Document.swift",
|| > "external/com_github_tadija_aexml/Sources/AEXML/Element.swift",
|| > "external/com_github_tadija_aexml/Sources/AEXML/Error.swift",
|| > "external/com_github_tadija_aexml/Sources/AEXML/Options.swift",
|| > "external/com_github_tadija_aexml/Sources/AEXML/Parser.swift"
|| 109c113
|| < "@com_github_tadija_aexml//:AEXML darwin_x86_64-fastbuild-ST-1b9bd654f600",
|| ---
|| > "@com_github_kylef_pathkit//:PathKit darwin_x86_64-fastbuild-ST-1b9bd654f600",
|| 151,152c155,156
|| < "PRODUCT_MODULE_NAME": "AEXML",
|| < "PRODUCT_NAME": "AEXML",
|| ---
|| > "PRODUCT_MODULE_NAME": "PathKit",
|| > "PRODUCT_NAME": "PathKit",
|| 162c166
|| < "label": "@com_github_tadija_aexml//:AEXML",
|| ---
|| > "label": "@com_github_kylef_pathkit//:PathKit",
|| 164c168
|| < "name": "AEXML",
|| ---
|| > "name": "PathKit",
|| 167,170c171,174
|| < "name": "AEXML.swiftmodule",
|| < "swiftdoc": "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/external/com_github_tadija_aexml/AEXML.swiftdoc",
|| < "swiftmodule": "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/external/com_github_tadija_aexml/AEXML.swiftmodule",
|| < "swiftsourceinfo": "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/external/com_github_tadija_aexml/AEXML.swiftsourceinfo"
|| ---
|| > "name": "PathKit.swiftmodule",
|| > "swiftdoc": "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/external/com_github_kylef_pathkit/PathKit.swiftdoc",
|| > "swiftmodule": "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/external/com_github_kylef_pathkit/PathKit.swiftmodule",
|| > "swiftsourceinfo": "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/external/com_github_kylef_pathkit/PathKit.swiftsourceinfo"
|| 179,180c183,184
|| < "name": "AEXML",
|| < "path": "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/external/com_github_tadija_aexml/libAEXML.a",
|| ---
|| > "name": "PathKit",
|| > "path": "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/external/com_github_kylef_pathkit/libPathKit.a",
|| 184,188c188
|| < "external/com_github_tadija_aexml/Sources/AEXML/Document.swift",
|| < "external/com_github_tadija_aexml/Sources/AEXML/Element.swift",
|| < "external/com_github_tadija_aexml/Sources/AEXML/Error.swift",
|| < "external/com_github_tadija_aexml/Sources/AEXML/Options.swift",
|| < "external/com_github_tadija_aexml/Sources/AEXML/Parser.swift"
|| ---
|| > "external/com_github_kylef_pathkit/Sources/PathKit.swift"
|| 421,422c421,422
|| < "@com_github_kylef_pathkit//:PathKit darwin_x86_64-fastbuild-ST-1b9bd654f600",
|| < "@com_github_tuist_xcodeproj//:XcodeProj darwin_x86_64-fastbuild-ST-1b9bd654f600"
|| ---
|| > "@com_github_tuist_xcodeproj//:XcodeProj darwin_x86_64-fastbuild-ST-1b9bd654f600",
|| > "@com_github_kylef_pathkit//:PathKit darwin_x86_64-fastbuild-ST-1b9bd654f600"
|| 784,785c784,785
|| < "//tools/generator:generator.library darwin_x86_64-fastbuild-ST-1b9bd654f600",
|| < "@com_github_pointfreeco_swift_custom_dump//:CustomDump darwin_x86_64-fastbuild-ST-1b9bd654f600"
|| ---
|| > "@com_github_pointfreeco_swift_custom_dump//:CustomDump darwin_x86_64-fastbuild-ST-1b9bd654f600",
|| > "//tools/generator:generator.library darwin_x86_64-fastbuild-ST-1b9bd654f600"
|| 882a883,884
|| > "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/external/com_github_pointfreeco_swift_custom_dump/libCustomDump.a",
|| > "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/external/com_github_pointfreeco_xctest_dynamic_overlay/libXCTestDynamicOverlay.a",
|| 886,888c888
|| < "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/external/com_github_kylef_pathkit/libPathKit.a",
|| < "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/external/com_github_pointfreeco_swift_custom_dump/libCustomDump.a",
|| < "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/external/com_github_pointfreeco_xctest_dynamic_overlay/libXCTestDynamicOverlay.a"
|| ---
|| > "bazel-out/darwin_x86_64-fastbuild-ST-1b9bd654f600/bin/external/com_github_kylef_pathkit/libPathKit.a"
||
|| Run `bazel run //test/fixtures:update` if you wish to accept these changes.
|| ================================================================================
https://bazel.build/reference/be/c-cpp#cc_test
additional_linker_inputs
linkstatic
malloc
?nocopts
(support removed in Bazel, so not doing anything for it un rules_xcodeproj)ios_app_clip
if neededPBXCopyFilesBuildPhase
//examples/ios_app
ios_application
macos_application
tvos_application
watchos_application
For each:
For watchos_application
:
PBXCopyFilesBuildPhase
: #718Non-minimal fields that need support:
app_icons
: #730alternate_icons
: #1125codesignopts
: #593entitlements
: #367executable_name
: #721frameworks
: #1163infoplists
: #225launch_images
: #713launch_storyboard
: #712provisioning_profile
strings
: #1176Currently a cc_library
at //examples/cc_binary/lib:lib
will have a a target name of examples_cc_binary_lib_lib
. This is the same for objc_library
or swift_library
, expect when module_name
is set.
I think when there is no ambiguity between targets we should use name
instead of the sanitized label. Does the name provide value as is (since you have to do includes as #include "examples/cc_binary/lib/header.h
)?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.