Nokia nmake Product Builder: Java Support

:JAR: Assertion Operator

:JAR: - build and maintain jar files

Description

The :JAR: assertion builds and maintains jar files, with support for viewpathing, index files, and manifest files. Multiple :JAR: assertions are supported in a single Makefile.

name.jar :JAR: [manifest-file][JARROOT=root_dir] files

where:

name.jar
The target jar file to be created.
files
Files to include in the jar, typically class files, specified using full ksh-style shell patterns. Non-absolute paths are relative to the current directory and must begin with a prefix of $(JARROOT). Paths in the resulting jar file are relative to $(JARROOT).
manifest-file
The name of manifest file, used to merge its contents to the target jar file as one part of the internal manifest file. By default, filenames with suffix .mf are automatically recognized as manifest files. In general, filenames marked with the .JARMANIFEST attribute are taken as manifest files.
JARROOT
The root of the package of prerequisite files for the jar archive specified relative to the current directory. The default is the current directory.

Removing a File from the Build

Similar to :JAVA:, java source files containing the string ``#empty'' outside of comment sections and as the first item on a line are excluded from jar archives when archiving source files. Changing a file to ``#empty'' masks old versions of the file in the viewpath. See the :JAVA: manual page for more information.

By default class files are not affected. To exclude ``#empty'' class files include the following in the makefiles:

.ATTRIBUTE.%.class : .SCAN.java

If a member of a jar archive is changed to ``#empty'' in an incremental build then it is removed from the target jar file. If all members become ``#empty'' then a zero sized file is created for the target jar to mask out old versions of the jar in the viewpath.

Variables and Atoms

The following user-settable variables may be used:

JAR
Jar tool. Defaults to jar.
JARFLAGS
Extra flags for jar command. Defaults to null.
jarappend
Controls whether an existing jar file will be replaced or appended. Setting this to 1 will append to an existing jar file that is out of sync with the current state file thus allowing multiple makefiles to maintain members in the same jar. Setting to 0 or null will clobber an existing jar file that is out of sync with the current state file and remake it. Defaults to null.

The following attribute may be used:

.JARMANIFEST
Attribute to identify jar manifest file defined by user.

Example

$echo $VPATH
/home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar:/home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar2:/home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar3
$pwd
/home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar/test
$cat Makefile
:ALL:
stc0.jar :JAR: testclass/*.class JARROOT=$(VROOT)/test/testclass
stc1.jar :JAR: testclass/com/alcatel_lucent/$(ns)/$(ns).class wang.mf
stc2.jar :JAR: testclass/(com|com1)/*.(class|gif)
stc3.jar :JAR: testclass/com/alcatel_lucent/p[12]/*.@(class|gif)
stc4.jar :JAR: testclass/com/alcatel_lucent/p?/*.class image/*/*.gif

