Skip to content
This repository has been archived by the owner on Oct 22, 2023. It is now read-only.

Pass extra arguments to prerequisite tasks #1053

Open
charleskorn opened this issue Oct 5, 2021 · 4 comments
Open

Pass extra arguments to prerequisite tasks #1053

charleskorn opened this issue Oct 5, 2021 · 4 comments
Labels

Comments

@charleskorn
Copy link
Collaborator

charleskorn commented Oct 5, 2021

Is it also possible to pass those extra arguments for tasks (here: "build") as part of task prerequisites? I tried

task:
  prerequisites:
    - run-gradle build

and

task:
  prerequisites:
    - run-gradle -- build

but neither works.

Originally posted by @sschuberth in #1012 (comment)

@charleskorn
Copy link
Collaborator Author

@sschuberth could you talk a little more about your use case? I'm interested to understand what you're trying to achieve in case there's another way to provide the same end result in another way.

@sschuberth
Copy link
Contributor

Sure thing. I've defined a task like

tasks:
  gradle:
    description: >-
      A generic task that "forwards" task arguments to Gradle. Use it like
      `./batect gradle -- installDist`.
    run:
      container: build
      command: ./gradlew --stacktrace

and now my idea was to define another task like

  requirements:
    description: >-
      A task to check ORT's requirements against the runtime container.
    prerequisites:
      - gradle installDist
    run:
      container: run
      command: ./cli/build/install/ort/bin/ort requirements

That, however, does not work. What I'm currently doing as a work-around is to define yet one more intermediate task like

  buildCli:
    description: >-
      A convenience task to build (but not run) ORT's command line interface.
    run:
      container: build
      command: ./gradlew --stacktrace installDist

and then replace the prerequisite "gradle installDist" with "buildCli".

@charleskorn
Copy link
Collaborator Author

Makes sense, thanks for explaining @sschuberth.

@stale
Copy link

stale bot commented Dec 6, 2021

This issue has been automatically marked as stale because it has not had any activity in the last 60 days. It will automatically be closed if no further activity occurs in the next seven days to enable maintainers to focus on the most important issues.
If this issue is still affecting you, please comment below within the next seven days.
Thank you for your contributions.

@stale stale bot added the stale label Dec 6, 2021
@charleskorn charleskorn added the frozen Issue should not be marked as stale label Dec 6, 2021
@stale stale bot removed the stale label Dec 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants