Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,24 @@ processResources {
}
}

// Executing a windows shortcut
var executeShortcut = tasks.register('executeShortcut') {
mustRunAfter("copyJarToInstance")

doLast {
def shortcut = new File("${shortcut_path}").canonicalPath
Thread.start {
["explorer", shortcut].execute()
}
println("${green}${check} Launched ${darkGreen}${bold}$shortcut${reset}${green} successfully!${reset}")
}
}

// Automate building, copying the core jar to the mods modpack folder and launching minecraft to test
tasks.register("buildAndLaunch") {
dependsOn(build, "copyJarToInstance", executeShortcut)
}

sourceSets {
dev {
java.srcDir("src/dev/java")
Expand Down Expand Up @@ -224,14 +242,19 @@ allprojects {

// Moving the core jar to a custom folder
tasks.register('copyJarToInstance', Copy) {

mustRunAfter("build")
group = 'mod development/internal'

from("${buildDir}/libs") {
include("*${version}.jar")
exclude("*-sources.jar", "*-javadoc.jar")
}
into("${modpack_mods}")

doLast{
def coreJarName = "${project.base.archivesName.get()}-${version}.jar"
println("${green}${check} Copied ${darkGreen}${bold}$coreJarName${reset}${green} successfully to ${darkGreen}${bold}$modpack_mods${reset}${green}!${reset}")
}
}

if (project.findProperty('enable_copy_jar_to_instance')?.toBoolean()) {
Expand Down
9 changes: 9 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ minecraft_username = Developer

enable_copy_jar_to_instance = false
modpack_mods = D:/path/to/instances/TerrafirmaGreg-Modern/minecraft/mods/
shortcut_path = C:/path/to/TerrafirmaGreg-Modern.lnk

### Dependency versions

Expand Down Expand Up @@ -72,3 +73,11 @@ ad_astra_version = 1.15.20
puzzleslib_version = v8.1.32-1.20.1-Forge
hangglider_version = v8.0.1-1.20.1-Forge
ae2_version = 15.4.10-cosmolite.34

# Style
green = \u001B[32m
darkGreen = \u001B[38;5;28m
bold = \u001B[1m
yellow = \u001B[33m
reset = \u001B[0m
check = \u2714