Skip to content

Commit

Permalink
documentation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
serenibyss committed Jun 4, 2023
1 parent 6e991af commit 3b97647
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ This build script was heavily inspired by the build script created by GT New Hor
- Jabel for Java 17 language features while still targeting Java 8
- JUnit 5 added automatically
- Spotless auto-formatting with default formatter configurations, or user-specified configurations
- API and Source deployment along side obf and deobf jars
- API and Source deployment alongside obf and deobf jars
- Deployment testing options, so that you can ensure your tokens and other variables are set up properly
- Custom username setting for development, that can be set either project-wide or via an environment variable for shared projects
- Ships with Jetbrains annotations by default, so you have another option over `javax`
- Scala support
- Custom Maven publishing location support, with all secrets held by system environment variables
- Automatic mixin JSON generation, as well as mcmod.info and pack.mcmeta if they are missing
- Dependency shadowing for releasing dependencies in your builds, more info [here](https://github.com/GregTechCEu/Buildscripts/blob/master/docs/shadow.md)
- Automatic changelog generation by generating a list of all commits between the current tag and the previous tag

And many more to come! And of course, all of these features are toggleable via an option in `gradle.properties`.

Expand All @@ -35,6 +37,7 @@ And many more to come! And of course, all of these features are toggleable via a
- Ensure your project is initialized in git. For example, you can run `git init; git commit --message "initial commit"`
- Replace placeholder values, such as `gradle.properties`, package/class names for your `src/main` directory, etc.
- Run `./gradlew setupDecompWorkspace`
- Run `./gradlew updateBuildScript` to ensure that you are on the latest version
- You are good to go! You can now run the `runClient` run configuration or run `./gradlew runClient` to launch the game

## How to Install (Existing Project)
Expand All @@ -54,6 +57,7 @@ And many more to come! And of course, all of these features are toggleable via a
1. JEI
2. The One Probe
- Delete the `build.gradle.old` file
- And lastly, run `./gradlew updateBuildScript` to ensure that you are on the latest version

### Advanced
- If your project was using Mixins, you may get a new mixin config file generated as `mixins.{modid}.json`, if yours was not named this way. Currently, you will have to move your Mixin config options to this newly generated file. If this behavior does not suit your needs, feel free to open an issue and start a discussion on different behavior
Expand Down
2 changes: 2 additions & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* To add a mod with CurseMaven, replace '("g:n:v:c")' in the above with 'rfg.deobf("curse.maven:project_slug-project_id:file_id")'
* Example: implementation rfg.deobf("curse.maven:gregtech-ce-unofficial-557242:4527757")
*
* To shadow a dependency, use 'shadowImplementation'. For more info, see https://github.com/GregTechCEu/Buildscripts/blob/master/docs/shadow.md
*
* For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph
*/
dependencies {
Expand Down
12 changes: 12 additions & 0 deletions docs/shadow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Dependency shadowing

Shadowing is a useful tool which allows you to include other projects into your builds, so that users of your mod do not need to manually install them some other way.

Some use-cases for this include:
- Using Java libraries which are not normally available in an MC environment
- Including a non-released mod, such as a library mod of yours that you do not want to separately manage releases of
- Using newer versions of certain Java libraries than MC provides

However, this feature should be used carefully. Some common issues that can occur:
- If you include a shadowed mod in your project, and a modpack contains that mod, the game will not launch as Forge will see them as duplicate mods (matching mod id)
- If you include a shadowed Java library in your project, users creating addon mods for your mod may have difficulties with their environment if the 'relocateShadowedDependencies' option is enabled, as import paths will be changed

0 comments on commit 3b97647

Please sign in to comment.