forked from tinymce/tinymce_spellchecker_php
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
65 lines (55 loc) · 2.92 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?xml version="1.0" encoding="UTF-8"?>
<project name="TinyMCE" default="build" basedir=".">
<property description="Export directory" name="temp_dir" value="tmp" />
<!-- Allow any user specific values to override the defaults -->
<property file="${user.home}/tinymce_spellchecker_php_build.properties" />
<!-- Setup classpath for js-build-tools ant tasks -->
<path id="tasks.classpath">
<pathelement location="."/>
<fileset dir="tools/ant">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- Register new js-build-tools ant tasks -->
<taskdef name="preprocess" classname="com.moxiecode.ant.tasks.PreProcessTask" classpathref="tasks.classpath" loaderref="tasks.classpath.loader" />
<taskdef name="yuicompress" classname="com.moxiecode.ant.tasks.YuiCompressTask" classpathref="tasks.classpath" loaderref="tasks.classpath.loader" />
<taskdef name="moxiedoc" classname="com.moxiecode.ant.tasks.MoxieDocTask" classpathref="tasks.classpath" loaderref="tasks.classpath.loader" />
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="tasks.classpath" loaderref="tasks.classpath.loader" />
<!-- Cleanup the build -->
<target name="clean" depends="" description="Cleans up the project from temporary files">
<delete dir="${temp_dir}" quiet="true" />
</target>
<target name="build" depends="" description="Build the editor plugin">
<yuicompress infile="editor_plugin_src.js" outfile="editor_plugin.js" />
</target>
<target name="release" depends="" description="Builds a release package">
<!-- Copy the current repos and start processing it -->
<delete dir="${temp_dir}" quiet="true" />
<copy todir="${temp_dir}/spellchecker_php">
<fileset dir=".">
<include name="**"/>
<exclude name="**/.git/**"/>
<exclude name="**/.*"/>
<exclude name="tools/**"/>
<exclude name="build.*"/>
<exclude name="readme.md"/>
</fileset>
</copy>
<!-- Parse minor version, major version and release date from changelog -->
<loadfile property="changelog" srcFile="${temp_dir}/spellchecker_php/changelog.txt" />
<propertyregex property="version" input="${changelog}" regexp="^Version ([0-9xabrc.]+)" select="\1" />
<propertyregex property="release_date" input="${changelog}" regexp="^Version [^\(]+\(([^\)]+)\)" select="\1" />
<propertyregex property="file_version" input="${version}" regexp="\." replace="_" />
<!-- Replace backend with php -->
<replaceregexp match="\"\{backend\}\"" replace="this.url+'/rpc.php'" byline="true">
<fileset dir="${temp_dir}">
<include name="**/*.js*" />
</fileset>
</replaceregexp>
<!-- Compress development package -->
<delete file="${temp_dir}/tinymce_spellchecker_php_${file_version}.zip" quiet="true" />
<zip destfile="${temp_dir}/tinymce_spellchecker_php_${file_version}.zip">
<zipfileset dir="${temp_dir}/spellchecker_php" prefix="spellchecker"/>
</zip>
</target>
</project>