Setting compiler.theme option for Halo/Flex 4 in FlashDevelop - apache-flex

Here's what works with ant build.xml:
<mxmlc file="${module.main.dir}/main.mxml" keep-generated-actionscript="false" output="${module.output.dir}/main.swf" fork="${flex.fork}">
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
<source-path path-element="${FLEX_HOME}/frameworks"/>
<compiler.theme file="${FLEX_HOME}/frameworks/themes/Halo/halo.swc"/>
</mxmlc>
I tried the following values in Project > Properties > Compiler Options > Additional Compiler Options but none of them worked:
-theme=PATH_TO/halo.swc
-compiler.theme=PATH_TO/halo.swc
-theme=file=PATH_TO/halo.swc
-compiler.theme.file=PATH_TO/halo.swc
-theme.file=PATH_TO/halo.swc
Thanks.

-compatibility-version=3
should fix it
or you could try
-theme=../frameworks/themes/Halo/halo.swc

copy and paste the below line in additional compiler option.
-theme=${flexlib}/themes/Halo/halo.swc
This will work.

Related

lesscss-maven-plugin from biz.gabrys.maven.plugins : using <compilerOptions>

I succeed to compile less to css. But i cannot figure out how pass Compiler Options to the compiler in order to generate the mapping source file too.
From the doc, it should be a thing like :
<compilerOptions>
<compilerOption>dumpLineNumbers:all</compilerOption>
</compilerOptions>
But i get :
[INFO] Compiling 1 source to C:\workspaces\neon-dev\project\src\main\webapp\css
lesscss: couldn't open file dumpLineNumbers:all
Any hints ?
You have to pass options in command line style, e.g.:
<compilerOptions>
<compilerOption>--line-numbers=all</compilerOption>
</compilerOptions>
See all available options: http://lesscss.org/usage/index.html#command-line-usage-options.
Version 2.0 of the biz.gabrys.maven.plugins:lesscss-maven-plugin will have a simpler configuration e.g.:
<options>
<lineNumbers>all</lineNumbers>
</options>

ZCML configuration conflict between Zope2 and another zope.* package

I have a Plone add-on with the following setup.py
setup(
...
install_requires=[
...
'zope.i18n',
...
'Zope2',
],
...
)
If I run bin/instance I get the following traceback:
File ".buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 1527, in resolveConflicts
raise ConfigurationConflictError(conflicts)
zope.configuration.config.ConfigurationConflictError: Conflicting configuration actions
For: ('utility', <InterfaceClass zope.i18n.interfaces.INegotiator>, '')
File ".buildout/eggs/zope.i18n-3.7.4-py2.7.egg/zope/i18n/configure.zcml", line 3.2-6.8
<utility
provides="zope.i18n.interfaces.INegotiator"
component="zope.i18n.negotiator.negotiator"
/>
File ".buildout/eggs/Zope2-2.13.22-py2.7.egg/ZPublisher/i18n.zcml", line 5.2-8.8
<utility
provides="zope.i18n.interfaces.INegotiator"
component="zope.i18n.negotiator.negotiator"
/>
If I comment out zope.i18n from setup.py, run buildout again, then the instance starts fine.
Surprisingly enough, both bin/instance files (before and after removing zope.i18n) are exactly the same.
So I'm sort of left clueless about what's wrong on defining something on setup.py that anyway the same version gets picked...
Last note, on the distribution's main configure.zcml I have this line:
<includeDependencies package="." />
Does this matter at all?
That seems odd?? obviously it's not possible to registry twice the same utility, but both packages do? I'm very confused about that. Usually you don't need the <includeDependencies package="." /> parts, since all components should be loaded by the plone entry point of z3c.autoinclude. I assume in a default plone environment, one of the components will not be loaded.
I checked in on a Plone 4.3.6... The Negotiator of zope.i18n is used.
So my best bet is, that your <includeDependencies package="." />, also loads the configure.zcml of Zope2, which should not happen.
Removing the <includeDependencies package="." />, may solve your issue.

How to poke connectionString in sqlmap.config?

In a similar way to what is done here, I would like to xmlpoke connectionString from an sqlmap.config file:
<?xml version="1.0" encoding="utf-8" ?>
<sqlMapConfig
xmlns="http://ibatis.apache.org/dataMapper"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<database>
<provider name="oracleClient1.0"/>
<dataSource name="DSExtranetAdherent"
connectionString="Data Source=MyInstance;User ID=MyUser;Password=MyPwd;Unicode=True;"/>
</database>
</sqlMapConfig>
I tried with this poke:
<xmlpoke
file="${ConfigPath}\sqlmap.config"
xpath="/sqlMapConfig/database/dataSource/#connectionString"
value="${ConnectionString}" />
But I get an error message:
[xmlpoke] No matching nodes were found with XPath expression '/sqlMapConfig/database/dataSource/#connectionString'.
The xpath is effective when I remove the xmlns property, but then I get this runtime error:
Unable to load file via resource "SqlMap.config" as resource.
Any idea on how to fix this xmlpoke with a good xpath?
xmlns is the default namespace, xmlpoke require a prefix for xpath parsing:
<xmlpoke
file="${ConfigPath}\sqlmap.config"
xpath="/iba:sqlMapConfig/iba:database/iba:dataSource/#connectionString"
value="${ConnectionString}">
<namespaces>
<namespace prefix="iba" uri="http://ibatis.apache.org/dataMapper" />
</namespaces>
</xmlpoke>
You should specify the <namespaces> child node for the <xmlpoke> task:
<namespaces>
<namespace prefix="xsi" uri="http://www.w3.org/2001/XMLSchema-instance" />
</namespaces>
The last sample on this page explains just your case.

