Jump to content

Recommended Posts

Posted

I've recently switched over to the "proper" setup for Forge using gradle. What files should I commit to the mod repository and which should I .gitignore?

 

(Basically, which files are critical to the mod download from repo and which can I rely on gradle to rebuild for the downloadee?)

 

(I should mention I'm in the `gradlew idea` workspace)

 

My current .gitignore:

.gradle/
build/
gradle/
build.gradle
gradlew.bat
*.iml
*.ipr
*.iws
run/

 

The folder hierarchy I'm working with:

.git
|	<git stuff>
.gradle
|	<gradle stuff>
build
|	<build stuff>
run
|	<run environment>
src
|	<class files>
.gitignore
build.gradle
gradlew.bat
README.md
<project>.iml
<project>.ipr
<project>.iws
[code]

Posted

I use the following .gitignore:

 

# push src/ only
*
!src/
!gradle/
!gradlew
!gradlew.bat
!README.md
!LICENSE
!build.gradle

*.class

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.war
*.ear

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

 

All one needs to build is the "gradle/" and the "src/" directory aswell as the "gradlew" and "gradlew.bat" and the "build.gradle" file. This explains the .gitignore file:

First I ignore all files, then I unignore all files mentioned above. The other ignores are default from GitHub.

Posted

I agree, I do similar effect (although slightly different entries) in my gitignore:

$ cat .gitignore
/*
!/src
!build.gradle
!*.project

 

I would say the philosophy I use is that anything I edit directly I put in repo, anything that is built or referenced or pre-existing I don't.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

jabelar you should put the gradle wrapper into your repo, that's the whole point of the wrapper.

 

Sure, it wouldn't hurt.  The thing is for me I use the repo mostly for private backup and tutorial examples, so I mostly care about the code and I don't usually collaborate.  If I clone I likely still install a new Forge over top, and just preserve the source.  I don't usually edit the wrapper in a unique way, so am not worried about re-creating it as needed.  But still good idea for proper posterity.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

Thanks, diesieben, for clarifying, and jabelar and WorldsEnder for posting their .gitignores. I've got what I need now, thanks!

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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