| 295 | | if ( !CKRELEASER.revisionNumber ) |
| 296 | | { |
| 297 | | try |
| 298 | | { |
| 299 | | var o = |
| 300 | | { |
| 301 | | output : "" |
| 302 | | }; |
| 303 | | |
| 304 | | runCommand( "svn", "info", CKRELEASER.sourceDir, o ); |
| 305 | | |
| 306 | | if ( o.output.indexOf( "Revision:" ) != -1 ) |
| 307 | | { |
| 308 | | CKRELEASER.revisionNumber = regexLib.packagerRev.matcher( o.output ).replaceAll( '$1' ); |
| 309 | | } |
| 310 | | else |
| 311 | | { |
| 312 | | if ( o.output.indexOf( "not a working" ) != -1 ) |
| 313 | | print( "\nWARNING: Unable to fetch the revision number, source directory is not under version control: " |
| 314 | | + CKRELEASER.sourceDir ); |
| 315 | | else |
| 316 | | print( "\nWARNING: Unable to fetch the revision number, make sure that Subversion's bin directory is in your system path." ); |
| 317 | | } |
| 318 | | } |
| 319 | | catch( e ) |
| 320 | | { |
| 321 | | print( "\nWARNING: Unable to run \"svn\" command to get the revision number, make sure that Subversion is installed and that Subversion's bin directory is in your system path." ); |
| 322 | | } |
| 323 | | |
| 324 | | if ( !CKRELEASER.revisionNumber ) |
| 325 | | CKRELEASER.revisionNumber = "UNKNOWN"; |
| 326 | | } |
| 327 | | |
| | 448 | if ( !CKRELEASER.revisionNumber ) |
| | 449 | { |
| | 450 | try |
| | 451 | { |
| | 452 | var o = |
| | 453 | { |
| | 454 | output : "" |
| | 455 | }; |
| | 456 | |
| | 457 | runCommand( "svn", "info", CKRELEASER.sourceDir, o ); |
| | 458 | |
| | 459 | if ( o.output.indexOf( "Revision:" ) != -1 ) |
| | 460 | CKRELEASER.revisionNumber = parseInt( regexLib.packagerRev.matcher( o.output ).replaceAll( '$1' ) ); |
| | 461 | else |
| | 462 | { |
| | 463 | if ( o.output.indexOf( "not a working" ) != -1 ) |
| | 464 | print( "\nWARNING: Unable to fetch the revision number, source directory is not under version control: " |
| | 465 | + CKRELEASER.sourceDir ); |
| | 466 | else |
| | 467 | print( "\nWARNING: Unable to fetch the revision number, make sure that Subversion's bin directory is in your system path." ); |
| | 468 | } |
| | 469 | } |
| | 470 | catch( e ) |
| | 471 | { |
| | 472 | print( "\nWARNING: Unable to run \"svn\" command to get the revision number, make sure that Subversion is installed and that Subversion's bin directory is in your system path." ); |
| | 473 | } |
| | 474 | |
| | 475 | if ( !CKRELEASER.revisionNumber ) |
| | 476 | CKRELEASER.revisionNumber = "UNKNOWN"; |
| | 477 | } |
| | 478 | |
| | 479 | if ( !CKRELEASER.timestamp ) |
| | 480 | { |
| | 481 | var now = new Date(); |
| | 482 | var timestamp = Integer.toString( now.getUTCFullYear() % 1000, 36 ) |
| | 483 | + Integer.toString( now.getUTCMonth(), 36 ) + Integer.toString( now.getUTCDate(), 36 ) |
| | 484 | + Integer.toString( now.getUTCHours(), 36 ); |
| | 485 | |
| | 486 | if ( typeof CKRELEASER.revisionNumber == 'number' ) |
| | 487 | timestamp += Integer.toString( CKRELEASER.revisionNumber, 36 ); |
| | 488 | |
| | 489 | print( '\nGenerating timestamp (base36 encode of YYMMDDHH[revision_number]): ' + timestamp.toUpperCase() ); |
| | 490 | |
| | 491 | CKRELEASER.timestamp = timestamp.toUpperCase(); |
| | 492 | } |
| | 493 | |