-
Notifications
You must be signed in to change notification settings - Fork 1
/
plugin_build.xml
140 lines (121 loc) · 6.74 KB
/
plugin_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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?xml version="1.0" encoding="UTF-8"?>
<project name="JCE Editor Plugin" basedir="." default="build">
<property description="Language directory" name="plugin_lang_dir" value="/Users/ryandemmer/Sites/20x/language/en-GB" />
<property description="Export directory" name="plugin_export_dir" value="/Users/ryandemmer/Releases/plugins/" />
<property description="E-mail" name="e-mail" value="info@joomlacontenteditor.net" />
<property description="Licence" name="licence" value="GNU/GPL Version 2 - http://www.gnu.org/licenses/gpl-2.0.html" />
<property description="Copyright" name="copyright" value="Copyright (C) 2006 - 2015 Ryan Demmer. All rights reserved" />
<property description="Plugin Directory" name="plugin_dir" value="/Users/ryandemmer/Sites/20x/components/com_jce/editor/tiny_mce/plugins/${plugin_name}" />
<property name="base_dir" value="/Users/ryandemmer/Sites/20x/administrator/components/com_jce" />
<target name="build">
<!-- Setup classpath for js-build-tools ant tasks -->
<path id="tasks.classpath">
<pathelement location="."/>
<fileset dir="/Users/ryandemmer/ant-tools">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- generate checksum of this file -->
<checksum file="build.xml" property="etag" />
<taskdef name="jsmin" classname="net.matthaynes.jsmin.JSMin_Task" classpathref="tasks.classpath" />
<taskdef name="yuicompressor-moxiecode" classname="com.moxiecode.ant.tasks.YuiCompressTask" classpathref="tasks.classpath" loaderref="tasks.classpath.loader" />
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="tasks.classpath" loaderref="tasks.classpath.loader" />
<taskdef name="yui-compressor" classname="net.noha.tools.ant.yuicompressor.tasks.YuiCompressorTask" classpathref="tasks.classpath" />
<tstamp>
<format property="DATE" pattern="dd MMMM yyyy" />
</tstamp>
<delete dir="${plugin_export_dir}/${plugin_name}/${plugin_package_version}"
quiet="true" />
<delete file="${plugin_export_dir}/jce_${plugin_name}_${plugin_package_version}.zip"
quiet="true" />
<copy todir="${plugin_export_dir}/${plugin_name}/${plugin_package_version}/">
<fileset dir="${plugin_dir}" defaultexcludes="yes">
<include name="**" />
<exclude name="build.xml" />
<exclude name=".project" />
<exclude name=".settings" />
<exclude name=".buildpath" />
<exclude name=".externalToolBuilders/" />
<exclude name="**.project" />
<exclude name="**.settings" />
<exclude name="*.settings" />
<exclude name="**.settings/" />
<exclude name="**.buildpath" />
<exclude name="**.externalToolBuilders/" />
<exclude name="changelog.txt" />
<exclude name="README" />
<exclude name="**/nbproject" />
<exclude name="**/nbproject/**" />
</fileset>
<fileset dir="${plugin_lang_dir}">
<include name="en-GB.com_jce_${plugin_name}.ini" />
</fileset>
<fileset dir="${base_dir}">
<include name="header.js.txt" />
<include name="header.css.txt" />
</fileset>
</copy>
<replace
dir="${plugin_export_dir}/${plugin_name}/${plugin_package_version}/">
<replacefilter
token="@@name@@"
value="${plugin_name}"/>
<replacefilter
token="@@version@@"
value="${plugin_version}"/>
<replacefilter
token="@@e-mail@@"
value="${e-mail}"/>
<replacefilter
token="@@date@@"
value="${DATE}"/>
<replacefilter
token="@@licence@@"
value="${licence}"/>
<replacefilter
token="@@copyright@@"
value="${copyright}"/>
</replace>
<!-- Load Header file -->
<loadfile property="header" srcFile="${plugin_export_dir}/${plugin_name}/${plugin_package_version}/header.js.txt"/>
<loadfile property="header" srcFile="${plugin_export_dir}/${plugin_name}/${plugin_package_version}/header.css.txt"/>
<!-- JSMin -->
<jsmin force="true" copyright="${header}">
<fileset dir="${plugin_export_dir}/${plugin_name}/${plugin_package_version}">
<include name="**/*.js" />
</fileset>
</jsmin>
<yui-compressor warn="false" charset="UTF-8" fromdir="${plugin_export_dir}/${plugin_name}/${plugin_package_version}" todir="${plugin_export_dir}/${plugin_name}/${plugin_package_version}">
<include name="**/*.css" />
</yui-compressor>
<!-- Prepend header -->
<for param="file">
<path>
<fileset dir="${plugin_export_dir}/${plugin_name}/${plugin_package_version}">
<include name="**/*-min.css" />
</fileset>
</path>
<sequential>
<concat destfile="@{file}.tmp">
<fileset file="${plugin_export_dir}/${plugin_name}/${plugin_package_version}/header.css.txt" />
<fileset file="@{file}" />
</concat>
</sequential>
</for>
<move todir="${plugin_export_dir}/${plugin_name}/${plugin_package_version}" includeemptydirs="false">
<fileset dir="${plugin_export_dir}/${plugin_name}/${plugin_package_version}">
<include name="**/**-min.css.tmp" />
</fileset>
<mapper type="regexp" from="^(.*)-min\.css\.tmp$" to="\1.css" />
</move>
<delete dir="${plugin_export_dir}/${plugin_name}/${plugin_package_version}" quiet="true">
<include name="**/**-min.css" />
</delete>
<delete file="${plugin_export_dir}/${plugin_name}/${plugin_package_version}/header.js.txt" quiet="true" />
<delete file="${plugin_export_dir}/${plugin_name}/${plugin_package_version}/header.css.txt" quiet="true" />
<zip destfile="${plugin_export_dir}/jce_${plugin_name}_${plugin_package_version}.zip"
basedir="${plugin_export_dir}/${plugin_name}/${plugin_package_version}/">
<fileset dir="${plugin_export_dir}/${plugin_name}/${plugin_package_version}/" />
</zip>
</target>
</project>