Skip to content

Instantly share code, notes, and snippets.

@peterkir
Last active July 8, 2020 08:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterkir/3ec15642ee440210a10a7d86f92f7d9b to your computer and use it in GitHub Desktop.
Save peterkir/3ec15642ee440210a10a7d86f92f7d9b to your computer and use it in GitHub Desktop.
gradle.md

Gradle

global/general configuration store inside ~/.gradle/gradle.properties

org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.configureondemand=true
org.gradle.jvmargs=-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

systemProp.http.proxyHost=<proxy host>
systemProp.http.proxyPort=<proxy port>
systemProp.http.proxyUser=<proxy user>
systemProp.http.proxyPassword=<proxy password>
systemProp.http.nonProxyHosts=<csv of exceptions>
systemProp.https.proxyHost=<proxy host>
systemProp.https.proxyPort=<proxy port>
systemProp.https.proxyUser=<proxy user>
systemProp.https.proxyPassword=<proxy password>
systemProp.https.nonProxyHosts=<csv of exceptions seperated by | >

property handling - reading, using, printing

    def myPropFile = file ("my.properties")
    if (myPropFile.exists()) {
        println "using property file from " + myPropFile
    } else { 
        ant.fail('configuration file is not available ' + myPropFile) 
    }
    def myProps = new Properties()
    myPropFile.withInputStream { gsepProps.load(it) }
    println "prop.key.with.dot=${myProps['prop.key.with.dot']}"
    println "prop.key.with.dot="+myProps['prop.key.with.dot']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment