MinecraftForge / ForgeGradle

Minecraft mod development framework used by Forge and FML for the gradle build system
GNU Lesser General Public License v2.1
514 stars 443 forks source link

MISSING REPLACEMENT DATA FOR RUN_DIR when using Gradle 4.5 #469

Closed Pokechu22 closed 6 years ago

Pokechu22 commented 6 years ago
  1. Download the latest forge MDK.

  2. Check ./gradlew -v to see that the version is 2.14.

  3. Run ./gradlew build → everything works

  4. Update the gradle wrapper to 4.4.1:

    ./gradlew wrapper --gradle-version=4.4.1

  5. Run ./gradlew build → everything works

  6. Update the gradle wrapper to 4.5:

    ./gradlew wrapper --gradle-version=4.5

  7. Run ./gradlew build → failure

The build fails with the following message (runDir is still specified in build.gradle; build.gradle hasn't been edited at all during this process):

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\Pokechu22\Downloads\forge-1.12.2-14.23.1.2604-mdk\build.gradle' line: 10

* What went wrong:
A problem occurred evaluating root project 'forge-1.12.2-14.23.1.2604-mdk'.
> Failed to apply plugin [id 'net.minecraftforge.gradle.forge']
   > MISSING REPLACEMENT DATA FOR RUN_DIR

* 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 48s

Full log, with --debug --stacktrace: https://gist.github.com/Pokechu22/b91a8447d6977cb9a376b488c6622871

Pokechu22 commented 6 years ago

The problematic change: gradle/gradle@d7c6df20509781fedacfc9aea24b1f71e88ec768, which made it so that the call to exec.workingDir(delayedFile(REPLACE_RUN_DIR)); is evaluated immediately.

Specific line that broke this.

BrainStone commented 6 years ago

I'm experiencing this issue too.

CDAGaming commented 6 years ago

Oddly this issue didn't occur to me, though it did for a friend of mine. Weird.

supertassu commented 6 years ago

Same for me.

arlyon commented 6 years ago

Following the steps outlined above produces the same result for me too, latest java version, macOS

LexManos commented 6 years ago

Havent had time to look into this, if someone wants to write up and test a PR go for it. Until then just dont use 4.5, use something less.

delvr commented 6 years ago

Still occurs with 4.6 unfortunately.

liach commented 6 years ago

Pull request #480 comes with a fix.

ghost commented 6 years ago

Anyone going to merge liach's pr? Still having this issue on 4.6.

CDAGaming commented 6 years ago

Same here, anyone wanna merge it soon?

tomasbrod commented 6 years ago

Gradle 4.6, failure still present.

liach commented 6 years ago

@tomasbrod Upload log. Two things:

  1. It might be different bug
  2. You might be using ForgeGradle 1.2, 2.0, or 2.1; that bug is not fixed on those versions.
tomasbrod commented 6 years ago

Oh, I thought this was gradle issue, not forge. It is the same issue, because though I am using the newest gradle, I need older ForgeGradle (for 1.7.10) and that does not have the patches.

CDAGaming commented 6 years ago

Pretty sure either I or @liach can take some time to backport #480 to the older FG versions :D

CDAGaming commented 6 years ago

Hm Well seems #480 was backported by someone else to 2.2, in this case just 2.1 and 2.0 would remain for it to be backported (Not even sure anyone is still using 1.2 of FG)