|
@@ -365,16 +365,19 @@ |
365 |
365 |
|
|
366 |
366 |
|
int zCurVersion = extractVersionFromUrlPattern( zWarWebXml ); |
367 |
367 |
|
|
368 |
|
- |
File zIndexHtmlFile = new File( mCanonicalProjectDir, "war/v" + zCurVersion + "/index.html" ); |
|
368 |
+ |
String zWarResourceRelativePathCurrent = "warResources/v" + zCurVersion; |
|
369 |
+ |
|
|
370 |
+ |
File zIndexHtmlFile = new File( mCanonicalProjectDir, zWarResourceRelativePathCurrent + "/index.html" ); |
369 |
371 |
|
String zIndexHtml = assertVersionedIndexHtml( zIndexHtmlFile, zCurVersion ); |
370 |
372 |
|
|
371 |
373 |
|
List<File> zVersionedGwtXmlFiles = findVersionedGwtXmlFiles( zCurVersion ); |
372 |
374 |
|
|
373 |
375 |
|
int zNewVersion = zCurVersion + 1; |
374 |
376 |
|
|
375 |
|
- |
if ( new File( mCanonicalProjectDir, "war/v" + zNewVersion ).exists() ) |
|
377 |
+ |
String zWarResourceRelativePathNew = "warResources/v" + zNewVersion; |
|
378 |
+ |
if ( new File( mCanonicalProjectDir, zWarResourceRelativePathNew ).exists() ) |
376 |
379 |
|
{ |
377 |
|
- |
throw new IllegalStateException( "Project already contains a 'war/v" + zNewVersion + "' directory?" ); |
|
380 |
+ |
throw new IllegalStateException( "Project already contains a 'warResources/v" + zNewVersion + "' directory?" ); |
378 |
381 |
|
} |
379 |
382 |
|
|
380 |
383 |
|
progress( "versionGWT: " + this + " | " + zCurVersion + " -> " + (zCurVersion + 1) ); |
|
@@ -384,10 +387,14 @@ |
384 |
387 |
|
{ |
385 |
388 |
|
progress( " " + zFile.getPath() ); |
386 |
389 |
|
} |
|
390 |
+ |
progress( " " + zWarResourceRelativePathCurrent + " -> " + zWarResourceRelativePathNew ); |
|
391 |
+ |
|
|
392 |
+ |
new Paths( zWarResourceRelativePathCurrent ).copyTo( zWarResourceRelativePathNew ); |
|
393 |
+ |
|
|
394 |
+ |
updateFileContents( new File( mCanonicalProjectDir, zWarResourceRelativePathNew + "/index.html" ), updateVersionedIndexHtml( zIndexHtml, zCurVersion, zNewVersion ) ); |
387 |
395 |
|
|
388 |
|
- |
new Paths( "war/v" + zCurVersion ).copyTo( "war/v" + zNewVersion ); |
389 |
|
- |
updateFileContents( new File( mCanonicalProjectDir, "war/v" + zNewVersion + "/index.html" ), updateVersionedIndexHtml( zIndexHtml, zCurVersion, zNewVersion ) ); |
390 |
396 |
|
updateFileContents( zWarWebXmlFile, updateVersionedWebXml( zWarWebXml, zCurVersion, zNewVersion ) ); |
|
397 |
+ |
|
391 |
398 |
|
for ( File zFile : zVersionedGwtXmlFiles ) |
392 |
399 |
|
{ |
393 |
400 |
|
updateFileContents( zFile, updateVersionedGwtXmlFile( fileContents( zFile ), zCurVersion, zNewVersion ) ); |
|
@@ -397,10 +404,10 @@ |
397 |
404 |
|
String redirectScript = "var loc = window.location.href;\n" + // |
398 |
405 |
|
"var at = loc.indexOf( '" + zCurPathVersion + "' );\n" + // |
399 |
406 |
|
"window.location.href = loc.substring(0, at) + '/v" + zNewVersion + "' + loc.substring(at + " + zCurPathVersion.length() + ");\n"; |
400 |
|
- |
updateFileContents( new File( mCanonicalProjectDir, "war/v" + zCurVersion + "/v" + zCurVersion + ".nocache.js" ), redirectScript ); |
|
407 |
+ |
updateFileContents( new File( mCanonicalProjectDir, zWarResourceRelativePathCurrent + "/v" + zCurVersion + ".nocache.js" ), redirectScript ); |
401 |
408 |
|
|
402 |
409 |
|
// Update the "root" html (if it exists) |
403 |
|
- |
File zRootHtmlFile = new File( mCanonicalProjectDir, "war/index.html" ); |
|
410 |
+ |
File zRootHtmlFile = new File( mCanonicalProjectDir, "warResources/index.html" ); |
404 |
411 |
|
if ( zRootHtmlFile.isFile() ) |
405 |
412 |
|
{ |
406 |
413 |
|
updateFileContents( zRootHtmlFile, updateRootHTML( fileContents( zRootHtmlFile ), zCurVersion, zNewVersion ) ); |