Skip to content

Instantly share code, notes, and snippets.

View comdotlinux's full-sized avatar
😉
Web Components, Quarkus and GraalVM

Guruprasad Kulkarni comdotlinux

😉
Web Components, Quarkus and GraalVM
View GitHub Profile
@comdotlinux
comdotlinux / asdf-update.sh
Created October 10, 2022 14:39
A Shell script to find and update tools in .tool-versions from asdf
#!/usr/bin/env bash
SCRIPT_PATH=$(dirname "$0")
echo "-- adding plugins --"
grep -v '^ *#' < "$SCRIPT_PATH/.tool-versions" | while IFS= read -r line
do
asdf plugin add "$(echo "$line" | awk '{print $1}')"
done
@comdotlinux
comdotlinux / build.gradle.kts
Created November 26, 2022 00:26
Simple External Command Execution Using Gradle
tasks.register("runBuild") {
group = "com.linux"
description = "Trigger Build Execution On Github Actions"
doLast {
val command = """gh workflow run build.yaml --ref master --field version=0.0.1"""
exec {
logger.lifecycle("Running Command $command")
commandLine = command.split(" ")
logger.lifecycle("Command executed.")
}
@comdotlinux
comdotlinux / build.gradle.kts
Created November 26, 2022 18:36
A confirmation Dialog From WIthin Gradle.
import javax.swing.JOptionPane
tasks.register("askConfirmation") {
doLast {
if (confirmation("Do you want to answer me?")) {
logger.lifecycle("😃 You Answered Yes!!!!")
} else {
logger.lifecycle("😒 You Answered No 🤷")
}
@comdotlinux
comdotlinux / build.gradle.kts
Created November 26, 2022 19:28
Get the Output of an External Command into an variable for further use.
import java.io.ByteArrayOutputStream
tasks.register("gitCommit") {
group = "com.linux"
description = "Get The last git commit"
doLast {
val output = ByteArrayOutputStream().let { os ->
exec {
commandLine("/usr/bin/git rev-parse --verify HEAD".split(" "))
standardOutput = os
@comdotlinux
comdotlinux / settings.gradle.kts
Created November 26, 2022 21:03
Enabling Gradle Build Scans
plugins {
id("com.gradle.enterprise") version("3.10.1") // https://plugins.gradle.org/plugin/com.gradle.enterprise
}
gradleEnterprise {
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
capture {
isTestLogging = true
isBuildLogging = true