java/UpozorneniEmailem/build.xml
author František Kučera <franta-hg@frantovo.cz>
Sun Mar 08 22:23:47 2009 +0100 (2009-03-08)
changeset 8 123d3d185ad5
permissions -rw-r--r--
Přibalení zdrojových kódů do .war souboru
franta-hg@8
     1
<?xml version="1.0" encoding="UTF-8"?>
franta-hg@8
     2
<!-- You may freely edit this file. See commented blocks below for -->
franta-hg@8
     3
<!-- some examples of how to customize the build. -->
franta-hg@8
     4
<!-- (If you delete it and reopen the project it will be recreated.) -->
franta-hg@8
     5
<!-- By default, only the Clean and Build commands use this build script. -->
franta-hg@8
     6
<!-- Commands such as Run, Debug, and Test only use this build script if -->
franta-hg@8
     7
<!-- the Compile on Save feature is turned off for the project. -->
franta-hg@8
     8
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
franta-hg@8
     9
<!-- in the project's Project Properties dialog box.-->
franta-hg@8
    10
<project name="UpozorneniEmailem" default="default" basedir=".">
franta-hg@8
    11
    <description>Builds, tests, and runs the project UpozorneniEmailem.</description>
franta-hg@8
    12
    <import file="nbproject/build-impl.xml"/>
franta-hg@8
    13
    <!--
franta-hg@8
    14
franta-hg@8
    15
    There exist several targets which are by default empty and which can be 
franta-hg@8
    16
    used for execution of your tasks. These targets are usually executed 
franta-hg@8
    17
    before and after some main targets. They are: 
franta-hg@8
    18
franta-hg@8
    19
      -pre-init:                 called before initialization of project properties 
franta-hg@8
    20
      -post-init:                called after initialization of project properties 
franta-hg@8
    21
      -pre-compile:              called before javac compilation 
franta-hg@8
    22
      -post-compile:             called after javac compilation 
franta-hg@8
    23
      -pre-compile-single:       called before javac compilation of single file
franta-hg@8
    24
      -post-compile-single:      called after javac compilation of single file
franta-hg@8
    25
      -pre-compile-test:         called before javac compilation of JUnit tests
franta-hg@8
    26
      -post-compile-test:        called after javac compilation of JUnit tests
franta-hg@8
    27
      -pre-compile-test-single:  called before javac compilation of single JUnit test
franta-hg@8
    28
      -post-compile-test-single: called after javac compilation of single JUunit test
franta-hg@8
    29
      -pre-dist:                 called before archive building 
franta-hg@8
    30
      -post-dist:                called after archive building 
franta-hg@8
    31
      -post-clean:               called after cleaning build products 
franta-hg@8
    32
      -pre-run-deploy:           called before deploying
franta-hg@8
    33
      -post-run-deploy:          called after deploying
franta-hg@8
    34
franta-hg@8
    35
    Example of pluging an obfuscator after the compilation could look like 
franta-hg@8
    36
franta-hg@8
    37
        <target name="-post-compile">
franta-hg@8
    38
            <obfuscate>
franta-hg@8
    39
                <fileset dir="${build.classes.dir}"/>
franta-hg@8
    40
            </obfuscate>
franta-hg@8
    41
        </target>
franta-hg@8
    42
franta-hg@8
    43
    For list of available properties check the imported 
franta-hg@8
    44
    nbproject/build-impl.xml file. 
franta-hg@8
    45
franta-hg@8
    46
franta-hg@8
    47
    Other way how to customize the build is by overriding existing main targets.
franta-hg@8
    48
    The target of interest are: 
franta-hg@8
    49
franta-hg@8
    50
      init-macrodef-javac:    defines macro for javac compilation
franta-hg@8
    51
      init-macrodef-junit:   defines macro for junit execution
franta-hg@8
    52
      init-macrodef-debug:    defines macro for class debugging
franta-hg@8
    53
      do-dist:                archive building
franta-hg@8
    54
      run:                    execution of project 
franta-hg@8
    55
      javadoc-build:          javadoc generation 
franta-hg@8
    56
franta-hg@8
    57
    Example of overriding the target for project execution could look like 
franta-hg@8
    58
franta-hg@8
    59
        <target name="run" depends="<PROJNAME>-impl.jar">
franta-hg@8
    60
            <exec dir="bin" executable="launcher.exe">
franta-hg@8
    61
                <arg file="${dist.jar}"/>
franta-hg@8
    62
            </exec>
franta-hg@8
    63
        </target>
franta-hg@8
    64
franta-hg@8
    65
    Notice that overridden target depends on jar target and not only on 
franta-hg@8
    66
    compile target as regular run target does. Again, for list of available 
franta-hg@8
    67
    properties which you can use check the target you are overriding in 
franta-hg@8
    68
    nbproject/build-impl.xml file. 
franta-hg@8
    69
franta-hg@8
    70
    -->
franta-hg@8
    71
franta-hg@8
    72
    <target name="-post-init">
franta-hg@8
    73
        <property name="zdrojaky-archiv-soubor" value="web/UpozorneniEmailem-src.zip"/>
franta-hg@8
    74
        <property name="zdrojaky-archiv-komentar" value="Kódování: UTF-8 | Autor: František Kučera | Web: http://frantovo.cz/ | Licence: GNU Affero GPL, verze 3"/>
franta-hg@8
    75
        <property name="hashovani" value="SHA-512"/>
franta-hg@8
    76
franta-hg@8
    77
        <zip basedir="../../.." excludes="UpozorneniEmailem/.hg/** UpozorneniEmailem/.hgignore UpozorneniEmailem/java/UpozorneniEmailem/build/** UpozorneniEmailem/java/UpozorneniEmailem/nbproject/private/** UpozorneniEmailem/java/UpozorneniEmailem/dist/** UpozorneniEmailem/java/UpozorneniEmailem/${zdrojaky-archiv-soubor} UpozorneniEmailem/java/UpozorneniEmailem/${zdrojaky-archiv-soubor}.${hashovani} UpozorneniEmailem/licence/agpl-3.0.pdf UpozorneniEmailem/licence/agpl-3.0.tex"  includes="UpozorneniEmailem/**" encoding="UTF-8" comment="${zdrojaky-archiv-komentar}" destfile="${zdrojaky-archiv-soubor}"/>
franta-hg@8
    78
        <checksum file="${zdrojaky-archiv-soubor}" algorithm="${hashovani}" pattern="{0}  {1}"/>
franta-hg@8
    79
franta-hg@8
    80
        <manifest file="src/conf/MANIFEST.MF" mode="replace">
franta-hg@8
    81
            <attribute name="Manifest-Version" value="1.0"/>
franta-hg@8
    82
            <section name="Frantovo.cz">
franta-hg@8
    83
                <attribute name="Kompiloval" value="${user.name}"/>
franta-hg@8
    84
                <attribute name="java-version" value="${java.version}"/>
franta-hg@8
    85
                <attribute name="java-vm-version" value="${java.vm.version}"/>
franta-hg@8
    86
                <attribute name="os-name" value="${os.name}"/>
franta-hg@8
    87
                <attribute name="os-arch" value="${os.arch}"/>
franta-hg@8
    88
                <attribute name="os-version" value="${os.version}"/>
franta-hg@8
    89
            </section>
franta-hg@8
    90
        </manifest>
franta-hg@8
    91
    </target>
franta-hg@8
    92
franta-hg@8
    93
</project>