| java.lang.Object tide.export.JarCreation
JarCreation | final public class JarCreation (Code) | | Creation of the project jar file, with a lot of associated features.
|
Method Summary | |
public static Process | addFilesFromSourceFolder(File jarExecutor, File jarFile, File source_home, boolean includeSourceFiles, boolean includeResourceFiles, List<String> ignoredEndings) | public static void | compress_pack200(File src, File dest) pack200 and gzipped, => very good compression success... | public static void | createBatchLauncher(File javaExecutor, File jarFile, String jvmOptions, String appOptions) A small batch launcher to start the jar app with the JVM arguments
( A double click on a jar will ignore them... | public static Process | createClassesJarFile(File jarExecutor, File jarFile, File classesDest, String mainClassName, List<File> classPath, File customManifestFile) | public static void | createJNLPLauncher(File jarFile, String jvmOptions, String appOptions, String mainClassJavaName, List<File> classPath, String codeBase, String title, String vendor, String homepage, String descr, String j2seversion, String xmx, boolean isSigned) A jnlp launcher to start the jar through the net. | public static void | create_separate_SourcesZipFile(File sources_home, List<SourceFile> allSources, List<File> resources, File dest) | public static Process | indexJarFile(File jarExecutor, File jarFile) Since 1.3, create an index (incomplete ! ?) of the jar and the jars in the class-path. | public static void | replaceJarWithPack200Decompressed(File jarFile, File pack200GzFile) Pack200 rearranges the contents of the resultant JAR file. |
addFilesFromSourceFolder | public static Process addFilesFromSourceFolder(File jarExecutor, File jarFile, File source_home, boolean includeSourceFiles, boolean includeResourceFiles, List<String> ignoredEndings) throws Exception(Code) | | Updates the given jar file with all the given files from the source folder (images, .java, ...)
null if no files are found. |
compress_pack200 | public static void compress_pack200(File src, File dest) throws Exception(Code) | | pack200 and gzipped, => very good compression success... 5 to 9 on pure class contents!
Be careful, the signature is NOT conservated, because pack200
let a great freedom for the reconstruction, some variable tables may be shuffled !
and sha-1 and other bytecode verifications are no more of same signature !!!
=> normalize the jar before signing !
PROBLEM: uses JVM memory and causes problems... => call in another JVM !
|
createBatchLauncher | public static void createBatchLauncher(File javaExecutor, File jarFile, String jvmOptions, String appOptions) throws Exception(Code) | | A small batch launcher to start the jar app with the JVM arguments
( A double click on a jar will ignore them... [Jan2006] ).
|
createClassesJarFile | public static Process createClassesJarFile(File jarExecutor, File jarFile, File classesDest, String mainClassName, List<File> classPath, File customManifestFile) throws Exception(Code) | | Parameters: customManifestFile - is null (normal case), a correct and complete manif will be createdDon't include classes excluded from project !( they are also not compiled => not in the classes folder )=> project must be cleared and compiled first. |
createJNLPLauncher | public static void createJNLPLauncher(File jarFile, String jvmOptions, String appOptions, String mainClassJavaName, List<File> classPath, String codeBase, String title, String vendor, String homepage, String descr, String j2seversion, String xmx, boolean isSigned) throws Exception(Code) | | A jnlp launcher to start the jar through the net.
Overtakes most settings from the project, as classpath, main method, ...
app arguments, jvm arguments (not all are supported, be careful !)
|
create_separate_SourcesZipFile | public static void create_separate_SourcesZipFile(File sources_home, List<SourceFile> allSources, List<File> resources, File dest) throws Exception(Code) | | To retrieve all the sources, use
List allSources = MainEditorFrame.instance.sourcesTreePanel.getTreeModel().getAllSourceFiles();
|
indexJarFile | public static Process indexJarFile(File jarExecutor, File jarFile) throws Exception(Code) | | Since 1.3, create an index (incomplete ! ?) of the jar and the jars in the class-path.
Important: the files to index are prsent in the classpath manifest entry and MUST be present
in the destination folder (where the jar is)
|
replaceJarWithPack200Decompressed | public static void replaceJarWithPack200Decompressed(File jarFile, File pack200GzFile) throws Exception(Code) | | Pack200 rearranges the contents of the resultant JAR file. The jarsigner hashes the contents of the class file
and stores the hash in an encrypted digest in the manifest. When the unpacker runs on a packed packed, the contents
of the classes will be rearranged and thus invalidate the signature. Therefore, the JAR file must be normalized first
using pack200 and unpack200, and thereafter signed.
[Nov2007] Could be also made with "pack200 --repack myarchive.jar"
(Here's why this works: Any reordering the packer does of any classfile structures is idempotent, so the second packing
does not change the orderings produced by the first packing. Also, the unpacker is guaranteed by the JSR 200 specification
to produce a specific bytewise image for any given transmission ordering of archive elements.)
|
|
|