-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '#15_add-ant-build-support' into develop
- Loading branch information
Showing
57 changed files
with
356 additions
and
1,394 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.