Quantcast
Channel: Gradle Forums - Latest posts
Viewing all articles
Browse latest Browse all 19850

Specify the order when a task depends on 2 other tasks

$
0
0

Hi @Shuyinsama,

It is generally the better approach to declare dependencies between projects instead of dependencies between tasks. E.g.:

backend.gradle

dependencies {
  implementation project(":frontend")
}

If that is set up correctly, Gradle will always execute things in the right order.

If you need to share other artifacts than the jar file(s) (which are the default artifacts if you built Java projects) you can define your own artifacts. You can also set that up without applying a Java plugin at all, if you are not compiling Java sources. Please have a look at the documentation on Sharing outputs between projects. Let me know if you are stuck with something in your non-Java centric use case.

There are quite some improvements in this area with the latest Gradle 5 and Gradle 6 versions. So I would recommend using the latest Gradle version if you can.


Viewing all articles
Browse latest Browse all 19850

Trending Articles