summaryrefslogtreecommitdiff
path: root/actionscript/core/build.xml
blob: 5bcc0b8a5ebe3b8111b61734d7d1eb643c0f11c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?xml version="1.0"?>
<!--
 * Copyright 2011 ZXing authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
-->
<project name="ZXing" default="build" basedir="../">
  <property environment="env" />
  <property file="${basedir}/build.properties.local" />
  <property file="${basedir}/../build.properties"/>
  <property name="FLEX_HOME" location="${env.FLEX_HOME}" />
  <property name="dist" location="${basedir}/core/bin" />
  <property name="src" location="${basedir}/core/src" />
  <property name="test" location="${basedir}/core/test" />
  <property name="assets" location="${basedir}/../core/test/data" />
  <property name="libs" location="${basedir}/core/libs" />
  <property name="output" location="${basedir}/core/bin/output" />
  <property name="report" location="${basedir}/core/bin/report" />

  <fail unless="FLEX_HOME"
        message="Error: define FLEX_HOME env. var. with a path to Flex4 SDK" />
  <fail unless="version"
        message="Error: version is undefined." />

  <property name="libraryName" value="zxing-${version}.swc" />

  <taskdef resource="flexTasks.tasks"
           classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />
  <taskdef resource="flexUnitTasks.tasks"
           classpath="${libs}/flexUnitTasks-4.1.0-8.jar" />

  <target name="clean">
    <delete>
      <fileset dir="${dist}" includes="**/${libraryName}"/>
    </delete>
  </target>

  <target name="init">
    <mkdir dir="${dist}"/>
  </target>

  <target name="build" depends="init">
    <fileset id="srcFiles" dir="${src}">
      <include name="**/*.as"/>
    </fileset>
    <pathconvert property="classes" pathsep="," refid="srcFiles">
      <chainedmapper>
        <globmapper from="${src}/*" to="*"></globmapper>
        <mapper type="package" from="*.as" to="*"/>
      </chainedmapper>
    </pathconvert>
    <compc output="${dist}/${libraryName}" include-classes="${classes}">
      <source-path path-element="${src}"/>
	  <include-sources dir="${basedir}/core/src" includes="*" />
    </compc>
  </target>

  <target name="compile.tests" depends="build">
    <mxmlc file="${test}/com/google/zxing/testrunner/ZXingTestsRunner.mxml"
           output="${output}/ZXingTestsRunner.swf"
           debug="true">
      <library-path dir="${dist}" append="true">
        <include name="*.swc"/>
      </library-path>
      <library-path dir="${libs}" append="true">
        <include name="*.swc"/>
      </library-path>
      <library-path dir="${FLEX_HOME}/frameworks/libs/air" append="true">
        <include name="*.swc"/>
      </library-path>
      <library-path dir="${FLEX_HOME}/frameworks/libs" append="true">
        <include name="framework.swc"/>
      </library-path>
      <source-path path-element="${test}" />
      <source-path path-element="${assets}" />
      <compiler.verbose-stacktraces>true</compiler.verbose-stacktraces>
			<compiler.headless-server>true</compiler.headless-server>
    </mxmlc>
    <copy todir="${output}">
      <fileset dir="${test}/com/google/zxing/testrunner">
        <include name="zxing*.xml" />
      </fileset>
    </copy>
  </target>

</project>