theme dependencies not working

phillip.green.ii's Avatar

phillip.green.ii

06 Feb, 2014 11:55 AM

I'm in the process of converting our flex code base from ant+maven to gradle and I came across the following error:

I assume it was due to the theme being missing, so I ran gradle dependencies and my theme was not displaying:

C:\development\flexworkspaces\GradleizeFlex\build\tmp>gradle dependencies
Relying on packaging to define the extension of the main artifact has been depre
cated and is scheduled to be removed in Gradle 2.0
flexhome is C:\Users\PGreen\.gradle\gradleFx\sdks\5da5981341a82f894a1f47dac1541d
6bad440c8d
:dependencies

------------------------------------------------------------
Root project - project_with_theme_from_flexhome_not_working
------------------------------------------------------------

airSDK
No dependencies

archives - Configuration for archive artifacts.
No dependencies

default - Configuration for default artifacts.
No dependencies

external
No dependencies

flexSDK
\--- org.apache:apache-flex-sdk:4.6.0

internal
No dependencies

merged
No dependencies

rsl
No dependencies

test
No dependencies

theme
No dependencies

BUILD SUCCESSFUL

Total time: 6.866 secs
C:\development\flexworkspaces\GradleizeFlex\build\tmp>

Below is a trimmed down version of build.gradle:

buildscript {
    repositories {
        mavenCentral()
        mavenLocal()
        maven {
            url "https://oss.sonatype.org/content/repositories/snapshots/"
        }
    }

    dependencies {
        classpath group: 'org.gradlefx', name: 'gradlefx', version: '0.8.2-SNAPSHOT'
    }
}

apply plugin: 'gradlefx'

group='demo'
type = 'swc'

description='project_with_theme_from_flexhome_not_working'
version='0.0.1-SNAPSHOT'

repositories {
    mavenCentral()
    mavenLocal()
}

dependencies {
    //installed with mvn install:install-file -Dfile=/path/to/flex_sdk_4.6.zip -DgroupId=org.apache -DartifactId=apache-flex-sdk -Dversion=4.6.0 -Dpackaging=zip

    flexSDK group: 'org.apache', name: 'apache-flex-sdk', version: '4.6.0', ext: 'zip'
    //I tried setting the theme explicitly, but the same result
    //theme files("C:\\Users\\PGreen\\.gradle\\gradleFx\\sdks\\5da5981341a82f894a1f47dac1541d6bad440c8d\\frameworks\\themes\\Halo\\halo.swc")
}

afterEvaluate {
    //this line shows the correct flexHome
    println "flexhome is ${flexHome}"
    dependencies {
        //this must be in afterEvaluate in order for flexHome to be already set
        theme files("${flexHome}/frameworks/themes/Halo/halo.swc")
    }
}

I am using the trick to install the sdk from a dependencies, because of that flexHome isn't populated immediately, which is why the theme is in the afterEvaluate block. From in the block, the println shows that flexHome is set correctly. Just to make sure it wasn't the afterEvaluate block , I tried hardcoding the theme path, but no dice there either. The theme never shows up when I run gradle dependencies.

