src/Tools/jEdit/build.xml
author wenzelm
Thu Sep 02 00:48:07 2010 +0200 (2010-09-02)
changeset 38980 af73cf0dc31f
parent 34684 d59b1005968e
permissions -rw-r--r--
turned show_question_marks into proper configuration option;
show_question_marks only affects regular type/term pretty printing, not raw Term.string_of_vname;
tuned;
wenzelm@34320
     1
<?xml version="1.0" encoding="UTF-8"?>
wenzelm@34320
     2
<!-- You may freely edit this file. See commented blocks below for -->
wenzelm@34320
     3
<!-- some examples of how to customize the build. -->
wenzelm@34320
     4
<!-- (If you delete it and reopen the project it will be recreated.) -->
wenzelm@34320
     5
<project name="Isabelle-jEdit" default="default" basedir=".">
wenzelm@34320
     6
    <description>Builds, tests, and runs the project Isabelle-jEdit.</description>
wenzelm@34320
     7
    <import file="nbproject/build-impl.xml"/>
wenzelm@34320
     8
    <!--
wenzelm@34320
     9
wenzelm@34320
    10
    There exist several targets which are by default empty and which can be 
wenzelm@34320
    11
    used for execution of your tasks. These targets are usually executed 
wenzelm@34320
    12
    before and after some main targets. They are: 
wenzelm@34320
    13
wenzelm@34320
    14
      -pre-init:                 called before initialization of project properties
wenzelm@34320
    15
      -post-init:                called after initialization of project properties
wenzelm@34320
    16
      -pre-compile:              called before javac compilation
wenzelm@34320
    17
      -post-compile:             called after javac compilation
wenzelm@34320
    18
      -pre-compile-single:       called before javac compilation of single file
wenzelm@34320
    19
      -post-compile-single:      called after javac compilation of single file
wenzelm@34320
    20
      -pre-compile-test:         called before javac compilation of JUnit tests
wenzelm@34320
    21
      -post-compile-test:        called after javac compilation of JUnit tests
wenzelm@34320
    22
      -pre-compile-test-single:  called before javac compilation of single JUnit test
wenzelm@34320
    23
      -post-compile-test-single: called after javac compilation of single JUunit test
wenzelm@34320
    24
      -pre-jar:                  called before JAR building
wenzelm@34320
    25
      -post-jar:                 called after JAR building
wenzelm@34320
    26
      -post-clean:               called after cleaning build products
wenzelm@34320
    27
wenzelm@34320
    28
    (Targets beginning with '-' are not intended to be called on their own.)
wenzelm@34320
    29
wenzelm@34320
    30
    Example of inserting an obfuscator after compilation could look like this:
wenzelm@34320
    31
wenzelm@34320
    32
        <target name="-post-compile">
wenzelm@34320
    33
            <obfuscate>
wenzelm@34320
    34
                <fileset dir="${build.classes.dir}"/>
wenzelm@34320
    35
            </obfuscate>
wenzelm@34320
    36
        </target>
wenzelm@34320
    37
wenzelm@34320
    38
    For list of available properties check the imported 
wenzelm@34320
    39
    nbproject/build-impl.xml file. 
wenzelm@34320
    40
wenzelm@34320
    41
wenzelm@34320
    42
    Another way to customize the build is by overriding existing main targets.
wenzelm@34320
    43
    The targets of interest are: 
wenzelm@34320
    44
wenzelm@34320
    45
      -init-macrodef-javac:     defines macro for javac compilation
wenzelm@34320
    46
      -init-macrodef-junit:     defines macro for junit execution
wenzelm@34320
    47
      -init-macrodef-debug:     defines macro for class debugging
wenzelm@34320
    48
      -init-macrodef-java:      defines macro for class execution
wenzelm@34320
    49
      -do-jar-with-manifest:    JAR building (if you are using a manifest)
wenzelm@34320
    50
      -do-jar-without-manifest: JAR building (if you are not using a manifest)
