Skip to content

Commit 608cf21

Browse files
committed
Update RFG, allow for .kts external scripts
1 parent eadbc68 commit 608cf21

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This build script was heavily inspired by the build script created by GT New Hor
1111
- Automatic "Tag" creation, which can supply your Java code with the ModId, ModName, and Version generated for you by Gradle
1212
- Access Transformers, can even have multiple
1313
- Core Mods
14-
- Mixin, or specifying Mixin as a dependency if you do not use it, but projects you depend on do
14+
- Mixin using MixinBooter 8 and Unimix, or specifying Mixin as a dependency if you do not use it but projects you depend on do
1515
- Automatic repository settings, including common repositories such as CurseMaven, Modrinth Maven, and others
1616
- Automatically include JEI and The One Probe in your project, at both compile-time and runtime
1717
- CurseForge and Modrinth deployments
@@ -69,11 +69,13 @@ And many more to come! And of course, all of these features are toggleable via a
6969
## How to Use
7070
### Files
7171
- `build.gradle`: This file is automatically updated, and as a result should not be modified by the user directly
72-
- `gradle.properties`: Contains all of the user configuration for the build script
73-
- `dependencies.gradle`: Add your mod's dependencies here. This is separate from the main build script so that you can replace `build.gradle` if an update is available
74-
- `repositories.gradle`: Add your dependencies' repositories here. Many common ones are already handled by `build.gradle`
75-
- `addon.gradle`: An optional file, which can be used if you have any more advanced gradle commands. However, we are open to new features, so let us know if there is something you want that we could add to this build script to avoid needing this file!
72+
- `gradle.properties`: Contains all the user configuration for the build script
7673
- `settings.gradle`: This file contains some basic setup of the build script. It is currently not versioned, so it is safe to add to, though should not have things removed from it
74+
### Custom Files
75+
Any of these files can optionally be either `.gradle` (Groovy), or `.gradle.kts` (Kotlin DSL).
76+
- `dependencies.gradle[.kts]`: Add your mod's dependencies here. This is separate from the main build script so that you can replace `build.gradle` if an update is available
77+
- `repositories.gradle[.kts]`: Add your dependencies' repositories here. Many common ones are already handled by `build.gradle`
78+
- `addon.gradle[.kts]`: An optional file, which can be used if you have any more advanced gradle commands. However, we are open to new features, so let us know if there is something you want that we could add to this build script to avoid needing this file!
7779

7880
### Custom Gradle Tasks
7981
- `./gradlew updateBuildScript`

build.gradle

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ plugins {
2323
id 'eclipse'
2424
id 'maven-publish'
2525
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.7'
26-
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.19'
26+
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.20'
2727
id 'net.darkhax.curseforgegradle' version '1.0.14' apply false
2828
id 'com.modrinth.minotaur' version '2.8.0' apply false
2929
id 'com.diffplug.spotless' version '6.13.0' apply false
@@ -248,6 +248,8 @@ tasks.withType(ScalaCompile).configureEach {
248248
// Allow others using this buildscript to have custom gradle code run
249249
if (getFile('addon.gradle').exists()) {
250250
apply from: 'addon.gradle'
251+
} else if (getFile('addon.gradle.kts').exists()) {
252+
apply from: 'addon.gradle.kts'
251253
}
252254

253255

@@ -330,6 +332,8 @@ repositories.configureEach { repo ->
330332
// Allow adding custom repositories to the buildscript
331333
if (getFile('repositories.gradle').exists()) {
332334
apply from: 'repositories.gradle'
335+
} else if (getFile('repositories.gradle.kts').exists()) {
336+
apply from: 'repositories.gradle.kts'
333337
}
334338

335339
repositories {
@@ -454,6 +458,8 @@ dependencies {
454458

455459
if (getFile('dependencies.gradle').exists()) {
456460
apply from: 'dependencies.gradle'
461+
} else if (getFile('dependencies.gradle.kts').exists()) {
462+
apply from: 'dependencies.gradle.kts'
457463
}
458464

459465

0 commit comments

Comments
 (0)