Gradle Dependency Documentation
andrewminer opened this issue ยท 3 comments
I was trying to follow the documentation for add a dependency on Buildcraft and found that that the instructions didn't quite work for me. I am using an older version of Minecraft (1.7.10) along with matching version of ForgeGradle (2.2), so it may just be me, but I figured I'd mention it, and let you decide if updating the docs would be helpful.
First, I should mention that this is the first time I've worked with Gradle, so part of my confusion is undoubtedly that.
The first source of confusion was where it mentions to add a new ivy
repository; I got things wrong at first because I added it to the repositories
section of the buildscripts
part of the file. I eventually realized that I needed to create a new repositories
section at the root level.
The second confusing bit was that my version of the build process doesn't have a deobfCompile
step. Instead, I needed to add:
dependencies {
compile name: "buildcraft", version: "7.1.17", classifier:"dev"
}
Figuring out that I needed to add the classifier
part also took a while as I got some very unhelpful "Method not found" errors, and it only slowly dawned on me that I needed a de-obfuscated version of the BuildCraft jar.
I'm all set now, so I don't need anything further, but I thought this might help improve the documentation for others who are in a similar situation as myself.
deobfCompile
does exist, it's not a task on it's own but it's an identifier for both tasks, the reason you've been getting method not found errors is because right now you told gradle the BC file is only needed to compile it, meaning it didn't add the file to be used in your IDE or when launching MC
@andrewminer Unfortunately this was caused by you followiwing the 7.2.x dev setup - and it is different to the 7.1.x setup. Currently they are separated depending on which branch you are looking at (although the default branch is 7.2.x and there is nothing saying how to get to the 7.1.x one).
@AEnterprise that's not quite how it works - deobfCompile is provided by ForgeGradle in mc 1.8+ as a way to automatically deobfuscate required mods to the current mcp mappings. (Gradle will always add all required files as specified in compile to your ide workspace)
the reason you've been getting method not found errors is because right now you told gradle the BC file is only needed to compile it, meaning it didn't add the file to be used in your IDE or when launching MC
Oddly, enough, I was running into those errors when running Gradle from the command line for the reasons @AlexIIL mentioned. By the time I figured out those problems, I just used the eclipse
target from the command-line to update the Eclipse classpath and didn't have any further problems.
Unfortunately this was caused by you followiwing the 7.2.x dev setup
Thanks for the explanation! That makes much more sense. It would be great if all versions of the documentation mentioned how that works and advised people to switch to the appropriate branch for the correct instructions. Thanks again!