Posted August 22, 201411 yr Is there a way to have the RF API available on Github as a dependency in build.gradle or is there a better way to depend on it? The repo is located at https://github.com/CoFH/RedstoneFlux-API
August 23, 201411 yr Yes. Follow this instruction: 1. Assuming you already have your workspace set up, create a new folder named "/lib" in your project directory. That's the directory that contains your /bin, /build, /gradle, and /src folders, and now also has a /lib folder. 2. Download Thermal Expansion and place it into /mods folder, that locates in /eclipse folder. Download RF-API source file and place it in the /lib folder you just created. 3. In Eclipse, right-click on your project, select "Build Path" and then "Configure Build Path". Click the "Libraries" tab, then "Add External JARs" and find the TE file that you just placed in the /mods folder. 4. Open the "Referenced Libraries" tree in your package explorer, find the API binary that you just referenced and right-click on it; go to "Properties" -> "External location" -> "External file" and navigate to the source file in the /lib folder. Original tutorial by coolAlias. Edited by me. Tip: use search.
August 23, 201411 yr Author Thank you but I was referring specifically to the gradle build system and dependencies as briefly explained here https://github.com/MinecraftForge/ForgeGradle/wiki/Dpendencies. The instructions you gave involve cloning the repo, compiling the jar and linking in eclipse (I'm using IntelliJ anyway). What I'm wondering is if the Gradle build system can do essentially the same thing automatically by listing it as a dependency in the build.gradle file.
August 23, 201411 yr TeamCoFH doesn't have maven repo, that's why I didn't talk about Maven Dependency. And yes, I forgot to talk about compiling. You should compile your mod so: Open build.gradle file, and add the following code: dependencies { compile files ("lib/RF-API.jar") } P.S in mcmod.info add following code: "dependencies": ["ThermalExpansion"], "useDependencyInformation": "true" P.P.S As far as I know, Redstone Flux API is only used in Thermal Expansion, that's why I printed "ThermalExpansion" (mod ID) in "dependencies" field.
August 23, 201411 yr Author Ah I'm new to these build systems. After looking it up it seems you can only depend on Maven and Ivy repositories remotely, can you not depend on a remote repository that uses Gradle to build? The 3 lines you said to add to build.gradle, just to clarify, is that compiling the lib source files into a jar or is it taking an already compiled jar in compilation of my project? Not sure if that's quite right about TE as dependency, many mods use it and you can use those mods without TE installed (such as ExtraUtils and AE2). Thank you
August 23, 201411 yr You are new. Gradle and Maven are diffrent things, as Ivy and Ant. Read about it in wikipedia. Those 3 lines compile source of RF-API.
August 23, 201411 yr Author I understand they are different build systems, in the documentation it has instructions on linking an external Maven or Ivy repository to use as a dependency. Can you not link to an external repository that uses gradle to build, or am I missing something fundamental here?
August 23, 201411 yr Yes, you can do it with Maven and Ivy publishing plugin for Gradle. Read about Ivy plugin here and about Maven plugin here.
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.