#!/bin/bash
## This is a batch file first. Call of zbnfjax calls the zmake with the given zmake-rule-file.
## The input for the make rules in ZBNF is the same like this file. It may be also another file, but it is a good idea to do so.
zbnfjax zmakeAnt zmake_test_zbnfjax.sh

## exit the shell here.
exit 0

## After exit, the lines weren't interpreting by the batch execution.
## The start of the Zmake rules in the same file starts after ZMAKE_RULES: at begin of a line.

## The start of the Zmake rules in the same, the script file:
ZMAKE_RULES:
[?NOTE: this is a included comment. The C/Java-like string /*...*/ is not useable here because the sequence /* occurs in pathes. ?]
//This examples demonstrates the using of file copy features of ANT in junction with Zmake. Visit the generated ant.xml-Files!

//example1: copies files from several sources flat to destination. Note the position of : in path!
test1/** := copyNewerFiles(../../srcJava_Zbnf/org/vishia/zbnf:ZbnfParser.java, ../../srcJava_Zbnf/org/vishia/util:FileSystem.java);

//example2: copies not flat but with a part from sourcepath.
test2/** := copyNewerFiles(../../srcJava_Zbnf/org/vishia:zbnf/ZbnfParser.java, ../../srcJava_Zbnf/org/vishia:util/FileSystem.java);

//example3: The common srcpath is named.
test3/** := copyNewerFiles(srcpath="../../srcJava_Zbnf", org/vishia/zbnf/ZbnfParser.java, org/vishia/util/FileSystem.java);

//example 4: wildcard for all files under srcJava/org/vishia, but copy only from folder belos vihia:
test4/** := copyNewerFiles(../../srcJava_Zbnf/org/vishia:**);

//example 5: use two wildcards.
test5/** := copyNewerFiles(../../srcJava_Zbnf/org/vishia/zbnf:**, ../../srcJava_Zbnf/org/vishia/util:**);

//example 6: use a common srcpath for both pathes.
test6/** := copyNewerFiles(srcpath="../../srcJava_Zbnf", org:vishia/zbnf/**, org:vishia/util/**);

//example 7: use wildcard in path
test7/** := copyNewerFiles(../../srcJava_Zbnf/org:vishia/**/*.java);

//This task demonstrates the using of a fileset.

$srcfiles=fileset
( vishia/util/*.java
, vishia/zbnf/ZbnfParser.java
);

test8/** := copyNewerFiles(srcpath="../../srcJava_Zbnf/org", $srcfiles);

//This task demonstrates the calling of an conventionell maker in ANT.
//Note that ANT excutes nothing because the ZmakeStd.xsl contains the generation variant,
//  that the existing of libTRCA.mak is tested. As it is not existing, no execution is done. Visit the tmp/ant_zmake_test.xml!

libWinD/libTRCAD.lib := msMake(libWinD/libTRCA.mak, $srcfiles, delete="libWinD/debug");

//This task demonstrates the zip routine of ant!
test9/test.zip := zipFiles("../../srcJava_Zbnf:org/vishia/**" + "..:ByteDataAccessJava/**");

