matthewprenger / CurseGradle

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

Error: "Cannot add task ':curseforge' as a task with that name already exists." #3

Closed DanielleHuisman closed 8 years ago

DanielleHuisman commented 8 years ago

I'm using the ForgeGradle-2.1 snapshots and for some reason I get this error on my local machine and on CircleCI for one project: Cannot add task ':curseforge' as a task with that name already exists. But another project on CircleCI with the exact same configuration does not get this error.

Full error: http://pastebin.com/2rXcH2Wc Build scripts:

Examples on CircleCI:

AbrarSyed commented 8 years ago

@matthewprenger I blame you

DanielleHuisman commented 8 years ago

Small note: it also happens on the latest version of CurseGradle (1.0.4)

matthewprenger commented 8 years ago

@DanielHuisman I just cloned your repo and tested in debug mode and I couldn't replicate the issue. My only thought is, are you using some kind of init script on the ci server that is creating a task called curseforge?

DanielleHuisman commented 8 years ago

No, the CI commands are in the circle.yml and all they do is use the Gradle wrapper to execute some commands. I will try wiping my Gradle caches on my local machine and try it, but I already tried clean and refreshing dependencies.

DanielleHuisman commented 8 years ago

Ok, I removed my .gradle directory (both in my user folder and in the project folder) and removed the build folder, but I still get exactly the same error.

matthewprenger commented 8 years ago

Can you get me a log with --info --stacktrace?

matthewprenger commented 8 years ago

OK @DanielHuisman I figured it out. The problem is this line. You're creating a project with an empty string for the ID. CurseGradle creates a task for each project called curseforge<ID>, and the main task that uploads all projects called curseforge. Since there is no ID for that project, it's creating a duplicate task name. I would recommend changing that line to default to noid or something else.

DanielleHuisman commented 8 years ago

Face palm, forgot to set the env variables on CircleCI, but will apply your change to fix local builds.