Skip to content

Discussion: Version with loosened dependencies? #12

Closed

Description

@JustinGrote

Since this is aiming to be a "library" of tasks and a framework to use for opinionated templates, perhaps some of the dependency ordering should be loosened?

For instance, maybe I don't want Publish to depend on Test, or maybe I don't want Test to be dependent on Pester because I want to use my own testing framework.

I was thinking of a variable(s?) to make these dependencies conditional. The dependencies would be on by default, but you could set the variable that would effectively remove all the dependencies and then you can pick-and-choose the tasks/jobs and assign dependencies as required in the downstream template.

This would be an "at-your-own-risk" item, but also should probably focus on individual tasks also being autonomous and not being "truly" dependent on each other (e.g. won't fail if a dependency isn't met)

For tasks that require interoperation, could define high level tasks like "Build", "Test", "Publish" but those are just empty tasks with dependencies, so that those could be overridden in the script.

Activity

  1. devblackops commented on Nov 21, 2018

    @devblackops
    Member

    @JustinGrote I was thinking the same thing. We can define default dependencies via $PSBPreference properties and allow the user to modify those if needed.

    Default Publish task dependency in build.properties.ps1

    $PSBPreference.TaskDependencies.Publish = 'Test'

    psakeFile.ps1

    task Publish -depends $PSBPreference.TaskDependencies.Publish {
        ...
    }

    Override Publish task dependency in your psakeFile.ps1

    $PSBPreference.TaskDependencies.Publish = 'MyOwnTest'
  2. added a commit that references this issue on Mar 31, 2025
    5f85aba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions