|
1 | 1 | //file:noinspection DependencyNotationArgument |
2 | 2 | // TODO remove when fixed in RFG ^ |
3 | 3 | /* |
4 | | - * Add your dependencies here. Common configurations: |
5 | | - * - implementation("group:name:version:classifier"): if you need this for internal implementation details of the mod. |
6 | | - * Available at compiletime and runtime for your environment. |
7 | | - * |
8 | | - * - compileOnlyApi("g:n:v:c"): if you need this for internal implementation details of the mod. |
9 | | - * Available at compiletime but not runtime for your environment. |
10 | | - * |
| 4 | + * Add your dependencies here. Supported configurations: |
| 5 | + * - api("group:name:version:classifier"): if you use the types from this dependency in the public API of this mod |
| 6 | + * Available at runtime and compiletime for mods depending on this mod |
| 7 | + * - implementation("g:n:v:c"): if you need this for internal implementation details of the mod, but none of it is visible via the public API |
| 8 | + * Available at runtime but not compiletime for mods depending on this mod |
| 9 | + * - compileOnly("g:n:v:c"): if the mod you're building doesn't need this dependency during runtime at all, e.g. for optional mods |
| 10 | + * Not available at all for mods depending on this mod, only visible at compiletime for this mod |
| 11 | + * - compileOnlyApi("g:n:v:c"): like compileOnly, but also visible at compiletime for mods depending on this mod |
| 12 | + * Available at compiletime but not runtime for mods depending on this mod |
| 13 | + * - runtimeOnlyNonPublishable("g:n:v:c"): if you want to include a mod in this mod's runClient/runServer runs, but not publish it as a dependency |
| 14 | + * Not available at all for mods depending on this mod, only visible at runtime for this mod |
| 15 | + * - devOnlyNonPublishable("g:n:v:c"): a combination of runtimeOnlyNonPublishable and compileOnly for dependencies present at both compiletime and runtime, |
| 16 | + * but not published as Maven dependencies - useful for RFG-deobfuscated dependencies or local testing |
| 17 | + * - runtimeOnly("g:n:v:c"): if you don't need this at compile time, but want it to be present at runtime |
| 18 | + * Available at runtime for mods depending on this mod |
11 | 19 | * - annotationProcessor("g:n:v:c"): mostly for java compiler plugins, if you know you need this, use it, otherwise don't worry |
| 20 | + * - testCONFIG("g:n:v:c") - replace CONFIG by one of the above (except api), same as above but for the test sources instead of main |
| 21 | + * |
| 22 | + * - shadowImplementation("g:n:v:c"): effectively the same as API, but the dependency is included in your jar under a renamed package name |
| 23 | + * Requires you to enable usesShadowedDependencies in gradle.properties |
| 24 | + * For more info, see https://github.com/GregTechCEu/Buildscripts/blob/master/docs/shadow.md |
12 | 25 | * |
13 | | - * - testCONFIG("g:n:v:c"): replace CONFIG by one of the above, same as above but for the test sources instead of main |
| 26 | + * You can exclude transitive dependencies (dependencies of the chosen dependency) by appending { transitive = false } if needed, |
| 27 | + * but use this sparingly as it can break using your mod as another mod's dependency if you're not careful. |
14 | 28 | * |
15 | | - * You can exclude transitive dependencies (dependencies of the chosen dependency) by appending { transitive = false } if needed. |
| 29 | + * To depend on obfuscated jars you can use `devOnlyNonPublishable(rfg.deobf("dep:spec:1.2.3"))` to fetch an obfuscated jar from maven, |
| 30 | + * or `devOnlyNonPublishable(rfg.deobf(project.files("libs/my-mod-jar.jar")))` to use a file. |
16 | 31 | * |
17 | 32 | * 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")' |
18 | | - * Example: implementation rfg.deobf("curse.maven:gregtech-ce-unofficial-557242:4527757") |
| 33 | + * Example: devOnlyNonPublishable(rfg.deobf("curse.maven:top-245211:2667280")) |
19 | 34 | * |
20 | | - * To shadow a dependency, use 'shadowImplementation'. For more info, see https://github.com/GregTechCEu/Buildscripts/blob/master/docs/shadow.md |
| 35 | + * Gradle names for some of the configuration can be misleading, compileOnlyApi and runtimeOnly both get published as dependencies in Maven, but compileOnly does not. |
| 36 | + * The buildscript adds runtimeOnlyNonPublishable to also have a runtime dependency that's not published. |
21 | 37 | * |
22 | | - * For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph |
| 38 | + * For more details, see https://docs.gradle.org/8.4/userguide/java_library_plugin.html#sec:java_library_configurations_graph |
23 | 39 | */ |
24 | 40 | dependencies { |
25 | 41 |
|
|
0 commit comments