Skip to content

Commit

Permalink
Merge pull request #6 from dwursteisen/main
Browse files Browse the repository at this point in the history
Update the bundle tasks to make them more user friendly.
  • Loading branch information
dwursteisen committed Apr 26, 2021
2 parents a22fa5b + ad82efb commit ce0e9b4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.github.minigdx.gradle.plugin.internal.maybeCreateMiniGdxExtension
import com.github.minigdx.gradle.plugin.internal.minigdx
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.tasks.bundling.Zip

class MiniGdxJsGradlePlugin : Plugin<Project> {

Expand All @@ -29,10 +30,15 @@ class MiniGdxJsGradlePlugin : Plugin<Project> {
it.dependsOn("gltf", "jsBrowserDevelopmentRun")
}

project.tasks.register("bundle-js") {
project.tasks.register("bundle-js", Zip::class.java) {
it.group = "minigdx"
it.description = "Create a bundle as zip."
it.dependsOn("gltf", "jsBrowserProductionWebpack")
it.from(project.buildDir.resolve("distributions"))
it.destinationDirectory.set(project.buildDir.resolve("minigdx"))
it.doLast {
project.logger.lifecycle("[MINIGDX] The js distribution of your game is available at: ${it.outputs.files.first()}")
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ class MiniGdxJvmGradlePlugin : Plugin<Project> {
}
}
jar.from(flatClasses)
jar.destinationDirectory.set(project.buildDir.resolve("minigdx"))
jar.dependsOn("gltf", "jvmJar")
jar.doLast {
project.logger.lifecycle("[MINIGDX] The jar distribution of your game is available at: ${jar.outputs.files.first()}")
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions plugin/src/main/resources/banner.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
██║╚██╔╝██║██║██║╚██╗██║██║██║ ██║██║ ██║ ██╔██╗
██║ ╚═╝ ██║██║██║ ╚████║██║╚██████╔╝██████╔╝██╔╝ ██╗
╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝

:: Need information? => Visit https://github.com/minigdx

0 comments on commit ce0e9b4

Please sign in to comment.