From f7cb843652dbf7a447c869c5b06473ec8995bbe6 Mon Sep 17 00:00:00 2001 From: Balbino Aylagas Date: Tue, 9 Nov 2021 15:40:39 -0600 Subject: [PATCH] fixed the update manifest, now created jar has modifications --- src/cfml/system/util/CompileDSL.cfc | 33 +++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/src/cfml/system/util/CompileDSL.cfc b/src/cfml/system/util/CompileDSL.cfc index b6434b82..c77b4639 100644 --- a/src/cfml/system/util/CompileDSL.cfc +++ b/src/cfml/system/util/CompileDSL.cfc @@ -99,7 +99,9 @@ component accessors=true { } function toJar( string jarName='' ) { - setJarNameString( jarName ); + if( jarName.len() ) { + setJarNameString( jarName ); + } setCreateJar( true ); return this; } @@ -119,10 +121,11 @@ component accessors=true { return this; } - function addToManifest( required string customManifest ) { + //no longer needed + /* function addToManifest( required string customManifest ) { setCustomManifest( fileSystemutil.resolvePath( customManifest, getProjectRoot() ) ); return this; - } + } */ function manifest( required struct customParams ) { setCustomManifestParams( customParams ); @@ -288,13 +291,15 @@ component accessors=true { } jarName &= word & ".jar"; - setJarNameString( jarName ); - //job.addLog( ' jarName= #jarName# ' ); } } + setJarNameString( jarName ); + //job.addLog( ' jarName= #jarName# ' ); + //job.addLog( ' jarName*= #getJarNameString()# ' ); + job.complete(); try{ @@ -308,12 +313,13 @@ component accessors=true { //j = 'run "#getJavaBinFolder()#jar" --file #currentLibsDir##jarName# #getJarOptionsString()#'; //j = 'run "#getJavaBinFolder()#jar" --create --file #currentLibsDir#testX.jar "@#tempSrcFileName#" #getJarOptionsString()#'; if( !getCustomManifest().len() ) { - j = 'run ""#getJavaBinFolder()#jar" cf "#currentLibsDir#\#jarName#" "@#tempSrcFileName#" #getJarOptionsString()#"'; + j = 'run ""#getJavaBinFolder()#jar" cf "#currentLibsDir##jarName#" "@#tempSrcFileName#" #getJarOptionsString()#"'; } else { - j = 'run ""#getJavaBinFolder()#jar" cfm "#currentLibsDir#\#jarName#" "#variables.customManifest#" "@#tempSrcFileName#" #getJarOptionsString()#"'; + j = 'run ""#getJavaBinFolder()#jar" cfm "#currentLibsDir##jarName#" "#variables.customManifest#" "@#tempSrcFileName#" #getJarOptionsString()#"'; } job.addLog( j ); - command( j ).run(echo=true); + //command( j ).run(echo=true); + command( j ).run(); } finally { if ( FileExists( tempSrcFileName ) ) { @@ -339,7 +345,7 @@ component accessors=true { j = 'run ""#getJavaBinFolder()#jar" uf "#currentLibsDir##jarName#" -C #currentResourcePath# . "' - job.addLog( j ); + //job.addLog( j ); //command( j ).run(echo=true); command( j ).run(); @@ -407,6 +413,15 @@ component accessors=true { try { writeUpdateManifestFile( tempUpdateManifestFileName, paramStruct ); } finally { + /* + if the file was created then we have to save the filename and path + to use it when creating the jar + */ + if( FileExists( tempUpdateManifestFileName ) ) { + setCustomManifest( tempUpdateManifestFileName ); + } + + // not needed here any more /* if ( FileExists( tempUpdateManifestFileName ) ) { fileDelete( tempUpdateManifestFileName ); } */