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

Support specifying dependencies list in `build` / `checkout` / `update` commands #972

Merged
merged 38 commits into from Dec 17, 2015

Conversation

Projects
None yet
5 participants
@ikesyo
Member

ikesyo commented Dec 5, 2015

Resolves #610. Supersedes @NachoSoto's work of #618 and #886.
#218 is also related:

Along the same lines, carthage update could accept a specific list of dependency names to bump.

This PR introduces an argument list to build, checkout and update command (someday --exclude option might be added or not). That accepts dependency names as follows:

carthage update ReactiveTask Commandant --platform mac

For build command, only the given dependencies and their nested dependencies would be build~~, but their nested dependencies would not since we can't detect them from Cartfile.resolved~~.

For checkout command, only the given dependencies and their nested dependencies would be checked out.

For update command, only the versions of the given dependencies and their nested dependencies would be updated.

TODO

@mdiep

This comment has been minimized.

Show comment
Hide comment
@mdiep

mdiep Dec 5, 2015

Member

I haven't looked over the code yet, but…

  1. I don't think this should be part of an option. It should just be carthage update ReactiveTask Commandant.
  2. We should probably support this for checkout as well.
  3. Ideally build would also build nested dependencies if update does. But this may need to wait on #717?
  4. Maybe we should add an option to not update/checkout/build nested dependencies?
Member

mdiep commented Dec 5, 2015

I haven't looked over the code yet, but…

  1. I don't think this should be part of an option. It should just be carthage update ReactiveTask Commandant.
  2. We should probably support this for checkout as well.
  3. Ideally build would also build nested dependencies if update does. But this may need to wait on #717?
  4. Maybe we should add an option to not update/checkout/build nested dependencies?
@ikesyo

This comment has been minimized.

Show comment
Hide comment
@ikesyo

ikesyo Dec 5, 2015

Member

I don't think this should be part of an option. It should just be carthage update ReactiveTask Commandant.

To do this, I think we should reconsider the directoryPath positional argument of BuildOptions and CheckoutOptions.

Member

ikesyo commented Dec 5, 2015

I don't think this should be part of an option. It should just be carthage update ReactiveTask Commandant.

To do this, I think we should reconsider the directoryPath positional argument of BuildOptions and CheckoutOptions.

Merge branch 'master' into update-and-build-specific-denpendencies
Conflicts:
	Source/carthage/Build.swift
	Source/carthage/Update.swift
@ikesyo

This comment has been minimized.

Show comment
Hide comment
@ikesyo

ikesyo Dec 5, 2015

Member

Ideally build would also build nested dependencies if update does.

I agree with you.

But this may need to wait on #717?

Yes, that seems the blocker.

Member

ikesyo commented Dec 5, 2015

Ideally build would also build nested dependencies if update does.

I agree with you.

But this may need to wait on #717?

Yes, that seems the blocker.

@mdiep

This comment has been minimized.

Show comment
Hide comment
@mdiep

mdiep Dec 7, 2015

Member

To do this, I think we should reconsider the directoryPath positional argument of BuildOptions and CheckoutOptions.

I didn't even know that was a thing. 👍 to making that a named argument instance. --project-directory seems like a reasonable name and matches what CocoaPods uses.

Member

mdiep commented Dec 7, 2015

To do this, I think we should reconsider the directoryPath positional argument of BuildOptions and CheckoutOptions.

I didn't even know that was a thing. 👍 to making that a named argument instance. --project-directory seems like a reasonable name and matches what CocoaPods uses.

@mdiep

This comment has been minimized.

Show comment
Hide comment
@mdiep

mdiep Dec 7, 2015

Member

I'm pretty excited for this! Thanks for working on it!

Member

mdiep commented Dec 7, 2015

I'm pretty excited for this! Thanks for working on it!

@ikesyo

This comment has been minimized.

Show comment
Hide comment
@ikesyo

ikesyo Dec 8, 2015

Member

I didn't even know that was a thing. 👍 to making that a named argument instance. --project-directory seems like a reasonable name and matches what CocoaPods uses.

