This is an automated email from the ASF dual-hosted git repository.
aharui pushed a commit to branch release_practice
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git
The following commit(s) were added to refs/heads/release_practice by this push:
new b3a549e strip timezone info before timestamping files in the swc. We
want the timestamp to be the same regardless of the timezone of the build
machine because zip format does not store timezone information
b3a549e is described below
commit b3a549ea422bed4e3912b751757f453f0c519b29
Author: Alex Harui <[email protected]>
AuthorDate: Tue May 14 23:50:16 2019 -0700
strip timezone info before timestamping files in the swc. We want the
timestamp to be the same regardless of the timezone of the build machine
because zip format does not store timezone information
---
.../org/apache/royale/compiler/clients/COMPJSC.java | 14 ++++++++++++++
.../royale/compiler/clients/COMPJSCRoyale.java | 21 +++++++++++++++++++++
.../java/org/apache/royale/swc/io/SWCWriter.java | 7 +++++++
3 files changed, 42 insertions(+)
diff --git
a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/COMPJSC.java
b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/COMPJSC.java
index 1647e30..96ccc4f 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/COMPJSC.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/COMPJSC.java
@@ -479,6 +479,13 @@ public class COMPJSC extends MXMLJSC
if (metadataDate != null)
{
String metadataFormat =
targetSettings.getSWFMetadataDateFormat();
+ // strip off timezone. Zip format
doesn't store timezone
+ // and the goal is to have the same
date and time regardless
+ // of which timezone the build machine
is using.
+ int c = metadataDate.lastIndexOf(" ");
+ metadataDate =
metadataDate.substring(0, c);
+ c = metadataFormat.lastIndexOf(" ");
+ metadataFormat =
metadataFormat.substring(0, c);
try {
SimpleDateFormat sdf = new
SimpleDateFormat(metadataFormat);
fileDate =
sdf.parse(metadataDate).getTime();
@@ -521,6 +528,13 @@ public class COMPJSC extends MXMLJSC
if (metadataDate != null)
{
String metadataFormat =
targetSettings.getSWFMetadataDateFormat();
+ // strip off timezone. Zip format doesn't
store timezone
+ // and the goal is to have the same date and
time regardless
+ // of which timezone the build machine is using.
+ int c = metadataDate.lastIndexOf(" ");
+ metadataDate = metadataDate.substring(0, c);
+ c = metadataFormat.lastIndexOf(" ");
+ metadataFormat = metadataFormat.substring(0, c);
try {
SimpleDateFormat sdf = new
SimpleDateFormat(metadataFormat);
fileDate =
sdf.parse(metadataDate).getTime();
diff --git
a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/COMPJSCRoyale.java
b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/COMPJSCRoyale.java
index 0d43610..cd5d225 100644
---
a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/COMPJSCRoyale.java
+++
b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/COMPJSCRoyale.java
@@ -214,6 +214,13 @@ public class COMPJSCRoyale extends MXMLJSCRoyale
if (metadataDate != null)
{
String metadataFormat =
targetSettings.getSWFMetadataDateFormat();
+ // strip off timezone. Zip format
doesn't store timezone
+ // and the goal is to have the same
date and time regardless
+ // of which timezone the build machine
is using.
+ int c = metadataDate.lastIndexOf(" ");
+ metadataDate =
metadataDate.substring(0, c);
+ c = metadataFormat.lastIndexOf(" ");
+ metadataFormat =
metadataFormat.substring(0, c);
try {
SimpleDateFormat sdf = new
SimpleDateFormat(metadataFormat);
fileDate =
sdf.parse(metadataDate).getTime();
@@ -358,6 +365,13 @@ public class COMPJSCRoyale extends MXMLJSCRoyale
if (metadataDate != null)
{
String metadataFormat =
targetSettings.getSWFMetadataDateFormat();
+ // strip off timezone. Zip format
doesn't store timezone
+ // and the goal is to have the same
date and time regardless
+ // of which timezone the build machine
is using.
+ int c = metadataDate.lastIndexOf(" ");
+ metadataDate =
metadataDate.substring(0, c);
+ c = metadataFormat.lastIndexOf(" ");
+ metadataFormat =
metadataFormat.substring(0, c);
try {
SimpleDateFormat sdf = new
SimpleDateFormat(metadataFormat);
fileDate =
sdf.parse(metadataDate).getTime();
@@ -408,6 +422,13 @@ public class COMPJSCRoyale extends MXMLJSCRoyale
if (metadataDate != null)
{
String metadataFormat =
targetSettings.getSWFMetadataDateFormat();
+ // strip off timezone. Zip format doesn't
store timezone
+ // and the goal is to have the same date and
time regardless
+ // of which timezone the build machine is using.
+ int c = metadataDate.lastIndexOf(" ");
+ metadataDate = metadataDate.substring(0, c);
+ c = metadataFormat.lastIndexOf(" ");
+ metadataFormat = metadataFormat.substring(0, c);
try {
SimpleDateFormat sdf = new
SimpleDateFormat(metadataFormat);
fileDate =
sdf.parse(metadataDate).getTime();
diff --git a/compiler/src/main/java/org/apache/royale/swc/io/SWCWriter.java
b/compiler/src/main/java/org/apache/royale/swc/io/SWCWriter.java
index 9509891..8ba69c5 100644
--- a/compiler/src/main/java/org/apache/royale/swc/io/SWCWriter.java
+++ b/compiler/src/main/java/org/apache/royale/swc/io/SWCWriter.java
@@ -85,6 +85,13 @@ public class SWCWriter extends SWCWriterBase
if (metadataDate != null)
{
+ // strip off timezone. Zip format doesn't store timezone
+ // and the goal is to have the same date and time regardless
+ // of which timezone the build machine is using.
+ int c = metadataDate.lastIndexOf(" ");
+ metadataDate = metadataDate.substring(0, c);
+ c = metadataFormat.lastIndexOf(" ");
+ metadataFormat = metadataFormat.substring(0, c);
try {
SimpleDateFormat sdf = new
SimpleDateFormat(metadataFormat);
fileDate = sdf.parse(metadataDate).getTime();