How to use user environment variable in gradle.properites

In a gradle task, I can create a path like this:

System.env.FOLDER_PATH + '/subFolder'

      

but I would like to set this in my gradle.properties so that it would be something like

subFolderPath=${System.env.FOLDER_PATH}/subFolder

      

but I can't find any examples of this, is it possible?

+3


source to share


2 answers


gradle.properties

is a simple Java properties file. It can only contain literal key / value pairs.



+2


source


Have you tried something like this?



subFolderPath=file("${System.env.FOLDER_PATH}/subFolder")

      

0


source







All Articles