Skip to content

Commit

Permalink
Merge branch '#15_add-ant-build-support' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
dasa committed Jan 25, 2013
2 parents 9c4e062 + b9cca53 commit 3bad0df
Show file tree
Hide file tree
Showing 57 changed files with 356 additions and 1,394 deletions.
4 changes: 2 additions & 2 deletions .actionScriptProperties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<actionScriptProperties analytics="false" mainApplicationPath="index.mxml" projectUUID="034d1e94-f1a9-4d3b-a1f5-4df718f153ab" version="10">
<compiler additionalCompilerArguments="-locale en_US -source-path=locale/{locale} -keep-all-type-selectors=true" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="false" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="false" verifyDigests="true" warn="true">
<compiler additionalCompilerArguments="-locale=en_US -source-path=locale/{locale} -keep-all-type-selectors=true" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="false" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="false" verifyDigests="true" warn="true">
<compilerSourcePath/>
<libraryPath defaultLinkType="0">
<libraryPathEntry kind="4" path="">
Expand All @@ -17,7 +17,7 @@
<application path="index.mxml"/>
</applications>
<modules>
<module application="src/index.mxml" destPath="widgets/AttributeTable/AttributeTableWidget.swf" optimize="true" sourcePath="src/widgets/AttributeTable/AttributeTableWidget.mxml"/>
<module application="src/index.mxml" destPath="widgets/AttributeTable/AttributeTableWidget.swf" optimize="true" sourcePath="src/widgets/AttributeTable/AttributeTableWidget.mxml"/>
<module application="src/index.mxml" destPath="widgets/Bookmark/BookmarkWidget.swf" optimize="true" sourcePath="src/widgets/Bookmark/BookmarkWidget.mxml"/>
<module application="src/index.mxml" destPath="widgets/Coordinate/CoordinateWidget.swf" optimize="true" sourcePath="src/widgets/Coordinate/CoordinateWidget.mxml"/>
<module application="src/index.mxml" destPath="widgets/Chart/ChartWidget.swf" optimize="true" sourcePath="src/widgets/Chart/ChartWidget.mxml"/>
Expand Down
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Ant build files
env.properties
local.properties

# Build and Release Folders
bin-debug/
bin-release/
dist/

# Other files
*.swc
12 changes: 12 additions & 0 deletions build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# The distribution directory
dist.dir=dist

# Flash Builder's locale compiler vaule
# For example, -locale=en_US
fb.locale=en_US

# Flash Builder's debug directory
fb.debug.dir=bin-debug

# The name of the Flex Viewer project in the workspace set in local.properties
fb.workspace.project.name=FlexViewer
229 changes: 229 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
///////////////////////////////////////////////////////////////////////////
// Copyright (c) 2008-2013 Esri. All Rights Reserved.
//
// 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="ArcGIS Viewer for Flex" default="main" basedir=".">

<property file="env.properties"/>
<property environment="env"/>
<property file="local.properties"/>
<property file="build.properties"/>

<target name="main"
depends="clean,run-flash-builder,check-fb-result"
description="Runs Flash Builder"/>

<target name="full-build"
depends="clean,backup-actionScriptProperties,update-actionScriptProperties,run-flash-builder,restore-actionScriptProperties,check-fb-result,build-all-resoure-modules,update-index.html,copy-index.html,copy-version.xml"
description="Runs a full build"/>

<target name="clean" description="Deletes dist directory">
<delete dir="${dist.dir}"/>
</target>

<target name="backup-actionScriptProperties"
depends="check-backup-exists"
unless="backup.exists">
<copy file=".actionScriptProperties" tofile=".actionScriptProperties.bak"/>
</target>

<target name="check-backup-exists">
<available property="backup.exists" file=".actionScriptProperties.bak"/>
</target>

<target name="restore-actionScriptProperties">
<move file=".actionScriptProperties.bak" tofile=".actionScriptProperties"/>
</target>

<target name="update-actionScriptProperties">
<replace file=".actionScriptProperties"
token="-locale=${fb.locale}"
value="-locale= -resource-bundle-list=bundle-list.txt"/>
</target>

<target name="run-flash-builder" description="Compile a release build using Flash Builder">
<!-- mac -->
<exec executable="${basedir}/fbbuild.sh"
osfamily="mac"
resultproperty="fb.result">
<env key="FB_PATH" value="${fb.path}"/>
<env key="WORKSPACE" value="${fb.workspace.path}"/>
</exec>
<!-- windows -->
<exec executable="cmd"
osfamily="windows"
resultproperty="fb.result">
<arg value="/c"/>
<arg value="fbbuild.bat"/>
<env key="FB_PATH" value="${fb.path}"/>
<env key="WORKSPACE" value="${fb.workspace.path}"/>
</exec>
</target>

