Skip to content

Conversation

@nekrich
Copy link
Member

@nekrich nekrich commented Jun 24, 2025

Pull Request Template

Description

ResolveCommand refactoring.

  • Add validate method to read, validate and store configuration.
  • Normalize names for parameters (config, output, cache), but use explicit variable names.
  • No short name for cache since it conflicts with --config/-c.
  • Parameters are optional and resolved as specified in the BinaryDependenciesConfigurationReader. It tries to locate existing paths; otherwise, it reverts to the default.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Screenshots (if applicable)

Additional Context

Add any other context or screenshots about the pull request here.

@nekrich nekrich requested a review from PaulTaykalo June 24, 2025 09:40
@nekrich nekrich force-pushed the chore/refactor-resolve-command branch from 7ef56e9 to bf0cc3c Compare June 24, 2025 09:41
```sh
./Binary/binary-dependencies-manager \
--dependencies path/to/dependencies.json \
--config path/to/.binary-dependencies.yaml \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:sigh:

README.md Outdated
output: MyLibrary
- repo: AnotherOrg/AnotherBinary
tag: 0.9.0
checksum: d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some easter egg will be great here. i.e.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. It's a hash sum of MacPaw ❤️

cacheDirectoryPath: cacheDirectoryPath,
outputDirectoryPath: outputDirectoryPath
dependencies: configuration!.dependencies,
cacheDirectoryPath: cacheDirectoryPath!,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run throws. No force casts, please
assertionFailure, preconditionafailure. not force casts

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@nekrich nekrich requested a review from PaulTaykalo June 24, 2025 10:00
import Utils

public struct DependenciesResolverRunner {
public struct DependenciesResolverRunner: Codable {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Storing it as a var in the ParsableCommand requires it to be Decodable

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong on so many levels.. can we just creat this runner in Run? and avoid having this as a property?

@nekrich nekrich force-pushed the chore/refactor-resolve-command branch from bfe3dac to bdd40ed Compare June 24, 2025 11:41
@nekrich nekrich force-pushed the chore/refactor-resolve-command branch from bdd40ed to 3d5d165 Compare June 24, 2025 11:43
@nekrich nekrich merged commit 33097ed into chore/refactor Jun 24, 2025
1 check passed
@nekrich nekrich deleted the chore/refactor-resolve-command branch June 26, 2025 04:54
nekrich added a commit that referenced this pull request Jun 26, 2025
* chore: refactor resolve command

* chore: update resolve command

* chore: add precondition

* chore: add easter egg

* chore: store dependenciesResolver

* chore: fix unwrapping
nekrich added a commit that referenced this pull request Jul 1, 2025
…rt (#30)

* chore: ignore SPM folders

* chore: add BinaryDependenciesConfiguration (#9)

* chore: add yams (#7)

* chore: add config reader (#10)

* fix: make sure that tests can be ran with                 `BinaryDependencyManager` target (#8)

* fix: rename BinaryDependenciesManager to binary_dependencies_manager

* fix: Make sure that target naming is CamelCase and tests works

* fix: add Utils which is used from the Manager and the Runenr

* fix: Add binary file to exclude

* chpore: fix imports

---------

Co-authored-by: Paul Taykalo <ptaykalo@macpaw.com>

* chore: chore: add CLI and GitHub (#12)

* chore: add Asset to Dependency (#13)

* chore: add version (#11)

* chore: public interface (#14)

* chore: add BinaryDependenciesDownloader (#16)

* chore: add GenericError (#17)

* chore: add version to the BinaryDependenciesManager (#18)

* chore: refactor resolve command (#15)

* chore: refactor resolve command

* chore: update resolve command

* chore: add precondition

* chore: add easter egg

* chore: store dependenciesResolver

* chore: fix unwrapping

* chore: update file manager protocol (#20)

* chore: remove unneded downloadSourceCode method (#26)

* fix: resolve command (#23)

* chore: update CleanCommand (#22)

* chore: validate CLI run exit code (#24)

* chore: Utils tests target (#25)

* chore: add copyItem to FileManagerProtocol (#33)

* chore: add ChecksumCalculatorProtocol (#32)

* ci: add test workflow [refactor branch] (#28)

* ci: add test workflow

* fix(ci): linux build

* chore: specify derived data for xcodebuild

* chore: update Sources/BinaryDependencyManager/Utils/BinaryDependenciesConfigurationReader.swift

* chore: refactor runner (#19)

* chore: refactor DepeneciesResolverRunner

* chore: Tests cleanup (#34)

* Remove deduplication and simplify test setup

* A bit refactored tests

* fix: failing test with uuid neste temp dir

* fix: unwrapping

* chore: bump min target (#35)

---------

Co-authored-by: Paul Taykalo <ptaykalo@macpaw.com>

* chore: refactor download tests (#36)

* fix: ci compilation (#38)

* chore: refactor tests (#37)

* chore: standartize file URLs and update tests (#39)

---------

Co-authored-by: Paul Taykalo <ptaykalo@macpaw.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants