Jump to content

Gradle Build


Damian3395

Recommended Posts

i am using 3 libraries for my mod: CodeChickenLib-dev.jar, Mantle-dev.jar, mysql-connector.jar-bin.jar

the game works fine when i run it in eclipse, but when I try to gradlew build it, those dependencies are not being included into my mods' compiled jar. The libraries are located in the root project folder, inside of a folder named 'libs'

 

I tried adding this to the build.gradle file:

dependencies{

compile files('libs/CodeChickenLib-1.7.10-1.1.3.140-dev.jar', 'libs/Mantle-1.7.10dev.jar', 'libs/mysql-connector-java-5.1.38-bin.jar')

}

 

but it still won't added the dependencies.

Link to comment
Share on other sites

Dependencies are never shaded (included in your JAR) by default, you always need to specify that they should be.

 

For CodeChickenLib, I'd recommend have it auto-download like ChickenBones does: Include the

DepLoader

class from CodeChickenCore in your code, call it from an

IFMLLoadingPlugin

  specified in your manifest and include a dependencies.info file that specifies CodeChickenLib as a dependency. For examples, search GitHub for

DepLoader

and limit the search to Java code.

 

For Mantle, don't shade it all. Tinkers' Construct doesn't include it, neither should you.

 

For MySQL Connector, you can shade it using this technique or using a proper shading plugin like shadow.

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

Announcements



×
×
  • Create New...

Important Information

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