I hope I'm not chasing a red herring. The true problem is that I can't compile the code. It seems to be due to the theme not being a dependency, so if that isn't correct, then please point me in the right direction.

  1. Support Staff 1 Posted by Maxime Cowez on 06 Feb, 2014 12:16 PM

    Maxime Cowez's Avatar

    That's the halo theme that comes with the sdk. I don't think you need to link it in explicitly. Can you give us the compiler error you're getting and a dump of the compiler options that are passed by gradlefx?

  2. 2 Posted by phillip.green.i... on 06 Feb, 2014 06:05 PM

    phillip.green.ii's Avatar

    I believe this is all of the compile parameters:

    13:00:40.493 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:java] Output redirected to property: compcOutput
    13:00:40.513 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Execute:Java13CommandLauncher: Executing 'C:\Program Files\Java\jdk1.6.0_34\jre\bin\java.exe' with arguments:
    '-Xmx1024m'
    '-jar'
    'C:\Users\PGreen\.gradle\gradleFx\sdks\5da5981341a82f894a1f47dac1541d6bad440c8d\lib\compc.jar'
    '-runtime-shared-library-path='
    '-external-library-path+=C:\Users\PGreen\.gradle\gradleFx\sdks\5da5981341a82f894a1f47dac1541d6bad440c8d/frameworks/libs/framework.swc'
    '-external-library-path+=C:\Users\PGreen\.gradle\gradleFx\sdks\5da5981341a82f894a1f47dac1541d6bad440c8d/frameworks/libs/textLayout.swc'
    '-external-library-path+=C:\Users\PGreen\.gradle\gradleFx\sdks\5da5981341a82f894a1f47dac1541d6bad440c8d/frameworks/libs/spark.swc'
    '-external-library-path+=C:\Users\PGreen\.gradle\gradleFx\sdks\5da5981341a82f894a1f47dac1541d6bad440c8d/frameworks/libs/sparkskins.swc'
    '-external-library-path+=C:\Users\PGreen\.gradle\gradleFx\sdks\5da5981341a82f894a1f47dac1541d6bad440c8d/frameworks/libs/rpc.swc'
    '-external-library-path+=C:\Users\PGreen\.gradle\gradleFx\sdks\5da5981341a82f894a1f47dac1541d6bad440c8d/frameworks/libs/charts.swc'
    '-external-library-path+=C:\Users\PGreen\.gradle\gradleFx\sdks\5da5981341a82f894a1f47dac1541d6bad440c8d/frameworks/libs/spark_dmv.swc'
    '-external-library-path+=C:\Users\PGreen\.gradle\gradleFx\sdks\5da5981341a82f894a1f47dac1541d6bad440c8d/frameworks/libs/osmf.swc'
    '-external-library-path+=C:\Users\PGreen\.gradle\gradleFx\sdks\5da5981341a82f894a1f47dac1541d6bad440c8d/frameworks/libs/mx/mx.swc'
    '-external-library-path+=C:\Users\PGreen\.gradle\gradleFx\sdks\5da5981341a82f894a1f47dac1541d6bad440c8d/frameworks/libs/advancedgrids.swc'
    '-source-path+=C:\development\flexworkspaces\GradleizeFlex\src\module_portalProjectMgmt\src\main\actionscript\das'
    '-source-path+=C:\development\flexworkspaces\GradleizeFlex\src\module_portalProjectMgmt\src\main\actionscript\mpv'
    '-source-path+=C:\development\flexworkspaces\GradleizeFlex\src\module_portalProjectMgmt\src\main\actionscript\projectUpload'
    '-source-path+=C:\development\flexworkspaces\GradleizeFlex\src\module_portalProjectMgmt\src\main\actionscript\spv'
    '-source-path+=C:\development\flexworkspaces\GradleizeFlex\src\module_portalProjectMgmt\src\main\actionscript\src'
    '-include-sources+=C:\development\flexworkspaces\GradleizeFlex\src\module_portalProjectMgmt\src\main\actionscript\das'
    '-include-sources+=C:\development\flexworkspaces\GradleizeFlex\src\module_portalProjectMgmt\src\main\actionscript\mpv'
    '-include-sources+=C:\development\flexworkspaces\GradleizeFlex\src\module_portalProjectMgmt\src\main\actionscript\projectUpload'
    '-include-sources+=C:\development\flexworkspaces\GradleizeFlex\src\module_portalProjectMgmt\src\main\actionscript\spv'
    '-include-sources+=C:\development\flexworkspaces\GradleizeFlex\src\module_portalProjectMgmt\src\main\actionscript\src'
    '-external-library-path+=C:\development\flexworkspaces\GradleizeFlex\src\library_common\build\library_common.swc'
    '-library-path+=C:\Users\PGreen\.m2\repository\org\robotlegs\robotlegs-framework\1.5.2\robotlegs-framework-1.5.2.swc'
    '-define=CONFIG::automation,false'
    '-warnings=false'
    '-strict=false'
    '-output=C:\development\flexworkspaces\GradleizeFlex\src\module_portalProjectMgmt\build\module_portalProjectMgmt.swc'
    

    This is the error:

    13:02:05.144 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Setting project property: compcOutput -> Loading configuration file C:\Users\PGreen\.gradle\gradleFx\sdks\5da5981341a82f894a1f47dac1541d6bad440c8d\frameworks\flex-config.xml
    C:\development\flexworkspaces\GradleizeFlex\src\module_portalProjectMgmt\src\main\actionscript\src\com\crowncastle\prjmgmt\components\LoadingProgressBarComp.mxml(8): Error: The style 'trackColors' is only supported by type 'mx.controls.ProgressBar' with the theme(s) 'halo'.
    
                    complete="completeHandler(event)" trackColors="[#444444, #AAAAAA]" barColor="green" borderColor="#660000"
    
    C:\development\flexworkspaces\GradleizeFlex\src\module_portalProjectMgmt\src\main\actionscript\src\com\crowncastle\prjmgmt\components\LoadingProgressBarComp.mxml(8): Error: The style 'barColor' is only supported by type 'mx.controls.ProgressBar' with the theme(s) 'halo'.
    
                    complete="completeHandler(event)" trackColors="[#444444, #AAAAAA]" barColor="green" borderColor="#660000"
    
    C:\development\flexworkspaces\GradleizeFlex\src\module_portalProjectMgmt\src\main\actionscript\src\com\crowncastle\prjmgmt\components\LoadingProgressBarComp.mxml(8): Error: The style 'borderColor' is only supported by type 'mx.controls.ProgressBar' with the theme(s) 'halo'.
    
                    complete="completeHandler(event)" trackColors="[#444444, #AAAAAA]" barColor="green" borderColor="#660000"
    
  3. Support Staff 3 Posted by Yennick Trevels on 08 Feb, 2014 05:33 AM

    Yennick Trevels's Avatar

    Hi,

    Specifying the theme as a theme dependency won't work with GradleFx since the '-theme' compileroption is only supported by the mxmlc compiler, while the compc compiler is used for a swc based project.

    What may help is specifying the halo.swc as an 'external' dependency in the swc project, and then specify it as a 'theme' dependency in the swf project.

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

24 Jun, 2017 02:18 PM
10 Jun, 2017 04:16 PM
24 Mar, 2017 07:10 PM
19 Mar, 2017 04:39 AM
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
01 Jun, 2016 05:20 PM
03 May, 2016 09:17 PM