Comments (5)
I would probably do it directly in Target+Core.swift
instead of providing a new option in the glob behavior.
from tuist.
Hey 👋
Yeah, that looks like a valid issue (I'm still being surprised every day by some of the decisions of package authors). Would you want to take a look?
I wouldn't fix this at the ProjectFileElements
level but instead wherever we expand the source file glob, we should do a case-sensitive comparison. Before we do that, I'd double check how vanilla SPM works if a package has an actual Swift file called "MyFile.Swift`. Does it pick up? If so, then instead of doing a case sensitive comparison, we would need to check if a given path is a file or a directory.
from tuist.
Hey 👋
Yeah, that looks like a valid issue (I'm still being surprised every day by some of the decisions of package authors). Would you want to take a look?
I wouldn't fix this at the
ProjectFileElements
level but instead wherever we expand the source file glob, we should do a case-sensitive comparison. Before we do that, I'd double check how vanilla SPM works if a package has an actual Swift file called "MyFile.Swift`. Does it pick up? If so, then instead of doing a case sensitive comparison, we would need to check if a given path is a file or a directory.
Can't we check whether it's a file or a directory rather than relying on case?
not 100% sure, but I think Xcode/SPM also accepts upper case, at least for some extensions
from tuist.
Can't we check whether it's a file or a directory rather than relying on case? not 100% sure, but I think Xcode/SPM also accepts upper case, at least for some extensions
Yeah, we can, that's what I said we could also do 😄 I'm not sure how fast the isDirectory
operation is because we would technically need to run it for every file, so even if it's fast, it could compound. But maybe it's fast enough that it wouldn't add to the generation time.
If SPM/Xcode pick up files with .Swift
extension, then we can't rely on case-sensitive compare of the extension, yeah.
from tuist.
Looks like vanilla SPM accepts uppercased .Swift
extension. So now we should check if the path is directory or a file.
I'm not sure which place would be the best to run the check.
- Add an extra guard statement below
Target+Core.swift L:85
to filter out paths that are directories.
.filter { path in
guard let `extension` = path.extension else { return false }
guard !FileHandler.shared.isFolder(path) else { return false } // Adding this line solves the problem
return Target.validSourceExtensions
.contains(where: { $0.caseInsensitiveCompare(`extension`) == .orderedSame })
}
- Add
behavior: Glob.Behavior
parameter tothrowingGlob
function and pass a behavior withincludesDirectoriesInResults
set tofalse
when getting paths from glob execution. (Target+Core.swift L:75
)
I tested both implementations and all of them worked as expected
from tuist.
Related Issues (20)
- Airship/AirshipAutomation failures
- Binary caching with swift-system v1.3.0 as a dependency fails HOT 3
- tuist test compiles unrelated targets
- 'tuist cache' fails when there are targets without sources HOT 3
- Tuist rewrite GCC_PREFIX_HEADER when resource bundle synthesizer enabled ignoring user-defined values HOT 3
- The Composable Architecture compatibility issues HOT 15
- Missing logs when running `tuist test`
- Tuist Cache fails when using macros in combination with Workspace test covearge
- SkeletonView library gives error: "unrecognized selector sent to instance" HOT 5
- Tuist cloud run report shows tuist version twice HOT 3
- `.package.resolved` is not generated HOT 7
- Crash in unit tests with enforceExplicitDependencies, tuist cache and dynamic framework GRDB HOT 1
- Duplicate Symbols Issue When Using Tuist with Multiple Frameworks HOT 19
- error: external macro implementation type 'ComposableArchitectureMacros.ReducerMacro' could not be found for macro 'Reducer()' HOT 1
- 'swift' command exited with error code 1 on install
- Mergeable Libraries not reexported
- When using `DefaultSettings.essential` mergeable libraries build settings not set
- Using `MergedBinaryType.manual` overrides Other Linker Flags HOT 2
- `tuist init` DX
- [Feature Proposal] Conventionally default `CURRENT_PROJECT_VERSION` to `CFBundleVersion`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tuist.