使用Jenkins提供编译器常量来构建Adobe AIR项目 [英] Supplying compiler constants using Jenkins to build an Adobe AIR project

查看:276
本文介绍了使用Jenkins提供编译器常量来构建Adobe AIR项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在设置Jenkins来构建项目。

我有一个使用AIR平台上的FlashDevelop编写的项目。 >

在ActionScript源文件中是使用.as3proj中保存的值传递给编译器的区域。



从.as3proj文件:

 < build> 
< option additional = - define = CONFIG :: desktop,true&#xA; -define = CONFIG :: mobile,false/>
< / build>

然而,我的pom.xml文件指定一个特定的ActionScript文件被用作入口点,这意味着这些编译器选项没有被设置。这会导致Jenkins在尝试编译代码时给出如下错误:

  workspace \src\AppMain.as :[47,10]访问未定义的属性手机。 CONFIG :: mobile {

如何在pom.xml文件中指定这些值,以便Jenkins能够编译?

解决方案

我找到了

  /flex/flexmojos.txtrel =nofollow>资源如下: <项目> 
< build>
< sourceDirectory> src< / sourceDirectory>
< plugins>
< plugin> <! - 允许编译SWF - >
< groupId> org.sonatype.flexmojos< / groupId>
< artifactId> flexmojos-maven-plugin< / artifactId>
< version> 4.0-RC2< / version>
< extensions> true< / extensions>
<配置>
< sourceFile> AppMain.as< / sourceFile>
<定义>
<属性>
<名称> CONFIG :: desktop< / name>
<值> true< /值>
< / property>
< / define>
< / configuration>
< / plugin>
< / plugins>
< / build>
< / project>


I have a project that's been written using FlashDevelop on the AIR platform.

I'm in the process of setting up Jenkins to build the project.

Within the ActionScript sources files are regions which use a values held in the .as3proj to pass to the compiler.

Extract from the .as3proj file:

  <build>
<option additional="-define=CONFIG::desktop,true  &#xA;-define=CONFIG::mobile,false" />
</build>

However my pom.xml file is specifying that a specific ActionScript file is being used as an entry point, meaning that these compiler options aren't being set. This leads to Jenkins giving errors like the following when it attempts to compile the code:

workspace\src\AppMain.as:[47,10] Access of undefined property mobile.   CONFIG::mobile {

How can I specify these values in the pom.xml file so that Jenkins is able to compile?

解决方案

I found the following resource which referenced how to achieve this:

<project>
    <build>
        <sourceDirectory>src</sourceDirectory>
        <plugins>
            <plugin> <!-- Allows SWF to be compiled -->
                <groupId>org.sonatype.flexmojos</groupId>
                <artifactId>flexmojos-maven-plugin</artifactId>
                <version>4.0-RC2</version>
                <extensions>true</extensions>
                <configuration>
                    <sourceFile>AppMain.as</sourceFile>
                    <defines>
                        <property>
                            <name>CONFIG::desktop</name>
                            <value>true</value>
                        </property>
                    </defines>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

这篇关于使用Jenkins提供编译器常量来构建Adobe AIR项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