Open jascotty2 opened 6 years ago
Yep, I've seen this, haven't looked into it fully yet. I don't use any of the forge annotation features, so I haven't worried about this too much (it doesn't affect the build). I'm pretty sure this is an issue in ForgeGradle itself, which I'll investigate when I have time.
The final jar shouldn't have a duplicate litemod.json file (at least on my machine it doesn't). If it does, please let me know.
It does
Can't reproduce :/ (I did a clean build, after deleting all of the produced jars)
However, I know this happens... so I'm going to have to keep testing (maybe it doesn't happen on windows? but it happened on windows before?)
Using Oracle Java 8 (1.8.0_151) for Linux, and Engrampa 1.18.3 to read the archive. What java version are you using to build with? The files in the releases directory are ok - just the ones I built have that error
I'm using Oracle java 1.8.0_162 on windows, and I've used 7-zip (from past experience I know 7-zip handles multiple files with the same name correctly; it displays both of them).
Can reproduce the error message now, though the built jar still doesn't contain a duplicate litemod.json on my machine. However, I do see that the input
jar in build/tmp/extractAnnotationsJar
, and in fact the one in build/unobfJar
is like that too.
See also #70. It looks like the unobfuscated jar having a duplicate litemod.json is a pretty old issue, but normally that's solved after reobf.
Normally, the extractAnnotationsJar
task works off of the reobf'd jar, but it targets the regular jar. This happens because the reobf task is designed to change the jar in place. Since that's caused me pain before (that's what #70 was), I've tweaked that task to not do it in place. But, that means extractAnnotationsJar
doesn't target the right jar for me, because it works on the non-replaced one instead of the new one.
This does seem to cause other issues, so I'll be submitting it to FG first instead of fixing it in begradle.
I've created an FG issue for the litemod task generating an extra one, and have pushed a change that will hopefully fix the task too (there's some other work with it that I'd like to do soon though, but I'd like to know if this change helps or not).
EDIT: actually pushed, seems like I forgot to do so yesterday
Refreshed everything to try this out, and getting another error, this time getting the environment set up: $ ./gradlew install
FAILURE: Build failed with an exception.
Where: Build file '/home/jacob/Data/Jacob/Programs/Java/WorldDownloader/WorldDownloader-4/build.gradle' line: 39
What went wrong: A problem occurred evaluating root project 'WorldDownloader-4'.
A problem occurred configuring project ':1.11.2'. Could not resolve all files for configuration ':1.11.2:classpath'. Could not find pokechu22.test.begradle:begradle:0.1.3. Searched in the following locations: file:/home/jacob/.m2/repository/pokechu22/test/begradle/begradle/0.1.3/begradle-0.1.3.pom file:/home/jacob/.m2/repository/pokechu22/test/begradle/begradle/0.1.3/begradle-0.1.3.jar https://repo.maven.apache.org/maven2/pokechu22/test/begradle/begradle/0.1.3/begradle-0.1.3.pom https://repo.maven.apache.org/maven2/pokechu22/test/begradle/begradle/0.1.3/begradle-0.1.3.jar https://oss.sonatype.org/content/repositories/snapshots/pokechu22/test/begradle/begradle/0.1.3/begradle-0.1.3.pom https://oss.sonatype.org/content/repositories/snapshots/pokechu22/test/begradle/begradle/0.1.3/begradle-0.1.3.jar http://files.minecraftforge.net/maven/pokechu22/test/begradle/begradle/0.1.3/begradle-0.1.3.pom http://files.minecraftforge.net/maven/pokechu22/test/begradle/begradle/0.1.3/begradle-0.1.3.jar https://jcenter.bintray.com/pokechu22/test/begradle/begradle/0.1.3/begradle-0.1.3.pom https://jcenter.bintray.com/pokechu22/test/begradle/begradle/0.1.3/begradle-0.1.3.jar
Oh, I did something silly. I pushed v0.1.3 for BEGradle, but then I pushed another commit to mark it as 0.1.4-SNAPSHOT. In begradle if you run git checkout v0.1.3
first it'll give you that version.
I really need to set up a maven repo for it at some point; having to manually build it is a bit of a mess.
the file in [version]-litemod/build/unobfJar still gets two copies of the same entry, but the compile works without error now and the version that's copied to libs works correctly :)
Are you on a case-sensitive filesystem?
Yes.
I can reproduce the duplicate one before obf (and I've created this forgegradle issue for that), though it's still something that ideally shouldn't be happening. I'll also note that I'm using a case-insensitive file system.
Not just for 1.12, but this seems to happen to all versions
Two "litemod.json" files will be added to the root of the file For example, the 1.10.litemod's root has one "litemod.json" that is 115 bytes, and another that is 242 bytes
(etc)