JarSizeReplacer (& JarSizeReplacerTask)


What is the JarSizeReplacer?

The JarSizeReplacer is replacing value of JAR file size in descriptor file.

It outputs to stdout, that created new descriptor file data.

supported:

A build of MIDlet Application or NTT Docomo i Application.

 1. compile(javac)
 2. verification(preverify)
 3. packaging(jar)
 4. making jad file(JarSizeReplacer!)
 

Usage

java JarSizeReplacer <JAR file path> <descriptor template file path>

Example

----- sample.jad.template - from here  -----
MIDlet-Jar-URL: sample.jar
MIDlet-Name: sample
MIDlet-Vendor: sample
MIDlet-Version: 1.0
MIDlet-Data-Size: 128
MIDlet-Resident: N
MIDlet-Network: Y
MIDlet-Application-Range: 0,0
MIDlet-Jar-Size: 0
----- sample.jad.template - up to here -----
C:\>java JarSizeReplacer sample.jar sample.jad.template > sample.jad
----- sample.jad - from here  --------------
MIDlet-Jar-URL: sample.jar
MIDlet-Name: sample
MIDlet-Vendor: sample
MIDlet-Version: 1.0
MIDlet-Data-Size: 128
MIDlet-Resident: N
MIDlet-Network: Y
MIDlet-Application-Range: 0,0
MIDlet-Jar-Size: 12345 <----- replacing value
----- sample.jad - up to here --------------

License

The MIT License

Download

source code: JarSizeReplacer.java JarSizeReplacerTask.java

JAD template sample: sample.jad.template

ADF template sample: sample.jam.template

What is the JarSizeReplacerTask?

The JarSizeReplacerTask is a task of Apache Ant. The JarSizeReplacerTask is replacing value of JAR file size in descriptor file.

Example:

 // compile
 C:\>javac -classpath C:\ant\lib\ant.jar JarSizeReplacer.java JarSizeReplacerTask.java
 
 // jar
 C:\>jar -cvf jsr.jar JarSizeReplacer.class JarSizeReplacerTask.class
 
 // copy
 C:\>copy jsr.jar C:\ant\lib
 
 // ant 
 C:\>ant
 Buildfile: build.xml
 
 init:
 
 jsr:
   [jsr] The JarSizeReplacerTask created 'sample.jad'
   [jsr] JAR file path is 'sample.jar'
   [jsr] The descriptor template file path is 'sample.jad.template'
 
 BUILD SUCCESSFUL
 Total time: 0 seconds
 
 --- example of build.xml ---
 <?xml version="1.0"?>
 <project name="sample" default="jsr" basedir=".">
 
   <target name="init">
     <taskdef name="jsr" classname="JarSizeReplacerTask" />
   </target>
 
   <target name="jsr" depends="init" description="jsr">
     <jsr jarfile="sample.jar" descriptortemplatefile="sample.jad.template" destfile="sample.jad" />
   </target>
 
 </project>
 

API Reference(by JavaDoc)

API Reference

How to compile

Example:

C:\>javac -classpath C:\ant\lib\ant.jar JarSizeReplacer.java JarSizeReplacerTask.java

How to make english API reference by Javadoc

Example:

C:\>javadoc -locale en_US -classpath C:\ant\lib\ant.jar -version -author -breakiterator -windowtitle "JarSizeReplacer" JarSizeReplacer.java JarSizeReplacerTask.java
Loading source file JarSizeReplacer.java...
Loading source file JarSizeReplacerTask.java...
Constructing Javadoc information...
Standard Doclet version 1.4.0

Generating constant-values.html...
Building tree for all the packages and classes...
Building index for all the packages and classes...
Generating overview-tree.html...
Generating index-all.html...
Generating deprecated-list.html...
Building index for all classes...
Generating allclasses-frame.html...
Generating allclasses-noframe.html...
Generating index.html...
Generating packages.html...
Generating JarSizeReplacer.html...
Generating JarSizeReplacerTask.html...
Generating package-list...
Generating help-doc.html...
Generating stylesheet.css...

Similar Products?

This page's information.

author: NI-Lab.