<target name="check-fb-result">
<fail message="Flash Builder failed">
<condition>
<isfailure code="${fb.result}"/>
</condition>
</fail>
</target>

<target name="build-all-resoure-modules" depends="get-bundles">
<antcall target="build-resoure-module">
<param name="LOCALE" value="ar"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="de_DE"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="en_US"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="es_ES"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="fr_FR"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="it_IT"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="ja_JP"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="ko_KR"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="nb_NO"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="nl_NL"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="pl_PL"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="pt_BR"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="ro_RO"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="ru_RU"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="sv_SE"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="zh_CN"/>
</antcall>
</target>

<target name="build-resoure-module">
<java jar="${env.FLEX_HOME}/lib/mxmlc.jar"
failonerror="true"
maxmemory="1024m"
fork="true">
<jvmarg value="-Dsun.io.useCanonCaches=false"/>
<arg line="+flexlib='${env.FLEX_HOME}/frameworks'"/>
<arg line="-headless-server"/>
<arg line="-locale=${LOCALE}"/>
<arg line="-include-resource-bundles=${BUNDLES}"/>
<arg line="-source-path=locale/{locale}"/>
<arg line="-library-path+=libs"/>
<arg line="-output=${dist.dir}/assets/locale/${LOCALE}.swf"/>
</java>
</target>

<target name="get-bundles">
<loadfile property="bundleList" srcFile="${fb.debug.dir}/bundle-list.txt"/>
<script language="javascript">
<![CDATA[
if (bundleList.indexOf(" ViewerStrings ") == -1)
{
// add missing ViewerStrings
bundleList += "ViewerStrings ";
}
// change from: bundles = ESRIMessages SharedResources ViewerStrings ...
// to ESRIMessages,SharedResources,ViewerStrings,...
var bundles = bundleList.substring(10); // remove "bundles = "
bundles = bundles.split(" ") // create Array
bundles = bundles.join(); // create CSV
var property = project.createTask("property");
property.setName("BUNDLES");
property.setValue(bundles);
property.perform();
]]>
</script>
</target>

