Merge pull request #16 from jawira/15-reduce-size

Reduce Emoji.php size
This commit is contained in:
Jawira Portugal 2020-10-14 09:23:44 +02:00 committed by GitHub
commit 6c51671e00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 3544 additions and 3553 deletions

BIN
build.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View File

@ -13,13 +13,13 @@
</exec> </exec>
</target> </target>
<target name="setup" description="Prepare project for dev" depends="composer:install, visualizer"/> <target name="setup" description="Prepare project for dev" depends="composer:install,visualizer"/>
<target name="qa" description="Quality assurance" depends="composer:validate, php:lint"/> <target name="qa" description="Quality assurance" depends="composer:validate,php:lint"/>
<target name="update" description="Update class and catalog" depends="emoji:update, catalog:update"/> <target name="update" description="Update class and catalog" depends="emoji:update,catalog:update,emoji:count"/>
<target name="emoji:update" description="Update Emoji.php" <target name="emoji:update" description="Update Emoji.php"
depends="emoji-list:download, emoji:parse, emoji:build, emoji:clean"/> depends="emoji-list:download,emoji:parse,emoji:build"/>
<target name="catalog:update" description="Update catalog.md" <target name="catalog:update" description="Update catalog.md"
depends="emoji-list:download, catalog:parse, catalog:build"/> depends="emoji-list:download,catalog:parse,catalog:build"/>
<target name="composer:validate" description="Validate composer.json"> <target name="composer:validate" description="Validate composer.json">
<composer command="validate"> <composer command="validate">
@ -36,6 +36,7 @@
<target name="composer:install" description="Install for dev"> <target name="composer:install" description="Install for dev">
<composer command="install"> <composer command="install">
<arg value="--quiet"/>
<arg value="--no-suggest"/> <arg value="--no-suggest"/>
<arg value="--no-interaction"/> <arg value="--no-interaction"/>
<arg value="--profile"/> <arg value="--profile"/>
@ -66,9 +67,9 @@
</target> </target>
<target name="emoji-list:download"> <target name="emoji-list:download">
<mkdir dir="resources/unicode/"/> <mkdir dir="resources/unicode"/>
<httpget dir="resources/unicode/" url="https://unicode.org/emoji/charts/full-emoji-list.html"/> <httpget dir="resources/unicode" url="https://unicode.org/emoji/charts/full-emoji-list.html"/>
<httpget dir="resources/unicode/" url="https://unicode.org/emoji/charts/full-emoji-modifiers.html"/> <httpget dir="resources/unicode" url="https://unicode.org/emoji/charts/full-emoji-modifiers.html"/>
</target> </target>
<target name="emoji:parse"> <target name="emoji:parse">
@ -97,17 +98,6 @@
<append file="resources/templates/emoji-footer.php.dist" destFile="src/Emoji.php"/> <append file="resources/templates/emoji-footer.php.dist" destFile="src/Emoji.php"/>
</target> </target>
<target name="emoji:clean" description="Reduce Emoji.php size">
<reflexive file="src/Emoji.php">
<filterchain>
<stripphpcomments/>
<linecontainsregexp>
<regexp pattern="\S"/>
</linecontainsregexp>
</filterchain>
</reflexive>
</target>
<target name="catalog:parse"> <target name="catalog:parse">
<mkdir dir="resources/output"/> <mkdir dir="resources/output"/>
<delete file="resources/output/catalog-1.txt"/> <delete file="resources/output/catalog-1.txt"/>

View File

@ -6,20 +6,11 @@
<xsl:template match="/"> <xsl:template match="/">
<xsl:for-each select="//table//tr[./td//img]"> <xsl:for-each select="//table//tr[./td//img]">
<xsl:text> /**&#10;</xsl:text> <xsl:text>const </xsl:text>
<xsl:text> * </xsl:text>
<xsl:call-template name="get-name"/>
<xsl:text>&#10;</xsl:text>
<xsl:text> *&#10;</xsl:text>
<xsl:text> * Code point(s): </xsl:text>
<xsl:call-template name="get-code"/>
<xsl:text>&#10;</xsl:text>
<xsl:text> */&#10;</xsl:text>
<xsl:text> const </xsl:text>
<xsl:call-template name="get-constant-name"/> <xsl:call-template name="get-constant-name"/>
<xsl:text> = "</xsl:text> <xsl:text> = "</xsl:text>
<xsl:call-template name="get-emoji"/> <xsl:call-template name="get-emoji"/>
<xsl:text>";&#10;&#10;</xsl:text> <xsl:text>";&#10;</xsl:text>
</xsl:for-each> </xsl:for-each>
</xsl:template> </xsl:template>

File diff suppressed because it is too large Load Diff