Read a property from gradle.properties with a bash script

#!/usr/bin/env bash

GRADLE_PROPERTIES_FILE=gradle.properties

function getProperty {
    PROP_KEY=$1
    PROP_VALUE=`cat $GRADLE_PROPERTIES_FILE | grep "$PROP_KEY" | cut -d'=' -f2`
    echo $PROP_VALUE
}
GRAILS_VERSION=$(getProperty "grailsVersion")
echo $GRAILS_VERSION

Tags: #gradle #bash
May 2017, 16.

 

My next events:
🗓 Oct 05 17:00 Jumpstart your Java applications with AWS Lambda and Micronaut