<target name="update-index.html">
<replace file="${dist.dir}/index.html" token="var flashvars = {};">
<replacevalue expandProperties="true"><![CDATA[var flashvars = {};
flashvars.localeChain = "${fb.locale}";
flashvars.resourceModuleURLs = "assets/locale/${fb.locale}.swf";
//flashvars.localeChain = "ar";
//flashvars.resourceModuleURLs = "assets/locale/ar.swf";
//flashvars.localeChain = "de_DE";
//flashvars.resourceModuleURLs = "assets/locale/de_DE.swf";
//flashvars.localeChain = "es_ES";
//flashvars.resourceModuleURLs = "assets/locale/es_ES.swf";
//flashvars.localeChain = "fr_FR";
//flashvars.resourceModuleURLs = "assets/locale/fr_FR.swf";
//flashvars.localeChain = "it_IT";
//flashvars.resourceModuleURLs = "assets/locale/it_IT.swf";
//flashvars.localeChain = "ja_JP";
//flashvars.resourceModuleURLs = "assets/locale/ja_JP.swf";
//flashvars.localeChain = "ko_KR";
//flashvars.resourceModuleURLs = "assets/locale/ko_KR.swf";
//flashvars.localeChain = "nb_NO";
//flashvars.resourceModuleURLs = "assets/locale/nb_NO.swf";
//flashvars.localeChain = "nl_NL";
//flashvars.resourceModuleURLs = "assets/locale/nl_NL.swf";
//flashvars.localeChain = "pl_PL";
//flashvars.resourceModuleURLs = "assets/locale/pl_PL.swf";
//flashvars.localeChain = "pt_BR";
//flashvars.resourceModuleURLs = "assets/locale/pt_BR.swf";
//flashvars.localeChain = "ro_RO";
//flashvars.resourceModuleURLs = "assets/locale/ro_RO.swf";
//flashvars.localeChain = "ru_RU";
//flashvars.resourceModuleURLs = "assets/locale/ru_RU.swf";
//flashvars.localeChain = "sv_SE";
//flashvars.resourceModuleURLs = "assets/locale/sv_SE.swf";
//flashvars.localeChain = "zh_CN";
//flashvars.resourceModuleURLs = "assets/locale/zh_CN.swf";]]></replacevalue>
</replace>
</target>

<target name="copy-index.html">
<copy file="${dist.dir}/index.html" tofile="${dist.dir}/default.htm"/>
</target>

<target name="copy-version.xml">
<tstamp>
<format property="today" pattern="yyyy-MM-dd"/>
</tstamp>
<copy file="src/version.xml"
todir="${dist.dir}"
overwrite="true">
<filterset>
<filter token="BUILD_DATE" value="${today}"/>
</filterset>
</copy>
</target>

</project>
36 changes: 36 additions & 0 deletions env-template.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# If you chose to use this file, copy it to env.properties and uncomment the
# properties you wish to set.

# For each of
#
# FLEX_HOME
#
# you need to set an environment variable with that name or set the property here
# prefixed with "env.". If a property is set in this file, and the corresponding
# environment variable is also set, the property set here takes precedence over the
# corresponding environment variable.
#
# Use absolute file paths.
#
# This is a Java property file. On Windows, you can use the '/' file separator,
# or if you use the '\' file separator, you must use "\\", but not escape spaces, for example,
#
# env.FLEX_HOME=C:\\Program Files (x86)\\Adobe\\Adobe Flash Builder 4.6\\sdks\\4.6.0

#
# Set this to the directory that contains the Adobe Flex SDK
# for your platform.
#
# On Windows (32-bit), if installed to the default location, the setting would be
# env.FLEX_HOME=C:\\Program Files\\Adobe\\Adobe Flash Builder 4.6\\sdks\\4.6.0
#
# or on a 64-bit version of Windows
# env.FLEX_HOME=C:\\Program Files (x86)\\Adobe\\Adobe Flash Builder 4.6\\sdks\\4.6.0
#
# Note: the folder "Program Files" (or "Program Files (x86)") might have a different name
# depending on the language of your Windows installation.
#
# On Mac, if installed to the default location, the setting would be
# env.FLEX_HOME=/Applications/Adobe Flash Builder 4.6/sdks/4.6.0
#
#env.FLEX_HOME=
7 changes: 7 additions & 0 deletions fbbuild.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
REM works with either FlashBuilderC.exe or eclipsec.exe
"%FB_PATH%" ^
--launcher.suppressErrors ^
-noSplash ^
-application org.eclipse.ant.core.antRunner ^
-data "%WORKSPACE%" ^
-file "%cd%\fbbuild.xml" main
9 changes: 9 additions & 0 deletions fbbuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh -e

# works with either FlashBuilder.app or Eclipse.app
"$FB_PATH" \
--launcher.suppressErrors \
-noSplash \
-application org.eclipse.ant.core.antRunner \
-data "$WORKSPACE" \
-file "$(pwd)/fbbuild.xml" main
15 changes: 15 additions & 0 deletions fbbuild.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project default="main">

<property file="local.properties"/>
<property file="build.properties"/>

<target name="main">
<echo message="Workspace: ${fb.workspace.path}"/>
<echo message="Project: ${fb.workspace.project.name}"/>

<fb.exportReleaseBuild destdir="${dist.dir}"
project="${fb.workspace.project.name}"/>
</target>

</project>
32 changes: 32 additions & 0 deletions local-template.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Save a copy of this as local.properties and set the properties below.

# You may also override any build.properties here since this takes precedence
# over the corresponding property in build.properties.
#
# Use absolute file paths.
#
# This is a Java property file. On Windows, you can use the '/' file separator,
# or if you use the '\' file separator, you must use "\\", but not escape spaces.

#
# The path to the Flash Builder executable.
#
# Mac OS X example
# fb.path=/Applications/Adobe Flash Builder 4.6/Adobe Flash Builder 4.6.app/Contents/MacOS/Adobe Flash Builder 4.6
#
# Windows example
# fb.path=C:/Program Files/Adobe/Adobe Flash Builder 4.6/FlashBuilderC.exe
#
#fb.path=

#
# The path to the Flash Builder workspace where the Flex Viewer project is.
#
# Mac OS X example
# fb.workspace.path=/Users/jack/Documents/Adobe Flash Builder 4.6
#
# Windows examples
# fb.workspace.path=C:/Users/jack/Adobe Flash Builder 4.6
# fb.workspace.path=C:/Documents and Settings/jack/Adobe Flash Builder 4.6
#
#fb.workspace.path=
2 changes: 1 addition & 1 deletion locale/en_US/ViewerStrings.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -- UI related messages for the context menu on the map, in addition to messages from the api --
#
contextMenuText=About ArcGIS Viewer for Flex...
aboutText=This application is using ArcGIS Viewer for Flex version 3.1.\nBuild date 2012-12-12.
aboutText=This application is using ArcGIS Viewer for Flex version 3.1.
aboutLearnMoreBtn=Learn more
aboutCloseBtn=Close

Expand Down
Loading

0 comments on commit 3bad0df

Please sign in to comment.