$nmake
-- Making stc0.jar --
+ cd /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar2/test/testclass
+ jar cf /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar/test/stc0.jar com/alcatel_lucent/p2/CC.class com/alcatel_lucent/p2/DD.class com/alcatel_lucent/p2/pkg21/E.class com/alcatel_lucent/p2/pkg21/F.class com/alcatel_lucent/p2/pkg22/G.class com/alcatel_lucent/p2/pkg22/H.class
+ cd /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar/test/testclass
+ jar uf /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar/test/stc0.jar com/AAAA.class com/BBBB.class com/alcatel_lucent/AAA.class com/alcatel_lucent/BBB.class com/alcatel_lucent/p1/AA.class com/alcatel_lucent/p1/BB.class com/alcatel_lucent/p1/pkg11/A.class com/alcatel_lucent/p1/pkg11/B.class com/alcatel_lucent/p1/pkg12/C.class com/alcatel_lucent/p1/pkg12/D.class
+ jar i /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar/test/stc0.jar
-- Making stc1.jar --
+ cd /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar2/test
+ jar cf /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar/test/stc1.jar testclass/com/alcatel_lucent/p2/CC.class testclass/com/alcatel_lucent/p2/DD.class
+ cd /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar/test
+ jar uf /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar/test/stc1.jar testclass/com/alcatel_lucent/p1/AA.class testclass/com/alcatel_lucent/p1/BB.class
+ jar umf wang.mf /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar/test/stc1.jar
+ jar i /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar/test/stc1.jar
-- Making stc2.jar --
+ cd /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar2/test
+ jar cf /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar/test/stc2.jar testclass/com/alcatel_lucent/p2/CC.class testclass/com/alcatel_lucent/p2/DD.class testclass/com/alcatel_lucent/p2/pkg21/E.class testclass/com/alcatel_lucent/p2/pkg21/F.class testclass/com/alcatel_lucent/p2/pkg22/G.class testclass/com/alcatel_lucent/p2/pkg22/H.class
+ cd /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar/test
+ jar uf /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar/test/stc2.jar testclass/com/AAAA.class testclass/com/BBBB.class testclass/com/alcatel_lucent/AAA.class testclass/com/alcatel_lucent/BBB.class testclass/com/alcatel_lucent/p1/AA.class testclass/com/alcatel_lucent/p1/BB.class testclass/com/alcatel_lucent/p1/pkg11/A.class testclass/com/alcatel_lucent/p1/pkg11/B.class testclass/com/alcatel_lucent/p1/pkg12/C.class testclass/com/alcatel_lucent/p1/pkg12/D.class
+ jar i /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar/test/stc2.jar
-- Making stc3.jar --
+ cd /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar2/test
+ jar cf /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar/test/stc3.jar testclass/com/alcatel_lucent/p2/CC.class testclass/com/alcatel_lucent/p2/DD.class testclass/com/alcatel_lucent/p2/pkg21/E.class testclass/com/alcatel_lucent/p2/pkg21/F.class testclass/com/alcatel_lucent/p2/pkg22/G.class testclass/com/alcatel_lucent/p2/pkg22/H.class
+ cd /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar/test
+ jar uf /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar/test/stc3.jar testclass/com/alcatel_lucent/p1/AA.class testclass/com/alcatel_lucent/p1/BB.class testclass/com/alcatel_lucent/p1/pkg11/A.class testclass/com/alcatel_lucent/p1/pkg11/B.class testclass/com/alcatel_lucent/p1/pkg12/C.class testclass/com/alcatel_lucent/p1/pkg12/D.class
+ jar i /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar/test/stc3.jar
-- Making stc4.jar --
+ cd /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar3/test
+ jar cf /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar/test/stc4.jar image/com1/CCCC.gif image/com1/alcatel_lucent/CCC.gif image/com1/alcatel_lucent/p1/CC.gif image/com1/alcatel_lucent/p1/pkg11/C1.gif image/com1/alcatel_lucent/p1/pkg11/C2.gif image/com1/alcatel_lucent/p1/pkg12/C3.gif image/com1/alcatel_lucent/p1/pkg12/C4.gif
+ cd /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar2/test
+ jar uf /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar/test/stc4.jar testclass/com/alcatel_lucent/p2/CC.class testclass/com/alcatel_lucent/p2/DD.class testclass/com/alcatel_lucent/p2/pkg21/E.class testclass/com/alcatel_lucent/p2/pkg21/F.class testclass/com/alcatel_lucent/p2/pkg22/G.class testclass/com/alcatel_lucent/p2/pkg22/H.class
+ cd /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar/test
+ jar uf /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar/test/stc4.jar testclass/com/alcatel_lucent/p1/AA.class testclass/com/alcatel_lucent/p1/BB.class test-class/com/alcatel_lucent/p1/pkg11/A.class testclass/com/alcatel_lucent/p1/pkg11/B.class testclass/com/alcatel_lucent/p1/pkg12/C.class testclass/com/alcatel_lucent/p1/pkg12/D.class
+ jar i /home/hqwang/nmake/MR/lu3.6/jdeps010013/mr_jar/test/stc4.jar

Notes

See Also

:JAVA:, npwj(1).


Copyright 2004 Lucent Technologies Inc. Copyright 2007, 2008 Alcatel-Lucent. All Rights Reserved.
See http://www.bell-labs.com/project/nmake/licenseagreement.html for terms of use.

:JAR: - build and maintain jar files
Release 10 @(#)jarman.html 10.1.2.1 08/08/07