-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MJAVADOC-627 make output jars reproducible like m-source-p
- Loading branch information
Showing
11 changed files
with
111 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
|
||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import java.io.*; | ||
import java.util.*; | ||
import java.util.jar.*; | ||
|
||
boolean result = true; | ||
|
||
try | ||
{ | ||
File target1 = new File( basedir, "test1/target/test1-1.0-SNAPSHOT-javadoc.jar" ); | ||
if ( !target1.exists() ) | ||
{ | ||
System.err.println( "Javadoc jar for module test1 is missing." ); | ||
return false; | ||
} | ||
|
||
File target2 = new File( basedir, "test2/target/test2-1.0-SNAPSHOT-javadoc.jar" ); | ||
if ( !target2.exists() ) | ||
{ | ||
System.err.println( "Javadoc jar for module test2 is missing." ); | ||
return false; | ||
} | ||
|
||
JarFile jar = new JarFile( target1 ); | ||
Enumeration jarEntries = jar.entries(); | ||
long timestamp = -1; | ||
while ( jarEntries.hasMoreElements() ) | ||
{ | ||
JarEntry entry = (JarEntry) jarEntries.nextElement(); | ||
if ( timestamp == -1 ) | ||
{ | ||
timestamp = entry.getTime(); // reproducible timestamp in jar file cause local timestamp depending on timezone | ||
} | ||
if ( entry.getTime() != timestamp ) | ||
{ | ||
System.out.println( "wrong entry time for " + entry.getName() + ": " + entry.getTime() + " instead of " + timestamp ); | ||
return false; | ||
} | ||
} | ||
jarEntries = new JarFile( target1 ).entries(); | ||
while ( jarEntries.hasMoreElements() ) | ||
{ | ||
JarEntry entry = (JarEntry) jarEntries.nextElement(); | ||
if ( entry.getTime() != timestamp ) | ||
{ | ||
System.out.println( "wrong entry time for " + entry.getName() + ": " + entry.getTime() + " instead of " + timestamp ); | ||
return false; | ||
} | ||
} | ||
} | ||
catch( IOException e ) | ||
{ | ||
e.printStackTrace(); | ||
result = false; | ||
} | ||
|
||
return result; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters