Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

293 lines (255 sloc) 11.877 kb
<project name="Poedit" default="compile">
<description>
Builds Poedit.
</description>
<property file="build.local.properties"/>
<property file="build.properties"/>
<condition property="is_osx">
<os family="mac"/>
</condition>
<condition property="is_windows">
<os family="windows"/>
</condition>
<target name="deps"
description="build Poedit dependencies">
<ant dir="deps"/>
</target>
<target name="compile"
description="compile all dependencies for building on this platform"
depends="compile-win,compile-osx"/>
<target name="distrib"
description="build distribution for this platform"
depends="distrib-win,distrib-osx"/>
<!-- ==============================================================
Windows build
============================================================== -->
<available property="bootstrapped.win" file="win32/poedit.vcproj"/>
<target name="bootstrap-win" if="is_windows" unless="bootstrapped.win">
<echo level="info" message="Bootstrapping git sources..."/>
<mkdir dir="icons/win32"/>
<mkdir dir="icons/win32/vista"/>
<mkdir dir="icons/win32/xp"/>
<exec dir="icons" executable="${imagemagick.convert}" failonerror="true">
<arg value="appicon\48x48\apps\poedit.png"/>
<arg value="-background"/>
<arg value="white"/>
<arg value="-extent"/>
<arg value="55x55-4-4"/>
<arg value="-type"/>
<arg value="palette"/>
<arg value="BMP3:win32\installer_wizard_image.bmp"/>
</exec>
<exec dir="icons" executable="${imagemagick.convert}" failonerror="true">
<arg value="appicon\16x16\apps\poedit.png"/>
<arg value="appicon\32x32\apps\poedit.png"/>
<arg value="appicon\48x48\apps\poedit.png"/>
<arg value="appicon\256x256\apps\poedit.png"/>
<arg value="-compress"/>
<arg value="None"/>
<arg value="win32\appicon.ico"/>
</exec>
<exec dir="icons" executable="${imagemagick.convert}" failonerror="true">
<arg value="mime-win32\xp\generic\*.png"/>
<arg value="-compress"/>
<arg value="None"/>
<arg value="win32\xp\poedit-translation-generic.ico"/>
</exec>
<exec dir="icons" executable="${imagemagick.convert}" failonerror="true">
<arg value="mime-win32\vista\generic\*.png"/>
<arg value="-compress"/>
<arg value="None"/>
<arg value="win32\vista\poedit-translation-generic.ico"/>
</exec>
<!-- generate project files: -->
<exec dir="win32" executable="bakefile_gen" failonerror="true"/>
</target>
<target name="compile-win" if="is_windows" depends="bootstrap-win">
<exec dir="win32" executable="${msvs.vcbuild}" failonerror="true">
<arg value="/platform:Win32"/>
<arg value="poedit.vcproj"/>
<arg value="Release"/>
</exec>
<antcall target="win-codesign">
<param name="codesign.what" value="win32/Release/poedit.exe"/>
</antcall>
</target>
<target name="distrib-win" if="is_windows">
<mkdir dir="distrib"/>
<parallel>
<antcall target="win-debug-info"/>
<antcall target="win-make-installer"/>
</parallel>
</target>
<target name="win-debug-info">
<echo level="info" message="Packaging debug info (PDB) files.."/>
<tar destfile="distrib/poedit-pdb-${poedit.version}.tar.bz2"
compression="bzip2">
<tarfileset file="win32/Release/*.pdb"/>
<tarfileset file="deps/db/build_windows/Win32/Release/*.pdb"/>
</tar>
</target>
<target name="win-make-installer">
<echo level="info" message="Building Windows installer.."/>
<!-- only one of these will run, they're conditions are mutually exclusive: -->
<antcall target="win-make-installer-signed"/>
<antcall target="win-make-installer-unsigned"/>
</target>
<target name="win-make-installer-unsigned" unless="codesign.identity">
<exec dir="win32" executable="deps/inno-setup/iscc.exe" failonerror="true">
<arg value="poedit.iss"/>
<arg value="/dCRT_REDIST=${msvs.redist}"/>
</exec>
</target>
<target name="win-make-installer-signed" if="codesign.identity">
<exec dir="win32" executable="deps/inno-setup/iscc.exe" failonerror="true">
<arg value="poedit.iss"/>
<arg value="/dCRT_REDIST=${msvs.redist}"/>
<arg value="/dSIGNTOOL=default"/>
<arg value="/Sdefault=${codesign.win.signtool} sign /n $$q${codesign.identity}$$q /t ${codesign.timestamp.server} /d Poedit /du http://www.poedit.net $$f"/>
</exec>
<antcall target="win-codesign-verify">
<param name="codesign.what" value="distrib/poedit-${poedit.version}-setup.exe"/>
</antcall>
</target>
<target name="win-codesign" if="codesign.identity">
<echo level="info" message="Signing binary ${codesign.what}..."/>
<exec executable="${codesign.win.signtool}" failonerror="true">
<arg value="sign"/>
<arg value="/n"/>
<arg value="${codesign.identity}"/>
<arg value="/t"/>
<arg value="${codesign.timestamp.server}"/>
<arg value="/d"/>
<arg value="Poedit"/>
<arg value="/du"/>
<arg value="http://www.poedit.net"/>
<arg path="${codesign.what}"/>
</exec>
<antcall target="win-codesign-verify">
<param name="codesign.what" value="win32/Release/poedit.exe"/>
</antcall>
</target>
<target name="win-codesign-verify" if="codesign.identity">
<echo level="info" message="Verifying signature on ${codesign.what}..."/>
<exec executable="${codesign.win.signtool}" failonerror="true">
<arg value="verify"/>
<arg value="/pa"/>
<arg path="${codesign.what}"/>
</exec>
</target>
<!-- ==============================================================
OS X build
============================================================== -->
<available property="bootstrapped.osx" file="configure"/>
<target name="bootstrap-osx" if="is_osx" unless="bootstrapped.osx">
<echo level="info" message="Bootstrapping git sources..."/>
<exec executable="./bootstrap" failonerror="true"/>
</target>
<target name="compile-osx-arch">
<echo level="info" message="Building Poedit for ${poedit.osx.arch}..."/>
<mkdir dir="build-osx/${poedit.osx.arch}"/>
<exec dir="build-osx/${poedit.osx.arch}" executable="/bin/sh" failonerror="true">
<arg value="../../configure"/>
<arg value="CC=${poedit.osx.cc}"/>
<arg value="CXX=${poedit.osx.cxx}"/>
<arg value="CPPFLAGS=-I${deps.dir}/boost -I${deps.dir}/bin-osx/${poedit.osx.arch}/include"/>
<arg value="CFLAGS=-arch ${poedit.osx.arch} ${poedit.osx.cflags}"/>
<arg value="CXXFLAGS=-arch ${poedit.osx.arch} ${poedit.osx.cflags}"/>
<arg value="OBJCFLAGS=-arch ${poedit.osx.arch} ${poedit.osx.cflags}"/>
<arg value="LDFLAGS=-arch ${poedit.osx.arch} ${poedit.osx.ldflags} -L${deps.dir}/bin-osx/${poedit.osx.arch}/lib"/>
<arg value="--with-wx-config=${deps.dir}/bin-osx/${poedit.osx.arch}/bin/wx-config"/>
<arg value="--with-sparkle=${deps.dir}/sparkle/build/Release"/>
<arg value="WXRC=${deps.dir}/bin-osx/${poedit.osx.arch.native}/bin/wxrc"/>
</exec>
<exec dir="build-osx/${poedit.osx.arch}/src" executable="make" failonerror="true">
<arg value="all"/>
</exec>
</target>
<target name="compile-osx" if="is_osx" depends="bootstrap-osx">
<antcall target="compile-osx-arch">
<param name="poedit.osx.arch" value="i386"/>
</antcall>
<antcall target="compile-osx-arch">
<param name="poedit.osx.arch" value="ppc"/>
</antcall>
<antcall target="osx-make-bundle"/>
</target>
<target name="osx-make-bundle">
<echo level="info" message="Creating universal Poedit binary..."/>
<exec dir="build-osx" executable="lipo" failonerror="true">
<arg value="-arch"/>
<arg value="i386"/>
<arg value="i386/src/poedit"/>
<arg value="-arch"/>
<arg value="ppc"/>
<arg value="ppc/src/poedit"/>
<arg value="-create"/>
<arg value="-output"/>
<arg value="poedit.universal"/>
</exec>
<echo level="info" message="Creating Poedit.app bundle..."/>
<exec dir="build-osx" executable="../macosx/make-bundle" failonerror="true">
<env key="GETTEXT_PREFIX" path="${deps.dir}/bin-gettext"/>
<env key="WX_ROOT" path="${deps.dir}/bin-osx/i386"/>
<env key="SPARKLE_FRAMEWORK" path="${deps.dir}/sparkle/build/Release/Sparkle.framework"/>
<arg value="Poedit.app"/>
<arg value="poedit.universal"/>
<arg value="i386"/> <!-- top_builddir (any) -->
<arg value=".."/> <!-- top_srcdir -->
</exec>
<echo level="info" message="Stripping debug info into dSYM..."/>
<delete dir="build-osx/Poedit.app.dSYM"/>
<exec dir="build-osx" executable="dsymutil" failonerror="true">
<arg value="--out=Poedit.app.dSYM"/>
<arg value="--threads=2"/>
<arg value="Poedit.app/Contents/MacOS/Poedit"/>
</exec>
<exec dir="build-osx" executable="strip" failonerror="true">
<arg value="-u"/>
<arg value="-r"/>
<arg value="Poedit.app/Contents/MacOS/Poedit"/>
</exec>
<antcall target="osx-codesign"/>
</target>
<target name="osx-codesign" if="codesign.identity">
<echo level="info" message="Signing Poedit.app binary..."/>
<exec dir="build-osx" executable="codesign" failonerror="true">
<arg line="${codesign.osx.args}"/>
<arg value="-s"/>
<arg value="${codesign.identity}"/>
<arg value="Poedit.app"/>
</exec>
<echo level="info" message="Verifying signature..."/>
<exec dir="build-osx" executable="codesign" failonerror="true">
<arg value="-vv"/>
<arg value="Poedit.app"/>
</exec>
</target>
<target name="distrib-osx" if="is_osx">
<mkdir dir="distrib"/>
<parallel>
<antcall target="osx-make-installer"/>
<antcall target="osx-debug-info"/>
</parallel>
</target>
<target name="osx-make-installer">
<echo level="info" message="Creating DMG package..."/>
<exec executable="macosx/make-dmg" failonerror="true">
<arg value="distrib/poedit-${poedit.version}.dmg"/>
<arg value="build-osx/Poedit.app"/>
<arg value="macosx/dmg"/>
</exec>
</target>
<target name="osx-debug-info">
<echo level="info" message="Packaging debug info (dSYM) files.."/>
<tar destfile="distrib/poedit-dSYM-${poedit.version}.tar">
<tarfileset dir="deps/sparkle/build/Release" includes="*.dSYM/**"/>
<tarfileset dir="build-osx" includes="*.dSYM/**"/>
</tar>
<delete file="distrib/poedit-dSYM-${poedit.version}.tar.lzma"/>
<exec executable="lzma">
<arg value="--best"/>
<arg value="distrib/poedit-dSYM-${poedit.version}.tar"/>
</exec>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.