Coder Social home page Coder Social logo

Comments (8)

uschi2000 avatar uschi2000 commented on June 16, 2024

Do you have a minimal example that clarifies the inconsistency?

On Wed, Apr 20, 2016 at 2:29 PM Michael Nazario [email protected]
wrote:

I was quite confused to have to use real task objects rather than strings
in the dependsOn field in the docker block. We should be able to use
string-based input too just like a normal gradle task.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#40

from gradle-docker.

mnazbro avatar mnazbro commented on June 16, 2024
task bar() {
}
task foo() {
    dependsOn bar
}

and

task foo() {
    dependsOn 'bar'
}
task bar() {
}

vs

task foo() {
}
docker {
    name 'hub.docker.com/username/my-app:version'
    dependsOn foo
}

and

task foo() {
}
docker {
    name 'hub.docker.com/username/my-app:version'
    dependsOn 'foo'
}

from gradle-docker.

mnazbro avatar mnazbro commented on June 16, 2024

It's important to note that the string version allows you to have not defined the task yet (and use a path to a task in a different project)

from gradle-docker.

uschi2000 avatar uschi2000 commented on June 16, 2024

Hmm, it's odd that the docker plugin configures dependencies via the
DockerExtension. A more natural implementation would use task dependencies
instead.

On Wed, Apr 20, 2016 at 3:09 PM Michael Nazario [email protected]
wrote:

It's important to note that the string version allows you to have not
defined the task yet (and use a path to a task in a different project)


You are receiving this because you commented.

Reply to this email directly or view it on GitHub
#40 (comment)

from gradle-docker.

mnazbro avatar mnazbro commented on June 16, 2024

The DockerExtension also does something extra though. It copies the output of each of those dependsOn tasks into the docker build folder.

from gradle-docker.

uschi2000 avatar uschi2000 commented on June 16, 2024

Yep, I know. But really the task should do that.

On Wed, Apr 20, 2016 at 5:12 PM Michael Nazario [email protected]
wrote:

The DockerExtension also does something extra though. It copies the output
of each of those dependsOn tasks into the docker build folder.


You are receiving this because you commented.

Reply to this email directly or view it on GitHub
#40 (comment)

from gradle-docker.

rmelick avatar rmelick commented on June 16, 2024

I agree. Why is the docker task created by this plugin different from a normal gradle task, which would allow me to use the normal dependsOn?

I did figure out a workaround to allow referencing tasks by string, but it seems like there should be a better way to fix this. You can use the tasks.getByPath method (see https://docs.gradle.org/current/userguide/more_about_tasks.html)

dependsOn tasks.getByPath('bar')

Any guidance on where the docker task is defined in the code? I'm happy to send a pull request (although this would be the first gradle plugin I've worked on).

from gradle-docker.

markelliot avatar markelliot commented on June 16, 2024

We need/want to actually capture the task outputs when using dependsOn in the configuration. You can always grab the task and encode a dependency using something like tasks.docker to get a handle on it and add your dependencies.

from gradle-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.