-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
build tools could use a clean function #427
Conversation
Thank you for the pull request! ✨ However, I feel like this responsibility is better handled by the version control system—for example, It's also problematic because different folks commit different Carthage artifacts. Almost everyone should commit Can you maybe clarify how you see this being used, and we can use that to determine whether it's needed on top of the VCS' functionality? |
Carthage has been created as a decentralized dependency management tool. Maven's clean command removes files from the target directory which is a kin to the Carthage/Build directory. Cleaning is making sure that the build tool is compiling each module from scratch. The clean phase, per convention, is meant to make a build reproducible, i.e. it cleans up anything that was created by previous builds. Maven actually left the clean phase in its own lifecycle and i think that was a mistake. mvn clean install is more deterministic than a mvn install without the clean. Carthage takes the dependency management goodness from Maven but is more like Ant in its decentralized storage of frameworks. Therefore, lets take a look at Ant.
Since a goal for Carthage is to be flexible and unintrusive, while I believe clean phase is an essential part of a CRISP build lifecycle, i'm proposing having clean as a separate optional command for the users who commit the Carthage/Build folder. http://bradapp.blogspot.com/2009/04/crisp-builds.html http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html p.s. |
@ctava Sorry for the delay in getting back to you—I've been on vacation. I'll try to respond in detail very soon! |
After thinking it over, I believe the biggest problem with your suggestion is that cleaning All build intermediates are owned by Xcode, and stored in its DerivedData directory. We'd have to delete some of the contents of DerivedData in order to ensure a truly clean build, and I don't believe that it's Carthage's responsibility to do that. It's also easy to imagine that doing so might cause issues for some users. Furthermore, As both pieces of the proposed |
wrote a clean function that whacks the Carthage directory and the Cartfile.resolved file.
think its useful to have this function to get your project back to a clean slate, in case you've build dependancies on content/.Frameworks in the Carthage Build and Checkouts folders.
speaking of dependancies on the Carthage directory,
Added $(PROJECT_DIR)/Carthage/Build/Mac. Not sure thats correct/you want/will accept that change.
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/Mac",
);
ideally, the only change to Carthage.xcodeproj/project.pbxproj is the addition of Clean.swift
but then again, had a bunch of challenges building the source from a straight up clone of the repo.
please take a look and let me know if this is a change your interested in and if you have feedback.
certainly willing to fix it up for ya.
-chris