theme dependencies not working
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.
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
Support Staff 1 Posted by Maxime Cowez on 06 Feb, 2014 12:16 PM
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 Posted by phillip.green.i... on 06 Feb, 2014 06:05 PM
I believe this is all of the compile parameters:
This is the error:
Support Staff 3 Posted by Yennick Trevels on 08 Feb, 2014 05:33 AM
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.