Supplying compiler constants using Jenkins to build an Adobe AIR project

好久不见. 提交于 2019-12-12 04:53:45

问题


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?


回答1:


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>


来源:https://stackoverflow.com/questions/27046418/supplying-compiler-constants-using-jenkins-to-build-an-adobe-air-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!