Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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]

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.

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/

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/

  • Author

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.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.