Okay, I'll do it first in another PR to separate the concern.

Member

ikesyo commented Dec 8, 2015

I didn't even know that was a thing. 👍 to making that a named argument instance. --project-directory seems like a reasonable name and matches what CocoaPods uses.

Okay, I'll do it first in another PR to separate the concern.

return { buildPlatform in { skipCurrent in { colorOptions in { verbose in { directoryPath in { dependenciesToBuild in
let dependenciesToBuild: [String]? = dependenciesToBuild.isEmpty ? nil : dependenciesToBuild
return self.init(configuration: configuration, buildPlatform: buildPlatform, skipCurrent: skipCurrent, colorOptions: colorOptions, verbose: verbose, directoryPath: directoryPath, dependenciesToBuild: dependenciesToBuild)
} } } } } }

This comment has been minimized.

@NachoSoto

NachoSoto Dec 15, 2015

Contributor

I bet Xcode ❤️ to parse this.

@NachoSoto

NachoSoto Dec 15, 2015

Contributor

I bet Xcode ❤️ to parse this.

@@ -48,6 +48,15 @@ internal func print<T>(object: T) {
}
}
extension String {
/// Split the string into substrings separated by the given separators.
internal func split(allowEmptySlices: Bool = false, separators: [Character] = [ ",", " " ]) -> [String] {

This comment has been minimized.

@NachoSoto

NachoSoto Dec 15, 2015

Contributor

Cool

@NachoSoto

NachoSoto Dec 15, 2015

Contributor

Cool

@NachoSoto

This comment has been minimized.

Show comment
Hide comment
@NachoSoto

NachoSoto Dec 15, 2015

Contributor

Just a bunch of nits, but the implementation looks great. Awesome job!

Contributor

NachoSoto commented Dec 15, 2015

Just a bunch of nits, but the implementation looks great. Awesome job!

@ikesyo

This comment has been minimized.

Show comment
Hide comment
@ikesyo

ikesyo Dec 15, 2015

Member

Appreciate your review! I applied them. 💥

Member

ikesyo commented Dec 15, 2015

Appreciate your review! I applied them. 💥

@ikesyo ikesyo referenced this pull request Dec 15, 2015

Closed

Install Command #990

@mdiep

This comment has been minimized.

Show comment
Hide comment
@mdiep

mdiep Dec 17, 2015

Member

🤘

Member

mdiep commented Dec 17, 2015

🤘

mdiep added a commit that referenced this pull request Dec 17, 2015

Merge pull request #972 from Carthage/update-and-build-specific-denpe…
…ndencies

Support specifying dependencies list in `build` / `checkout` / `update` commands

@mdiep mdiep merged commit e634924 into master Dec 17, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@mdiep mdiep deleted the update-and-build-specific-denpendencies branch Dec 17, 2015

@mdiep mdiep referenced this pull request Dec 17, 2015

Closed

[WIP] Ability to build only one dependency #886

0 of 3 tasks complete
@NachoSoto

This comment has been minimized.

Show comment
Hide comment
@NachoSoto

NachoSoto Dec 17, 2015

Contributor

😍

Contributor

NachoSoto commented Dec 17, 2015

😍

@ikesyo

This comment has been minimized.

Show comment
Hide comment
@ikesyo

ikesyo Dec 18, 2015

Member

🎉

Member

ikesyo commented Dec 18, 2015

🎉

@derpoliuk

This comment has been minimized.

Show comment
Hide comment
@derpoliuk

derpoliuk Jan 11, 2016

Thank you for a great feature! I'm trying to use it for frameworks added like git "https://enterprise.local/desktop/git-error-translations2.git". Is it even possible to do? I tried:

  • git SomeLib "https://enterprise.local/desktop/git-error-translations2.git" and then carthage update SomeLib
  • carthage update "https://enterprise.local/desktop/git-error-translations2.git"

Both didn't work. Maybe I'm missing something obvious? My framework is added via carthage update --use-submodules.

Any help will be highly appreciated. I want to save build time for me and other developers.

derpoliuk commented Jan 11, 2016

Thank you for a great feature! I'm trying to use it for frameworks added like git "https://enterprise.local/desktop/git-error-translations2.git". Is it even possible to do? I tried:

  • git SomeLib "https://enterprise.local/desktop/git-error-translations2.git" and then carthage update SomeLib
  • carthage update "https://enterprise.local/desktop/git-error-translations2.git"

Both didn't work. Maybe I'm missing something obvious? My framework is added via carthage update --use-submodules.

Any help will be highly appreciated. I want to save build time for me and other developers.

@ikesyo

This comment has been minimized.

Show comment
Hide comment
@ikesyo

ikesyo Jan 11, 2016

Member

@derpoliuk At first, git SomeLib "https://enterprise.local/desktop/git-error-translations2.git" is not a valid Cartfile syntax. That should be git "https://enterprise.local/desktop/git-error-translations2.git" as written in the documentation.

For git origins, you should specify the repository name which is the last path component of its URL with stripped .git suffix:

carthage update git-error-translations2 --use-submodules
Member

ikesyo commented Jan 11, 2016

@derpoliuk At first, git SomeLib "https://enterprise.local/desktop/git-error-translations2.git" is not a valid Cartfile syntax. That should be git "https://enterprise.local/desktop/git-error-translations2.git" as written in the documentation.

For git origins, you should specify the repository name which is the last path component of its URL with stripped .git suffix:

carthage update git-error-translations2 --use-submodules
@derpoliuk

This comment has been minimized.

Show comment
Hide comment
@derpoliuk

derpoliuk Jan 11, 2016

@ikesyo Thank you for a quick answer!

git SomeLib "https://enterprise.local/desktop/git-error-translations2.git" is not a valid Cartfile syntax.

I figured it out, just tried different approaches.

For git origins, you should specify the repository name which is the last path component with stripped .git suffix:
carthage update git-error-translations2 --use-submodules

Running this command (with real framework name of course) gives error:

Failed to read file or folder at /PATH_TO_PROJECT/git-error-translations2/Cartfile: 
Error Domain=NSCocoaErrorDomain Code=260 "The file “Cartfile” couldn’t be opened because there is no such file." 
UserInfo={NSFilePath=/PATH_TO_PROJECT/git-error-translations2/Cartfile,
 NSUnderlyingError=0x7fef39442a90 
 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

Running carthage build Carthage/Checkouts/git-error-translations2/ doesn't fail but it doesn't build neither.

I have Carthage v0.11

derpoliuk commented Jan 11, 2016

@ikesyo Thank you for a quick answer!

git SomeLib "https://enterprise.local/desktop/git-error-translations2.git" is not a valid Cartfile syntax.

I figured it out, just tried different approaches.

For git origins, you should specify the repository name which is the last path component with stripped .git suffix:
carthage update git-error-translations2 --use-submodules

Running this command (with real framework name of course) gives error:

Failed to read file or folder at /PATH_TO_PROJECT/git-error-translations2/Cartfile: 
Error Domain=NSCocoaErrorDomain Code=260 "The file “Cartfile” couldn’t be opened because there is no such file." 
UserInfo={NSFilePath=/PATH_TO_PROJECT/git-error-translations2/Cartfile,
 NSUnderlyingError=0x7fef39442a90 
 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

Running carthage build Carthage/Checkouts/git-error-translations2/ doesn't fail but it doesn't build neither.

I have Carthage v0.11

@ikesyo

This comment has been minimized.

Show comment
Hide comment
@ikesyo

ikesyo Jan 11, 2016

Member

I have Carthage v0.11

This feature (branch) was merged to master but not released yet.

Member

ikesyo commented Jan 11, 2016

I have Carthage v0.11

This feature (branch) was merged to master but not released yet.

@derpoliuk

This comment has been minimized.

Show comment
Hide comment
@derpoliuk

derpoliuk Jan 12, 2016

@ikesyo Thank you! Sorry, didn't pay enough attention for that =/

derpoliuk commented Jan 12, 2016

@ikesyo Thank you! Sorry, didn't pay enough attention for that =/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment