Setting flexHome in ~/.gradle/gradle.properties

Mike Dalrymple's Avatar

Mike Dalrymple

09 Aug, 2014 12:26 AM

Is there a way to set the flexHome variable in a user's local gradle.properties file (e.g. ~/.gradle/gradle.properties)? I've tried:

flexHome=/opt/flex_sdk_4.6/

And that doesn't seem to get loaded early enough for the compile task to function. I end up with the following NPE:

Caused by: java.lang.NullPointerException
at org.gradlefx.configuration.sdk.SdkInstallLocationFactory.createSdkLocation(SdkInstallLocationFactory.groovy:62)

For now I'm just setting FLEX_HOME as a system variable but I would really like to keep environment specific properties constrained to gradle.properties files.

Thanks!

  1. 1 Posted by Mike Dalrymple on 09 Aug, 2014 12:29 AM

    Mike Dalrymple's Avatar

    I should note that when I set this property in ~/.gradle/gradle.properties, it does print the value if I just dump the following into the build script:

    println "flexHome = ${flexHome}"

  2. Support Staff 2 Posted by Yennick Trevels on 09 Aug, 2014 08:00 AM

    Yennick Trevels's Avatar

    Hi Mike,

    I've just tried to use a flexHome property defined in gradle.properties and my build picked it up nicely.
    It seems though (based on the stacktrace) like it can't find the GradleFx convention object, which might indicate some other problem which isn't related to your flexHome variable.

    Which version of Gradle and GradleFx are you using?
    Are you using a custom modified version of GradleFx?

  3. 3 Posted by Mike Dalrymple on 11 Aug, 2014 06:40 PM

    Mike Dalrymple's Avatar

    I'm using gradleFX 0.8.3 without any customization and Gradle 1.10.

    ------------------------------------------------------------
    Gradle 1.10
    ------------------------------------------------------------

    Build time: 2013-12-17 09:28:15 UTC
    Build number: none
    Revision: 36ced393628875ff15575fa03d16c1349ffe8bb6

    Groovy: 1.8.6
    Ant: Apache Ant(TM) version 1.9.2 compiled on July 8 2013
    Ivy: 2.2.0
    JVM: 1.7.0_55 (Oracle Corporation 24.51-b03)
    OS: Linux 3.5.0-54-generic amd64

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac