modrinth / minotaur

Gradle plugin for deploying build artifacts to Modrinth.
GNU Lesser General Public License v2.1
81 stars 15 forks source link

The upload file is missing or null. task ':subproject:remapSourcesJar' #25

Closed axieum closed 2 years ago

axieum commented 2 years ago

Describe the bug
Modrinth does not wait for subproject builds to finish.

To Reproduce
Steps to reproduce the behavior:

  1. Add a subproject's task as an additional file
  2. Clean out your build folder
  3. Publish Modrinth and watch it fail to find a file

Find problematic build.gradle here: https://github.com/axieum/fabric-example-mod/blob/16bfd3b7afecf5e22fd6a0a346d1afd3515115e9/build.gradle#L139-L174

Expected behavior
To wait for subproject tasks to produce the artifacts before trying to upload them.

Attempts to fix

Adding the following line to the build.gradle, but I don't think it only works as a coincidence as I only have one layer deep of subprojects:

tasks.modrinth.dependsOn subprojects.collect { it.tasks.build }

Screenshots

00:43:33: Executing 'modrinth'...

> Configure project :
Fabric Loom: 0.12.48
Fabric Loom: 0.12.48

> Task :example-submod:compileJava
> Task :example-submod:processResources
> Task :example-submod:classes
> Task :example-submod:jar
> Task :compileJava
> Task :processResources
> Task :classes
> Task :jar
> Task :javadoc
> Task :javadocJar
> Task :prepareRemapJar
> Task :example-submod:prepareRemapJar
> Task :sourcesJar
> Task :remapSourcesJar
> Task :checkstyleMain
> Task :compileTestJava
> Task :processTestResources NO-SOURCE
> Task :testClasses
> Task :checkstyleTest
> Task :example-submod:remapJar
> Task :test
> Task :validateAccessWidener NO-SOURCE
> Task :check
> Task :remapJar
> Task :assemble
> Task :build

> Task :modrinth FAILED
Minotaur: 2.2.0
The upload file is missing or null. task ':example-submod:remapSourcesJar'

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':modrinth'.
> The upload file is missing or null. task ':example-submod:remapSourcesJar'

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 5s
19 actionable tasks: 19 executed
00:43:39: Execution finished 'modrinth'.

Environment Info:

Additional context

matthewprenger/CurseGradle runs okay with no additional setup, and I believe it is due to these lines:

https://github.com/matthewprenger/CurseGradle/blob/2167af2c8a8a7d781d5e792b422b3337d6b1dac8/src/main/groovy/com/matthewprenger/cursegradle/CurseGradlePlugin.groovy#L71-L93

triphora commented 2 years ago

Thanks for the report! Fixed in v2.2.1

axieum commented 2 years ago

Excellent, this works great! Thank you for fixing this very fast - I appreciate it. 😊