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
Adding support for resource folder references #318
Adding support for resource folder references #318
Conversation
- Resources are now `FileElement`s to support folder references - Resource folder references are added to the project and copied to the final product (bundle resources)
Generated by π« Danger |
Codecov Report
@@ Coverage Diff @@
## master #318 +/- ##
==========================================
+ Coverage 89.48% 89.69% +0.21%
==========================================
Files 280 280
Lines 10707 10793 +86
==========================================
+ Hits 9581 9681 +100
+ Misses 1126 1112 -14
Continue to review full report at Codecov.
|
@@ -65,3 +65,19 @@ extension FileElement: ExpressibleByStringLiteral { | |||
self = .glob(pattern: value) | |||
} | |||
} | |||
|
|||
extension Array: ExpressibleByUnicodeScalarLiteral where Element == FileElement { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π
var fileHandler: MockFileHandler! | ||
override func setUp() { | ||
do { | ||
fileHandler = try MockFileHandler() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be safe to go with try! MockFileHandler()
here but all good π
@@ -72,6 +72,8 @@ Scenario: The project is an iOS application that has resources (ios_app_with_fra | |||
Then tuist generates the project | |||
Then I should be able to build the scheme App | |||
Then the product 'App.app' with destination 'Debug-iphoneos' contains resource 'tuist.png' | |||
Then the product 'App.app' with destination 'Debug-iphoneos' contains resource 'Examples/item.json' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job @kwridan. The PR looks to me and CI is happy about it π
Resolves #202
Short description π
Resources to include in an application can be in the form of files as well as folder references.
Solution π¦
Add support for folder references within target resources. For consistency, we can use
FileElement
which has already been used inProject
andWorkspace
to define additional files.e.g.
Implementation π©βπ»π¨βπ»
Test Plan β
Verify unit tests pass via
swift test
Verify acceptance tests pass via
bundle exec rake features
Run
tuist generate
withinfixtures/ios_app_with_framework_and_resources
Inspect the generated workspace
Verify
MainApp
has a folder reference toExamples
which is also included in the Copy Bundle Resources phase