From Flex to GradleFx

Parthasarathy's Avatar

Parthasarathy

04 Apr, 2016 07:14 AM

http://gradle.org/docs/2.2.1/userguide/gradle_daemon.html

Popup.mxml
<?xml version="1.0" encoding="utf-8"?>
<comp:Resize xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:comp="com.abc.help.component.*"
xmlns:controls="com.randomFractals.media.controls.*">
</comp:Resize>

Resize.mxml

Both present in the same directory.

In the build.gradle file I have mentioned it as

compileFlex {
    mainClass= 'Popup.mxml'
}

However on build am getting an error stating
Error: Unable to locate specified base class 'com.abc.help.component.Resize' for component class 'Popup'.

  1. Support Staff 1 Posted by Yennick Trevels on 04 Apr, 2016 07:52 AM

    Yennick Trevels's Avatar

    Hi!

    One issue I see is the way you specify the mainClass. This shouldn't be wrapped into a compileFlex block, but instead can be used without. Also, since both Popup.mxml and Resize.mxml are in the same package (so com.abc.help.component), this path should also be used in the mainClass definition:

    mainClass = 'com/abc/help/component/Popup.mxml'
    
  2. 2 Posted by Partha Sarathy on 05 Apr, 2016 07:44 AM

    Partha Sarathy's Avatar

    Hi Yennick,
    Thanks for your reply.

    mainClass = 'com/abc/help/component/Popup.mxml'

    I removed compileFlex block and declared the main class as suggested
    'com/abc/help/component/Popup.mxml'. However its looking for file with name
    'com/abc/help/component/Popup.mxml' instead of Popup.mxml in specified path.
    I have given srcDirs = ['com/abc/help/component','com/abc/help/presentation'
    .....]
    However nothing is working. If you could please help me.

    Thanks & Regards,
    Parthasarathy K.

  3. Support Staff 3 Posted by Yennick Trevels on 05 Apr, 2016 12:45 PM

    Yennick Trevels's Avatar

    ok, in that case it makes sense that the component Resize can't be found, given your defined srcDirs. The srcDirs should point to the root of your package structure.

    For example, given you have the following directory structure in your project, where "com/abs/help/component" is a package structure containing your class files:

    src/main/flex/com/abs/help/component
    

    Then srcDirs should be:

    srcDirs = ['src/main/flex']
    

    and mainClass should be:

    mainClass = 'com/abc/help/component/Popup.mxml'
    
  4. 4 Posted by Partha Sarathy on 07 Apr, 2016 07:43 AM

    Partha Sarathy's Avatar

    Hi Yennick,
    Thanks that helped me :)

    Thanks,
    Parthasarathy K.

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

Recent Discussions

22 Jan, 2017 07:46 AM
11 Oct, 2016 01:18 PM
20 Sep, 2016 04:36 PM
06 Sep, 2016 08:05 PM
03 Aug, 2016 11:15 AM