matthewprenger / CurseGradle

Gradle plugin to upload Minecraft mods to CurseForge
MIT License
1 stars 1 forks source link

ForgeGradle SignJar task executed after the upload task #14

Closed UpcraftLP closed 6 years ago

UpcraftLP commented 6 years ago

when uploading a mod to curseforge the project-specific task is executed before the sign jar task(s) are invoked, leading to uploading unsigned jars.

my current gradle configuration can be found here

Gradle Wrapper 2.14.1 CurseGradle 1.0-SNAPSHOT (also tried 1.0.9 and 1.0.10) ForgeGradle 2.0-SNAPSHOT Forge Mapings: stable_18 MC 1.8.0 Forge 11.14.4.1577

This is a recent gradle build log: gradle.log

I don't really know if this is a real issue or if I just derped when configuring gradle, so sorry if this is my fault, and thanks for the help anyways ;D

HyCraftHD commented 6 years ago

You can fix this with some gradle dependsOn stuff. First let the build depend on signJar: build.dependsOn signJar And add in your curseforge block this: tasks.curseforge.dependsOn build Here is the whole gradle file: https://github.com/HyCraftHD/Worldgeneration-Profiler/blob/master/build.gradle#L69-L86

UpcraftLP commented 6 years ago

You can fix this with some gradle dependsOn stuff. First let the build depend on signJar: build.dependsOn signJar And add in your curseforge block this: tasks.curseforge.dependsOn build

if you had looked at my gradle build file then you had noticed that I am already doing that, however uploading is done in the project-specific task which is executed BEFORE the sign task.

HyCraftHD commented 6 years ago

Thats the strage gradle behaviour of dependencies. Try this tasks.curseforge.dependsOn publish in or after the curseforge task. Then it should work. (At least for me it does)

Stormwind99 commented 6 years ago

I'm seeing the same behavior, but worse...

Correction: I was just seeing the same problem, and the workaround worked for me - thanks @HyCraftHD .

My other issues were caused by my dependencies section using "compile" instead of "deobfCompile" declarations.

UpcraftLP commented 6 years ago

fixed it using those two lines on 1.0.11: tasks.curseforge.mustRunAfter signJar, signDeobfJar, signJavadocJar tasks.curseforge.dependsOn build