Jump to content

How do I add github dependencies to build.gradle?


That_Martin_Guy
 Share

Recommended Posts

A mod I want to create requires CoFH core, and I see no source download for this. Therefore I go onto their github and try and add the clone command found there to my build.gradle 

dependencies { compile 'https://github.com/CoFH/CoFHCore.git' }

(The code isn't actually all on one line, the formatter was just not happy with me copy pasting it.)

 

I run "gradlew setupDecompWorkspace --refresh-dependencies", followed by gradlew dependencies, but it says lines like

testRuntime - Runtime dependencies for source set 'test'.
\--- https://github.com/CoFH/CoFHCore.git: FAILED

.

 

So instead I use  

compile 'scm:git:git://github.com/CoFH/CoFHCore.git'

which I found in their build.gradle, but it provides a similar result. What am I doing wrong?

Link to comment
Share on other sites

26 minutes ago, diesieben07 said:

You can't add github repositories as a dependency by default. You can use something like https://jitpack.io/ though.

I did find an existing version of CoFH-Core on there, but when I ran gradlew dependencies it showed

testRuntime - Runtime dependencies for source set 'test'.
+--- com.github.CoFH:CoFHCore:a19dbc5eea
|    \--- mezz.jei:jei_1.11.2:4.5.0.+ FAILED

Is this an error on CoFH's part? I don't think 4.5.0.+ is a valid version of JEI (I might be wrong though). Also, I tried adding my own version of JEI, also via jitpack, but JEI doesn't show up in game, and no new files are created in my project directory. Is this intended? Do I still need a jar for viewing the CoFH's source code in my IDE?

Edited by That_Martin_Guy
Link to comment
Share on other sites

So I simply cloned the 1.10.2 branch (since that is the version I'm working on) and moved the src folders to my project. However, I get a ton of errors in IDEA (mostly related to IDEA not recognizing it should compile for java 1.8). If I try to use gradlew runClient with the dependencies in build.gradle it tells me this:

> Could not find mezz.jei:jei_1.10.2:3.14.7.416.
  Searched in the following locations:
      http://files.minecraftforge.net/maven/mezz/jei/jei_1.10.2/3.14.7.416/jei_1.10.2-3.14.7.416.pom
      http://files.minecraftforge.net/maven/mezz/jei/jei_1.10.2/3.14.7.416/jei_1.10.2-3.14.7.416.jar
      https://repo1.maven.org/maven2/mezz/jei/jei_1.10.2/3.14.7.416/jei_1.10.2-3.14.7.416.pom
      https://repo1.maven.org/maven2/mezz/jei/jei_1.10.2/3.14.7.416/jei_1.10.2-3.14.7.416.jar
      https://libraries.minecraft.net/mezz/jei/jei_1.10.2/3.14.7.416/jei_1.10.2-3.14.7.416.pom
      https://libraries.minecraft.net/mezz/jei/jei_1.10.2/3.14.7.416/jei_1.10.2-3.14.7.416.jar
      https://jitpack.io/mezz/jei/jei_1.10.2/3.14.7.416/jei_1.10.2-3.14.7.416.pom
      https://jitpack.io/mezz/jei/jei_1.10.2/3.14.7.416/jei_1.10.2-3.14.7.416.jar
      file:/C:/Users/Axel/.gradle/caches/minecraft/deobfedDeps/mezz/jei/jei_1.10.2/3.14.7.416/jei_1.10.2-3.14.7.416.pom
      file:/C:/Users/Axel/.gradle/caches/minecraft/deobfedDeps/mezz/jei/jei_1.10.2/3.14.7.416/jei_1.10.2-3.14.7.416.jar
      file:/D:/Java Projects/Minecraft Mods/Brighten Up/.gradle/minecraft/jei_1.10.2-3.14.7.416.jar
      file:/D:/Java Projects/Minecraft Mods/Brighten Up/.gradle/minecraft/jei_1.10.2.jar

. If I remove the dependencies from build.gradle the output still gives a ton of errors, mostly it telling me not to use code only available in java 1.7+. What did I do wrong?

Link to comment
Share on other sites

6 hours ago, That_Martin_Guy said:

I did find an existing version of CoFH-Core on there, but when I ran gradlew dependencies it showed


testRuntime - Runtime dependencies for source set 'test'.
+--- com.github.CoFH:CoFHCore:a19dbc5eea
|    \--- mezz.jei:jei_1.11.2:4.5.0.+ FAILED

Is this an error on CoFH's part? I don't think 4.5.0.+ is a valid version of JEI (I might be wrong though). Also, I tried adding my own version of JEI, also via jitpack, but JEI doesn't show up in game, and no new files are created in my project directory. Is this intended? Do I still need a jar for viewing the CoFH's source code in my IDE?

 

You need add the dependency repositories used by CoFH to your build.gradle file manually, JitPack doesn't seem to handle that automatically.

 

Basically, copy the repositories from the repositories section of CoFHCore's build.gradle file into the repositories section of your build.gradle file. Use the repositories sections in the main body, not in the buildscript section.

 

I also had to add the universal classifier to the CoFHCore dependency, e.g. deobfCompile 'com.github.CoFH:CoFHCore:f60b7b70fe:universal'.

Edited by Choonster

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I'm researching the how to create biomes in json. There is a great tool for creating the jsons online. Using the vanilla `river` biome, I want to essentially create a custom disk feature that mixes 3 blocks instead of a single-block provider. Any ideas on where to start with that?
    • I figured out what was wrong ... you can spot it pretty quick most likely: { "type": "minecraft:smelting", "ingredient": { "item": "minecraft:gold_nugget_ore" }, "result": "minecraft:gold_nugget", "experience": 0.25, "cookingtime": 150 }   ... so, after changing `minecraft` to `foundations` for all the custom items and all the recipes work. Well that's what copy/paste will get you. One last question about recipes, though. What does the following json key/value do in the game? "group": "copper_ingot"  
    • # Copyright (c) 1993-2009 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a '#' symbol. # # For example: # #      102.54.94.97     rhino.acme.com          # source server #       38.25.63.10     x.acme.com              # x client host # localhost name resolution is handled within DNS itself. #    127.0.0.1       localhost #    ::1             localhost ###0.0.0.0 apps.corel.com ###0.0.0.0 mc.corel.com 0.0.0.0 origin-mc.corel.com ###0.0.0.0 iws.corel.com
    • Is there a way to create a custom map marker for a custom structure/biome (same as a vanilla mansion)?
    • I’ve scrounged the Internet for solutions and found absolutely nothing that has worked for me I have posted my code in a GitHub Repository. I bet the culprit is somewhere in the Container or TileEntity classes (Furnace packages are in blocks/coke_furnace or blocks/foundry) PS I know I’m on 1.12.2 and that it’s not supported I don’t want to update my game or my code. Lol It’s my favorite version and the most widely modded. I don’t plan to release the mod, I’m just customizing my game to my will. I’ll send it to friends but that’s it.
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.