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

Ensuring Library search paths and Swift import paths are set #308

Merged
merged 3 commits into from Mar 27, 2019

Conversation

kwridan
Copy link
Collaborator

@kwridan kwridan commented Mar 24, 2019

Resolves #256

Short description 📝

A few additional build settings are needed when linking against pre-built static libraries

  • LIBRARY_SEARCH_PATHS needs to point to the directory containing the .a file
  • SWIFT_INCLUDE_PATHS need to point to the directory containing the .swiftmodule file

Solution 📦

Describe the solution you came up with and the reasons that led you to that solution. If you thought about other solutions don't forget about mentioning them.

Implementation 👩‍💻👨‍💻

  • Add fixture
  • Update link generator to include missing settings

Test Plan ⚒

Test Plan:

  • Generate fixtures/ios_app_with_static_libraries
  • Verify the application builds
  • Verify the LIBRARY_SEARCH_PATHS and SWIFT_INCLUDE_PATHS settings are set on target A

@tuistbot
Copy link
Contributor

tuistbot commented Mar 24, 2019

1 Warning
⚠️ Have you introduced any user-facing changes? If so, please take some time to update the documentation. Keeping the documentation up to date makes it easier for users to learn how to use Tuist.

Generated by 🚫 Danger

- A few additional build settings are needed when linking against pre-built static libraries
- `LIBRARY_SEARCH_PATHS` needs to point to the directory containing the `.a` file
- `SWIFT_INCLUDE_PATHS` need to point to the directory containing the `.swiftmodule` file

Test Plan:

- Generate `fixtures/ios_app_with_static_libraries`
- Verify the application builds
- Verify the `LIBRARY_SEARCH_PATHS` and `SWIFT_INCLUDE_PATHS` settings are set on target `A`
@kwridan kwridan force-pushed the fixes/256-library-search-path branch from 06a24ca to 3de69de Compare March 24, 2019 22:05
@@ -266,3 +292,13 @@ final class LinkGenerator: LinkGenerating {
pbxTarget.buildPhases.append(buildPhase)
}
}

private extension XCBuildConfiguration {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd move to xcodeproj (the library) and make it public. I think it's a method more developers could benefit from.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍 will submit a separate PR to xcodeproj for this, it would need to be beefed up a bit further as here we only deal with space separated string settings, however other use cases may contain array of strings.

@kwridan
Copy link
Collaborator Author

kwridan commented Mar 25, 2019

The CI failed due to deleting a workspace file that was accidentally checked in - raised #309

@pepicrft
Copy link
Contributor

The CI failed due to deleting a workspace file that was accidentally checked in - raised #309

Good catch 👏

- added a `build.sh` helper script to allow re-creating the static library if needed
@codecov
Copy link

codecov bot commented Mar 27, 2019

Codecov Report

Merging #308 into master will increase coverage by 0.13%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #308      +/-   ##
==========================================
+ Coverage   89.18%   89.32%   +0.13%     
==========================================
  Files         276      276              
  Lines       10474    10591     +117     
==========================================
+ Hits         9341     9460     +119     
+ Misses       1133     1131       -2
Impacted Files Coverage Δ
...s/TuistKitTests/Generator/LinkGeneratorTests.swift 100% <100%> (ø) ⬆️
Tests/TuistKitTests/Graph/GraphTests.swift 100% <100%> (ø) ⬆️
Sources/TuistKit/Graph/Graph.swift 92.72% <100%> (+0.57%) ⬆️
Sources/TuistKit/Generator/LinkGenerator.swift 91.22% <100%> (+0.79%) ⬆️
Sources/TuistKit/Utils/ProjectFilesSortener.swift 100% <0%> (+3.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d803a9b...1f64aad. Read the comment docs.

@kwridan kwridan merged commit 5956b94 into tuist:master Mar 27, 2019
@kwridan kwridan deleted the fixes/256-library-search-path branch March 27, 2019 21:32
@kwridan
Copy link
Collaborator Author

kwridan commented Mar 27, 2019

raised tuist/XcodeProj#395 re: xcodeproj helper

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.

Library search path build setting is not set
3 participants