PageRenderTime 127ms CodeModel.GetById 40ms app.highlight 42ms RepoModel.GetById 21ms app.codeStats 0ms

/jEdit/tags/jedit-4-3-pre5/build.xml

#
XML | 1118 lines | 1081 code | 37 blank | 0 comment | 0 complexity | d252da7b6ea850f85dbefd5acfc893a7 MD5 | raw file
   1<?xml version="1.0"?>
   2<project name="jEdit"
   3		 default="build">
   4	<description>
   5		This is an ant build.xml file for building jEdit - Programmer's Text Editor.
   6	</description>
   7	
   8	<property file="build.properties"
   9			  prefix="config" />
  10	<property name="src.dir"
  11			  location="." />
  12	<property name="build.dir"
  13			  location="${config.build.dir}" />
  14	<property name="dist.dir"
  15			  location="${config.dist.dir}" />
  16	<property name="classes.dir"
  17			  location="${build.dir}/classes" />
  18	<property name="jar.location"
  19			  location="${build.dir}" />
  20	<property name="build.debuglevel"
  21			  value="lines,vars,source" />
  22	
  23	<target name="init"
  24			unless="init.done">
  25		<echo message="Buildfile for ${ant.project.name} (${ant.file})"
  26			  level="info" />
  27		<property name="init.done"
  28				  value="true" />
  29	</target>
  30	
  31	<target name="clean"
  32			depends="init"
  33			description="clean up build.dir and dist.dir">
  34		<delete includeemptydirs="true"
  35				failonerror="false">
  36			<fileset dir="${build.dir}/classes" />
  37			<fileset dir="${dist.dir}/classes" />
  38		</delete>
  39	</target>
  40	
  41	<target name="clean-all"
  42			depends="init"
  43			description="clean up build.dir and dist.dir completely">
  44		<delete includeemptydirs="true"
  45				failonerror="false">
  46			<fileset dir="${build.dir}" />
  47			<fileset dir="${dist.dir}" />
  48		</delete>
  49	</target>
  50	
  51	<target name="compile"
  52			depends="init">
  53		<mkdir dir="${classes.dir}/core" />
  54		<depend srcDir="${src.dir}"
  55				destDir="${classes.dir}/core"
  56				cache="${classes.dir}" />
  57		<javac srcdir="${src.dir}"
  58			   destdir="${classes.dir}/core"
  59			   debug="true"
  60			   debuglevel="${build.debuglevel}"
  61			   deprecation="true"
  62			   source="${config.target.java.version}"
  63			   target="${config.target.java.version}"
  64			   compiler="modern">
  65			<include name="bsh/**" />
  66			<include name="org/**" />
  67			<include name="com/**" />
  68			<include name="gnu/**" />
  69		</javac>
  70	</target>
  71	
  72	<target name="build"
  73			depends="init,compile"
  74			description="build the jEdit JAR-file with full debug-information">
  75		<mkdir dir="${jar.location}" />
  76		<jar destfile="${jar.location}/${config.jar.filename}"
  77			 basedir="${classes.dir}/core"
  78			 compress="false"
  79			 manifest="org/gjt/sp/jedit/jedit.manifest"
  80			 duplicate="fail"
  81			 index="true">
  82			<fileset dir=".">
  83				<include name="bsh/commands/*.bsh" />
  84				<include name="org/gjt/sp/jedit/**/*.dtd" />
  85				<include name="org/gjt/sp/jedit/default.abbrevs" />
  86				<include name="org/gjt/sp/jedit/*.props" />
  87				<include name="org/gjt/sp/jedit/*.xml" />
  88				<include name="org/gjt/sp/jedit/icons/*.gif" />
  89				<include name="org/gjt/sp/jedit/icons/*.jpg" />
  90				<include name="org/gjt/sp/jedit/icons/*.png" />
  91				<include name="gnu/regexp/MessagesBundle.properties" />
  92			</fileset>
  93		</jar>
  94		<copy todir="${jar.location}">
  95			<fileset dir=".">
  96				<include name="macros/**" />
  97				<include name="modes/**" />
  98				<include name="properties/**" />
  99				<include name="startup/**" />
 100			</fileset>
 101		</copy>
 102	</target>
 103	
 104	<target name="run"
 105			depends="init,build"
 106			description="run jEdit">
 107		<java jar="${jar.location}/${config.jar.filename}"
 108			  fork="true"
 109			  spawn="true" />
 110	</target>
 111	
 112	<target name="generate-docbook-wrapper"
 113			if="format"
 114			depends="init">
 115		<pathconvert property="absolute-stylesheet"
 116					 dirsep="/">
 117			<path location="${config.docbook.xsl}/${stylesheet}" />
 118		</pathconvert>
 119		<echo message="&lt;?xml version=&quot;1.0&quot;?&gt;${line.separator}"
 120			  file="doc/docbook-wrapper-${format}.xsl"
 121			  level="error" />
 122		<echo message="&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;${line.separator}"
 123			  file="doc/docbook-wrapper-${format}.xsl"
 124			  append="true"
 125			  level="error" />
 126		<echo message="                version=&quot;1.0&quot;&gt;${line.separator}"
 127			  file="doc/docbook-wrapper-${format}.xsl"
 128			  append="true"
 129			  level="error" />
 130		<echo message="    &lt;xsl:import href=&quot;file:///${absolute-stylesheet}&quot; /&gt;${line.separator}"
 131			  file="doc/docbook-wrapper-${format}.xsl"
 132			  append="true"
 133			  level="error" />
 134		<echo message="&lt;/xsl:stylesheet&gt;${line.separator}"
 135			  file="doc/docbook-wrapper-${format}.xsl"
 136			  append="true"
 137			  level="error" />
 138	</target>
 139	
 140	<target name="generate-doc-faq"
 141			depends="init"
 142			if="doc.output.location"
 143			unless="faq.is.up.to.date">
 144		<mkdir dir="${doc.output.location}/FAQ" />
 145		<exec executable="${config.xsltproc.executable}"
 146			  dir="doc"
 147			  failonerror="true">
 148			<arg value="--output" />
 149			<arg value="../${doc.output.location}/FAQ/" />
 150			<arg value="--catalogs" />
 151			<arg value="jedithtml.xsl" />
 152			<arg value="FAQ/faq.xml" />
 153			<env key="SGML_CATALOG_FILES"
 154				 file="${config.docbook.catalog}" />
 155		</exec>
 156	</target>
 157	
 158	<target name="generate-doc-news"
 159			depends="init"
 160			if="doc.output.location"
 161			unless="news.is.up.to.date">
 162		<mkdir dir="${doc.output.location}/news42" />
 163		<exec executable="${config.xsltproc.executable}"
 164			  dir="doc"
 165			  failonerror="true">
 166			<arg value="--output" />
 167			<arg value="../${doc.output.location}/news42/" />
 168			<arg value="--catalogs" />
 169			<arg value="jedithtml.xsl" />
 170			<arg value="news42/news.xml" />
 171			<env key="SGML_CATALOG_FILES"
 172				 file="${config.docbook.catalog}" />
 173		</exec>
 174	</target>
 175	
 176	<target name="generate-doc-users-guide"
 177			depends="init"
 178			if="doc.output.location"
 179			unless="users-guide.is.up.to.date">
 180		<mkdir dir="${doc.output.location}/users-guide" />
 181		<exec executable="${config.xsltproc.executable}"
 182			  dir="doc"
 183			  failonerror="true">
 184			<arg value="--output" />
 185			<arg value="../${doc.output.location}/users-guide/" />
 186			<arg value="--catalogs" />
 187			<arg value="jedithtml.xsl" />
 188			<arg value="users-guide/users-guide.xml" />
 189			<env key="SGML_CATALOG_FILES"
 190				 file="${config.docbook.catalog}" />
 191		</exec>
 192	</target>
 193	
 194	<target name="docs-html"
 195			depends="init"
 196			description="generate HTML docs (needs xsltproc)">
 197		<antcall target="generate-docbook-wrapper">
 198			<param name="format"
 199				   value="html" />
 200			<param name="stylesheet"
 201				   value="html/chunk.xsl" />
 202		</antcall>
 203		<pathconvert property="doc.output.location"
 204					 dirsep="/">
 205			<path location="${jar.location}/doc" />
 206			<globmapper from="${basedir}/*"
 207						to="*"
 208						handledirsep="true" />
 209		</pathconvert>
 210		<dependset>
 211			<srcfileset dir="doc/FAQ" />
 212			<targetfileset dir="${doc.output.location}/FAQ" />
 213		</dependset>
 214		<available property="faq.is.up.to.date"
 215				   file="${doc.output.location}/FAQ/toc.xml"
 216				   type="file" />
 217		<antcall target="generate-doc-faq" />
 218		<dependset>
 219			<srcfileset dir="doc/news42" />
 220			<targetfileset dir="${doc.output.location}/news42" />
 221		</dependset>
 222		<available property="news.is.up.to.date"
 223				   file="${doc.output.location}/news42/toc.xml"
 224				   type="file" />
 225		<antcall target="generate-doc-news" />
 226		<dependset>
 227			<srcfileset dir="doc/users-guide" />
 228			<targetfileset dir="${doc.output.location}/users-guide" />
 229		</dependset>
 230		<available property="users-guide.is.up.to.date"
 231				   file="${doc.output.location}/users-guide/toc.xml"
 232				   type="file" />
 233		<antcall target="generate-doc-users-guide" />
 234		<delete file="doc/docbook-wrapper-html.xsl"
 235				failonerror="false" />
 236		<copy todir="${doc.output.location}">
 237			<fileset dir="doc">
 238				<include name="*.txt" />
 239				<include name="*.html" />
 240				<include name="*.png" />
 241				<include name="tips/**" />
 242			</fileset>
 243		</copy>
 244	</target>
 245	
 246	<target name="generate-javadoc"
 247			depends="init"
 248			unless="javadoc.is.up.to.date">
 249		<mkdir dir="${classes.dir}/javadoc" />
 250		<javac srcdir="${src.dir}"
 251			   destdir="${classes.dir}/javadoc"
 252			   includes="doclet/**"
 253			   debug="true"
 254			   debuglevel="${build.debuglevel}"
 255			   deprecation="true"
 256			   source="${config.target.java.version}"
 257			   target="${config.target.java.version}"
 258			   compiler="modern" />
 259		<javadoc sourcepath="${src.dir}"
 260				 destdir="${classes.dir}/javadoc/api"
 261				 packagenames="bsh.*,org.*,com.*,gnu.*"
 262				 classpath="${classes.dir}/core"
 263				 doclet="doclet.GenerateTocXML"
 264				 docletpath="${classes.dir}/javadoc"
 265				 version="true"
 266				 use="true"
 267				 author="true"
 268				 splitindex="true"
 269				 windowtitle="jEdit API"
 270				 doctitle="jEdit API"
 271				 failonerror="true"
 272				 source="${config.target.java.version}">
 273			<group title="jEdit"
 274				   packages="org.gjt.sp*" />
 275			<group title="BeanShell"
 276				   packages="bsh*:org.objectweb.asm*" />
 277			<group title="Microstar XML Parser"
 278				   packages="com.microstar.xml*" />
 279			<group title="GNU Regular Expression Implementation"
 280				   packages="gnu.regexp*" />
 281		</javadoc>
 282	</target>
 283	
 284	<target name="docs-javadoc"
 285			depends="init"
 286			description="generate JavaDoc API docs">
 287		<dependset>
 288			<srcfileset dir="${src.dir}">
 289				<include name="doclet/**/*.java" />
 290				<include name="bsh/**/*.java" />
 291				<include name="bsh/**/package.html" />
 292				<include name="org/**/*.java" />
 293				<include name="org/**/package.html" />
 294				<include name="com/**/*.java" />
 295				<include name="com/**/package.html" />
 296				<include name="gnu/**/*.java" />
 297				<include name="gnu/**/package.html" />
 298			</srcfileset>
 299			<targetfileset dir="${classes.dir}/javadoc" />
 300		</dependset>
 301		<available property="javadoc.is.up.to.date"
 302				   file="${classes.dir}/javadoc/api/toc.xml"
 303				   type="file" />
 304		<antcall target="generate-javadoc" />
 305		<copy todir="${jar.location}/doc">
 306			<fileset dir="${classes.dir}/javadoc"
 307					 includes="api/**"
 308					 excludes="api/**/*.html" />
 309		</copy>
 310		<copy todir="${jar.location}/doc">
 311			<fileset dir="${classes.dir}/javadoc"
 312					 includes="api/**/*.html" />
 313			<filterchain>
 314				<tokenfilter>
 315					<replacestring from="&lt;TD BGCOLOR=&quot;#FFFFFF&quot; CLASS=&quot;NavBarCell1Rev&quot;&gt;"
 316								   to="&lt;TD BGCOLOR=&quot;#00008B&quot; CLASS=&quot;NavBarCell1Rev&quot;&gt;" />
 317				</tokenfilter>
 318				<tokenfilter>
 319					<filetokenizer />
 320					<replaceregex pattern="(&lt;SCRIPT type=&quot;text/javascript&quot;&gt;.*?&lt;/SCRIPT&gt;|onload=&quot;.*?&quot;)"
 321								  flags="gs" />
 322				</tokenfilter>
 323			</filterchain>
 324		</copy>
 325	</target>
 326	
 327	<target name="generate-pdf-users-guide"
 328			depends="init"
 329			if="paper.type"
 330			unless="pdf-users-guide.is.up.to.date">
 331		<antcall target="generate-docbook-wrapper">
 332			<param name="format"
 333				   value="fo" />
 334			<param name="stylesheet"
 335				   value="fo/docbook.xsl" />
 336		</antcall>
 337		<pathconvert property="docs-pdf.classes.dir"
 338					 dirsep="/">
 339			<path location="${classes.dir}/docs-pdf" />
 340			<globmapper from="${basedir}/*"
 341						to="*"
 342						handledirsep="true" />
 343		</pathconvert>
 344		<mkdir dir="${docs-pdf.classes.dir}" />
 345		<exec executable="${config.xsltproc.executable}"
 346			  dir="doc"
 347			  failonerror="true">
 348			<arg value="--stringparam" />
 349			<arg value="paper.type" />
 350			<arg value="&quot;${paper.type}&quot;" />
 351			<arg value="--output" />
 352			<arg value="../${docs-pdf.classes.dir}/${config.manual.filename.prefix}${paper.type}.fot" />
 353			<arg value="--novalid" />
 354			<arg value="jeditfo.xsl" />
 355			<arg value="users-guide/users-guide.xml" />
 356		</exec>
 357		<delete file="doc/docbook-wrapper-fo.xsl"
 358				failonerror="false" />
 359		<taskdef name="fop"
 360				 classname="org.apache.fop.tools.anttasks.Fop"
 361				 classpath="${config.fop.dir}/build/fop.jar">
 362			<classpath>
 363				<fileset dir="${config.fop.dir}/lib"
 364						 includes="*.jar" />
 365			</classpath>
 366		</taskdef>
 367		<fop fofile="${docs-pdf.classes.dir}/${config.manual.filename.prefix}${paper.type}.fot"
 368			 outfile="${jar.location}/${config.manual.filename.prefix}${paper.type}.pdf"
 369			 format="application/pdf"
 370			 messagelevel="info" />
 371	</target>
 372	
 373	<target name="docs-pdf"
 374			depends="init"
 375			if="paper.type">
 376		<dependset>
 377			<srcfileset dir="doc/users-guide" />
 378			<targetfilelist dir="${classes.dir}/docs-pdf"
 379							files="${config.manual.filename.prefix}${paper.type}.fot" />
 380			<targetfilelist dir="${jar.location}"
 381							files="${config.manual.filename.prefix}${paper.type}.pdf" />
 382		</dependset>
 383		<available property="pdf-users-guide.is.up.to.date"
 384				   file="${jar.location}/${config.manual.filename.prefix}${paper.type}.pdf"
 385				   type="file" />
 386		<antcall target="generate-pdf-users-guide" />
 387	</target>
 388	
 389	<target name="docs-pdf-a4"
 390			depends="init"
 391			description="generate PDF users-guide with A4 paper size (needs xsltproc and fop)">
 392		<antcall target="docs-pdf">
 393			<param name="paper.type"
 394				   value="A4" />
 395		</antcall>
 396	</target>
 397	
 398	<target name="docs-pdf-USletter"
 399			depends="init"
 400			description="generate PDF users-guide with US letter paper size (needs xsltproc and fop)">
 401		<antcall target="docs-pdf">
 402			<param name="paper.type"
 403				   value="USletter" />
 404		</antcall>
 405	</target>
 406	
 407	<target name="compile-installer"
 408			depends="init">
 409		<mkdir dir="${classes.dir}/installer" />
 410		<depend srcDir="${src.dir}"
 411				destDir="${classes.dir}/installer"
 412				cache="${classes.dir}" />
 413		<javac srcdir="${src.dir}"
 414			   destdir="${classes.dir}/installer"
 415			   includes="installer/**"
 416			   debug="true"
 417			   debuglevel="${build.debuglevel}"
 418			   deprecation="true"
 419			   source="${config.target.java.version}"
 420			   target="${config.target.java.version}"
 421			   compiler="modern" />
 422	</target>
 423	
 424	<target name="compile-default-plugins-for-dist"
 425			depends="init">
 426		<ant dir="jars/LatestVersion"
 427			 target="dist"
 428			 inheritAll="false">
 429			<property name="jedit.install.dir"
 430					  value="${dist.dir}" />
 431		</ant>
 432		<ant dir="jars/LatestVersion"
 433			 target="clean"
 434			 inheritAll="false">
 435			<property name="jedit.install.dir"
 436					  value="${dist.dir}" />
 437		</ant>
 438		<ant dir="jars/QuickNotepad"
 439			 target="dist"
 440			 inheritAll="false">
 441			<property name="jedit.install.dir"
 442					  value="${dist.dir}" />
 443		</ant>
 444		<ant dir="jars/QuickNotepad"
 445			 target="clean"
 446			 inheritAll="false">
 447			<property name="jedit.install.dir"
 448					  value="${dist.dir}" />
 449		</ant>
 450		<ant dir="jars/MacOS"
 451			 target="dist"
 452			 inheritAll="false">
 453			<property name="jedit.install.dir"
 454					  value="${dist.dir}" />
 455		</ant>
 456		<ant dir="jars/MacOS"
 457			 target="clean"
 458			 inheritAll="false">
 459			<property name="jedit.install.dir"
 460					  value="${dist.dir}" />
 461		</ant>
 462	</target>
 463
 464	<target name="dist-java"
 465			depends="init"
 466			description="build the Java-installer">
 467		<antcall target="prepare-dist-files" />
 468		<tar destfile="${dist.dir}/jedit-macros.tar.bz2"
 469			 basedir="${dist.dir}"
 470			 includes="macros/**"
 471			 compression="bzip2" />
 472		<tar destfile="${dist.dir}/jedit-program.tar.bz2"
 473			 basedir="${dist.dir}"
 474			 includes="doc/**
 475					   jars/LatestVersion.jar
 476					   jars/QuickNotepad.jar
 477					   modes/**
 478					   properties/**
 479					   startup/**
 480					   ${config.jar.filename}"
 481			 excludes="doc/api/**"
 482			 compression="bzip2" />
 483		<tar destfile="${dist.dir}/jedit-mac.tar.bz2"
 484			 basedir="${dist.dir}"
 485			 includes="jars/MacOS.jar"
 486			 compression="bzip2" />
 487		<tar destfile="${dist.dir}/jedit-api.tar.bz2"
 488			 basedir="${dist.dir}"
 489			 includes="doc/api/**"
 490			 compression="bzip2" />
 491		<tar destfile="${dist.dir}/jedit-os2.tar.bz2"
 492			 basedir="package-files/os2"
 493			 includes="jedit.cmd"
 494			 compression="bzip2" />
 495		<antcall target="compile-installer">
 496			<param name="build.debuglevel"
 497				   value="lines,source" />
 498			<param name="classes.dir"
 499				   location="${dist.dir}/classes" />
 500		</antcall>
 501		<copy todir="${dist.dir}/classes/installer/installer"
 502			  overwrite="true">
 503			<fileset file="installer/install.props" />
 504			<filterset>
 505				<filter token="jedit.version"
 506						value="${config.jedit.version}" />
 507			</filterset>
 508		</copy>
 509		<jar destfile="${dist.dir}/${config.dist.jar.filename}"
 510			 basedir="${dist.dir}/classes/installer"
 511			 compress="true"
 512			 manifest="installer/install.mf"
 513			 duplicate="fail"
 514			 index="true">
 515			<fileset dir=".">
 516				<include name="installer/*.html" />
 517			</fileset>
 518			<fileset dir="${dist.dir}/classes/package-files/linux">
 519				<include name="jedit.1" />
 520			</fileset>
 521			<zipfileset dir="${dist.dir}"
 522						includes="jedit-api.tar.bz2
 523						          jedit-mac.tar.bz2
 524						          jedit-macros.tar.bz2
 525						          jedit-os2.tar.bz2
 526						          jedit-program.tar.bz2"
 527						prefix="installer" />
 528		</jar>
 529		<condition property="wipe.dist.files">
 530			<not>
 531				<isset property="dont.wipe.dist.files" />
 532			</not>
 533		</condition>
 534		<antcall target="dist-cleanup" />
 535	</target>
 536	
 537	<target name="dist-manuals"
 538			depends="init"
 539			description="build the PDF-manuals">
 540		<antcall target="docs-pdf-a4">
 541			<param name="classes.dir"
 542				   location="${dist.dir}/classes" />
 543			<param name="jar.location"
 544				   location="${dist.dir}" />
 545		</antcall>
 546		<antcall target="docs-pdf-USletter">
 547			<param name="classes.dir"
 548				   location="${dist.dir}/classes" />
 549			<param name="jar.location"
 550				   location="${dist.dir}" />
 551		</antcall>
 552		<condition property="wipe.dist.files">
 553			<not>
 554				<isset property="dont.wipe.dist.files" />
 555			</not>
 556		</condition>
 557		<antcall target="dist-cleanup" />
 558	</target>
 559	
 560	<target name="dist-src"
 561			depends="init"
 562			description="build the src-archive">
 563		<pathconvert property="relative.build.dir">
 564			<path location="${build.dir}" />
 565			<globmapper from="${basedir}/*"
 566						to="jEdit/*"
 567						handledirsep="true" />
 568		</pathconvert>
 569		<pathconvert property="relative.dist.dir">
 570			<path location="${dist.dir}" />
 571			<globmapper from="${basedir}/*"
 572						to="jEdit/*"
 573						handledirsep="true" />
 574		</pathconvert>
 575		<mkdir dir="${dist.dir}" />
 576		<tar destfile="${dist.dir}/${config.src.archive.filename}"
 577			 basedir=".."
 578			 includes="jEdit/**"
 579			 excludes="${relative.build.dir}/**
 580			 		   ${relative.dist.dir}/**"
 581			 compression="bzip2" />
 582	</target>
 583	
 584	<target name="compile-jarbundler"
 585			depends="init">
 586		<mkdir dir="${classes.dir}/jarbundler" />
 587		<depend srcDir="${src.dir}"
 588				destDir="${classes.dir}/jarbundler"
 589				cache="${classes.dir}" />
 590		<javac srcdir="${src.dir}"
 591			   destdir="${classes.dir}/jarbundler"
 592			   includes="net/**"
 593			   debug="true"
 594			   debuglevel="${build.debuglevel}"
 595			   deprecation="true"
 596			   source="${config.target.java.version}"
 597			   target="${config.target.java.version}"
 598			   compiler="modern" />
 599	</target>
 600
 601	<target name="dist-mac-finish"
 602			depends="init"
 603			unless="build.on.non.mac"
 604			description="finish building the Mac OS X disk image (DMG-file) on Mac OS X">
 605		<fail message="The disk image (DMG-file) for easy distribution on Mac OS X can only be built on Mac OS X currently">
 606			<condition>
 607				<not>
 608					<os family="mac" />
 609				</not>
 610			</condition>
 611		</fail>
 612		<taskdef name="jarbundler"
 613				 classname="net.sourceforge.jarbundler.JarBundler"
 614				 classpath="${dist.dir}/classes/jarbundler" />
 615		<tstamp>
 616			<format property="current.year"
 617					pattern="yyyy" />
 618		</tstamp>
 619		<mkdir dir="${dist.dir}/classes/mac" />
 620		<jarbundler dir="${dist.dir}/classes/mac"
 621					name="jEdit"
 622					mainclass="org.gjt.sp.jedit.jEdit"
 623					jar="${dist.dir}/${config.jar.filename}"
 624					arguments="-background"
 625					build="${config.jedit.build.number}"
 626					bundleid="org.gjt.sp.jedit"
 627					extraclasspath="/System/Library/Java"
 628					icon="icons/icon.icns"
 629					infostring="jEdit ${config.jedit.version}, Copyright &#169; 1998-${current.year} Slava Pestov"
 630					jvmversion="${config.mac.target.java.version}"
 631					shortname="jEdit"
 632					signature="JESP"
 633					stubfile="jedit"
 634					version="${config.jedit.version}">
 635			<javaproperty name="apple.awt.antialiasing"
 636						  value="true" />
 637			<javaproperty name="apple.awt.textantialiasing"
 638						  value="true" />
 639			<javaproperty name="apple.laf.useScreenMenuBar"
 640						  value="true" />
 641			<javafileset dir="${dist.dir}"
 642						 includes="doc/**
 643								   jars/**
 644								   macros/**
 645								   modes/**
 646								   properties/**
 647								   startup/**" />
 648			<documenttype name="jEdit TEXT Document"
 649						  extensions="*"
 650						  ostypes="TEXT ****"
 651						  iconfile="icons/file.icns"
 652						  role="Editor" />
 653			<service message="openFile"
 654					 menuitem="jEdit/Open Files"
 655					 sendtypes="NSStringPboardType,NSFilenamesPboardType" />
 656			<service message="insertSelection"
 657					 menuitem="jEdit/Insert Text"
 658					 sendtypes="NSStringPboardType" />
 659			<service message="openSelection"
 660					 menuitem="jEdit/New Buffer with Text"
 661					 sendtypes="NSStringPboardType" />
 662		</jarbundler>
 663		<delete file="${dist.dir}/classes/mac/jEdit.app/Contents/MacOS/jedit" />
 664		<exec executable="ln"
 665			  failonerror="true">
 666			<arg value="-s" />
 667			<arg file="/System/Library/Frameworks/JavaVM.framework/Resources/MacOS/JavaApplicationStub" />
 668			<arg file="${dist.dir}/classes/mac/jEdit.app/Contents/MacOS/jedit" />
 669		</exec>
 670		<delete file="${dist.dir}/${config.mac.disk.image.filename}"
 671				failonerror="false" />
 672		<exec executable="hdiutil"
 673			  failonerror="true">
 674			<arg value="create" />
 675			<arg value="-quiet" />
 676			<arg value="-volname" />
 677			<arg value="jEdit ${config.jedit.version}" />
 678			<arg value="-srcfolder" />
 679			<arg file="${dist.dir}/classes/mac/jEdit.app" />
 680			<arg file="${dist.dir}/${config.mac.disk.image.filename}" />
 681		</exec>
 682		<exec executable="hdiutil"
 683			  failonerror="true">
 684			<arg value="internet-enable" />
 685			<arg value="-quiet" />
 686			<arg file="${dist.dir}/${config.mac.disk.image.filename}" />
 687		</exec>
 688		<condition property="wipe.dist.files">
 689			<not>
 690				<isset property="dont.wipe.dist.files" />
 691			</not>
 692		</condition>
 693		<antcall target="dist-cleanup" />
 694	</target>
 695	
 696	<target name="prepare-dist-mac-finish"
 697			depends="init"
 698			if="build.on.non.mac">
 699		<tar destfile="${dist.dir}/jEdit-${config.jedit.version}-dist-mac-finish.tar.bz2"
 700			 basedir="."
 701			 includes="build.properties
 702			 		   build.xml
 703			 		   icons/file.icns
 704			 		   icons/icon.icns
 705			 		   ${config.dist.dir}/${config.jar.filename}
 706			 		   ${config.dist.dir}/classes/jarbundler/**
 707			 		   ${config.dist.dir}/doc/**
 708			 		   ${config.dist.dir}/jars/**
 709			 		   ${config.dist.dir}/macros/**
 710			 		   ${config.dist.dir}/modes/**
 711			 		   ${config.dist.dir}/properties/**
 712			 		   ${config.dist.dir}/startup/**"
 713			 compression="bzip2" />
 714	</target>
 715	
 716	<target name="dist-mac"
 717			depends="init"
 718			description="build the Mac OS X disk image (DMG-file)">
 719		<antcall target="prepare-dist-files" />
 720		<antcall target="compile-jarbundler">
 721			<param name="build.debuglevel"
 722				   value="lines,source" />
 723			<param name="classes.dir"
 724				   location="${dist.dir}/classes" />
 725		</antcall>
 726		<condition property="build.on.non.mac">
 727			<not>
 728				<os family="mac" />
 729			</not>
 730		</condition>
 731		<antcall target="dist-mac-finish">
 732			<param name="dont.wipe.dist.files"
 733				   value="true" />
 734		</antcall>
 735		<antcall target="prepare-dist-mac-finish" />
 736		<condition property="wipe.dist.files">
 737			<not>
 738				<isset property="dont.wipe.dist.files" />
 739			</not>
 740		</condition>
 741		<antcall target="dist-cleanup" />
 742	</target>
 743	
 744	<target name="prepare-dist-files"
 745			depends="init">
 746		<antcall target="build">
 747			<param name="build.debuglevel"
 748				   value="lines,source" />
 749			<param name="classes.dir"
 750				   location="${dist.dir}/classes" />
 751			<param name="jar.location"
 752				   location="${dist.dir}" />
 753		</antcall>
 754		<antcall target="docs-html">
 755			<param name="build.debuglevel"
 756				   value="lines,source" />
 757			<param name="classes.dir"
 758				   location="${dist.dir}/classes" />
 759			<param name="jar.location"
 760				   location="${dist.dir}" />
 761		</antcall>
 762		<antcall target="docs-javadoc">
 763			<param name="build.debuglevel"
 764				   value="lines,source" />
 765			<param name="classes.dir"
 766				   location="${dist.dir}/classes" />
 767			<param name="jar.location"
 768				   location="${dist.dir}" />
 769		</antcall>
 770		<antcall target="compile-default-plugins-for-dist" />
 771		<copy todir="${dist.dir}/classes/package-files"
 772			  overwrite="true">
 773			<fileset dir="package-files"
 774					 excludes="windows/launchstub.exe" />
 775			<filterset>
 776				<filter token="jar.filename"
 777						value="${config.jar.filename}" />
 778				<filter token="jedit.version"
 779						value="${config.jedit.version}" />
 780				<filter token="jedit.build.number"
 781						value="${config.jedit.build.number}" />
 782				<filter token="slackware.target.java.version"
 783						value="${config.slackware.target.java.version}" />
 784			</filterset>
 785		</copy>
 786		<copy todir="${dist.dir}/classes/package-files/windows">
 787			<fileset file="package-files/windows/launchstub.exe" />
 788		</copy>
 789		<gzip src="${dist.dir}/classes/package-files/linux/jedit.1"
 790			  destfile="${dist.dir}/classes/package-files/linux/jedit.1.gz" />
 791	</target>
 792	
 793	<target name="dist-slackware"
 794			depends="init"
 795			description="build the Slackware Package">
 796		<antcall target="prepare-dist-files" />
 797		<tar destfile="${dist.dir}/jEdit-${config.jedit.version}-noarch-1sao.tgz"
 798			 compression="gzip">
 799			<tarfileset file="."
 800						username="root"
 801						group="root"
 802						fullpath="./" />
 803			<tarfileset dir="${dist.dir}/classes/package-files/linux/slackware"
 804						includes="doinst.sh
 805								  slack-desc
 806								  slack-required"
 807						username="root"
 808						group="root"
 809						prefix="install/" />
 810			<tarfileset file="${dist.dir}/classes/package-files/linux/jedit"
 811						mode="755"
 812						username="root"
 813						group="bin"
 814						fullpath="usr/bin/jedit" />
 815			<tarfileset dir="${dist.dir}/doc"
 816						includes="*.txt"
 817						username="root"
 818						group="root"
 819						prefix="usr/doc/jEdit-${config.jedit.version}/" />
 820			<tarfileset file="${dist.dir}/classes/package-files/linux/jedit.1.gz"
 821						username="root"
 822						group="root"
 823						fullpath="usr/man/man1/jedit.1.gz" />
 824			<tarfileset file="${dist.dir}/classes/package-files/linux/slackware/jEdit.desktop"
 825						username="root"
 826						group="root"
 827						fullpath="usr/share/applications/jEdit.desktop" />
 828			<tarfileset dir="${dist.dir}"
 829						includes="doc/**
 830								  jars/LatestVersion.jar
 831								  jars/QuickNotepad.jar
 832								  macros/**
 833								  modes/**
 834								  properties/**
 835								  startup/**
 836								  ${config.jar.filename}"
 837						username="root"
 838						group="root"
 839						prefix="usr/share/jEdit-${config.jedit.version}/" />
 840			<tarfileset dir="icons"
 841						includes="jedit-file48.png
 842								  jedit-icon48.png"
 843						username="root"
 844						group="root"
 845						prefix="usr/share/pixmaps/" />
 846		</tar>
 847		<condition property="wipe.dist.files">
 848			<not>
 849				<isset property="dont.wipe.dist.files" />
 850			</not>
 851		</condition>
 852		<antcall target="dist-cleanup" />
 853	</target>
 854	
 855	<target name="compile-ar"
 856			depends="init">
 857		<mkdir dir="${classes.dir}/ar" />
 858		<depend srcDir="${src.dir}"
 859				destDir="${classes.dir}/ar"
 860				cache="${classes.dir}" />
 861		<javac srcdir="${src.dir}"
 862			   destdir="${classes.dir}/ar"
 863			   includes="de/masters_of_disaster/ant/tasks/ar/**"
 864			   debug="true"
 865			   debuglevel="${build.debuglevel}"
 866			   deprecation="true"
 867			   source="${config.target.java.version}"
 868			   target="${config.target.java.version}"
 869			   compiler="modern" />
 870	</target>
 871	
 872	<target name="compile-deb"
 873			depends="init">
 874		<mkdir dir="${classes.dir}/deb" />
 875		<depend srcDir="${src.dir}"
 876				destDir="${classes.dir}/deb"
 877				cache="${classes.dir}" />
 878		<javac srcdir="${src.dir}"
 879			   destdir="${classes.dir}/deb"
 880			   includes="de/masters_of_disaster/ant/tasks/deb/**"
 881			   debug="true"
 882			   debuglevel="${build.debuglevel}"
 883			   deprecation="true"
 884			   source="${config.target.java.version}"
 885			   target="${config.target.java.version}"
 886			   compiler="modern" />
 887	</target>
 888	
 889	<target name="dist-deb"
 890			depends="init"
 891			description="build the DEB Package">
 892		<antcall target="prepare-dist-files" />
 893		<antcall target="compile-ar">
 894			<param name="build.debuglevel"
 895				   value="lines,source" />
 896			<param name="classes.dir"
 897				   location="${dist.dir}/classes" />
 898		</antcall>
 899		<antcall target="compile-deb">
 900			<param name="build.debuglevel"
 901				   value="lines,source" />
 902			<param name="classes.dir"
 903				   location="${dist.dir}/classes" />
 904		</antcall>
 905		<taskdef name="deb"
 906				 classname="de.masters_of_disaster.ant.tasks.deb.Deb"
 907				 classpath="${dist.dir}/classes/deb" />
 908		<taskdef name="calculateinstalledsizefordeb"
 909				 classname="de.masters_of_disaster.ant.tasks.deb.CalculateInstalledSizeForDeb"
 910				 classpath="${dist.dir}/classes/deb" />
 911		<calculateinstalledsizefordeb property="deb.installed.size">
 912			<fileset dir="${dist.dir}/doc"
 913					 includes="*.txt" />
 914			<fileset dir="${dist.dir}"
 915					 includes="classes/package-files/linux/jedit
 916					 	 	   classes/package-files/linux/deb/jedit
 917					 	 	   classes/package-files/linux/deb/jedit.desktop
 918					 	 	   classes/package-files/linux/jedit.1.gz
 919					 	 	   doc/**
 920						 	   jars/LatestVersion.jar
 921						 	   jars/QuickNotepad.jar
 922						 	   macros/**
 923						 	   modes/**
 924						 	   properties/**
 925						 	   startup/**
 926						 	   ${config.jar.filename}" />
 927		</calculateinstalledsizefordeb>
 928		<copy todir="${dist.dir}/classes/package-files/linux/deb"
 929			  overwrite="true">
 930			<fileset file="package-files/linux/deb/control" />
 931			<filterset>
 932				<filter token="jedit.build.number"
 933						value="${config.jedit.build.number}" />
 934				<filter token="deb.installed.size"
 935						value="${deb.installed.size}" />
 936			</filterset>
 937		</copy>
 938		<deb destfile="${dist.dir}/jedit_${config.jedit.version}_all.deb"
 939			 tempDir="${dist.dir}/classes/deb"
 940			 deleteTempFiles="false"
 941			 includeMd5sums="true">
 942			<controlfileset file="${dist.dir}/classes/package-files/linux/deb/control" />
 943			<controlfileset dir="${dist.dir}/classes/package-files/linux/deb"
 944							includes="postinst
 945									  postrm"
 946							mode="755" />
 947			<datafileset file="${dist.dir}/classes/package-files/linux/jedit"
 948						 fullpath="usr/bin/jedit"
 949						 mode="755" />
 950			<datafileset file="${dist.dir}/classes/package-files/linux/deb/jedit"
 951						 fullpath="usr/lib/menu/jedit" />
 952			<datafileset file="${dist.dir}/classes/package-files/linux/deb/jedit.desktop"
 953						 fullpath="usr/share/applications/jedit.desktop" />
 954			<datafileset dir="${dist.dir}/doc"
 955						 includes="*.txt"
 956						 prefix="usr/share/doc/jEdit/" />
 957			<datafileset dir="${dist.dir}/jars"
 958						 includes="LatestVersion.jar
 959						 		   QuickNotepad.jar"
 960						 prefix="usr/share/java/" />
 961			<datafileset dir="${dist.dir}"
 962						 includes="doc/**
 963						 		   macros/**
 964						 		   modes/**
 965						 		   properties/**
 966						 		   startup/**
 967						 		   ${config.jar.filename}"
 968						 prefix="usr/share/jEdit/" />
 969			<datafileset file="${dist.dir}/classes/package-files/linux/jedit.1.gz"
 970						 fullpath="usr/share/man/man1/jedit.1.gz" />
 971		</deb>
 972		<condition property="wipe.dist.files">
 973			<not>
 974				<isset property="dont.wipe.dist.files" />
 975			</not>
 976		</condition>
 977		<antcall target="dist-cleanup" />
 978	</target>
 979	
 980	<target name="dist-win-finish"
 981			depends="init"
 982			unless="build.on.non.win"
 983			description="finish building the Windows installer (EXE-file) on Windows">
 984		<fail message="The Windows installer (EXE-file) can only be built on Windows currently">
 985			<condition>
 986				<not>
 987					<os family="windows" />
 988				</not>
 989			</condition>
 990		</fail>
 991		<tstamp>
 992			<format property="current.year"
 993					pattern="yyyy" />
 994		</tstamp>
 995		<copy todir="${dist.dir}/classes/package-files/windows"
 996			  overwrite="true">
 997			<fileset file="package-files/windows/win32installer.iss" />
 998			<filterset>
 999				<filter token="jar.filename"
1000						value="${config.jar.filename}" />
1001				<filter token="jedit.version"
1002						value="${config.jedit.version}" />
1003				<filter token="jedit.build.number"
1004						value="${config.jedit.build.number}" />
1005				<filter token="win.filename"
1006						value="${config.win.filename}" />
1007				<filter token="dist.dir"
1008						value="${dist.dir}" />
1009				<filter token="base.dir"
1010						value="${basedir}" />
1011				<filter token="current.year"
1012						value="${current.year}" />
1013			</filterset>
1014		</copy>
1015			<exec executable="${config.innosetup.compiler.executable}"
1016			  failonerror="true">
1017			<arg value="/cc" />
1018			<arg file="${dist.dir}/classes/package-files/windows/win32installer.iss" />
1019		</exec>
1020		<condition property="wipe.dist.files">
1021			<not>
1022				<isset property="dont.wipe.dist.files" />
1023			</not>
1024		</condition>
1025		<antcall target="dist-cleanup" />
1026	</target>
1027	
1028	<target name="prepare-dist-win-finish"
1029			depends="init"
1030			if="build.on.non.win">
1031		<tar destfile="${dist.dir}/jEdit-${config.jedit.version}-dist-win-finish.tar.bz2"
1032			 basedir="."
1033			 includes="build.properties
1034			 		   build.xml
1035			 		   icons/jedit.ico
1036			 		   icons/WindowsInstallerSmallImage.bmp
1037			 		   icons/WindowsInstallerImage.bmp
1038					   package-files/windows/win32installer.iss
1039			 		   ${config.dist.dir}/${config.jar.filename}
1040			 		   ${config.dist.dir}/classes/package-files/windows/**
1041			 		   ${config.dist.dir}/doc/**
1042			 		   ${config.dist.dir}/jars/LatestVersion.jar
1043			 		   ${config.dist.dir}/jars/QuickNotepad.jar
1044			 		   ${config.dist.dir}/macros/**
1045			 		   ${config.dist.dir}/modes/**
1046			 		   ${config.dist.dir}/properties/**
1047			 		   ${config.dist.dir}/startup/**"
1048			 compression="bzip2" />
1049	</target>
1050	
1051	<target name="dist-win"
1052			depends="init"
1053			description="build the Windows installer (EXE-file)">
1054		<antcall target="prepare-dist-files" />
1055		<condition property="build.on.non.win">
1056			<not>
1057				<os family="windows" />
1058			</not>
1059		</condition>
1060		<antcall target="dist-win-finish">
1061			<param name="dont.wipe.dist.files"
1062				   value="true" />
1063		</antcall>
1064		<antcall target="prepare-dist-win-finish" />
1065		<condition property="wipe.dist.files">
1066			<not>
1067				<isset property="dont.wipe.dist.files" />
1068			</not>
1069		</condition>
1070		<antcall target="dist-cleanup" />
1071	</target>
1072	
1073	<target name="dist"
1074			depends="init"
1075			description="build all distribution files">
1076		<property name="dont.wipe.dist.files"
1077				  value="true" />
1078		<antcall target="dist-java" />
1079		<antcall target="dist-manuals" />
1080		<antcall target="dist-src" />
1081		<antcall target="dist-slackware" />
1082		<antcall target="dist-deb" />
1083		<antcall target="dist-mac" />
1084		<antcall target="dist-win" />
1085		<property name="wipe.dist.files"
1086				  value="true" />
1087		<antcall target="dist-cleanup" />
1088	</target>
1089	
1090	<target name="dist-cleanup"
1091			depends="init">
1092		<delete includeemptydirs="true">
1093			<fileset dir="${dist.dir}">
1094				<selector if="wipe.dist.files">
1095					<or>
1096						<filename name="macros/**" />
1097						<filename name="doc/**" />
1098						<filename name="jars/**" />
1099						<filename name="modes/**" />
1100						<filename name="properties/**" />
1101						<filename name="startup/**" />
1102						<filename name="${config.jar.filename}" />
1103						<and>
1104							<filename name="*.tar.bz2" />
1105							<filename name="${config.src.archive.filename}"
1106									  negate="true" />
1107							<filename name="jEdit-${config.jedit.version}-dist-mac-finish.tar.bz2"
1108									  negate="true" />
1109							<filename name="jEdit-${config.jedit.version}-dist-win-finish.tar.bz2"
1110									  negate="true" />
1111						</and>
1112						<filename name="classes/**" />
1113					</or>
1114				</selector>
1115			</fileset>
1116		</delete>
1117	</target>
1118</project>