Jump to content

Gradle / .git project import questions


shadowmage4513

Recommended Posts

Hi all..

 

Working on setting up a 1.7x dev environment.

 

Got everything downloaded, eclipse plugin setup and working.  I can open up eclipse and view the project fine.

 

Where my questions/issues are coming from is trying to link existing source into the gradle setup.  Previously, I have kept all of my source separate from the eclipse workspaces by importing the project as a separate project, and then linking source folders into the existing Minecraft project.  All I had to do when it came time to recompile was copy the source into the actual mcp /src directory / recompile/reobfuscate (done through a batch file/build script).

 

What is the best method to link source an existing source folder into the new setup?  I have currently just linked my source folder into the gradle project.  It seems to work so far (at least it is throwing all of the errors I would expect for a non-updated mod), but I can see that when I run 'gradlew build' it does not even attempt to recompile any of my source.  Will I need to make another script/etc to copy my source into the /src folder for recompilation? 

 

Is there a cleaner way of setting this up?  I'm guessing the preferred method is to code right into the /src directory of the project -- which I'm not quite sure how this would work out with many projects going on at the same time.

 

I guess the end question is -- does the 'just copy into the /src folder for recompile and reobfuscate' trick still work, or am I going to need to completely re-arrange my work-layout?

 

Also, slightly off-topic -- is there any support for multiple MC / forge versions with gradle?  As near as I can tell it is limited to the currently 'setup' version, and only one MC version at a time.  I ask because I often keep my mods updated for the last 2 major MC udpates (e.g. currently 1.5.2 and 1.6.4), and found the ability to keep an MCP setup around for each MC version quite handy.

Link to comment
Share on other sites

You can do the same you were doing previously, using batch files to copy things over the default src folder.

Or tell Gradle your mod project depends on forge.

Both things can be done through the build.gradle file, which also support most script language.

 

I made a tutorial on multiple projects you might want to look into.

Link to comment
Share on other sites

You would have to set the source folders in the build.gradle file if you wanted to keep your sources outside.

However, the new system was deigned to not have to have you do any of that anymore.

Basically the src distro was designed to be directly checked into whatever CMS you decide to use {ignoring some metadata files like .gradle, eclipse, bin, .settings and build}

And be usable from that. All the forge/minecraft code/files are outside of that workspace folder, cached so that multiple projects don't have to continuously recreate the exact same data.

 

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

Also, slightly off-topic -- is there any support for multiple MC / forge versions with gradle?  As near as I can tell it is limited to the currently 'setup' version, and only one MC version at a time.  I ask because I often keep my mods updated for the last 2 major MC udpates (e.g. currently 1.5.2 and 1.6.4), and found the ability to keep an MCP setup around for each MC version quite handy.

If you're using git/github you can set up branches for more than one mc version, that's how forgegradle's git manages to be for both snapshot 1.0 and 1.1.

CreepyPastaCraft git | SCPCraft git

Keep an eye on them, see that I'm still working on it :P

Link to comment
Share on other sites

  • 1 month later...

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.