How to disable Flex SDK validations on the flexHome property

jeremie.charest's Avatar

jeremie.charest

18 Jan, 2013 07:16 PM

Hi,

I'm using GradleFx on a multi-project setup. Some of my co-worker (Java programmer) are not able to build their own project because of the Flex SDK validations execute in the actionscript project.

They always got the error : "The Flex home location isn't specified...". These validations came from the FlexSDKSpecifiedValidator::execute method.

Is there a way to prevent these validations to occur, at least in the gradle initialization/configuration phase? If possible, I don't want to add a Flex SDK dependency.

Thanks,
Jérémie

  1. Support Staff 1 Posted by Yennick Trevels on 18 Jan, 2013 07:37 PM

    Yennick Trevels's Avatar

    Can you provide me the structure of your multi project setup? Because it
    sounds like there is something wrong with your Gradle project structure.
    Your flex projects should be in a separate subtree of your project, so that you can specify the flex sdk dependency only on that subtree

  2. 2 Posted by jeremie.charest on 18 Jan, 2013 08:50 PM

    jeremie.charest's Avatar

    Our structure is the following (starting at the root project) :

    build.gradle
    as3.gradle
    java.gradle
    ----src
    --------main
    ------------as3
    -----------------*.as
    ------------java
    -----------------*.java
    --------test (same as main)
    

    We are new in the Gradle world so if you have suggestions they are more than welcome!

  3. Support Staff 3 Posted by Yennick Trevels on 18 Jan, 2013 10:31 PM

    Yennick Trevels's Avatar

    I suggest you create one root project and two subprojects, one for your java code and one for your actionscript/flex code. That's the way to go in Gradle (which is somewhat similar to the Maven structure). If we do this the structure would look like this:

    build.gradle             <-- common config for the whole project goes here
    frontend
    ----build.gradle        <-- Flex SDK dependency goes in here
    ----src
    --------main
    ------------as3
    ----------------*.as
    --------test
    ------------as3
    ----------------*Test.as
    backend
    ----build.gradle        <-- java specific config goes here
    ----src
    --------main
    ------------java
    ----------------*.java
    --------test
    ------------java
    ----------------*Test.java
    

    Furthermore I suggest you take a look at one of our sample projects which shows you the structure of a java + flex multiproject and how they can work together. It also shows you how you can put your compiled flex code in a war file. You can find the project here: https://github.com/GradleFx/GradleFx-Examples/tree/master/flex-java...

  4. 4 Posted by jeremie.charest on 21 Jan, 2013 04:11 PM

    jeremie.charest's Avatar

    Thank you very much for the tip, it's now so much less painful!

    But sadly it didn't solve the FLEX_HOME problem. I also tried, just to be sure, with the "flex-java-war" example with a fresh checkout and I still got the error.

    Repo step :
    1. Rename your FLEX_HOME to something else
    2. Close all command line window (I'm on Windows)
    3. Browse to flex-java-war/java and run a "gradle build"
    4. You should get the error preventing you to build the java project

  5. Support Staff 5 Posted by Yennick Trevels on 21 Jan, 2013 08:40 PM

    Yennick Trevels's Avatar

    If you get that error with the flex-java-war project, then that's normal,
    because the java project (or the war), has a dependency to the flex project
    because it needs to include the swf in the war. That's why it needs the
    FLEX_HOME.

    Are you sure that your FLEX_HOME environment variable is pointing to the root of your Flex SDK

  6. 6 Posted by jeremie.charest on 25 Jan, 2013 01:49 PM

    jeremie.charest's Avatar

    I love Gradle! Because our sub-project are all encapsulated and don't depends on each other we can use the new configuration on demand incubating feature from Gradle 1.4. That fixed our problems and speed up our build time :

    #root project gradle.properties
    systemProp.org.gradle.configuration.ondemand=true
    

    Configuration on demand

  7. Support Staff 7 Posted by Yennick Trevels on 25 Jan, 2013 02:43 PM

    Yennick Trevels's Avatar

    Oh cool, didn't know that new feature :)

  8. jeremie.charest closed this discussion on 25 Jan, 2013 03:31 PM.

Comments are currently closed for this discussion. You can start a new one.

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