Skip to content
Permalink
4a4f7fce20
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
464 lines (417 sloc) 21 KB
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**************************************************************************
OmegaT - Java based Computer Assisted Translation (CAT) tool
Copyright (C) 2000-2007 Keith Godfrey and Maxym Mykhalchuk
2008-2010 Didier Briel, Alex Buloichik
2012 Didier Briel
2013 Didier Briel, Aaron Madlon-Kay
2014 Didier Briel
2015 Aaron Madlon-Kay
Home page: http://www.omegat.org/
Support center: http://groups.yahoo.com/group/OmegaT/
This file is part of OmegaT.
OmegaT is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OmegaT is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
**************************************************************************/
-->
<project name="OmegaT" default="all" basedir=".">
<!-- Use an empty string for non-beta versions and _Beta for beta versions -->
<property name="beta" value="_Beta" />
<description>Builds, tests, and runs the project OmegaT.</description>
<import file="nbproject/build-impl.xml"/>
<import file="nbproject/profiler-build-impl.xml"/>
<fileset dir="lib" id="all-jars-fileset">
<include name="**/*.jar"/>
</fileset>
<pathconvert pathsep=" " property="all-jars-path" refid="all-jars-fileset">
<chainedmapper>
<flattenmapper/>
<globmapper from="*" to="lib/*"/>
</chainedmapper>
</pathconvert>
<target name="-pre-init">
<property name="iscc.exe" value="iscc.exe"/>
<property file="src/org/omegat/Version.properties"/>
<filter filtersfile="src/org/omegat/Version.properties"/>
<filter token="all-jars-path" value="${all-jars-path}"/>
<copy file="manifest-template.mf" tofile="manifest.mf" filtering="true"/>
<condition property="updatenr"
value="0${update}"
else="${update}">
<length string="${update}"
length="1"/>
</condition>
<condition property="distversion"
value="${version}"
else="${version}_${updatenr}">
<equals arg1="${updatenr}" arg2="00"/>
</condition>
</target>
<target name="-post-clean">
<delete>
<fileset dir="src" includes="**/*.class"/>
</delete>
<delete file="omegat.prefs"/>
<delete file="filters.conf"/>
<delete file="segmentation.conf"/>
<delete file="log.txt"/>
<delete file="manifest.mf"/>
<delete dir="dist2"/>
</target>
<target name="-post-jar">
<delete file="${dist.dir}/README.TXT"/>
<!-- copy the native libraries to the distribution directory -->
<copy todir="dist/native">
<fileset dir="native"/>
</copy>
<!-- copy scripts to the distribution directory -->
<copy todir="dist/scripts">
<fileset dir="scripts"/>
</copy>
</target>
<!-- Creates a zip with two localization packs -->
<target name="l10n-pack" depends="init" description="Build a distribution of localizable files">
<mkdir dir="dist2"/>
<property name="l10n.project.dir" value="release/l10n-project"/>
<property name="l10n.dir" value="${build.dir}/l10n"/>
<mkdir dir="${l10n.dir}"/>
<!-- minimal -->
<property name="l10n.min" value="OmegaT_${distversion}_L10N_Minimal"/>
<property name="l10n.min.dir" value="${l10n.dir}/${l10n.min}"/>
<mkdir dir="${l10n.min.dir}"/>
<copy todir="${l10n.min.dir}">
<fileset dir="${l10n.project.dir}"/>
</copy>
<copy todir="${l10n.min.dir}/source">
<fileset dir="."
includes="doc_src/en/InstantStartGuide.xml
doc_src/en/images/InstantGuide_1.png
doc_src/en/images/InstantGuide_2.png
src/**/Bundle.properties
release/win32-specific/CustomMessages.ini
scripts/properties/check_rules.properties
scripts/properties/spellcheck.properties
scripts/properties/svn_cleanup_selected.properties
scripts/properties/search_replace.properties
script/properties/replace_strip_tags.properties
release/mac-specific/OmegaT.app/Contents/Resources/en.lproj/Localizable.strings" />
</copy>
<copy file="release/readme.txt"
tofile="${l10n.min.dir}/source/readme.utf8"
encoding="UTF-8"
outputencoding="UTF-8">
<filterset begintoken="@@" endtoken="@@">
<filter token="TRANSLATION_NOTICE"
value="This translation is the work of [insert your name], copyright© [insert year]."/>
</filterset>
</copy>
<zip destfile="dist2/${l10n.min}.zip"
basedir="${l10n.dir}" includes="${l10n.min}/**" />
<!-- full -->
<property name="l10n.max" value="OmegaT_${distversion}_L10N_Full"/>
<property name="l10n.max.dir" value="${l10n.dir}/${l10n.max}"/>
<mkdir dir="${l10n.max.dir}"/>
<copy todir="${l10n.max.dir}">
<fileset dir="${l10n.project.dir}"/>
</copy>
<copy todir="${l10n.max.dir}/source">
<fileset dir="."
includes="doc_src/en/** src/**/Bundle.properties release/win32-specific/CustomMessages.ini
scripts/properties/check_rules.properties
scripts/properties/spellcheck.properties
scripts/properties/svn_cleanup_selected.properties
scripts/properties/search_replace.properties
script/properties/replace_strip_tags.properties
release/mac-specific/OmegaT.app/Contents/Resources/en.lproj/Localizable.strings"
excludes="doc_src/en/index.xml
doc_src/en/html/**
doc_src/en/pdf/**" />
</copy>
<copy file="release/readme.txt"
tofile="${l10n.max.dir}/source/readme.utf8"
encoding="UTF-8"
outputencoding="UTF-8">
<filterset begintoken="@@" endtoken="@@">
<filter token="TRANSLATION_NOTICE"
value="This translation is the work of [insert your name], copyright© [insert year]."/>
</filterset>
</copy>
<zip destfile="dist2/${l10n.max}.zip"
basedir="${l10n.dir}" includes="${l10n.max}/**" />
</target>
<!-- Builds a source distribution -->
<target name="src" depends="init" description="Build source distribution">
<mkdir dir="dist2"/>
<zip destfile="dist2/OmegaT_${distversion}${beta}_Source.zip" basedir="."
includes="docs/** images/** lib/** nbproject/** lib-mnemonics/** release/** src/** test/** gen/** manifest-template.mf build.xml native/** doc_src/** docs_devel/** scripts/**"
excludes="**/nbproject/private/** **/build/** **/dist/**" />
</target>
<!-- Copies all files to dist -->
<target name="release" depends="docindexgen">
<mkdir dir="dist"/>
<copy todir="dist">
<fileset dir="release" includes="*" excludes="readme.txt *-specific l10n-project"/>
</copy>
<copy todir="dist">
<fileset dir="release/linux-specific"/>
<fileset dir="release/win32-specific" includes="OmegaT.bat"/>
</copy>
<copy todir="dist"
file="release/readme.txt">
<!-- Remove TRANSLATION_NOTICE placeholder (from English readme) -->
<filterset begintoken="@@" endtoken="@@">
<filter token="TRANSLATION_NOTICE" value=""/>
</filterset>
</copy>
<mkdir dir="dist/plugins"/>
<copy todir="dist/plugins">
<fileset dir="release/plugins-specific"/>
</copy>
<mkdir dir="dist/docs"/>
<copy todir="dist/docs"> <!-- copy all files except English legalNotices.html -->
<fileset dir="docs" excludes="en/legalNotices.html"/>
</copy>
<copy todir="dist/docs"> <!-- copy just English legalNotices.html -->
<fileset dir="docs" includes="en/legalNotices.html"/>
<!-- Remove TRANSLATION_NOTICE placeholder (from English manual) -->
<filterset begintoken="@@" endtoken="@@">
<filter token="TRANSLATION_NOTICE" value=""/>
</filterset>
</copy>
<mkdir dir="dist/images"/>
<copy todir="dist/images">
<fileset dir="images"/>
</copy>
<mkdir dir="dist/lib"/>
<copy todir="dist/lib">
<fileset dir="lib" includes="**/*.txt" excludes="sources/**" />
</copy>
</target>
<!-- Builds a ZIP distribution -->
<target name="zip" description="Build Zip distro" depends="jar,release">
<mkdir dir="dist2"/>
<zip destfile="dist2/OmegaT_${distversion}${beta}_Without_JRE.zip">
<zipfileset dir="dist" excludes="OmegaT OmegaT-JRE linux-install.sh omegat.kaptn OmegaT.exe OmegaT.iss OmegaT-JRE.iss OmegaT.l4J.ini l10n-project"/>
<zipfileset dir="dist" includes="OmegaT linux-install.sh omegat.kaptn" filemode="755"/>
</zip>
</target>
<!-- Builds a Linux (tar, bz2) distribution -->
<target name="linux" description="Build Linux distro" depends="jar,release, check-jre-linux" if="jre-linux.exists">
<mkdir dir="dist2"/>
<mkdir dir="dist2/linux"/>
<copy todir="dist2/linux/OmegaT">
<fileset dir="dist" excludes="OmegaT OmegaT-JRE OmegaT.exe OmegaT.bat OmegaT.iss OmegaT-JRE.iss OmegaT.l4J.ini l10n-project"/>
</copy>
<copy file="dist/OmegaT-JRE" tofile="dist2/linux/OmegaT/OmegaT"/>
<copy todir="dist2/linux/OmegaT/jre">
<fileset dir="../jre-linux"/>
</copy>
<tar destfile="dist2/OmegaT_${distversion}_Linux.tar">
<tarfileset dir="dist2/linux" excludes="OmegaT/OmegaT OmegaT/linux-install.sh OmegaT/omegat.kaptn OmegaT/jre/bin/java"/>
<tarfileset dir="dist2/linux" includes="OmegaT/OmegaT OmegaT/linux-install.sh OmegaT/omegat.kaptn OmegaT/jre/bin/java" filemode="755"/>
</tar>
<bzip2 zipfile="dist2/OmegaT_${distversion}${beta}_Linux.tar.bz2" src="dist2/OmegaT_${distversion}_Linux.tar"/>
</target>
<!-- Builds a Linux-64 (tar, bz2) distribution -->
<target name="linux-64" description="Build Linux distro" depends="jar,release, check-jre-linux-64" if="jre-linux-64.exists">
<mkdir dir="dist2"/>
<mkdir dir="dist2/linux-64"/>
<copy todir="dist2/linux-64/OmegaT">
<fileset dir="dist" excludes="OmegaT OmegaT-JRE OmegaT.exe OmegaT.bat OmegaT.iss OmegaT-JRE.iss OmegaT.l4J.ini l10n-project"/>
</copy>
<copy file="dist/OmegaT-JRE" tofile="dist2/linux-64/OmegaT/OmegaT"/>
<copy todir="dist2/linux-64/OmegaT/jre">
<fileset dir="../jre-linux-64"/>
</copy>
<tar destfile="dist2/OmegaT_${distversion}_Linux_64.tar">
<tarfileset dir="dist2/linux-64" excludes="OmegaT/OmegaT OmegaT/linux-install.sh OmegaT/omegat.kaptn OmegaT/jre/bin/java"/>
<tarfileset dir="dist2/linux-64" includes="OmegaT/OmegaT OmegaT/linux-install.sh OmegaT/omegat.kaptn OmegaT/jre/bin/java" filemode="755"/>
</tar>
<bzip2 zipfile="dist2/OmegaT_${distversion}${beta}_Linux_64.tar.bz2" src="dist2/OmegaT_${distversion}_Linux_64.tar"/>
</target>
<!-- Creates a Windows Installer -->
<target name="do-win" depends="init,jar,zip" description="Creates a Windows Installer. PRE: Inno Setup (http://www.jrsoftware.org/isinfo.php) with all optional language packs must be installed and available on the path.
Custom strings from release\win32-specific must be added manually to the language files.">
<copy todir="dist" file="release/win32-specific/OmegaT.exe"/>
<copy todir="dist" file="release/win32-specific/OmegaT.l4J.ini"/>
<delete file="dist/OmegaT.iss"/>
<filter token="VERSION_NUMBER_SUBST" value="${distversion}${beta}"/>
<copy todir="dist" file="release/win32-specific/OmegaT.iss" filtering="on"/>
<mkdir dir="dist2"/>
<exec executable="${iscc.exe}">
<arg file="dist/OmegaT.iss"/>
</exec>
</target>
<!-- Creates a Windows Installer with JRE-->
<target name="do-win-jre" depends="check-jre" if="jre.exists" description="Creates a Windows Installer with JRE. PRE: Inno Setup (http://www.jrsoftware.org/isinfo.php) with all optional language packs must be installed and available on the path, and a JRE must be present in ..\\jre\\
Custom strings from release\win32-specific must be added manually to the language files.">
<copy todir="dist" file="release/win32-specific/OmegaT.exe"/>
<copy todir="dist" file="release/win32-specific/OmegaT.l4J.ini"/>
<delete file="dist/OmegaT-JRE.iss"/>
<filter token="VERSION_NUMBER_SUBST" value="${distversion}${beta}"/>
<copy todir="dist" file="release/win32-specific/OmegaT-JRE.iss" filtering="on"/>
<exec executable="${iscc.exe}">
<arg file="dist/OmegaT-JRE.iss"/>
</exec>
</target>
<!-- Builds a Mac distribution -->
<target name="mac" description="Build Mac distro. PRE: A MacOS JRE must be present in ../jre-mac-root/ and JavaAppLauncher must be in ../ (obtain from AppBundler JAR)" depends="jar,release,check-mac-reqs">
<!-- Build directories -->
<mkdir dir="dist2"/>
<filter token="VERSION_NUMBER_SUBST" value="${distversion}"/>
<copy todir="build/" file="release/mac-specific/OmegaT.app/Contents/Info.plist" filtering="on"/>
<zip destfile="dist2/OmegaT_${distversion}${beta}_Mac.zip">
<zipfileset dir="dist" excludes="OmegaT OmegaT-JRE linux-install.sh omegat.kaptn OmegaT.exe OmegaT.bat OmegaT.iss OmegaT-JRE.iss OmegaT.l4J.ini l10n-project" prefix="OmegaT.app/Contents/Java"/>
<zipfileset dir="release/mac-specific/" excludes="OmegaT.app/Contents/Info.plist"/>
<zipfileset dir="build/" includes="Info.plist" prefix="OmegaT.app/Contents/"/>
<zipfileset dir="../" includes="JavaAppLauncher" filemode="755" prefix="OmegaT.app/Contents/MacOS/"/>
<zipfileset dir="../jre-mac-root/" excludes="bin/" filemode="755" prefix="OmegaT.app/Contents/PlugIns/jre/"/>
</zip>
</target>
<!-- Requires AppBundler to be available to Ant (e.g. in ~/.ant/lib):
https://bitbucket.org/infinitekind/appbundler
AppBundler requires Java 1.7 -->
<target name="gen-mac" description="Generate Mac .app bundle.">
<taskdef name="bundleapp"
classname="com.oracle.appbundler.AppBundlerTask"/>
<bundleapp
outputdirectory="release/mac-specific"
name="OmegaT"
displayname="OmegaT"
identifier="org.omegat.OmegaT"
icon="images/OmegaT.icns"
version="@VERSION_NUMBER_SUBST@"
shortversion="@VERSION_NUMBER_SUBST@"
mainclassname="org.omegat.Main">
<option value="-Xdock:name=OmegaT"/>
<option value="-Xmx1024M"/>
<argument value="--config-file=$APP_ROOT/Contents/Resources/Configuration.properties"/>
<!--<option value="-Xdebug" />
<option value="-Xrunjdwp:transport=dt_socket,address=8998,server=y"/>-->
<bundledocument
extensions="project"
name="OmegaT Project"
role="editor"
icon="images/OmegaT.icns"/>
<bundledocument
extensions="*"
name="All Files"
role="none"/>
<plistentry key="JVMRuntime" value="jre"/>
</bundleapp>
</target>
<target name="check-win" depends="init">
<condition property="os.windows">
<and>
<os family="windows"/>
<available file="${iscc.exe}" filepath="${java.library.path}" />
</and>
</condition>
</target>
<target name="check-jre" depends="check-win" if="os.windows">
<available file="../jre" type="dir" property="jre.exists" />
</target>
<target name="check-jre-linux">
<available file="../jre-linux" type="dir" property="jre-linux.exists" />
</target>
<target name="check-jre-linux-64">
<available file="../jre-linux-64" type="dir" property="jre-linux-64.exists" />
</target>
<target name="check-mac-reqs">
<available file="../JavaAppLauncher" type="file" property="mac-java-stub.exists" />
<fail message="There is no Java for MacOS in the ../JavaAppLauncher" unless="mac-java-stub.exists" />
<available file="../jre-mac-root/Contents/Home/bin/java" type="file" property="mac-java-stub.exists1" />
<fail message="There is no Java for MacOS in the ../jre-mac-root/Contents/Home/bin/java" unless="mac-java-stub.exists1" />
<available file="../jre-mac-root/Contents/Home/lib/rt.jar" type="file" property="mac-java-stub.exists2" />
<fail message="There is no Java for MacOS in the ../jre-mac-root/Contents/Home/lib/rt.jar" unless="mac-java-stub.exists2" />
</target>
<target name="win" description="Build Win32 distro if on Windows. PRE: Inno Setup (http://www.jrsoftware.org/isinfo.php) with all optional language packs must be installed and available on the path, and for the JRE-version a JRE must be present in ..\\jre\\ "
depends="check-win" if="os.windows">
<ant target="do-win" />
<ant target="do-win-jre" />
</target>
<!-- Creates WebStart package -->
<target name="webstart" depends="init,jar">
<ant dir="release/WebStart-specific" antfile="build.xml"/>
</target>
<!-- Builds all OmegaT products -->
<target name="all" depends="l10n-pack,src,jar,zip,win,linux,linux-64, mac" />
<target name="checksums" description="Compute the checksum for files"><!--depends="l10n-pack,src,jar,zip,win,linux,mac"-->
<mkdir dir="dist2/checksums"/>
<!-- Adjust the fileset according to what is needed to be checksumed -->
<fileset dir="dist2" id="checksum_source">
<include name="*.zip"/>
<include name="*.exe"/>
</fileset>
<checksum todir="dist2/checksums" algorithm="SHA-512">
<fileset refid="checksum_source"/>
</checksum>
<checksum todir="dist2/checksums" algorithm="MD5">
<fileset refid="checksum_source"/>
</checksum>
</target>
<target name="gen">
<exec executable="xjc">
<arg line="-d src"/>
<arg line="-p gen.core.segmentation"/>
<arg value="src/schemas/srx20.xsd"/>
</exec>
<exec executable="xjc">
<arg line="-d src"/>
<arg line="-p gen.core.filters"/>
<arg value="src/schemas/filters.xsd"/>
</exec>
<exec executable="xjc">
<arg line="-d src"/>
<arg line="-p gen.core.tbx"/>
<arg value="src/schemas/tbx.xsd"/>
</exec>
<exec executable="xjc">
<arg line="-d src"/>
<arg line="-p gen.core.project"/>
<arg value="src/schemas/project_properties.xsd"/>
</exec>
<exec executable="xjc">
<arg line="-d src"/>
<arg line="-p gen.core.tmx14"/>
<arg line="-b src/schemas/tmx14.xjb"/>
<arg value="src/schemas/tmx14.xsd"/>
</exec>
<exec executable="xjc">
<arg line="-d src"/>
<arg line="-p gen.taas"/>
<arg line="-b src/schemas/taas.xjb"/>
<arg value="src/schemas/taas.xsd"/>
</exec>
</target>
<target name="docindexgen" depends="jar">
<mkdir dir="build/genclasses" />
<javac srcdir="gen/src" destdir="build/genclasses">
<classpath>
<fileset dir="lib" includes="**/*.jar" />
<pathelement path="build/classes" />
</classpath>
</javac>
<copy todir="build/genclasses">
<fileset dir="gen/src" excludes="**/*.java"/>
</copy>
<java classname="util.CreateDocIndexUtil">
<classpath>
<pathelement path="build/genclasses" />
<pathelement path="build/classes" />
</classpath>
</java>
<copy todir="docs">
<fileset dir="release" includes="OmegaT-license.txt doc-license.txt changes.txt" />
</copy>
</target>
</project>