Ticket #1527: 1527_ckreleaser_2.patch
File 1527_ckreleaser_2.patch, 4.5 KB (added by , 15 years ago) |
---|
-
_source/ckreleaser.js
66 66 CKRELEASER.sourceDir = arguments[1]; 67 67 CKRELEASER.targetDir = arguments[2]; 68 68 CKRELEASER.version = arguments[3]; 69 CKRELEASER.zipName = arguments[4]; 70 CKRELEASER.targzName = arguments[5]; 69 CKRELEASER.fileName = arguments[4]; 71 70 72 if ( !CKRELEASER.releaseFile || !CKRELEASER.sourceDir || !CKRELEASER.targetDir || !CKRELEASER.version || !CKRELEASER.zipName 73 || !CKRELEASER.targzName ) 71 if ( !CKRELEASER.releaseFile || !CKRELEASER.sourceDir || !CKRELEASER.targetDir || !CKRELEASER.version || !CKRELEASER.fileName ) 74 72 { 75 error( '\nUsage: ' + command + ' release_file source_dir target_dir version zip_name targz_name [-v]' +73 error( '\nUsage: ' + command + ' release_file source_dir target_dir version file_name [-v]' + 76 74 '\n' + 77 75 '\n release_file Path to CKReleaser configuration file.' + 78 76 '\n source_dir Path to the directory with code of application to be released.' + 79 77 '\n target_dir Path to the directory, where application will be build.' + 80 78 '\n If directory already exists, CKReleaser will not start.' + 81 79 '\n version The version string used to replace the %VERSION% directive.' + 82 '\n zip_name Name of the .zip file to create.' + 83 '\n targz_name Name of the .tar.gz file to create.' + 80 '\n file_name Name of the file to create (without the extension).' + 84 81 '\n\n -v | --verbose Enable verbose output.' + 85 82 '\n Display detailed exception information when an error occurs.'); 86 83 } -
_source/includes/releaser.js
223 223 var regexLib = 224 224 { 225 225 packagerRemove : Pattern.compile( '(?m-s:^.*?%REMOVE_START%).*?(?m-s:%REMOVE_END%.*?$)', Pattern.DOTALL ), 226 packagerRemoveLine : Pattern.compile( '.*%REMOVE_LINE%.*(?:\\r\\n|\\r|\\n)?' ) 226 packagerRemoveLine : Pattern.compile( '.*%REMOVE_LINE%.*(?:\\r\\n|\\r|\\n)?' ), 227 packagerRev : Pattern.compile( '.*Revision: (\\d+).*', Pattern.DOTALL ) 227 228 }; 228 229 229 230 /* 230 231 * %VERSION%: 231 232 * the "version" string passed to the CKReleaser execution command. 233 * %REV%: 234 * the SVN revision number of the source directory. 232 235 * %TIMESTAMP%: 233 236 * a four characters string containing the 234 237 * concatenation of the "Base 36" value of each of the following components … … 249 252 text = text.replace( /%VERSION%/g, CKRELEASER.version ); 250 253 replaced = true; 251 254 } 255 if ( text.indexOf( "%REV%" ) != -1 ) 256 { 257 var o = 258 { 259 output : "" 260 }; 261 262 runCommand( "svn", "info", CKRELEASER.sourceDir, o ); 263 264 if ( o.output.indexOf( "Revision:" ) != -1 ) 265 { 266 var rev = regexLib.packagerRev.matcher( o.output ).replaceAll( '$1' ); 267 text = text.replace( /%REV%/g, rev ); 268 } 269 else 270 { 271 if ( o.output.indexOf( "not a working" ) != -1 ) 272 print( "WARNING: Unable to fetch the revision number, source directory is not under version control: " 273 + CKRELEASER.sourceDir ); 274 else 275 print( "WARNING: Unable to fetch the revision number, make sure that Subversions bin directory is in your system path." ); 276 text = text.replace( /%REV%/g, "UNKNOWN" ); 277 } 278 279 replaced = true; 280 } 252 281 if ( text.indexOf( "%TIMESTAMP%" ) != -1 ) 253 282 { 254 283 text = text.replace( /%TIMESTAMP%/g, CKRELEASER.timestamp ); … … 492 521 493 522 print( "\nCreating compressed files...\n" ); 494 523 495 var zipFile = new File( CKRELEASER.targetDir, CKRELEASER. zipName);524 var zipFile = new File( CKRELEASER.targetDir, CKRELEASER.fileName + ".zip" ); 496 525 CKRELEASER.io.zipDirectory( CKRELEASER.releaseDir, zipFile, "ckeditor" ); 497 526 print( " Created " + zipFile.getName() + "...: " + zipFile.length() + " bytes (" 498 527 + Math.round( zipFile.length() / info.size * 100 ) + "% of original)" ); 499 528 500 var tarFile = new File( CKRELEASER.targetDir, CKRELEASER. targzName);529 var tarFile = new File( CKRELEASER.targetDir, CKRELEASER.fileName + ".tar.gz" ); 501 530 CKRELEASER.io.targzDirectory( CKRELEASER.releaseDir, tarFile, "ckeditor" ); 502 531 print( " Created " + tarFile.getName() + ": " + tarFile.length() + " bytes (" 503 532 + Math.round( tarFile.length() / info.size * 100 ) + "% of original)" );