java/jdbc-dk-driver/build.xml
author František Kučera <franta-hg@frantovo.cz>
Tue, 26 Feb 2019 18:19:49 +0100
branchv_0
changeset 236 a3ec71fa8e17
parent 187 65d1eb327cb1
permissions -rw-r--r--
Avoid reusing/rewriting the DB connection properties.
There was weird random errors while testing connection to multiple DB in parallel when one of them was meta connection to same DB connection.
Two kinds of exception: 1) missing password 2) „Passing DB password as CLI parameter is insecure!“
franta-hg@187
     1
<?xml version="1.0" encoding="UTF-8"?>
franta-hg@187
     2
<!-- You may freely edit this file. See commented blocks below for -->
franta-hg@187
     3
<!-- some examples of how to customize the build. -->
franta-hg@187
     4
<!-- (If you delete it and reopen the project it will be recreated.) -->
franta-hg@187
     5
<!-- By default, only the Clean and Build commands use this build script. -->
franta-hg@187
     6
<!-- Commands such as Run, Debug, and Test only use this build script if -->
franta-hg@187
     7
<!-- the Compile on Save feature is turned off for the project. -->
franta-hg@187
     8
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
franta-hg@187
     9
<!-- in the project's Project Properties dialog box.-->
franta-hg@187
    10
<project name="jdbc-dk-driver" default="default" basedir=".">
franta-hg@187
    11
    <description>Builds, tests, and runs the project jdbc-dk-driver.</description>
franta-hg@187
    12
    <import file="nbproject/build-impl.xml"/>
franta-hg@187
    13
    <!--
franta-hg@187
    14
franta-hg@187
    15
    There exist several targets which are by default empty and which can be 
franta-hg@187
    16
    used for execution of your tasks. These targets are usually executed 
franta-hg@187
    17
    before and after some main targets. They are: 
franta-hg@187
    18
franta-hg@187
    19
      -pre-init:                 called before initialization of project properties
franta-hg@187
    20
      -post-init:                called after initialization of project properties
franta-hg@187
    21
      -pre-compile:              called before javac compilation
franta-hg@187
    22
      -post-compile:             called after javac compilation
franta-hg@187
    23
      -pre-compile-single:       called before javac compilation of single file
franta-hg@187
    24
      -post-compile-single:      called after javac compilation of single file
franta-hg@187
    25
      -pre-compile-test:         called before javac compilation of JUnit tests
franta-hg@187
    26
      -post-compile-test:        called after javac compilation of JUnit tests
franta-hg@187
    27
      -pre-compile-test-single:  called before javac compilation of single JUnit test
franta-hg@187
    28
      -post-compile-test-single: called after javac compilation of single JUunit test
franta-hg@187
    29
      -pre-jar:                  called before JAR building
franta-hg@187
    30
      -post-jar:                 called after JAR building
franta-hg@187
    31
      -post-clean:               called after cleaning build products
franta-hg@187
    32
franta-hg@187
    33
    (Targets beginning with '-' are not intended to be called on their own.)
franta-hg@187
    34
franta-hg@187
    35
    Example of inserting an obfuscator after compilation could look like this:
franta-hg@187
    36
franta-hg@187
    37
        <target name="-post-compile">
franta-hg@187
    38
            <obfuscate>
franta-hg@187
    39
                <fileset dir="${build.classes.dir}"/>
franta-hg@187
    40
            </obfuscate>
franta-hg@187
    41
        </target>
franta-hg@187
    42
franta-hg@187
    43
    For list of available properties check the imported 
franta-hg@187
    44
    nbproject/build-impl.xml file. 
franta-hg@187
    45
franta-hg@187
    46
franta-hg@187
    47
    Another way to customize the build is by overriding existing main targets.
franta-hg@187
    48
    The targets of interest are: 
franta-hg@187
    49
franta-hg@187
    50
      -init-macrodef-javac:     defines macro for javac compilation
franta-hg@187
    51
      -init-macrodef-junit:     defines macro for junit execution
franta-hg@187
    52
      -init-macrodef-debug:     defines macro for class debugging
franta-hg@187
    53
      -init-macrodef-java:      defines macro for class execution
franta-hg@187
    54
      -do-jar:                  JAR building
franta-hg@187
    55
      run:                      execution of project 
franta-hg@187
    56
      -javadoc-build:           Javadoc generation
franta-hg@187
    57
      test-report:              JUnit report generation
franta-hg@187
    58
franta-hg@187
    59
    An example of overriding the target for project execution could look like this:
franta-hg@187
    60
franta-hg@187
    61
        <target name="run" depends="jdbc-dk-driver-impl.jar">
franta-hg@187
    62
            <exec dir="bin" executable="launcher.exe">
franta-hg@187
    63
                <arg file="${dist.jar}"/>
franta-hg@187
    64
            </exec>
franta-hg@187
    65
        </target>
franta-hg@187
    66
franta-hg@187
    67
    Notice that the overridden target depends on the jar target and not only on 
franta-hg@187
    68
    the compile target as the regular run target does. Again, for a list of available 
franta-hg@187
    69
    properties which you can use, check the target you are overriding in the
franta-hg@187
    70
    nbproject/build-impl.xml file. 
franta-hg@187
    71
franta-hg@187
    72
    -->
franta-hg@187
    73
</project>