'Grade createStartScript : need to generate JAVA_OPTS based on environment

I have a requirement to add JAVA_OPTS conditionally. Today In Maven I achieve this by using below in maven unix template

if ["$3"= “PROD”]; then
JAVA_OPTS=$JAVA_OPTS -Dadent=abc
else
JAVA_OPTS=$JAVA_OPTS -Dadent=xyz
fi

#$3 is the 3rd command line arg to the maven generated script.

How do I achieve this in gradle createStartScript?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source