-
-
Notifications
You must be signed in to change notification settings - Fork 604
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
Unable to reference files above the project root using ../
in the paths
#380
Comments
@csykes thanks for reporting it, we'll take a look into the issue soon 😄 |
We have a similar set up and we cannot use configuration files for the same reason :) We currently use horrible bash scripts which we'd love to move away from! |
Yep. I looked at the Xcode build errors and
and
would resolve to the same directory |
will it be the same with |
Yep tried that too and it's the same problem |
@csykes @macduy if you can add a PR with failing test it would help. I tried to reproduce this issue, but these tests pass: it("sources include path out of current path using ../") {
let config = ["sources": ["../otherPath"]]
let source = Configuration(dict: config, relativePath: relativePath).source
let expected = Source.sources(Paths(include: [relativePath.parent() + "otherPath"]))
expect(source).to(equal(expected))
}
it("templates include path out of current path using ../") {
let config = ["templates": ["../otherPath"]]
let templates = Configuration(dict: config, relativePath: relativePath).templates
let expected = Paths(include: [relativePath.parent() + "otherPath"])
expect(templates).to(equal(expected))
} |
Haven't had a chance to build up a PR with failing tests but we've found that adding an additional Working .sourcery.yaml
Given that we fetch the latest version of Sourcery from CocoaPods, the commands are run from that binary location. So I suspect that might have something to do with the issue. Xcode Build Phase Shell Command:
Environment definitions:
|
it works because |
Forgot to highlight that even though its using an absolute path now it still requires one extra I would have expected it to only need |
Hi @csykes @macduy I've been trying to debug the issue and I was able to reproduce it. After debugging further I found two things:
For now I think your workaround is the best option until we come up with the resolution for the |
Thanks for the update! With the work around, our app is using the latest Sourcery version now so I've got no issues waiting this out. |
@ilyapuchka I think it makes sense to mention this limitation somewhere in the documentation for config file, what do you think? |
I think we should have some kind of FAQ with answers to common questions, then we can put it there. |
I too have problems relating to not being able to use paths in parents folder in my Config file. Any update? |
Context
We've got an Xcode project that consists of multiple sub-projects + some common code base that sits at the root level of the meta-projects. We open the MetaProject.workspace file in Xcode and then select the sub-project's scheme to run/build. Sourcery ends up running from one of the child projects and reference files above it in the directory path. Prior to 0.6.0 we could just use
../
in the sources or templates path to reference those locations but that no longer works.Environment
Xcode 8.3.3
Apple Swift version 3.1 (swiftlang-802.0.53 clang-802.0.42)
Issue
After updating to 0.6.1 or 0.7.x we can no longer reference files above the root as the
../
appear to be ignored. We've tried this using both the YAML definition file and Bash shell commands with no luck.YAML definition
Bash shell definition
Results
We see the following failure in Xcode when we try to run the MySubProject
The text was updated successfully, but these errors were encountered: