convert createjs build to use a patch file. There are Ant targets that can be used to generate the patch files if we upgrade the createjs source we use
Project: http://git-wip-us.apache.org/repos/asf/flex-typedefs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-typedefs/commit/eae676d5 Tree: http://git-wip-us.apache.org/repos/asf/flex-typedefs/tree/eae676d5 Diff: http://git-wip-us.apache.org/repos/asf/flex-typedefs/diff/eae676d5 Branch: refs/heads/master Commit: eae676d56a7f6ce78bde877d1af1686e24a08853 Parents: cd0f8ab Author: Alex Harui <[email protected]> Authored: Mon May 23 11:35:34 2016 -0700 Committer: Alex Harui <[email protected]> Committed: Tue May 24 21:05:43 2016 -0700 ---------------------------------------------------------------------- createjs/build.xml | 138 +- createjs/src/main/config/compile-as-config.xml | 146 +- createjs/src/main/config/externc-config.xml | 2 +- createjs/src/main/patch/easeljs.patch | 19219 ++++++++++++++++++ createjs/src/main/patch/tweenjs.patch | 2863 +++ 5 files changed, 22352 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-typedefs/blob/eae676d5/createjs/build.xml ---------------------------------------------------------------------- diff --git a/createjs/build.xml b/createjs/build.xml index 1d6690a..63c8c2f 100644 --- a/createjs/build.xml +++ b/createjs/build.xml @@ -39,8 +39,9 @@ </target> <!-- createjs files have certain patterns that fool our compilers. - we process each file to make it look a bit more like what we expect --> - <target name="preprocess" depends="expandzip, expandzip_tween"> + we process each file to make it look a bit more like what we expect --> + <!-- this target requires mac/linux --> + <target name="make_patch" depends="download, download_tween, expandzip, expandzip_tween"> <antcall target="preprocessfile" > <param name="file" value="createjs/events/Event.js" /> <param name="folder" value="EaselJS-${createjs.version}" /> @@ -54,7 +55,7 @@ <param name="folder" value="EaselJS-${createjs.version}" /> </antcall> <antcall target="preprocessfile" > - <param name="file" value="createjs/utils/indexof.js" /> + <param name="file" value="createjs/utils/indexOf.js" /> <param name="folder" value="EaselJS-${createjs.version}" /> </antcall> <antcall target="preprocessfile" > @@ -226,6 +227,55 @@ <antcall target="preprocessEase" /> <antcall target="preprocessTween" /> <antcall target="preprocessTicker" /> + <antcall target="preprocessIndexOf" /> + <antcall target="externc_jsroot" /> + <antcall target="diff" /> + </target> + + <target name="diff" > + <mkdir dir="${basedir}/target/reference" /> + <delete dir="${basedir}/target/reference/EaselJS-${createjs.version}" /> + <unzip src="${basedir}/target/downloads/easel-${createjs.version}.zip" + dest="${basedir}/target/reference"> + </unzip> + <fixcrlf srcdir="${basedir}/target/reference/EaselJS-${createjs.version}" eol="unix" /> + <mkdir dir="${basedir}/target/reference" /> + <delete dir="${basedir}/target/reference/TweenJS-${tweenjs.version}" /> + <unzip src="${basedir}/target/downloads/tween-${tweenjs.version}.zip" + dest="${basedir}/target/reference"> + </unzip> + <fixcrlf srcdir="${basedir}/target/reference/TweenJS-${tweenjs.version}" eol="unix" /> + <delete dir="${basedir}/src/main/patch" /> + <mkdir dir="${basedir}/src/main/patch" /> + <exec executable="git" output="${basedir}/src/main/patch/easeljs.patch" > + <arg value="diff"/> + <arg value="--no-index"/> + <arg value="--"/> + <arg value="${basedir}/target/reference/EaselJS-${createjs.version}"/> + <arg value="${basedir}/target/downloads/EaselJS-${createjs.version}"/> + </exec> + <exec executable="git" output="${basedir}/src/main/patch/tweenjs.patch" > + <arg value="diff"/> + <arg value="--no-index"/> + <arg value="--"/> + <arg value="${basedir}/target/reference/TweenJS-${tweenjs.version}"/> + <arg value="${basedir}/target/downloads/TweenJS-${tweenjs.version}"/> + </exec> + <replace file="${basedir}/src/main/patch/easeljs.patch" token="target/reference" value="target/downloads" /> + <replace file="${basedir}/src/main/patch/easeljs.patch" token="${basedir}/target/downloads" value="/externs/createjs/target/downloads" /> + <replace file="${basedir}/src/main/patch/tweenjs.patch" token="target/reference" value="target/downloads" /> + <replace file="${basedir}/src/main/patch/tweenjs.patch" token="${basedir}/target/downloads" value="/externs/createjs/target/downloads" /> + </target> + + <target name="preprocess" depends="expandzip, expandzip_tween"> + <exec executable="git" dir="${basedir}/../.."> + <arg value="apply"/> + <arg value="${basedir}/src/main/patch/easeljs.patch"/> + </exec> + <exec executable="git" dir="${basedir}/../.."> + <arg value="apply"/> + <arg value="${basedir}/src/main/patch/tweenjs.patch"/> + </exec> </target> <target name="expandzip"> @@ -234,6 +284,7 @@ <unzip src="${basedir}/target/downloads/easel-${createjs.version}.zip" dest="${basedir}/target/downloads"> </unzip> + <fixcrlf srcdir="${basedir}/target/downloads/EaselJS-${createjs.version}" eol="unix" /> </target> <target name="expandzip_tween"> @@ -242,6 +293,7 @@ <unzip src="${basedir}/target/downloads/tween-${tweenjs.version}.zip" dest="${basedir}/target/downloads"> </unzip> + <fixcrlf srcdir="${basedir}/target/downloads/TweenJS-${tweenjs.version}" eol="unix" /> </target> <target name="preprocessfile" > @@ -296,6 +348,9 @@ <target name="preprocessMovieClip" > <replaceregexp file="${basedir}/target/downloads/EaselJS-${createjs.version}/src/easeljs/display/MovieClip.js" match="createjs.MovieClip.prototype.labels:.*currentLabel;" replace="" flags="gs" /> </target> + <target name="preprocessIndexOf" > + <replace file="${basedir}/target/downloads/EaselJS-${createjs.version}/src/createjs/utils/indexOf.js" token="@param searchElement Element" value="@param {Object} searchElement Element" /> + </target> <target name="rename.in.jsdoc" > <replace dir="${basedir}/target/downloads/EaselJS-${createjs.version}/src" > @@ -330,7 +385,9 @@ </replace> </target> - <target name="externc" > + <target name="externc_jsroot" > + <!-- this step removes function bodies and otherwise makes the files + look like typical GCC externs files that GCC expects --> <delete dir="${basedir}/target/generated-sources/externs" /> <java jar="${basedir}/../../compiler-jx/lib/externc.jar" fork="true" failonerror="false"> @@ -339,6 +396,79 @@ <arg value="-js-root=${basedir}/target/generated-sources/externs" /> <arg value="-load-config=${basedir}/src/main/config/externc-config.xml" /> </java> + <!-- copy the externc jsroot output back on top of the original files. + That way the build can just patch the original files and then flatten them + into a folder --> + <copy todir="${basedir}/target/downloads/EaselJS-${createjs.version}/src/easeljs/filters" overwrite="true"> + <fileset dir="${basedir}/target/generated-sources/externs"> + <include name="*Filter.js" /> + <include name="ColorMatrix.js" /> + </fileset > + </copy> + <copy todir="${basedir}/target/downloads/EaselJS-${createjs.version}/src/easeljs/display" overwrite="true"> + <fileset dir="${basedir}/target/generated-sources/externs"> + <include name="Bitmap.js" /> + <include name="BitmapText.js" /> + <include name="Container.js" /> + <include name="DisplayObject.js" /> + <include name="DOMElement.js" /> + <include name="Graphics.js" /> + <include name="MovieClip.js" /> + <include name="Shadow.js" /> + <include name="Shape.js" /> + <include name="Sprite.js" /> + <include name="SpriteContainer.js" /> + <include name="SpriteSheet.js" /> + <include name="SpriteStage.js" /> + <include name="Stage.js" /> + <include name="Text.js" /> + </fileset > + </copy> + <copy todir="${basedir}/target/downloads/EaselJS-${createjs.version}/src/easeljs/ui" overwrite="true"> + <fileset dir="${basedir}/target/generated-sources/externs"> + <include name="ButtonHelper.js" /> + </fileset > + </copy> + <copy todir="${basedir}/target/downloads/EaselJS-${createjs.version}/src/easeljs/geom" overwrite="true"> + <fileset dir="${basedir}/target/generated-sources/externs"> + <include name="DisplayProps.js" /> + <include name="Matrix2D.js" /> + <include name="Point.js" /> + <include name="Rectangle.js" /> + </fileset > + </copy> + <copy todir="${basedir}/target/downloads/TweenJS-${tweenjs.version}/src/tweenjs" overwrite="true"> + <fileset dir="${basedir}/target/generated-sources/externs"> + <include name="Ease.js" /> + <include name="Tween.js" /> + <include name="Timeline.js" /> + </fileset > + </copy> + <copy todir="${basedir}/target/downloads/EaselJS-${createjs.version}/src/createjs/events" overwrite="true"> + <fileset dir="${basedir}/target/generated-sources/externs"> + <include name="Event.js" /> + <include name="EventDispatcher.js" /> + </fileset > + </copy> + <copy todir="${basedir}/target/downloads/EaselJS-${createjs.version}/src/easeljs/events" overwrite="true"> + <fileset dir="${basedir}/target/generated-sources/externs"> + <include name="MouseEvent.js" /> + </fileset > + </copy> + <copy todir="${basedir}/target/downloads/EaselJS-${createjs.version}/src/easeljs/utils" overwrite="true"> + <fileset dir="${basedir}/target/generated-sources/externs"> + <include name="SpriteSheetBuilder.js" /> + </fileset > + </copy> + <copy todir="${basedir}/target/downloads/EaselJS-${createjs.version}/src/createjs/utils" overwrite="true"> + <fileset dir="${basedir}/target/generated-sources/externs"> + <include name="Ticker.js" /> + </fileset > + </copy> + </target> + + <target name="externc" > + <delete dir="${basedir}/target/generated-sources/externs" /> <java jar="${basedir}/../../compiler-jx/lib/externc.jar" fork="true" failonerror="false"> <arg value="+flexlib=externs" /> http://git-wip-us.apache.org/repos/asf/flex-typedefs/blob/eae676d5/createjs/src/main/config/compile-as-config.xml ---------------------------------------------------------------------- diff --git a/createjs/src/main/config/compile-as-config.xml b/createjs/src/main/config/compile-as-config.xml index 3abbb9a..3c4bc41 100644 --- a/createjs/src/main/config/compile-as-config.xml +++ b/createjs/src/main/config/compile-as-config.xml @@ -76,32 +76,156 @@ --> </include-sources> + <!-- Even though CreateJS source files are in a tree of folders, + in the files, the packages do not reflect the folder + tree. Everything is in the createjs package, + so we package them up in a single flat folder. --> <include-file> <name>externs/missing.js</name> <path>../src/main/javascript/missing.js</path> </include-file> <include-file> - <name>externs/createjs/*</name> - <path>downloads/EaselJS-0.8.0/src/createjs</path> + <name>externs/AlphaMapFilter.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/filters/AlphaMapFilter.js</path> </include-file> <include-file> - <name>externs/easeljs/*</name> - <path>downloads/EaselJS-0.8.0/src/easeljs</path> + <name>externs/AlphaMaskFilter.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/filters/AlphaMaskFilter.js</path> </include-file> <include-file> - <name>externs/tweenjs/*</name> - <path>downloads/TweenJS-0.6.2/src/tweenjs</path> + <name>externs/BlurFilter.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/filters/BlurFilter.js</path> + </include-file> + <include-file> + <name>externs/ColorFilter.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/filters/ColorFilter.js</path> + </include-file> + <include-file> + <name>externs/ColorMatrix.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/filters/ColorMatrix.js</path> + </include-file> + <include-file> + <name>externs/ColorMatrixFilter.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/filters/ColorMatrixFilter.js</path> + </include-file> + <include-file> + <name>externs/Filter.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/filters/Filter.js</path> + </include-file> + <include-file> + <name>externs/Bitmap.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/display/Bitmap.js</path> + </include-file> + <include-file> + <name>externs/BitmapText.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/display/BitmapText.js</path> + </include-file> + <include-file> + <name>externs/Container.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/display/Container.js</path> + </include-file> + <include-file> + <name>externs/DisplayObject.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/display/DisplayObject.js</path> + </include-file> + <include-file> + <name>externs/DOMElement.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/display/DOMElement.js</path> + </include-file> + <include-file> + <name>externs/Graphics.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/display/Graphics.js</path> + </include-file> + <include-file> + <name>externs/MovieClip.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/display/MovieClip.js</path> + </include-file> + <include-file> + <name>externs/Shadow.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/display/Shadow.js</path> + </include-file> + <include-file> + <name>externs/Shape.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/display/Shape.js</path> + </include-file> + <include-file> + <name>externs/Sprite.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/display/Sprite.js</path> + </include-file> + <include-file> + <name>externs/SpriteContainer.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/display/SpriteContainer.js</path> </include-file> - <!-- <include-file> - <name>assets/ErrorIndicator.png</name> - <path>assets/ErrorIndicator.png</path> + <name>externs/SpriteSheet.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/display/SpriteSheet.js</path> </include-file> <include-file> - <name>assets/RequiredIndicator.png</name> - <path>assets/RequiredIndicator.png</path> + <name>externs/SpriteStage.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/display/SpriteStage.js</path> + </include-file> + <include-file> + <name>externs/Stage.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/display/Stage.js</path> + </include-file> + <include-file> + <name>externs/Text.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/display/Text.js</path> + </include-file> + <include-file> + <name>externs/ButtonHelper.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/ui/ButtonHelper.js</path> + </include-file> + <include-file> + <name>externs/DisplayProps.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/geom/DisplayProps.js</path> + </include-file> + <include-file> + <name>externs/Matrix2D.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/geom/Matrix2D.js</path> + </include-file> + <include-file> + <name>externs/Point.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/geom/Point.js</path> + </include-file> + <include-file> + <name>externs/Rectangle.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/geom/Rectangle.js</path> + </include-file> + <include-file> + <name>externs/Ease.js</name> + <path>downloads/Tweenjs-0.6.2/src/tweenjs/Ease.js</path> + </include-file> + <include-file> + <name>externs/Tween.js</name> + <path>downloads/Tweenjs-0.6.2/src/tweenjs/Tween.js</path> + </include-file> + <include-file> + <name>externs/Timeline.js</name> + <path>downloads/Tweenjs-0.6.2/src/tweenjs/Timeline.js</path> + </include-file> + <include-file> + <name>externs/Event.js</name> + <path>downloads/EaselJS-0.8.0/src/createjs/events/Event.js</path> + </include-file> + <include-file> + <name>externs/EventDispatcher.js</name> + <path>downloads/EaselJS-0.8.0/src/createjs/events/EventDispatcher.js</path> + </include-file> + <include-file> + <name>externs/MouseEvent.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/events/MouseEvent.js</path> + </include-file> + <include-file> + <name>externs/SpriteSheetBuilder.js</name> + <path>downloads/EaselJS-0.8.0/src/easeljs/utils/SpriteSheetBuilder.js</path> + </include-file> + <include-file> + <name>externs/Ticker.js</name> + <path>downloads/EaselJS-0.8.0/src/createjs/utils/Ticker.js</path> </include-file> + <!-- <include-namespaces> <uri>library://ns.adobe.com/flex/spark</uri> </include-namespaces> http://git-wip-us.apache.org/repos/asf/flex-typedefs/blob/eae676d5/createjs/src/main/config/externc-config.xml ---------------------------------------------------------------------- diff --git a/createjs/src/main/config/externc-config.xml b/createjs/src/main/config/externc-config.xml index b15ab01..e5082de 100644 --- a/createjs/src/main/config/externc-config.xml +++ b/createjs/src/main/config/externc-config.xml @@ -64,7 +64,7 @@ <path-element>../../../target/downloads/EaselJS-0.8.0/src/createjs/events/Event.js</path-element> <path-element>../../../target/downloads/EaselJS-0.8.0/src/createjs/events/EventDispatcher.js</path-element> <path-element>../../../target/downloads/EaselJS-0.8.0/src/createjs/utils/extend.js</path-element> - <path-element>../../../target/downloads/EaselJS-0.8.0/src/createjs/utils/indexof.js</path-element> + <path-element>../../../target/downloads/EaselJS-0.8.0/src/createjs/utils/indexOf.js</path-element> <path-element>../../../target/downloads/EaselJS-0.8.0/src/createjs/utils/promote.js</path-element> <path-element>../../../target/downloads/EaselJS-0.8.0/src/createjs/utils/Ticker.js</path-element> <path-element>../../../target/downloads/EaselJS-0.8.0/src/easeljs/display/Bitmap.js</path-element>
