Error: configuration variable 'load-config' expected 1 argument(s), got 0.

wood's Avatar

wood

03 Feb, 2014 03:22 AM

I found that I can build the ActionScript project with AIR 4.0 SDK only in the IDE. Then I tried to force using AIR 4.0 SDK only (no FLEX) to run the grade build. It was not successful at the beginning that compc.jar and mxmlc.jar were not found. I created symbolic links for them (compc.jar -> compc-cli.jar and mxmlc.jar -> mxmlc-cli.jar). I can successfully run the build for the type in swc and frameworkLinkage in external but can't for the type in swc and frameworkLinkage in none. both mxmlc and compc have the same issue

Compiling with compc
    -load-config=                          <<<<<<<<<<<<<<<<<<<<<<<
    -external-library-path+=/Users/root/Desktop/AIRSDK_Compiler//frameworks/libs/player/{targetPlayerMajorVersion}.{targetPlayerMinorVersion}/playerglobal.swc
    -source-path+=/Users/root/Desktop/swc/GreenSock-AS3/src
    -include-sources+=/Users/root/Desktop/swc/GreenSock-AS3/src
    -library-path+=/Users/root/Desktop/AIRSDK_Compiler/frameworks/libs/asc-support.swc
    -library-path+=/Users/root/Desktop/AIRSDK_Compiler/frameworks/libs/core.swc
    -library-path+=/Users/root/Desktop/AIRSDK_Compiler/frameworks/libs/air/aircore.swc
    -library-path+=/Users/root/Desktop/AIRSDK_Compiler/frameworks/libs/air/airglobal.swc
    -library-path+=/Users/root/Desktop/AIRSDK_Compiler/frameworks/libs/air/applicationupdater.swc
    -library-path+=/Users/root/Desktop/AIRSDK_Compiler/frameworks/libs/air/applicationupdater_ui.swc
    -library-path+=/Users/root/Desktop/AIRSDK_Compiler/frameworks/libs/air/servicemonitor.swc
    -library-path+=/Users/root/Desktop/AIRSDK_Compiler/frameworks/libs/player/12.0/playerglobal.swc
    -target-player=12.0
    -output=/Users/root/Desktop/swc/GreenSock-AS3/build/greensock.swc

I found out the error came from -load-config= nothing. Then I took a look to your source from github.
In org.gradlefx.cli.CommandLineInstruction line 51
I changed from reset CompilerOption.LOAD_CONFIG to arguments.minus(CompilerOption.LOAD_CONFIG)
because your comment said "if it is a pure AS project, we don't want to load the Flex configuration" but this still pass "-load-config=" to build process and break the build.