Why doesn't ${locale} resolve in my <compc> Ant task?

I've seen a number of examples, e.g. here, where people are including locale resource bundles by referencing the locale attribute in the element. For some reason this doesn't work for me. Here's what I have for the task:
<compc output="${deploy.dir}/myfrmwrk.swc" locale="en_US">
<source-path path-element="${basedir}/src/main/flex"/>
<include-sources dir="${basedir}/src/main/flex" includes="*" />
<include-libraries file="${basedir}/libs"/>
<compiler.external-library-path dir="${FLEX_HOME}/frameworks/libs/player/9" append="true">
<include name="playerglobal.swc"/>
</compiler.external-library-path>
<compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
<include name="libs"/>
<include name="locale/${locale}"/>
</compiler.library-path>
<load-config filename="${basedir}/fb3config.xml" />
</compc>
This fails with a bunch of errors of the form:
[compc] Error: could not find source for resource bundle ...
I can make it build with this one change:
<include name="locale/en_US"/>
The configuration file generated by Flex Builder 3 actually renders this as "locale/{locale}" (notice the $ is missing). I've tried that as well with the same (failing) results.
For now, I'm doing OK directly injecting en_US as we won't be doing localization bundles for quite some time, but I will eventually need to get this working. Also, it bugs me that I can't make it work the way that it SHOULD work!
I think the problem here is that ${locale} is interpreted by ant as a property, rather than a string literal to pass to the compc task. What I mean is that ant sees ${locale} and thinks that you want to substitute the value of the property locale which is (supposedly) defined in your build file. Of course, this isn't what you want at all, and things break miserably because of it.
The way I've done things in my build files is to remove the $ prefix and everything seems to work as expected. So your example would look something like this:
<compc output="${deploy.dir}/myfrmwrk.swc" locale="en_US">
<source-path path-element="${basedir}/src/main/flex"/>
<include-sources dir="${basedir}/src/main/flex" includes="*" />
<include-libraries file="${basedir}/libs"/>
<compiler.external-library-path dir="${FLEX_HOME}/frameworks/libs/player/9" append="true">
<include name="playerglobal.swc"/>
</compiler.external-library-path>
<compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
<include name="libs"/>
<!-- Ditch the dollar sign and things should work! -->
<include name="locale/{locale}"/>
</compiler.library-path>
<load-config filename="${basedir}/fb3config.xml" />
</compc>

How to compile a SWC file with mulitple namespaces

I'm trying to compile an SWC file from a list of given ActionScript classes. I'm using the compc compiler. The problem is that there are so many classes grouped into multiple namespaces that I am finding it very tedious to specify each individual class to be included in the SWC. Is there any easier way of doing this like just simply specifying a root directory of these classes?
At the moment I have something like this:
<?xml version="1.0"?>
<flex-config xmlns="http://www.adobe.com/2006/flex-config">
<output>C:\SomeFolder\testSWC.swc</output>
<compiler>
<source-path>.</source-path>
</compiler>
<include-classes>
<class>SomeNamespaceOne.One</class>
<class>SomeNamespaceOne.Two</class>
<class>SomeNamespaceOne.Three</class>
<class>SomeNamespaceOne.Four</class>
...
<class>SomeNamespaceFifty.One</class>
</include-classes>
</flex-config>
But I want something like this:
<?xml version="1.0"?>
<flex-config xmlns="http://www.adobe.com/2006/flex-config">
<output>C:\SomeFolder\testSWC.swc</output>
<compiler>
<source-path>. </source-path>
</compiler>
<include-classes>
<class>SomeRootDirectoryOfClassesToCompile</class>
</include-classes>
</flex-config>
Is this possible?
We wanted something similar, in "Ant".
I am assuming you are not using Flex Builder. In that case, I will definitely recommend using Ant and Flex Ant tasks available from Adobe. Even when you use Ant, its not easy doing what you want to do, so I am including our code below.
Following is our code. I don't remember where I got the idea from, so cannot thank the source for it :)
<pathconvert property="XXX.classes" pathsep=" ">
<fileset dir="${basedir}/XXX/src">
<include name="**/*.as"/>
<include name="**/*.mxml"/>
</fileset>
<compositemapper>
<packagemapper from="${basedir}\XXX\src\*.as" to="*"/>
<packagemapper from="${basedir}/XXX/src/*.as" to="*"/>
<packagemapper from="${basedir}\XXX\src\*.mxml" to="*"/>
<packagemapper from="${basedir}/XXX/src/*.mxml" to="*"/>
</compositemapper>
</pathconvert>
<compc optimize="true" debug="false"
include-classes="${XXX.classes}" output="${BUILD_FOLDER}/XXX.swc">
</compc>
Like Tanmay said, you should use the ANT tasks to make life easier, but there's an even simpler wach include an entire directory in the compc ant task. If you just need to include everything in src.dir you can do it like this:
<compc output="${target.dir}/foo.swc">
<source-path path-element="${src.dir}"/>
<include-sources dir="${src.dir}">
<include name="**/*" />
</include-sources>
</compc>

Resources