wenzelm@34320
    51
      run:                      execution of project 
wenzelm@34320
    52
      -javadoc-build:           Javadoc generation
wenzelm@34320
    53
      test-report:              JUnit report generation
wenzelm@34320
    54
wenzelm@34320
    55
    An example of overriding the target for project execution could look like this:
wenzelm@34320
    56
wenzelm@34320
    57
        <target name="run" depends="Isabelle-jEdit-impl.jar">
wenzelm@34320
    58
            <exec dir="bin" executable="launcher.exe">
wenzelm@34320
    59
                <arg file="${dist.jar}"/>
wenzelm@34320
    60
            </exec>
wenzelm@34320
    61
        </target>
wenzelm@34320
    62
wenzelm@34320
    63
    Notice that the overridden target depends on the jar target and not only on 
wenzelm@34320
    64
    the compile target as the regular run target does. Again, for a list of available 
wenzelm@34320
    65
    properties which you can use, check the target you are overriding in the
wenzelm@34320
    66
    nbproject/build-impl.xml file. 
wenzelm@34320
    67
wenzelm@34320
    68
    -->
immler@34537
    69
    <target name="run" depends="Isabelle-jEdit-impl.jar,Isabelle-jEdit-impl.run">
immler@34537
    70
    </target>
immler@34537
    71
    <target name="debug" depends="Isabelle-jEdit-impl.jar,Isabelle-jEdit-impl.debug">
immler@34537
    72
    </target>
wenzelm@34329
    73
    <target name="-pre-jar">
wenzelm@34329
    74
      <copy file="plugin/services.xml" todir="${build.classes.dir}" />
wenzelm@34329
    75
      <copy file="plugin/dockables.xml" todir="${build.classes.dir}" />
wenzelm@34329
    76
      <copy file="plugin/actions.xml" todir="${build.classes.dir}" />
wenzelm@34418
    77
      <copy file="plugin/Isabelle.props" todir="${build.classes.dir}" />
wenzelm@34329
    78
    </target>
immler@34512
    79
    <target name="-post-jar">
immler@34512
    80
      <!-- jars -->
immler@34512
    81
      <delete file="${dist.dir}/jars/lib/jEdit.jar" />
immler@34512
    82
      <move todir="${dist.dir}/jars">
immler@34512
    83
        <fileset dir="${dist.dir}/jars/lib" />
immler@34512
    84
      </move>
immler@34512
    85
      <copy file="${scala.library}" todir="${dist.dir}/jars" />
immler@34684
    86
      <copy file="${scala.lib}/scala-swing.jar" todir="${dist.dir}/jars" />
immler@34512
    87
      <!-- clean up -->
immler@34512
    88
      <delete dir="{dist.dir}/jars/lib" />
immler@34512
    89
      <!-- dist-template -->
immler@34512
    90
      <copy file="dist-template/properties/jedit.props" tofile="${dist.dir}/properties" />
immler@34512
    91
      <copy todir="${dist.dir}/modes">
immler@34647
    92
        <fileset dir="dist-template/modes" />
immler@34647
    93
      </copy>
immler@34647
    94
      <copy todir="${dist.dir}/modes" overwrite="true">
immler@34647
    95
        <fileset dir="${project.jEdit}/modes" />
immler@34512
    96
      </copy>
immler@34647
    97
      <replaceregexp byline="true" file="${dist.dir}/modes/catalog">
immler@34647
    98
        <regexp pattern='(^.*NAME="javacc".*$)'/>
immler@34647
    99
        <substitution expression="&lt;MODE NAME=&quot;isabelle&quot; FILE=&quot;isabelle.xml&quot; FILE_NAME_GLOB=&quot;*.thy&quot;/&gt;${line.separator}${line.separator}\1"/>
immler@34647
   100
      </replaceregexp>
immler@34512
   101
    </target>
wenzelm@34320
   102
</project>