I made a change based on "my" error and your comment. I don't know whether it is correct or not. Later I will request pull (including the test) to your github

  1. Support Staff 1 Posted by Maxime Cowez on 03 Feb, 2014 10:07 AM

    Maxime Cowez's Avatar

    Hi Wood,

    the -load-config= thing is there on purpose. If you don't specify that flag explicitly to be nothing, mxmlc will automatically use flex-config.xml by default and we wanted to avoid loading the Flex framework dependencies when they aren't needed.

    I think the case we've overlooked is the compilation of a library (i.e. type='swc' in GradleFx) that has dependencies on the AIR libraries but not the Flex SDK libraries.

    As a workaround you could add the swcs from [flex-sdk]\frameworks\libs\air to your dependencies, or you can explicitly set load-config=air-config.xml explicitly through the additionalCompilerOptions.

    Max

  2. 2 Posted by wood on 03 Feb, 2014 02:17 PM

    wood's Avatar

    Hi Max,

    I tried to explicitly set -load-config in additionalCompilerOptions before addressing this issue and it's still failed with the same error

    Compiling with compc
        -load-config=
        -external-library-path+=/Users/root/Desktop/AIRSDK_Compiler//frameworks/libs/player/{targetPlayerMajorVersion}.{targetPlayerMinorVersion}/playerglobal.swc
        -source-path+=/Users/root/Desktop/swc/GreenSock-AS3/src
        -include-sources+=/Users/root/Desktop/swc/GreenSock-AS3/src
        -library-path+=/Users/root/Desktop/AIRSDK_Compiler/frameworks/libs/asc-support.swc
        -library-path+=/Users/root/Desktop/AIRSDK_Compiler/frameworks/libs/core.swc
        -library-path+=/Users/root/Desktop/AIRSDK_Compiler/frameworks/libs/air/aircore.swc
        -library-path+=/Users/root/Desktop/AIRSDK_Compiler/frameworks/libs/air/airglobal.swc
        -library-path+=/Users/root/Desktop/AIRSDK_Compiler/frameworks/libs/air/applicationupdater.swc
        -library-path+=/Users/root/Desktop/AIRSDK_Compiler/frameworks/libs/air/applicationupdater_ui.swc
        -library-path+=/Users/root/Desktop/AIRSDK_Compiler/frameworks/libs/air/servicemonitor.swc
        -library-path+=/Users/root/Desktop/AIRSDK_Compiler/frameworks/libs/player/12.0/playerglobal.swc
        -target-player=12.0
        -output=/Users/root/Desktop/swc/GreenSock-AS3/build/greensock.swc
        -load-config=/Users/root/Desktop/AIRSDK_Compiler/frameworks/flex-config.xml
    

    In short, if frameworkLinkage="none" for the type="swc" or type="swf", it must have the error.

    I have questions about "not loading the Flex framework dependencies when they aren't needed".
    1. Are they spark.swc, mx.swc, OSMF.swc...?
    2. Why we still need to specify the FLEX dependencies in build.gradle for the installation?. Now I can totally get rid of FLEX SDK and build my project with AIR SDK only. if you only use AIR SDK only to run the build, it will automaticially load Adobe AIR version's flex-config.xml.
    3. Can you let us choose either one of AIR SDK or FLEX SDK for the build? there is no need to specify both.

  3. Support Staff 3 Posted by Maxime Cowez on 03 Feb, 2014 03:18 PM

    Maxime Cowez's Avatar

    If you set load-config=air-config.xml in additionalCompilerOptions and it prints load-config= in the output, then that's a bug. Can you confirm that's what you did?

    About your questions:
    1. Yes, basically all dependencies that are configured in the flex-config.xml file of your sdk
    2. If you're saying that you have to have the flexSDK dependency in order to use the airSDK dependency, then I think that could be improved. I took a look at the flex-config.xml in the AIR SDK and it seems to be only a stub; there are no dependencies defined in it. So I guess to fix your issue we'll have to conditionally change the load-config flag based on the selected SDK(s).
    3. @Yennick wrote that part, so he'll have to tell us if it can't already be done and - if not -how hard it would be to add that feature.

  4. 4 Posted by wood on 03 Feb, 2014 03:49 PM

    wood's Avatar

    Let me give you the details

    ------------------------------------------------------------
    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_51 (Oracle Corporation 24.51-b03)
    OS:           Mac OS X 10.9.1 x86_64
    
    ------------------------------------------------------------
    build.gradle
    ------------------------------------------------------------
    
    buildscript {
      repositories {
        mavenCentral()
      }
    
      dependencies {
        classpath group: "org.gradlefx", name: "gradlefx", version: "0.8.1"
      }
    }
    
    apply plugin: "gradlefx"
    
    additionalCompilerOptions = [
      "-allow-source-path-overlap=true",
      "-omit-trace-statements=true",
      "-as3=true",
      "-debug=false",
      "-es=false",
      "-optimize=true",
      "-show-actionscript-warnings=true",
      "-strict=true",
      "-target-player=12.0",
      "-verbose-stacktraces=false",
      "-warnings=true",
      "-load-config=air-config.xml"
    ]
    
    srcDirs += ["src"]
    output = "greensock"
    
    type = "swc"
    frameworkLinkage = "none"
    
    ------------------------------------------------------------
    output
    ------------------------------------------------------------
    
    Starting Build
    Settings evaluated using settings file '/Users/wood/Desktop/swc/settings.gradle'.
    Projects loaded. Root project using build file '/Users/wood/Desktop/swc/build.gradle'.
    Included projects: [root project 'swc', project ':GreenSock-AS3']
    Evaluating root project 'swc' using build file '/Users/wood/Desktop/swc/build.gradle'.
    Compiling build file '/Users/wood/Desktop/swc/build.gradle' using StatementExtractingScriptTransformer.
    Compiling build file '/Users/wood/Desktop/swc/build.gradle' using BuildScriptTransformer.
    Evaluating project ':GreenSock-AS3' using build file '/Users/wood/Desktop/swc/GreenSock-AS3/build.gradle'.
    Using the flexHome convention
    All projects evaluated.
    Selected primary tasks 'clean', 'compileFlex'
    Tasks to be executed: [task ':GreenSock-AS3:clean', task ':GreenSock-AS3:compileFlex']
    :GreenSock-AS3:clean (Thread[main,5,main]) started.
    :GreenSock-AS3:clean
    Executing task ':GreenSock-AS3:clean' (up-to-date check took 0.001 secs) due to:
      Task has not declared any outputs.
    :GreenSock-AS3:clean UP-TO-DATE
    :GreenSock-AS3:clean (Thread[main,5,main]) completed. Took 0.012 secs.
    :GreenSock-AS3:compileFlex (Thread[main,5,main]) started.
    :GreenSock-AS3:compileFlex
    Executing task ':GreenSock-AS3:compileFlex' (up-to-date check took 0.167 secs) due to:
      Output file /Users/wood/Desktop/swc/GreenSock-AS3/build has changed.
      Output file /Users/wood/Desktop/swc/GreenSock-AS3/build/greensock.swc has been removed.
    Compiling with compc
        -load-config=
        -external-library-path+=/Users/wood/Desktop/AIRSDK_Compiler//frameworks/libs/player/{targetPlayerMajorVersion}.{targetPlayerMinorVersion}/playerglobal.swc
        -source-path+=/Users/wood/Desktop/swc/GreenSock-AS3/src
        -include-sources+=/Users/wood/Desktop/swc/GreenSock-AS3/src
        -allow-source-path-overlap=true
        -omit-trace-statements=true
        -as3=true
        -debug=false
        -es=false
        -optimize=true
        -show-actionscript-warnings=true
        -strict=true
        -target-player=12.0
        -verbose-stacktraces=false
        -warnings=true
        -load-config=air-config.xml
        -output=/Users/wood/Desktop/swc/GreenSock-AS3/build/greensock.swc
    [ant:java] Java Result: 4
    :GreenSock-AS3:compileFlex FAILED
    :GreenSock-AS3:compileFlex (Thread[main,5,main]) completed. Took 2.068 secs.
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':GreenSock-AS3:compileFlex'.
    > java.lang.Exception: compc execution failed: command line
      Error: configuration variable 'load-config' expected 1 argument(s), got 0.
      
      
    
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
    
  5. Support Staff 5 Posted by Yennick Trevels on 05 Feb, 2014 06:48 PM

    Yennick Trevels's Avatar

    Ok, so couple of things I found out:

    1. Apparently compc and mxmlc are packaged with the AIR SDK since 4.0. This wasn't the case with earlier versions. That's also the reason why it didn't work without the Flex SDK, and why we require you to specify the Flex SDK.
    2. In your output I can see that the -load-config parameter is specified twice, once by GradleFx and once by you. I would've thought the second one would override the first one (as it usually does), but apparently that doesn't seem to work. So it looks like we have to fix this.
    3. With your symbolic links, you should be able to specify only the FlexSDK. During the initialization, GradleFx will check two files:
      • To determine whether the Flex SDK is installed, it will check the 'lib/mxmlc.jar' file
      • To determine whether the AIR SDK is installed, it will check the 'lib/adt.jar' file So when you only specify the Flex SDK, I think it should be happy.
  6. Support Staff 6 Posted by Maxime Cowez on 05 Feb, 2014 10:15 PM

    Maxime Cowez's Avatar

    That configuration variable 'load-config' expected 1 argument(s), got 0. thing is a novelty too. I'm pretty sure the compiler accepted an empty -load-config flag before.
    Or is it only the AIR sdk's version of the compiler(s) that has this particularity?

    Now how do we compile a project with no framework dependencies? Do we package a no-sdk-config.xml file with GradleFx and use that instead?

  7. 7 Posted by wood on 06 Feb, 2014 07:23 AM

    wood's Avatar

    I found two things

    1. AIR SDK already have compc and mxmlc since AIR 3.4. If you go to http://helpx.adobe.com/air/kb/archived-air-sdk-version.html, you will find there are two versions, with and without Compiler. if you choose Adobe AIR SDK with Compiler, you will see compc-cli and mxmlc-cli in the lib folder.

    2. I try to build it with this command

      compc -load-config=   -external-library-path+=C:\Users\WooD\Desktop\AIRSDK_Compiler/frameworks/libs/player/{targetPlayerMajorVersion}.{targetPlayerMinorVersion}/playerglobal.swc -source-path+=C:\Users\WooD\Desktop\GreenSock-AS3\src -include-sources+=C:\Users\WooD\Desktop\GreenSock-AS3\src -accessible=false -allow-source-path-overlap=true -omit-trace-statements=true -as3=true -debug=true -es=false -optimize=true -show-actionscript-warnings=true -strict=true -target-player=12.0 -verbose-stacktraces=false -swf-version=23 -warnings=true -output=C:\Users\WooD\Desktop\GreenSock-AS3\build\GreenSock-AS3.swc
      

    I can conclude that Adobe AIR and Apache FLEX have their own specific compiler options. I would say it is possible to let us choose either one of dependency to build the AS project

  8. Support Staff 8 Posted by Yennick Trevels on 06 Feb, 2014 07:44 AM

    Yennick Trevels's Avatar

    k, wasn't aware that they published two versions of the AIR SDK.

  9. 9 Posted by wood on 06 Feb, 2014 08:14 AM

    wood's Avatar

    One more things, I can help you to code the plugin if you need

  10. Support Staff 10 Posted by Yennick Trevels on 06 Feb, 2014 11:05 AM

    Yennick Trevels's Avatar

    Sure, feel free to fork our repo and provide us a pull request. This would certainly help a lot! :-)

  11. 11 Posted by wood on 13 Feb, 2014 05:05 AM

    wood's Avatar
  12. Support Staff 12 Posted by Yennick Trevels on 14 Feb, 2014 07:00 AM

    Yennick Trevels's Avatar

    Thank you for this work! I'll try to review it this weekend.

  13. 13 Posted by soywiz on 14 Feb, 2014 02:06 PM

    soywiz's Avatar

    I had this problem too. Just for the record. I think there are three kind of sdks:

    http://www.adobe.com/devnet/flex/flex-sdk-download.html
    http://www.adobe.com/devnet/air/air-sdk-download.html
    http://flex.apache.org/download-binaries.html

    The adobe flexsdk is discontinued. But the airsdk is being updated by adobe frequently also it includes actionscript compiler 2.0. I'm using it for pure as3 projects (without any mxml) and I got the problem reported by wood.

  14. Support Staff 14 Posted by Yennick Trevels on 17 Feb, 2014 07:55 AM

    Yennick Trevels's Avatar

    Hi, I've reviewed the code. Overall, looks good, but I've found two issues:

    1. flexConvention.configPath.contains("flex-sdk"): As you already suggest in your comment, it's rather hacky and probably shouldn't stay in there :)
    2. In Compc.groovy, Asdoc.groovy & Mxmlc.groovy => when determining whether the user has specified the sdk, only checking the configuration isn't enough since he can choose not to use dependencies and specify the flexHome variable directly
  15. 15 Posted by wood on 17 Feb, 2014 05:19 PM

    wood's Avatar
    1. I am unable to created a test case. As the set is backed with a Map, I dont know how to do?

      project.configurations.getByName(Configuration.FLEXSDK_CONFIGURATION.configName()).files
      
    2. Done! But CommandLineInstruction.groovy still have the same issue. Am I correct?

  16. Support Staff 16 Posted by Yennick Trevels on 19 Feb, 2014 08:20 AM

    Yennick Trevels's Avatar
    1. I've also been having issues sometimes with writing unit tests for some of the build code. I think it's generally quite hard, since it relies quite heavily on external systems (filesystem, compilers, etc.).
      What we maybe can do is put the code which determines whether the Flex SDK is specified behind an interface. That way that logic is isolated to one class and can be easily mocked when using it in the CommandLineInstruction (or anywhere else).
    2. Nice! As for the CommandLineInstruction.groovy, that indeed still has the same issue.
  17. Support Staff 17 Posted by Yennick Trevels on 26 Feb, 2014 06:14 PM

    Yennick Trevels's Avatar

    Hi,

    When you're done, feel free to push a pull request. Then I'll merge it in the main codebase. It would be very much appreciated :)

    Cheers,
    Yennick

  18. 18 Posted by wood on 02 Mar, 2014 05:41 PM

    wood's Avatar

    Hi Yennick,

    All fixed with a new test case and please review
    https://github.com/GradleFx/GradleFx/pull/125

    Thanks,
    WooD

  19. 19 Posted by wood on 04 Mar, 2014 06:33 PM

    wood's Avatar

    Any update with my code??

  20. Support Staff 20 Posted by Yennick Trevels on 04 Mar, 2014 06:45 PM

    Yennick Trevels's Avatar

    Merging and testing it right now along with some other pull requests

  21. Support Staff 21 Posted by Yennick Trevels on 04 Mar, 2014 09:06 PM

    Yennick Trevels's Avatar

    The code has been merged in our develop branch and should be available on the snapshot repo (https://oss.sonatype.org/content/repositories/snapshots/) as version 0.8.2-SNAPSHOT

  22. 22 Posted by wood on 05 Mar, 2014 11:38 AM

    wood's Avatar

    Thanks for accepting my code

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