build.xml
authorFrantišek Kučera <franta-hg@frantovo.cz>
Tue, 23 Apr 2013 22:04:43 +0200
changeset 836569976087aa
parent 82 956501cb9ec8
child 84 ee75bd007626
build.xml
java/sql-vyuka/build.xml
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/java/sql-vyuka/build.xml	Tue Apr 23 22:04:43 2013 +0200
     1.3 @@ -0,0 +1,93 @@
     1.4 +<?xml version="1.0" encoding="UTF-8"?>
     1.5 +<!-- You may freely edit this file. See commented blocks below for -->
     1.6 +<!-- some examples of how to customize the build. -->
     1.7 +<!-- (If you delete it and reopen the project it will be recreated.) -->
     1.8 +<!-- By default, only the Clean and Build commands use this build script. -->
     1.9 +<!-- Commands such as Run, Debug, and Test only use this build script if -->
    1.10 +<!-- the Compile on Save feature is turned off for the project. -->
    1.11 +<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
    1.12 +<!-- in the project's Project Properties dialog box.-->
    1.13 +<project name="sql-vyuka" default="default" basedir=".">
    1.14 +    <description>Builds, tests, and runs the project sql-vyuka.</description>
    1.15 +    <import file="nbproject/build-impl.xml"/>
    1.16 +    <!--
    1.17 +
    1.18 +    There exist several targets which are by default empty and which can be 
    1.19 +    used for execution of your tasks. These targets are usually executed 
    1.20 +    before and after some main targets. They are: 
    1.21 +
    1.22 +      -pre-init:                 called before initialization of project properties 
    1.23 +      -post-init:                called after initialization of project properties 
    1.24 +      -pre-compile:              called before javac compilation 
    1.25 +      -post-compile:             called after javac compilation 
    1.26 +      -pre-compile-single:       called before javac compilation of single file
    1.27 +      -post-compile-single:      called after javac compilation of single file
    1.28 +      -pre-compile-test:         called before javac compilation of JUnit tests
    1.29 +      -post-compile-test:        called after javac compilation of JUnit tests
    1.30 +      -pre-compile-test-single:  called before javac compilation of single JUnit test
    1.31 +      -post-compile-test-single: called after javac compilation of single JUunit test
    1.32 +      -pre-dist:                 called before archive building 
    1.33 +      -post-dist:                called after archive building 
    1.34 +      -post-clean:               called after cleaning build products 
    1.35 +      -pre-run-deploy:           called before deploying
    1.36 +      -post-run-deploy:          called after deploying
    1.37 +
    1.38 +    Example of pluging an obfuscator after the compilation could look like 
    1.39 +
    1.40 +        <target name="-post-compile">
    1.41 +            <obfuscate>
    1.42 +                <fileset dir="${build.classes.dir}"/>
    1.43 +            </obfuscate>
    1.44 +        </target>
    1.45 +
    1.46 +    For list of available properties check the imported 
    1.47 +    nbproject/build-impl.xml file. 
    1.48 +
    1.49 +
    1.50 +    Other way how to customize the build is by overriding existing main targets.
    1.51 +    The target of interest are: 
    1.52 +
    1.53 +      init-macrodef-javac:    defines macro for javac compilation
    1.54 +      init-macrodef-junit:   defines macro for junit execution
    1.55 +      init-macrodef-debug:    defines macro for class debugging
    1.56 +      do-dist:                archive building
    1.57 +      run:                    execution of project 
    1.58 +      javadoc-build:          javadoc generation 
    1.59 +
    1.60 +    Example of overriding the target for project execution could look like 
    1.61 +
    1.62 +        <target name="run" depends="<PROJNAME>-impl.jar">
    1.63 +            <exec dir="bin" executable="launcher.exe">
    1.64 +                <arg file="${dist.jar}"/>
    1.65 +            </exec>
    1.66 +        </target>
    1.67 +
    1.68 +    Notice that overridden target depends on jar target and not only on 
    1.69 +    compile target as regular run target does. Again, for list of available 
    1.70 +    properties which you can use check the target you are overriding in 
    1.71 +    nbproject/build-impl.xml file. 
    1.72 +
    1.73 +    -->
    1.74 +
    1.75 +    <target name="-post-init">
    1.76 +        <property name="zdrojaky-archiv-soubor" value="web/sql-vyuka-src.zip"/>
    1.77 +        <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"/>
    1.78 +        <property name="hashovani" value="SHA-512"/>
    1.79 +
    1.80 +        <zip basedir="../../.." excludes="sql-vyuka/html/** sql-vyuka/.hg/** sql-vyuka/.hgignore sql-vyuka/java/sql-vyuka/build/** sql-vyuka/java/sql-vyuka/nbproject/private/** sql-vyuka/java/sql-vyuka/dist/** sql-vyuka/balíčky/** sql-vyuka/temp/** sql-vyuka/java/sql-vyuka/${zdrojaky-archiv-soubor} sql-vyuka/java/sql-vyuka/${zdrojaky-archiv-soubor}.${hashovani} sql-vyuka/licence/agpl-3.0.pdf sql-vyuka/licence/agpl-3.0.tex"  includes="sql-vyuka/**" encoding="UTF-8" comment="${zdrojaky-archiv-komentar}" destfile="${zdrojaky-archiv-soubor}"/>
    1.81 +        <checksum file="${zdrojaky-archiv-soubor}" algorithm="${hashovani}" pattern="{0}  {1}"/>
    1.82 +
    1.83 +        <manifest file="src/conf/MANIFEST.MF" mode="replace">
    1.84 +            <attribute name="Manifest-Version" value="1.0"/>
    1.85 +            <section name="Frantovo.cz">
    1.86 +                <attribute name="Kompiloval" value="${user.name}"/>
    1.87 +                <attribute name="java-version" value="${java.version}"/>
    1.88 +                <attribute name="java-vm-version" value="${java.vm.version}"/>
    1.89 +                <attribute name="os-name" value="${os.name}"/>
    1.90 +                <attribute name="os-arch" value="${os.arch}"/>
    1.91 +                <attribute name="os-version" value="${os.version}"/>
    1.92 +            </section>
    1.93 +        </manifest>
    1.94 +    </target>
    1.95 +
    1.96 +</project>