Files
jpexs-decompiler/build.xml
Jindra Petřík d434362a98 chore: remove echo
2026-04-06 21:06:19 +02:00

1014 lines
46 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<project name="FFDec" basedir="." default="all" xmlns:jacoco="antlib:org.jacoco.ant">
<description>Builds project FFDec</description>
<loadproperties srcfile="build.properties" />
<property name="jar.filename" value="${prefix.filename}"/>
<property name="exe.filename" value="${prefix.filename}"/>
<property name="exe64.filename" value="${prefix.filename}64"/>
<property name="checkstyle_config.path" location="checkstyle.xml"/>
<path id="ant.lib.classpath">
<fileset dir="${ant.lib.dir}" includes="**/*.jar"/>
</path>
<taskdef name="mkbom" classname="com.jpexs.jbomutils.ant.MkBomTask" classpathref="ant.lib.classpath" />
<taskdef name="xar" classname="com.jpexs.xar.ant.XarTask" classpathref="ant.lib.classpath" />
<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpathref="ant.lib.classpath" />
<taskdef name="cpio" classname="org.apache.ant.compress.taskdefs.Cpio" classpathref="ant.lib.classpath" />
<taskdef name="deb" classname="com.googlecode.ant_deb_task.Deb" classpathref="ant.lib.classpath" />
<taskdef name="desktopentry" classname="com.googlecode.ant_deb_task.DesktopEntry" classpathref="ant.lib.classpath" />
<taskdef name="testng" classname="org.testng.TestNGAntTask" classpathref="ant.lib.classpath" />
<taskdef name="nsis" classname="com.danielreese.nsisant.Task" classpathref="ant.lib.classpath" />
<taskdef name="checkstyle" classname="com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask" classpathref="ant.lib.classpath" />
<property name="dist.lib.dir" value="${dist.dir}/${dist.lib.dirname}"/>
<patternset id="compiler.resources">
<include name="**/?*.properties"/>
<include name="**/?*.colorschemes"/>
<include name="**/?*.bin"/>
<include name="**/?*.xml"/>
<include name="**/?*.txt"/>
<include name="**/?*.gif"/>
<include name="**/?*.png"/>
<include name="**/?*.jpeg"/>
<include name="**/?*.jpg"/>
<include name="**/?*.html"/>
<include name="**/?*.dtd"/>
<include name="**/?*.tld"/>
<include name="**/?*.mid"/>
<include name="**/?*.wav"/>
<include name="**/?*.js"/>
<include name="**/?*.swf"/>
<include name="**/?*.css"/>
</patternset>
<target name="-loadversion" depends="-loadversion-prop,-loadversion-private">
</target>
<target name="-loadversion-private" unless="new.version">
<property name="version.major" value="0" />
<property name="version.minor" value="0" />
<property name="version.release" value="0" />
<property name="version.major" value="0" />
<property name="version.build" value="0" />
<!-- <property name="version.revision" value="" /> -->
<property name="version.debug" value="true" />
<property name="version" value="${version.major}.${version.minor}.${version.release}" />
<property name="version.number" value="${version.major}.${version.minor}.${version.release}.${version.build}" />
<property name="private" value="true" />
</target>
<target name="-loadversion-prop" if="new.version">
<loadproperties srcfile="${version_info}" prefix="version"/>
<property name="version" value="${version.major}.${version.minor}.${version.release}" />
<property name="version.number" value="${version.major}.${version.minor}.${version.release}.${version.build}" />
<script language="beanshell" classpathref="ant.lib.classpath">
if("true".equals("" + project.getProperty("version.debug"))) {
project.setProperty("nightly","true");
}
</script>
<echo level="info" message="Loaded Version:${version.major}.${version.minor}.${version.release}.${version.build}"/>
</target>
<target name="checkstyle">
<checkstyle config="${checkstyle_config.path}" failonviolation="true" maxWarnings="0">
<fileset dir="src/com/jpexs" includes="**/*.java">
<exclude name="**/FontPreviewDialog.java" />
<exclude name="**/*Lexer.java" />
<exclude name="**/jna/" />
</fileset>
<fileset dir="libsrc/ffdec_lib/src/com/jpexs" includes="**/*.java">
<exclude name="**/*Lexer.java" />
<exclude name="**/jna/" />
</fileset>
</checkstyle>
</target>
<target name="compile" depends="build_lib,-copy-lib" unless="no_dist">
<!--<delete dir="${compile.dir}"/>-->
<mkdir dir="${compile.dir}"/>
<javac srcdir="${src.dir}" destdir="${compile.dir}" includes="**/*.java" target="${target.java}" source="${target.java}" debug="true"
debuglevel="lines,vars,source" includeantruntime="false" encoding="utf-8">
<compilerarg line="-Xlint:unchecked -Xlint:deprecation"/> <!-- For Java 8: -Xdiags:verbose -->
<classpath>
<fileset dir="${lib.dir}" includes="**/*-fix.jar"/>
<fileset dir="${lib.dir}" includes="**/*.jar" excludes="**/*-fix.jar"/>
</classpath>
</javac>
<copy todir="${compile.dir}">
<fileset dir="${src.dir}">
<patternset refid="compiler.resources"/>
<type type="file"/>
</fileset>
</copy>
</target>
<target name="compile_lib">
<ant antfile="${core.lib.script}" target="compile" inheritAll="false" usenativebasedir="true" />
</target>
<target name="compile-tests">
<delete dir="${compile.test.dir}"/>
<mkdir dir="${compile.test.dir}"/>
<javac srcdir="${test.dir}" destdir="${compile.test.dir}" includes="**/*.java" target="${target.java}" source="${target.java}" debug="true" includeantruntime="false" encoding="utf-8">
<classpath>
<pathelement path="${compile.dir}"/>
<fileset dir="${lib.dir}" includes="**/*-fix.jar"/>
<fileset dir="${lib.dir}" includes="**/*.jar" excludes="**/*-fix.jar"/>
<fileset dir="${test.lib.dir}" includes="**/*.jar"/>
</classpath>
</javac>
</target>
<target name="-test-halt-always">
<property name="test.halt.failure" value="true" />
</target>
<target name="-test-halt-newver" if="new.version">
<property name="test.halt.failure" value="true" />
</target>
<target name="-test-halt-nonewver" unless="new.version">
<property name="test.halt.failure" value="false" />
</target>
<target name="testhalt" depends="-test-halt-always,test">
</target>
<target name="test" depends="-test-halt-newver,-test-halt-nonewver,test_lib,compile,compile-tests">
<delete dir="${test.result.dir}"/>
<mkdir dir="${test.result.dir}"/>
<mkdir dir="${test.result.dir}/raw/"/>
<mkdir dir="${coverage.dir}" />
<jacoco:coverage destfile="${coverage.dir}/jacoco.exec">
<testng
outputDir="${test.result.dir}"
haltOnFailure="${test.halt.failure}" verbose="2" workingDir="${basedir}">
<classpath>
<pathelement path="${compile.test.dir}"/>
<pathelement path="${compile.dir}"/>
<fileset dir="${lib.dir}" includes="**/*-fix.jar"/>
<fileset dir="${lib.dir}" includes="**/*.jar" excludes="**/*-fix.jar"/>
<fileset dir="${test.lib.dir}" includes="**/*.jar"/>
</classpath>
<jvmarg value="-noverify" />
<classfileset dir="${compile.test.dir}" includes="**/*.class" />
</testng>
</jacoco:coverage>
<!-- Coverage report -->
<mkdir dir="${coverage.result.dir}"/>
<jacoco:report>
<executiondata>
<file file="${coverage.dir}/jacoco.exec" />
</executiondata>
<structure name="${project.name}">
<classfiles>
<fileset dir="${compile.dir}" />
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="${src.dir}" />
</sourcefiles>
</structure>
<html destdir="${coverage.result.dir}" />
</jacoco:report>
</target>
<condition property="is_windows">
<os family="windows"/>
</condition>
<target name="library" depends="-loadversion,release_lib,-copy-lib">
<mkdir dir="${releases.dir}"/>
<copy file="${lib.file}" todir="${releases.dir}" />
</target>
<target name="archive" depends="-loadversion,archive-dist,archive-no-dist">
</target>
<target name="archive-dist" depends="-loadversion,dist,archive-no-dist" unless="no_dist">
</target>
<target name="archive-no-dist" depends="-loadversion">
<mkdir dir="${releases.dir}"/>
<property name="zip.file" value="${releases.dir}/${prefix.filename}_${version}${version.suffix}.zip" />
<zip destfile="${zip.file}" basedir="${dist.dir}" excludes="${app.script}">
<zipfileset dir="${dist.dir}" includes="${app.script}" fullpath="${app.script}" filemode="755"/>
</zip>
</target>
<target name="deb" depends="deb-dist,deb-no-dist">
</target>
<target name="deb-dist" depends="-loadversion,dist" unless="no_dist">
</target>
<target name="deb-no-dist" depends="-loadversion,dist">
<mkdir dir="${releases.dir}"/>
<tempfile property="app.deb.desktop.temp" deleteonexit="true" prefix="desktop"/>
<desktopentry
toFile="${app.deb.desktop.temp}"
name="${product.name}"
comment="${app.description.short}"
exec="/usr/bin/${app.package}"
icon="/usr/share/java/${app.package}/icon.png"
categories="Development;Network;Utility;WebDevelopment;Java"
/>
<deb
package="${app.package}"
todir="${releases.dir}"
debFilenameProperty="deb.file.orig"
section="editors"
depends="${app.package.depends}">
<version upstream="${version}" />
<maintainer name="${vendor}" email="${app.vendor.mail}"/>
<description synopsis="${app.description.short}">${app.description}</description>
<tarfileset dir="${dist.dir}" prefix="usr/share/java/${app.package}">
<include name="**"/>
</tarfileset>
<tarfileset file="${dist.dir}/${app.script}" fullpath="usr/bin/${app.package}" filemode="755" />
<tarfileset file="${app.deb.desktop.temp}" fullpath="usr/share/applications/${app.deb.desktop.file}.desktop"/>
</deb>
<property name="deb.file" value="${releases.dir}/${prefix.filename}_${version}${version.suffix}.deb" />
<move file="${deb.file.orig}" tofile="${deb.file}" />
<delete file="${app.deb.desktop.temp}" />
</target>
<target name="osx-app-installer" depends="osx-app-bundle" unless="is_windows">
<mkdir dir="${app.installer.dir}/flat/base.pkg"/>
<mkdir dir="${app.installer.dir}/flat/Resources/en.lproj"/>
<mkdir dir="${app.installer.dir}/root/Applications"/>
<copy todir="${app.installer.dir}/root/Applications/">
<fileset dir="${app.bundle.dir}">
<include name="${app.osx.dir}.app/**" />
</fileset>
</copy>
<tempfile deleteonexit="true" property="app.cpio.temp" prefix="cpio"/>
<cpio destfile="${app.cpio.temp}" format="odc">
<tarfileset dir="${app.installer.dir}/root" uid="0" gid="80" includes="Applications/${app.osx.dir}.app/Contents/MacOS/${app.osx.dir}" filemode="777" />
<tarfileset dir="${app.installer.dir}/root" uid="0" gid="80">
<exclude name="Applications/${app.osx.dir}.app/Contents/Resources/${app.script}" />
<exclude name="Applications/${app.osx.dir}.app/Contents/MacOS/${app.osx.dir}" />
</tarfileset>
<tarfileset dir="${app.installer.dir}/root" uid="0" gid="80" includes="Applications/${app.osx.dir}.app/Contents/Resources/${app.script}" filemode="777" />
</cpio>
<gzip src="${app.cpio.temp}" destfile="${app.installer.dir}/flat/base.pkg/Payload" />
<delete file="${app.cpio.temp}" />
<resourcecount property="app.installer.files.number">
<fileset dir="${app.installer.dir}/root" />
</resourcecount>
<length property="app.installer.files.size.bytes">
<fileset dir="${app.installer.dir}/root" />
</length>
<script language="beanshell" classpathref="ant.lib.classpath">
<![CDATA[
long length_bytes = Long.parseLong(project.getProperty("app.installer.files.size.bytes"));
long length_kbytes = Math.round((length_bytes / 1024) * Math.pow(10,2))
/ Math.pow(10,2);
project.setNewProperty("app.installer.files.size.kilobytes", "" + length_kbytes);
]]>
</script>
<echo file="${app.installer.dir}/flat/base.pkg/PackageInfo"><![CDATA[<pkg-info format-version="2" identifier="${mac.bundle}.base.pkg" version="${version}${version.suffix}" install-location="/" auth="root">
<payload installKBytes="${app.installer.files.size.kilobytes}" numberOfFiles="${app.installer.files.number}"/>
<bundle-version>
<bundle id="${mac.bundle}" CFBundleIdentifier="${mac.bundle}" path="./Applications/${app.osx.dir}.app" CFBundleVersion="${version}${version.suffix}"/>
</bundle-version>
</pkg-info>]]></echo>
<mkbom destfile="${basedir}/${app.installer.dir}/flat/base.pkg/Bom">
<tarfileset dir="${app.installer.dir}/root" uid="0" gid="80" includes="Applications/${app.osx.dir}.app/Contents/MacOS/${app.osx.dir}" filemode="755" />
<tarfileset dir="${app.installer.dir}/root" uid="0" gid="80">
<exclude name="Applications/${app.osx.dir}.app/Contents/Resources/${app.script}" />
<exclude name="Applications/${app.osx.dir}.app/Contents/MacOS/${app.osx.dir}" />
</tarfileset>
<tarfileset dir="${app.installer.dir}/root" uid="0" gid="80" includes="Applications/${app.osx.dir}.app/Contents/Resources/${app.script}" filemode="755" />
</mkbom>
<echo file="${app.installer.dir}/flat/Distribution"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<installer-script minSpecVersion="1.000000" authoringTool="com.apple.PackageMaker" authoringToolVersion="3.0.3" authoringToolBuild="174">
<title>${product.name} ${version}${version.suffix}</title>
<options customize="never" allow-external-scripts="no"/>
<domains enable_anywhere="true"/>
<installation-check script="pm_install_check();"/>
<script>function pm_install_check() {
if(!(system.compareVersions(system.version.ProductVersion,'10.5') >= 0)) {
my.result.title = 'Failure';
my.result.message = 'You need at least Mac OS X 10.5 to install ${product.name}';
my.result.type = 'Fatal';
return false;
}
return true;
}
</script>
<choices-outline>
<line choice="choice1"/>
</choices-outline>
<choice id="choice1" title="base">
<pkg-ref id="${mac.bundle}.base.pkg"/>
</choice>
<pkg-ref id="${mac.bundle}.base.pkg" installKBytes="${app.installer.files.size.kilobytes}" version="${version}${version.suffix}" auth="Root">#base.pkg</pkg-ref>
</installer-script>]]></echo>
<property name="pkg.file" value="${releases.dir}/${prefix.filename}_${version}${version.suffix}.pkg"/>
<xar destfile="${basedir}/${pkg.file}" compression="none">
<tarfileset dir="${app.installer.dir}/flat" group="staff" gid="20" username="builder" uid="501" />
</xar>
</target>
<target name="deb-versioned" depends="new-version-set,deb">
</target>
<target name="osx-app-bundle" depends="osx-app-bundle-dist,osx-app-bundle-no-dist">
</target>
<target name="osx-app-bundle-dist" depends="-loadversion,dist,osx-app-bundle-no-dist" unless="no_dist">
</target>
<target name="osx-app-bundle-no-dist" depends="-loadversion">
<property name="app.script.temp" value="${app.bundle.dir}/${app.osx.dir}.app/Contents/MacOS/${app.osx.dir}"/>
<echo file="${app.script.temp}">#!/usr/bin/env bash&#10;$(dirname "$${BASH_SOURCE[0]}")/../Resources/${app.script} "$$&#64;"</echo>
<property name="app.info.temp" value="${app.bundle.dir}/${app.osx.dir}.app/Contents/Info.plist"/>
<echo file="${app.info.temp}"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDisplayName</key>
<string>${product.name}</string>
<key>CFBundleExecutable</key>
<string>FFDec</string>
<key>CFBundleIconFile</key>
<string>Icon.icns</string>
<key>CFBundleIdentifier</key>
<string>${mac.bundle}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>FFDec</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${version}${version.suffix}</string>
<key>CFBundleVersion</key>
<string>${version}${version.suffix}</string>
<key>LSApplicationCategoryType</key>
<string>${mac.category.type}</string>
</dict>
</plist>]]></echo>
<copy todir="${app.bundle.dir}/${app.osx.dir}.app/Contents/Resources/">
<fileset dir="${dist.dir}" />
</copy>
<fixcrlf srcdir="${app.bundle.dir}/${app.osx.dir}.app/Contents/Resources/" eol="lf" includes="**/*.txt" preservelastmodified="true" />
<fixcrlf srcdir="${app.bundle.dir}/${app.osx.dir}.app/Contents/Resources/" eol="lf" includes="**/*.md" preservelastmodified="true" />
</target>
<target name="osx-app-archive" depends="osx-app-bundle">
<mkdir dir="${releases.dir}"/>
<property name="osx.zip.file" value="${releases.dir}/${prefix.filename}_${version}${version.suffix}_macosx.zip" />
<zip destfile="${osx.zip.file}">
<zipfileset dir="${app.bundle.dir}" includes="${app.osx.dir}.app/Contents/MacOS/${app.osx.dir}" filemode="777" />
<zipfileset dir="${app.bundle.dir}">
<exclude name="${app.osx.dir}.app/Contents/Resources/${app.script}" />
<exclude name="${app.osx.dir}.app/Contents/MacOS/${app.osx.dir}" />
</zipfileset>
<zipfileset dir="${app.bundle.dir}" includes="${app.osx.dir}.app/Contents/Resources/${app.script}" filemode="777" />
</zip>
</target>
<target name="exe">
<!-- depends="-exe-splashscreen,-exe-versioninfo">-->
</target>
<target name="release" depends="library,exe,archive,deb,osx-app-archive,osx-app-installer">
</target>
<target name="-set-no-dist">
<property name="no_dist" value="1"/>
</target>
<target name="release-no-dist" depends="-set-no-dist,-timestamp,-suffix,library,exe,archive,deb,osx-app-archive,osx-app-installer">
</target>
<target name="all" depends="checkstyle,clean,build,test,release">
</target>
<target name="res">
<copy todir="${dist.dir}">
<fileset dir="${resources.dir}" includes="**/*.*"/>
<fileset dir="${resources.dir}" includes="ffdec"/>
</copy>
<copy todir="${dist.dir}" file="${changelog.file}"/>
<fixcrlf srcdir="${dist.dir}" includes="**/*.md" eol="crlf" preservelastmodified="true" />
<fixcrlf srcdir="${dist.dir}" includes="**/*.txt" eol="crlf" preservelastmodified="true" />
<fixcrlf srcdir="${dist.dir}" includes="**/*.sh" eol="lf" preservelastmodified="true" />
<fixcrlf srcdir="${dist.dir}" includes="**/*.bat" eol="crlf" preservelastmodified="true" />
</target>
<target name="dist" unless="no_dist">
<!-- depends="build,exe" -->
</target>
<target name="-nightly-suffix" if="nightly">
<property name="version.suffix" value="_nightly${version.build}"/>
</target>
<target name="-no-suffix" unless="version.suffix">
<property name="version.suffix" value=""/>
</target>
<target name="-private-suffix" if="private">
<property name="version.suffix" value="_private_${git.short.tag}"/>
</target>
<target name="-suffix" depends="-nightly-suffix,-private-suffix,-no-suffix">
</target>
<target name="-timestamp" depends="-loadversion,git-tag">
<tstamp>
<format property="BUILTAT" pattern="MM/dd/yyyy hh:mm aa" timezone="CET" locale="en"/>
<format property="VERDATE" pattern="yyyyMMdd_hhmm" timezone="CET" locale="en"/>
</tstamp>
<echo level="info" message="Version: ${version}"/>
</target>
<target name="release_lib" depends="git-tag,-loadversion,-save-version-info,-suffix,release_lib-dist,release_lib-no-dist">
</target>
<target name="release_lib-dist" depends="git-tag,-loadversion,-save-version-info,-suffix" unless="no_dist">
<copy file="${version_info}" tofile="${core.lib.version_info}" />
<ant antfile="${core.lib.script}" target="release" inheritAll="false" usenativebasedir="true"/>
<property name="lib.file" value="${lib.releases.dir}/${lib.prefix.filename}_${version}${version.suffix}.zip" />
</target>
<target name="release_lib-no-dist" depends="git-tag,-loadversion,-save-version-info,-suffix" if="no_dist">
<copy file="${version_info}" tofile="${core.lib.version_info}" />
<ant antfile="${core.lib.script}" target="release-no-dist" inheritAll="false" usenativebasedir="true"/>
<property name="lib.file" value="${lib.releases.dir}/${lib.prefix.filename}_${version}${version.suffix}.zip" />
</target>
<target name="release_lib_javadoc" depends="new-version-set,git-tag,-loadversion,-save-version-info,-suffix">
<ant antfile="${core.lib.script}" target="release_javadoc" inheritAll="false" usenativebasedir="true"/>
<property name="lib.javadoc.file" value="${lib.releases.dir}/${lib.prefix.filename}_${javadoc.release.filename}_${version}${version.suffix}.zip" />
<copy file="${lib.javadoc.file}" todir="${releases.dir}" />
</target>
<target name="build_lib" depends="-loadversion,-save-version-info" unless="no_dist">
<copy file="${version_info}" tofile="${core.lib.version_info}" />
<ant antfile="${core.lib.script}" target="build" inheritAll="false" usenativebasedir="true"/>
</target>
<target name="-copy-lib" unless="no_dist">
<copy file="${core.lib.path}" todir="${lib.dir}" />
</target>
<target name="clean_lib">
<ant antfile="${core.lib.script}" target="clean" inheritAll="false" usenativebasedir="true" />
<delete file="${lib.dir}/${core.lib.name}" />
</target>
<target name="-test_lib-newver" if="new.version">
<ant antfile="${core.lib.script}" target="testhalt" inheritAll="false" usenativebasedir="true" />
</target>
<target name="-test_lib-nonewver" unless="new.version">
<ant antfile="${core.lib.script}" target="test" inheritAll="false" usenativebasedir="true" />
</target>
<target name="test_lib" depends="-test_lib-newver,-test_lib-nonewver">
</target>
<target name="-git-check-exists" >
<property environment="env" />
<available file="git" filepath="${env.PATH}" property="git.present" />
<available file="git.exe" filepath="${env.Path}" property="git.present"/>
<available file="git.exe" filepath="${env.PATH}" property="git.present" />
</target>
<target name="-git-required" depends="-git-check-exists" unless="private">
<!-- <fail unless="git.present" message="Git not found. Please install git with commandline support."/> -->
</target>
<target name="-do-git-tag" if="git.present">
<exec executable="git" outputproperty="git.tag" failonerror="true">
<arg value="rev-parse"/>
<arg value="HEAD"/>
</exec>
<exec executable="git" outputproperty="git.short.tag" failonerror="true">
<arg value="rev-parse"/>
<arg value="--short"/>
<arg value="HEAD"/>
</exec>
<echo level="info" message="Git tag:${git.tag}"/>
<echo level="info" message="Git shorttag:${git.short.tag}"/>
</target>
<target name="-no-git-tag" if="private" unless="git.present">
<property name="git.tag" value="unknown" />
<property name="git.short.tag" value="unk" />
<echo level="warning" message="Warning: Git executable not found. No revision hash will be included in release." />
</target>
<target name="git-tag" depends="-git-required,-no-git-tag,-do-git-tag">
</target>
<target name="build" depends="-loadversion,build_lib,-copy-lib,-timestamp,-suffix,compile,res">
<mkdir dir="${dist.dir}"/>
<!-- <delete dir="${dist.lib.dir}"/> -->
<mkdir dir="${dist.lib.dir}"/>
<copy todir="${dist.lib.dir}">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
<fileset dir="${lib.dir}" includes="**/*.exe"/>
<fileset dir="${lib.dir}" includes="**/*.txt"/>
</copy>
<propertyfile file="${compile.dir}/${properties.name}"
comment="This file is automatically generated - DO NOT EDIT">
<entry key="buildtime" value="${BUILTAT}"/>
<entry key="build" value="${git.tag}"/>
<entry key="builder" value="${builder}"/>
<entry key="version" value="${version}"/>
<entry key="nightly" value="${nightly}"/>
<entry key="version.major" value="${version.major}"/>
<entry key="version.minor" value="${version.minor}"/>
<entry key="version.release" value="${version.release}"/>
<entry key="version.build" value="${version.build}"/>
<entry key="version.debug" value="${version.debug}"/>
</propertyfile>
<pathconvert pathsep=" " property="manifestClassPath">
<fileset dir="${dist.dir}" includes="${dist.lib.dirname}/**/*-fix.jar"/>
<fileset dir="${dist.dir}" includes="${dist.lib.dirname}/**/*.jar" excludes="${dist.lib.dirname}/**/*-fix.jar"/>
<chainedmapper>
<flattenmapper/>
<globmapper from="*" to="${dist.lib.dirname}/*"/>
</chainedmapper>
</pathconvert>
<jar destfile="${dist.dir}/${jar.filename}.jar" basedir="${compile.dir}">
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
<attribute name="Class-Path" value="${manifestClassPath}"/>
<attribute name="Enable-Native-Access" value="ALL-UNNAMED" />
</manifest>
</jar>
<antcall target="build_cli"></antcall>
</target>
<target name="run-for-screenshots" depends="new-version-set,run">
</target>
<target name="run" depends="build">
<java jar="${dist.dir}/${jar.filename}.jar" fork="true">
<env key="VLC_VERBOSE" value="-1" />
<jvmarg value="-Xmx${max.heap.size.run}m" />
<!-- <jvmarg value="-Xss${max.stack.size}m"/> -->
<jvmarg value="-Djava.net.preferIPv4Stack=true" />
<jvmarg value="-Djava.util.Arrays.useLegacyMergeSort=true" />
<arg line="${run.params}" />
</java>
</target>
<target name="-exe-splashscreen-generate" depends="build">
<java classname="com.jpexs.build.SplashScreenGenerator" fork="true" failonerror="true">
<classpath>
<pathelement location="${compile.dir}"/>
<pathelement location="${lib.dir}/ffdec_lib.jar"/>
</classpath>
</java>
</target>
<target name="-exe-splashscreen-inject-unix" depends="-exe-splashscreen-generate" unless="is_windows">
<copy todir="${reshack.path}" overwrite="true">
<file file="build/splash.bmp"/>
<file file="${dist.dir}/ffdec.exe"/>
</copy>
<exec executable="xvfb-run" failonerror="false">
<arg value="wine" />
<arg value="${reshack.path}ResourceHacker.exe"/>
<arg value="-open"/><arg value="${reshack.path}ffdec.exe"/>
<arg value="-save"/><arg value="${reshack.path}ffdec.exe"/>
<arg value="-action"/><arg value="addoverwrite"/>
<arg value="-res"/><arg value="${reshack.path}splash.bmp"/>
<arg value="-mask"/><arg value="BITMAP,1"/>
</exec>
<!--<exec executable="ls" failonerror="false">
<arg value="-la"/>
<arg value="${reshack.path}"/>
</exec>-->
<copy todir="${dist.dir}" file="${reshack.path}ffdec.exe" overwrite="true"/>
</target>
<target name="-exe-splashscreen-inject-windows" depends="-exe-splashscreen-generate" if="is_windows">
<exec executable="${reshack.path}ResourceHacker.exe" failonerror="true">
<arg value="-open"/><arg value="${dist.dir}/ffdec.exe"/>
<arg value="-save"/><arg value="${dist.dir}/ffdec.exe"/>
<arg value="-action"/><arg value="addoverwrite"/>
<arg value="-res"/><arg value="build/splash.bmp"/>
<arg value="-mask"/><arg value="BITMAP,1"/>
</exec>
</target>
<target name="-exe-splashscreen" depends="-exe-splashscreen-inject-unix, -exe-splashscreen-inject-windows">
</target>
<target name="-exe-versioninfo-generate" depends="-loadversion,git-tag,-suffix">
<copy file="versioninfo.rc" tofile="build/versioninfo.rc" overwrite="true">
<filterset>
<filter token="MAJOR" value="${version.major}"/>
<filter token="MINOR" value="${version.minor}"/>
<filter token="RELEASE" value="${version.release}"/>
<filter token="BUILD" value="${version.build}"/>
<filter token="VERSION" value="${version}${version.suffix}"/>
</filterset>
</copy>
</target>
<target name="-exe-versioninfo-inject-unix" depends="-exe-versioninfo-generate" unless="is_windows">
<copy todir="${reshack.path}" overwrite="true">
<file file="build/versioninfo.rc"/>
<file file="${dist.dir}/ffdec.exe"/>
</copy>
<exec executable="xvfb-run" failonerror="false">
<arg value="wine" />
<arg value="${reshack.path}ResourceHacker.exe"/>
<arg value="-open"/><arg value="${reshack.path}versioninfo.rc"/>
<arg value="-save"/><arg value="${reshack.path}versioninfo.res"/>
<arg value="-action"/><arg value="compile"/>
</exec>
<exec executable="xvfb-run" failonerror="false">
<arg value="wine" />
<arg value="${reshack.path}ResourceHacker.exe"/>
<arg value="-open"/><arg value="${reshack.path}ffdec.exe"/>
<arg value="-save"/><arg value="${reshack.path}ffdec.exe"/>
<arg value="-action"/><arg value="addoverwrite"/>
<arg value="-res"/><arg value="${reshack.path}versioninfo.res"/>
<arg value="-mask"/><arg value="Version Info,1"/>
</exec>
<copy todir="${dist.dir}" file="${reshack.path}ffdec.exe" overwrite="true"/>
</target>
<target name="-exe-versioninfo-inject-windows" depends="-exe-versioninfo-generate" if="is_windows">
<exec executable="${reshack.path}ResourceHacker.exe" failonerror="true">
<arg value="-open"/><arg value="build/versioninfo.rc"/>
<arg value="-save"/><arg value="build/versioninfo.res"/>
<arg value="-action"/><arg value="compile"/>
</exec>
<exec executable="${reshack.path}ResourceHacker.exe" failonerror="true">
<arg value="-open"/><arg value="${dist.dir}/ffdec.exe"/>
<arg value="-save"/><arg value="${dist.dir}/ffdec.exe"/>
<arg value="-action"/><arg value="addoverwrite"/>
<arg value="-res"/><arg value="build/versioninfo.res"/>
<arg value="-mask"/><arg value="Version Info,1"/>
</exec>
</target>
<target name="-exe-versioninfo" depends="-exe-versioninfo-inject-unix, -exe-versioninfo-inject-windows">
</target>
<target name="javadoc">
<mkdir dir="${javadoc.dir}"/>
<javadoc sourcepath="${src.dir}" destdir="${javadoc.dir}" windowtitle="${project.name}"
useexternalfile="yes">
<fileset dir="${src.dir}" includes="**/*.java"/>
<classpath>
<fileset dir="${lib.dir}" includes="**/*-fix.jar"/>
<fileset dir="${lib.dir}" includes="**/*.jar" excludes="**/*-fix.jar"/>
</classpath>
</javadoc>
<ant antfile="${core.lib.script}" target="javadoc" inheritAll="false" usenativebasedir="true"/>
</target>
<target name="clean" depends="clean_lib">
<delete dir="${compile.dir}"/>
<delete dir="${compile.test.dir}"/>
<delete dir="${coverage.dir}"/>
<delete dir="${coverage.result.dir}"/>
<delete dir="${test.result.dir}"/>
<delete dir="${locales.target.dir}"/>
<delete dir="${javadoc.dir}"/>
<delete dir="${dist.dir}"/>
<delete dir="${app.installer.dir}"/>
<delete dir="${app.bundle.dir}"/>
</target>
<!-- Debug one test method (Netbeans IDE) -->
<target name="debug-test-method" depends="compile-tests">
<fail unless="test.class">Must select one file in the IDE or set test.class</fail>
<fail unless="test.method">Must select some method in the IDE or set test.method</fail>
<delete dir="${test.result.dir}"/>
<mkdir dir="${test.result.dir}"/>
<mkdir dir="${test.result.dir}/raw/"/>
<nbjpdastart addressproperty="jpda.address" name="ffdec" transport="dt_socket">
<classpath>
<pathelement path="${compile.dir}"/>
<fileset dir="${lib.dir}" includes="**/*-fix.jar"/>
<fileset dir="${lib.dir}" includes="**/*.jar" excludes="**/*-fix.jar"/>
<fileset dir="${test.lib.dir}" includes="**/*.jar"/>
</classpath>
</nbjpdastart>
<testng
outputDir="${test.result.dir}"
haltOnFailure="false" verbose="2" workingDir="${basedir}" methods="${test.class}.${test.method}">
<classpath>
<pathelement path="${compile.test.dir}"/>
<pathelement path="${compile.dir}"/>
<fileset dir="${lib.dir}" includes="**/*-fix.jar"/>
<fileset dir="${lib.dir}" includes="**/*.jar" excludes="**/*-fix.jar"/>
<fileset dir="${test.lib.dir}" includes="**/*.jar"/>
</classpath>
<jvmarg value="-noverify" />
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
<classfileset dir="${compile.test.dir}" includes="**/*.class" />
</testng>
</target>
<target name="git-pull" depends="-git-required">
<exec executable="git" failonerror="true">
<arg value="pull"/>
</exec>
</target>
<target name="git-push">
<!-- NOTHING -->
</target>
<target name="-loadoldversion">
<loadproperties srcfile="${version_info}" prefix="oldversion" />
</target>
<target name="-save-version-info-file">
<propertyfile file="${version_info}"
comment="DO NOT MODIFY - it is updated automatically with the build script">
<entry key="major" value="${version.major}"/>
<entry key="minor" value="${version.minor}"/>
<entry key="release" value="${version.release}"/>
<entry key="build" value="${version.build}"/>
<entry key="debug" value="${version.debug}"/>
</propertyfile>
</target>
<target name="-save-version-info" depends="-save-version-info-file">
</target>
<target name="new-version-set">
<property name="new.version" value="1" />
</target>
<target name="new-version" depends="new-version-set,all">
</target>
<target name="new-version-library" depends="new-version-set,library">
</target>
<target name="new-version-archive" depends="new-version-set,archive">
</target>
<target name="new-version-deb" depends="new-version-set,deb">
</target>
<target name="new-version-osx-app-archive" depends="new-version-set,osx-app-archive">
</target>
<target name="new-version-osx-app-installer" depends="new-version-set,osx-app-installer">
</target>
<target name="new-version-locales" depends="new-version-set">
</target>
<target name="windows-home" >
</target>
<property environment="env" />
<condition property="windows_appdata_isset">
<and>
<os family="windows"/>
<isset property="env.APPDATA" />
</and>
</condition>
<condition property="windows_home_isset">
<and>
<isset property="user.home" />
<os family="windows"/>
</and>
</condition>
<condition property="osx_home_isset">
<and>
<isset property="user.home" />
<os family="mac"/>
</and>
</condition>
<condition property="os_specific_home_isset">
<or>
<isset property="osx_home_isset" />
<isset property="windows_appdata_isset" />
<isset property="windows_home_isset" />
</or>
</condition>
<target name="-get-env">
<property environment="env"/>
</target>
<target name="-get-home-from-user-windows-appdata" if="windows_appdata_isset">
<property name="app.homedir" value="${env.APPDATA}\${vendor}\${project.name}" />
<echo message="Detected homedir in Windows APPDATA: ${app.homedir}" level="info"/>
</target>
<target name="-get-home-from-user-windows-home" if="windows_home_isset" unless="windows_appdata_isset">
<property name="app.homedir" value="${user.home}\Application Data\${vendor}\${project.name}" />
<echo message="Detected homedir in Windows home Application Data: ${app.homedir}" level="info"/>
</target>
<target name="-get-home-from-user-osx-home" if="osx_home_isset">
<property name="app.homedir" value="${user.home}/Library/Application Support/${project.name}" />
<echo message="Detected homedir in OSX: ${app.homedir}" level="info"/>
</target>
<target name="-get-home-from-user" if="user.home" unless="os_specific_home_isset">
<property name="app.homedir" value="${user.home}/.${project.name}" />
<echo message="Detected homedir in user home: ${app.homedir}" level="info"/>
</target>
<target name="-get-home-no" unless="user.home">
<property name="app.homedir" value="." />
<echo message="Detected homedir in current dir: ${app.homedir}" level="info"/>
</target>
<target name="-get-home" depends="-get-home-from-user-windows-appdata,-get-home-from-user-windows-home,-get-home-from-user-osx-home,-get-home-from-user,-get-home-no">
</target>
<target name="fix-src-endoflines">
<fixcrlf srcdir="${src.dir}" includes="**/*.java" />
<fixcrlf srcdir="${src.dir}" includes="**/*.properties" />
<fixcrlf srcdir="${src.dir}" includes="**/*.txt" />
<fixcrlf srcdir="${src.dir}" includes="**/*.md" />
<fixcrlf srcdir="${src.dir}" includes="**/*.xml" />
<fixcrlf srcdir="${src.dir}" includes="**/*.flex" />
<fixcrlf srcdir="${src.dir}" includes="**/*.bat" eol="crlf" />
<fixcrlf srcdir="${src.dir}" includes="**/*.sh" eol="lf" />
<ant antfile="${core.lib.script}" target="fix-src-endoflines" inheritAll="false" usenativebasedir="true" />
</target>
<target name="update-changelog-md" depends="compile">
<java classname="com.jpexs.build.ChangelogUpdater" failonerror="true" fork="true">
<classpath>
<fileset dir="${basedir}" includes="lib/**/*-fix.jar"/>
<fileset dir="${basedir}" includes="lib/**/*.jar" excludes="lib/**/*-fix.jar"/>
<pathelement location="build/classes"/>
</classpath>
</java>
</target>
<target name="update-metainfo" depends="compile" >
<java classname="com.jpexs.build.MetainfoUpdater" failonerror="true" fork="true">
<classpath>
<fileset dir="${basedir}" includes="lib/**/*-fix.jar"/>
<fileset dir="${basedir}" includes="lib/**/*.jar" excludes="lib/**/*-fix.jar"/>
<pathelement location="build/classes"/>
</classpath>
</java>
</target>
<target name="-github-newversion-input">
<input message="Enter new version number (for example 19.2.3) :" addproperty="gh.newversion" />
<fail unless="gh.newversion">Version number must be nonempty</fail>
<tstamp>
<format property="gh.newversion.time" pattern="yyyy-MM-dd" />
</tstamp>
</target>
<target name="rename-unreleased-section" depends="-github-newversion-input">
<replace file="${basedir}/${changelog.file}" token="## [Unreleased]" value="## [${gh.newversion}] - ${gh.newversion.time}"/>
</target>
<target name="-add-unreleased-section" depends="-github-newversion-input">
<replace file="${basedir}/${changelog.file}" token="## [${gh.newversion}] - ${gh.newversion.time}" value="## [Unreleased]${line.separator}${line.separator}## [${gh.newversion}] - ${gh.newversion.time}"/>
</target>
<target name="-git-checkout-master" depends="-git-required">
<exec executable="git" failonerror="true">
<arg value="checkout"/>
<arg value="master"/>
</exec>
<exec executable="git" failonerror="true">
<arg value="pull"/>
<arg value="origin"/>
<arg value="master"/>
</exec>
</target>
<target name="build_cli">
<ant antfile="${cli.script}" target="build" inheritAll="false" usenativebasedir="true"/>
</target>
<target name="update-dockefile" depends="-github-newversion-input">
<replaceregexp file="Dockerfile" match="version[^/]+/ffdec_[^/]+.zip" replace="version${gh.newversion}/ffdec_${gh.newversion}.zip"/>
</target>
<target name="github-newversion" depends="-git-required,-git-checkout-master,-github-newversion-input,rename-unreleased-section,update-changelog-md,update-metainfo,update-dockefile">
<exec executable="git" failonerror="true">
<arg value="add"/>
<arg value="${changelog.file}"/>
<arg value="${metainfo.file}"/>
<arg value="Dockerfile"/>
</exec>
<exec executable="git" failonerror="true">
<arg value="commit"/>
<arg value="-m"/>
<arg value="chore: change version to ${gh.newversion}"/>
</exec>
<exec executable="git" failonerror="true">
<arg value="tag"/>
<arg value="version${gh.newversion}"/>
</exec>
<exec executable="git" failonerror="true">
<arg value="push"/>
<arg value="origin"/>
<arg value="master"/>
<arg value="version${gh.newversion}"/>
</exec>
<antcall target="-add-unreleased-section" />
<antcall target="update-changelog-md" />
<exec executable="git" failonerror="false">
<arg value="branch"/>
<arg value="-D"/>
<arg value="dev"/>
</exec>
<exec executable="git" failonerror="true">
<arg value="checkout"/>
<arg value="-b"/>
<arg value="dev"/>
</exec>
<exec executable="git" failonerror="true">
<arg value="add"/>
<arg value="${changelog.file}"/>
</exec>
<exec executable="git" failonerror="true">
<arg value="commit"/>
<arg value="-m"/>
<arg value="chore: create Unreleased section in CHANGELOG.md&#10;&#10;[ci skip]"/>
</exec>
<exec executable="git" failonerror="true">
<arg value="push"/>
<arg value="--set-upstream"/>
<arg value="origin"/>
<arg value="dev"/>
<arg value="--force"/>
</exec>
</target>
</project>