emoji-catalog/build.xml

136 lines
4.9 KiB
XML
Raw Normal View History

2022-02-09 01:06:21 +03:00
<?xml version="1.0" encoding="UTF-8"?>
2019-08-30 22:22:51 +03:00
2022-02-09 01:06:21 +03:00
<project name="jawira/emoji-catalog" default="help" phingVersion="3">
2019-08-30 22:22:51 +03:00
<defaultexcludes default="true"/><!--Initializing default excludes-->
<defaultexcludes add="**/.idea"/>
<defaultexcludes add="**/.idea/**"/>
<property name="phing.http.proxy" value="${env.http_proxy}"/>
2022-02-09 01:06:21 +03:00
<target name="setup" description="Prepare project for dev" depends="composer:install"/>
2020-10-14 00:58:07 +03:00
<target name="qa" description="Quality assurance" depends="composer:validate,php:lint"/>
<target name="update" description="Update class and catalog" depends="emoji:update,catalog:update,emoji:count"/>
<target name="emoji:update" description="Update Emoji.php"
2020-10-14 00:58:07 +03:00
depends="emoji-list:download,emoji:parse,emoji:build"/>
2019-10-02 00:08:31 +03:00
<target name="catalog:update" description="Update catalog.md"
2020-10-14 00:58:07 +03:00
depends="emoji-list:download,catalog:parse,catalog:build"/>
2019-08-30 22:22:51 +03:00
2022-02-09 01:06:21 +03:00
2019-08-30 22:22:51 +03:00
<target name="composer:validate" description="Validate composer.json">
<composer command="validate">
<arg value="--no-interaction"/>
<arg value="--profile"/>
<arg value="--strict"/>
<arg value="--quiet"/>
2019-08-30 22:22:51 +03:00
</composer>
</target>
2020-09-21 10:07:01 +03:00
<target name="visualizer">
2019-08-30 22:22:51 +03:00
<visualizer/>
</target>
<target name="composer:install" description="Install for dev">
<composer command="install">
2020-10-14 00:58:07 +03:00
<arg value="--quiet"/>
2019-08-30 22:22:51 +03:00
<arg value="--no-suggest"/>
<arg value="--no-interaction"/>
<arg value="--profile"/>
<arg value="--prefer-dist"/>
</composer>
</target>
2019-10-02 00:08:31 +03:00
<target name="emoji-list:download">
2020-10-14 00:58:07 +03:00
<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-modifiers.html"/>
2019-08-30 22:22:51 +03:00
</target>
<target name="emoji:parse">
<mkdir dir="resources/output"/>
2019-10-02 00:08:31 +03:00
<delete file="resources/output/emoji-1.txt"/>
2019-08-30 22:22:51 +03:00
<xslt file="resources/unicode/full-emoji-list.html"
2019-10-02 00:08:31 +03:00
tofile="resources/output/emoji-1.txt"
2019-08-30 22:22:51 +03:00
style="resources/xslt/emoji.xsl"
haltonerror="false"
overwrite="true"
html="true"/>
2019-10-02 00:08:31 +03:00
<delete file="resources/output/emoji-2.txt"/>
2019-08-30 22:22:51 +03:00
<xslt file="resources/unicode/full-emoji-modifiers.html"
2019-10-02 00:08:31 +03:00
tofile="resources/output/emoji-2.txt"
2019-08-30 22:22:51 +03:00
style="resources/xslt/emoji.xsl"
haltonerror="false"
overwrite="true"
html="true"/>
</target>
<target name="emoji:build">
2019-10-02 00:08:31 +03:00
<append file="resources/templates/emoji-header.php.dist" destFile="src/Emoji.php" append="false" overwrite="true"/>
<append file="resources/output/emoji-1.txt" destFile="src/Emoji.php"/>
<append file="resources/output/emoji-2.txt" destFile="src/Emoji.php"/>
<append file="resources/templates/emoji-footer.php.dist" destFile="src/Emoji.php"/>
</target>
<target name="catalog:parse">
<mkdir dir="resources/output"/>
<delete file="resources/output/catalog-1.txt"/>
<xslt file="resources/unicode/full-emoji-list.html"
tofile="resources/output/catalog-1.txt"
style="resources/xslt/catalog.xsl"
haltonerror="false"
overwrite="true"
html="true"/>
<delete file="resources/output/catalog-2.txt"/>
<xslt file="resources/unicode/full-emoji-modifiers.html"
tofile="resources/output/catalog-2.txt"
style="resources/xslt/catalog.xsl"
haltonerror="false"
overwrite="true"
html="true"/>
</target>
<target name="catalog:build">
<append file="resources/templates/catalog-header.md.dist" destFile="docs/catalog.md" append="false"
overwrite="true"/>
<append file="resources/output/catalog-1.txt" destFile="docs/catalog.md"/>
<append file="resources/output/catalog-2.txt" destFile="docs/catalog.md"/>
2019-08-30 22:22:51 +03:00
</target>
<target name="php:lint" description="Check PHP syntax">
2022-02-09 01:06:21 +03:00
<phplint deprecatedAsError="true" haltonfailure="true">
2019-08-30 22:22:51 +03:00
<fileset dir="src">
<include name="**/*.php"/>
</fileset>
</phplint>
</target>
2019-10-28 19:37:42 +03:00
<target name="emoji:count" description="Count constants in Emoji class">
<autoloader autoloaderpath="vendor/autoload.php"/>
<adhoc-task name="emoji-count"><![CDATA[
2022-02-09 01:06:21 +03:00
class EmojiCountTask extends \Phing\Task {
2019-10-28 19:37:42 +03:00
function main() {
$emojiReflection = new ReflectionClass(\Jawira\EmojiCatalog\Emoji::class);
$constants = $emojiReflection->getConstants();
$count = count($constants);
$this->log("Emoji count: $count");
$this->project->setProperty('emoji-count', $count);
}
}
]]></adhoc-task>
<emoji-count/>
</target>
2022-02-09 01:06:21 +03:00
<target name="help">
<uptodate property="uptodate.visualizer" srcfile="build.xml" targetfile="build.png"/>
<runtarget target="visualizer"/>
<open path="build.png"/>
</target>
<target name="visualizer" unless="uptodate.visualizer" description="Create buildfile map">
<visualizer/>
</target>
2019-08-30 22:22:51 +03:00
</project>