Closed Jonathing closed 3 years ago
Not sure about javadoc part, but looks like sources were fixed in https://github.com/MinecraftForge/ForgeGradle/pull/746.
Not sure about javadoc part, but looks like sources were fixed in #746.
Yup, I think that's good enough for now. Honestly, there probably isn't a need for the javadoc jar to be renamed anyway. Thank you very much, and sorry for the late response!
The problem
Hi all! I've noticed a bit of a weird and incredibly inconvenient issue with
fg.deobf
wherein whenever you use it to decompile a jar from a maven, it completely ignores javadoc and source jars that might also be up in the same location on the maven repository.Here's an example. I work on a mod with a few of my friends that requires a dependency mod we made called Structure Gel API. We recently launched a maven repository to make dependency handling for us easier, and so we've been able to add Structure Gel API as a dependency like so:
This works great on its own, but we also have a javadoc jar and a sources jar on the same location where the main built jar is located (for context, it's right here: https://maven.moddinglegacy.com/artifactory/modding-legacy/com/legacy/structure-gel/1.16.4-1.7.3/). However they are completely ignored by
fg.deobf
and are never actually added to the project. To my knowledge, usingcompile
on its own withoutfg.deobf
does not have this problem.Workaround (Eclipse only; very hacky)
I was able to workaround this problem in the buildscript by manually downloading the javadoc and sources jars with the Gradle Download Task, but obviously, the most idea solution would be for ForageGradle's
fg.deobf
dependency task to take into account potential sources and javadocs and attach them with the given dependency at hand.This workaround only works for Eclipse because the eclipse task actually outputs a file containing all of the dependencies of the gradle project, which can then be tinkered with in the buildscript. IntelliJ doesn't do that, so you'd have to manually re-add the sources jar and javadoc jar on each gradle project refresh.
For anyone interested in this workaround, here is what I wrote. Please do take into account variable names (which are stored in
gradle.properties
) and URLs I used and replace them with whatever you might need. Standard Gradle buildscript stuff.Top of the
build.gradle
Anywhere in
build.gradle
If there's anything else you might want me to clarify, feel free to make a comment and I'll answer as best as I can. Thanks for your time and patience!