Return-Path: X-Original-To: apmail-flex-dev-archive@www.apache.org Delivered-To: apmail-flex-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CA4571843E for ; Thu, 2 Jul 2015 15:38:05 +0000 (UTC) Received: (qmail 37718 invoked by uid 500); 2 Jul 2015 15:38:05 -0000 Delivered-To: apmail-flex-dev-archive@flex.apache.org Received: (qmail 37680 invoked by uid 500); 2 Jul 2015 15:38:05 -0000 Mailing-List: contact dev-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list dev@flex.apache.org Received: (qmail 37668 invoked by uid 99); 2 Jul 2015 15:38:05 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jul 2015 15:38:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 99A941A64B3 for ; Thu, 2 Jul 2015 15:38:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.79 X-Spam-Level: X-Spam-Status: No, score=0.79 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Xh1b37fJXIDN for ; Thu, 2 Jul 2015 15:37:55 +0000 (UTC) Received: from DUB004-OMC4S7.hotmail.com (dub004-omc4s7.hotmail.com [157.55.2.82]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 2311924C25 for ; Thu, 2 Jul 2015 15:37:55 +0000 (UTC) Received: from DUB118-W27 ([157.55.2.72]) by DUB004-OMC4S7.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Thu, 2 Jul 2015 08:37:49 -0700 X-TMN: [jGrUO12K2A6o6qTwiUkR3lHmKx2tvRXl] X-Originating-Email: [webdoublefx@hotmail.com] Message-ID: From: =?iso-8859-1?B?RnLpZOlyaWMgVEhPTUFT?= To: "dev@flex.apache.org" Subject: RE: [2/2] git commit: [flex-falcon] [refs/heads/develop] - GCC and externs: add the 'externs.js' files to the SWCs; tell GCC to use those to prevent renaming Date: Thu, 2 Jul 2015 16:37:48 +0100 Importance: Normal In-Reply-To: References: , ,, Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginalArrivalTime: 02 Jul 2015 15:37:49.0099 (UTC) FILETIME=[0CE71FB0:01D0B4DD] > Are you using IntelliJ?=0A= =0A= Yes=0A= =0A= > I'll post my command line script=2C if that might help?=0A= =0A= ok=0A= =0A= Fr=E9d=E9ric THOMAS=0A= =0A= =0A= ----------------------------------------=0A= > From: erik@ixsoftware.nl=0A= > Date: Thu=2C 2 Jul 2015 17:33:12 +0200=0A= > Subject: Re: [2/2] git commit: [flex-falcon] [refs/heads/develop] - GCC a= nd externs: add the 'externs.js' files to the SWCs=3B tell GCC to use those= to prevent renaming=0A= > To: dev@flex.apache.org=0A= >=0A= > Are you using IntelliJ?=0A= >=0A= > Then you're on your own :-P=0A= >=0A= > I'll post my command line script=2C if that might help?=0A= >=0A= > EdB=0A= >=0A= >=0A= >=0A= > On Thu=2C Jul 2=2C 2015 at 5:31 PM=2C Fr=E9d=E9ric THOMAS =0A= > wrote:=0A= >=0A= >>=0A= >>> This commit makes the 'release' version of Fred's excellent example wor= k=0A= >>> (with warnings). Don't forget to rebuild the 'jquery' externs SWC=2C as= it=0A= >>> needs to pick up the JS file.=0A= >>=0A= >> I rebuilt falcon=2C the externs=2C the project and I still have=0A= >> Uncaught ReferenceError: Main is not defined=0A= >> with js-release=2C what did I miss ?=0A= >>=0A= >> Thanks=2C=0A= >> Fr=E9d=E9ric THOMAS=0A= >>=0A= >>=0A= >> ----------------------------------------=0A= >>> From: erikdebruin@apache.org=0A= >>> Date: Thu=2C 2 Jul 2015 15:19:13 +0200=0A= >>> Subject: Re: [2/2] git commit: [flex-falcon] [refs/heads/develop] - GCC= =0A= >> and externs: add the 'externs.js' files to the SWCs=3B tell GCC to use t= hose=0A= >> to prevent renaming=0A= >>> To: dev@flex.apache.org=0A= >>>=0A= >>> This commit makes the 'release' version of Fred's excellent example wor= k=0A= >>> (with warnings). Don't forget to rebuild the 'jquery' externs SWC=2C as= it=0A= >>> needs to pick up the JS file.=0A= >>>=0A= >>> Looking further into those warnings.=0A= >>>=0A= >>> EdB=0A= >>>=0A= >>>=0A= >>>=0A= >>> On Thu=2C Jul 2=2C 2015 at 3:13 PM=2C wrote:= =0A= >>>=0A= >>>> GCC and externs: add the 'externs.js' files to the SWCs=3B tell GCC to= use=0A= >>>> those to prevent renaming=0A= >>>>=0A= >>>> We've worked so hard to create AS classes from the Closure externs=2C= =0A= >> let's=0A= >>>> not forget what these were originally intended for... and what we need= =0A= >> them=0A= >>>> for: prevent renaming of externally declared functions. We needed to= =0A= >>>> include the original extern files in their respective SWCs so we can= =0A= >> later=0A= >>>> present them to the GCC.=0A= >>>>=0A= >>>> Signed-off-by: Erik de Bruin =0A= >>>>=0A= >>>>=0A= >>>> Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo=0A= >>>> Commit:=0A= >> http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/1f35e526=0A= >>>> Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/1f35e526= =0A= >>>> Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/1f35e526= =0A= >>>>=0A= >>>> Branch: refs/heads/develop=0A= >>>> Commit: 1f35e5260e580b8b40f95551f383a362c2474edd=0A= >>>> Parents: e425a86=0A= >>>> Author: Erik de Bruin =0A= >>>> Authored: Thu Jul 2 15:12:50 2015 +0200=0A= >>>> Committer: Erik de Bruin =0A= >>>> Committed: Thu Jul 2 15:12:50 2015 +0200=0A= >>>>=0A= >>>> ----------------------------------------------------------------------= =0A= >>>> .../mxml/flexjs/MXMLFlexJSPublisher.java | 43 +++++++++++++++++++-=0A= >>>> externs/jasmine/compile-config.xml | 5 +++=0A= >>>> externs/jquery/compile-config.xml | 5 +++=0A= >>>> 3 files changed=2C 51 insertions(+)=2C 2 deletions(-)=0A= >>>> ----------------------------------------------------------------------= =0A= >>>>=0A= >>>>=0A= >>>>=0A= >>>>=0A= >> http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/1f35e526/compile= r.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSPu= blisher.java=0A= >>>> ----------------------------------------------------------------------= =0A= >>>> diff --git=0A= >>>>=0A= >> a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/= MXMLFlexJSPublisher.java=0A= >>>>=0A= >> b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/= MXMLFlexJSPublisher.java=0A= >>>> index 1d6c7aa..cf3869b 100644=0A= >>>> ---=0A= >>>>=0A= >> a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/= MXMLFlexJSPublisher.java=0A= >>>> +++=0A= >>>>=0A= >> b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/= MXMLFlexJSPublisher.java=0A= >>>> @@ -22=2C7 +22=2C9 @@ import java.io.BufferedReader=3B=0A= >>>> import java.io.File=3B=0A= >>>> import java.io.FileInputStream=3B=0A= >>>> import java.io.IOException=3B=0A= >>>> +import java.io.InputStream=3B=0A= >>>> import java.io.InputStreamReader=3B=0A= >>>> +import java.io.OutputStream=3B=0A= >>>> import java.net.URL=3B=0A= >>>> import java.util.ArrayList=3B=0A= >>>> import java.util.Collection=3B=0A= >>>> @@ -49=2C6 +51=2C8 @@ import=0A= >>>> org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration= =3B=0A= >>>> import org.apache.flex.compiler.internal.graph.GoogDepsWriter=3B=0A= >>>> import org.apache.flex.compiler.internal.projects.FlexJSProject=3B=0A= >>>> import org.apache.flex.compiler.utils.JSClosureCompilerWrapper=3B=0A= >>>> +import org.apache.flex.swc.ISWC=3B=0A= >>>> +import org.apache.flex.swc.ISWCFileEntry=3B=0A= >>>>=0A= >>>> public class MXMLFlexJSPublisher extends JSGoogPublisher implements=0A= >>>> IJSPublisher=0A= >>>> {=0A= >>>> @@ -57=2C6 +61=2C8 @@ public class MXMLFlexJSPublisher extends=0A= >> JSGoogPublisher=0A= >>>> implements IJSPublisher=0A= >>>> public static final String FLEXJS_INTERMEDIATE_DIR_NAME =3D "js-debug"= =3B=0A= >>>> public static final String FLEXJS_RELEASE_DIR_NAME =3D "js-release"=3B= =0A= >>>>=0A= >>>> + private static final String FLEXJS_EXTERNS =3D "externs"=3B=0A= >>>> +=0A= >>>> class DependencyRecord=0A= >>>> {=0A= >>>> String path=3B=0A= >>>> @@ -278=2C8 +284=2C41 @@ public class MXMLFlexJSPublisher extends=0A= >>>> JSGoogPublisher implements IJSPublisher=0A= >>>>=0A= >>>> JSClosureCompilerWrapper compilerWrapper =3D new=0A= >>>> JSClosureCompilerWrapper()=3B=0A= >>>>=0A= >>>> - GoogDepsWriter gdw =3D new GoogDepsWriter(intermediateDir=2C=0A= >>>> projectName=2C (JSGoogConfiguration) configuration=2C=0A= >>>> - project.getLibraries())=3B=0A= >>>> + List swcs =3D project.getLibraries()=3B=0A= >>>> +=0A= >>>> + // (erikdebruin) We don't want to forget that we need to tell the=0A= >>>> GCC=0A= >>>> + // about them fancy externs we've been working so=0A= >>>> hard on=0A= >>>> + for (ISWC swc : swcs)=0A= >>>> + {=0A= >>>> + String srcName =3D swc.getSWCFile().getName().replace(".swc"=2C=0A= >>>> ".js")=3B=0A= >>>> + String srcPath =3D FLEXJS_EXTERNS + File.separator + srcName=3B=0A= >>>> +=0A= >>>> + ISWCFileEntry fileEntry =3D swc.getFile(FLEXJS_EXTERNS +=0A= >>>> File.separator + srcName)=3B=0A= >>>> + if (fileEntry !=3D null)=0A= >>>> + {=0A= >>>> + File destFile =3D new File(intermediateDirPath +=0A= >>>> File.separator + srcPath)=3B=0A= >>>> +=0A= >>>> + InputStream inStream =3D fileEntry.createInputStream()=3B=0A= >>>> + OutputStream outStream =3D=0A= >>>> FileUtils.openOutputStream(destFile)=3B=0A= >>>> + byte[] b =3D new byte[1024 * 1024]=3B=0A= >>>> + int bytes_read=3B=0A= >>>> + while ((bytes_read =3D inStream.read(b)) !=3D -1)=0A= >>>> + {=0A= >>>> + outStream.write(b=2C 0=2C bytes_read)=3B=0A= >>>> + }=0A= >>>> + outStream.flush()=3B=0A= >>>> + outStream.close()=3B=0A= >>>> + inStream.close()=3B=0A= >>>> +=0A= >>>> + String destPath =3D destFile.getAbsolutePath()=3B=0A= >>>> +=0A= >>>> + System.out.println("using extern: " + destPath)=3B=0A= >>>> +=0A= >>>> + compilerWrapper.addJSExternsFile(destPath)=3B=0A= >>>> + }=0A= >>>> + }=0A= >>>> +=0A= >>>> + GoogDepsWriter gdw =3D new GoogDepsWriter(intermediateDir=2C=0A= >>>> projectName=2C (JSGoogConfiguration) configuration=2C swcs)=3B=0A= >>>> StringBuilder depsFileData =3D new StringBuilder()=3B=0A= >>>> try=0A= >>>> {=0A= >>>>=0A= >>>>=0A= >>>>=0A= >> http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/1f35e526/externs= /jasmine/compile-config.xml=0A= >>>> ----------------------------------------------------------------------= =0A= >>>> diff --git a/externs/jasmine/compile-config.xml=0A= >>>> b/externs/jasmine/compile-config.xml=0A= >>>> index abf867e..2af1e2a 100644=0A= >>>> --- a/externs/jasmine/compile-config.xml=0A= >>>> +++ b/externs/jasmine/compile-config.xml=0A= >>>> @@ -67=2C6 +67=2C11 @@=0A= >>>> out/as/functions=0A= >>>> =0A= >>>>=0A= >>>> + =0A= >>>> + externs/jasmine-2.0.js=0A= >>>> + externs/jasmine-2.0.js=0A= >>>> + =0A= >>>> +=0A= >>>>