1 Star 0 Fork 0

SWSJTX/tinymce

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.xml 19.12 KB
一键复制 编辑 原始数据 按行查看 历史
<?xml version="1.0" encoding="UTF-8"?>
<project name="tinymce" default="build" basedir=".">
<!-- Path properties -->
<property description="Classes directory" name="classes_dir" location="jscripts/tiny_mce/classes" />
<property description="Build directory" name="build_dir" location="jscripts/tiny_mce" />
<property description="Temp directory" name="temp_dir" location="tmp" />
<property environment="env" />
<!-- Allow any user specific values to override the defaults -->
<property file="${user.home}/tinymce_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>
<!-- use a build number from the environment, defaulting it if not set. -->
<target name="default-build-number" unless="env.BUILD_NUMBER">
<tstamp />
<property description="Build number" name="build-number" value="${DSTAMP}${TSTAMP}" />
<echo message="${build-number}" />
</target>
<target name="env-build-number" if="env.BUILD_NUMBER">
<property description="Build number" name="build-number" value="${env.BUILD_NUMBER}" />
</target>
<target name="init-build-number" depends="env-build-number,default-build-number"/>
<!-- 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" />
<!-- Generate JS documentation -->
<target name="moxiedoc" depends="" description="Generates HTML documentation out of js source">
<mkdir dir="docs"/>
<delete quiet="true">
<fileset dir="docs/api" includes="**/*"/>
</delete>
<moxiedoc outdir="${basedir}/docs/api" templatedir="${basedir}/tools/templates" msintellisense="${basedir}/docs/api/tinymce.vsdoc.js" eventclass="tinymce.util.Dispatcher" title="TinyMCE API">
<fileset dir="${basedir}/jscripts/tiny_mce/classes">
<include name="**/*.js" />
</fileset>
<fileset dir="${basedir}/jscripts/tiny_mce/themes">
<include name="**/editor_template_src.js" />
</fileset>
<fileset dir="${basedir}/jscripts/tiny_mce/plugins">
<include name="**/editor_plugin_src.js" />
</fileset>
</moxiedoc>
</target>
<!-- Cleanup the build -->
<target name="clean" depends="" description="Cleans up the project from temporary files">
<delete dir="${temp_dir}" quiet="true" />
</target>
<!-- Concat and minify classes and scripts -->
<target name="build" depends="" description="Builds the project">
<!-- Combine all class files into one single script file -->
<concat destfile="${build_dir}/tiny_mce_tmp.js" fixlastline="yes">
<fileset dir="${classes_dir}" includes="tinymce.js" />
<fileset dir="${classes_dir}" includes="adapter/jquery/adapter.js" />
<fileset dir="${classes_dir}" includes="adapter/prototype/adapter.js" />
<fileset dir="${classes_dir}" includes="util/Dispatcher.js" />
<fileset dir="${classes_dir}" includes="util/URI.js" />
<fileset dir="${classes_dir}" includes="util/Cookie.js" />
<fileset dir="${classes_dir}" includes="util/JSON.js" />
<fileset dir="${classes_dir}" includes="util/XHR.js" />
<fileset dir="${classes_dir}" includes="util/JSONRequest.js" />
<fileset dir="${classes_dir}" includes="dom/DOMUtils.js" />
<fileset dir="${classes_dir}" includes="dom/Range.js" />
<fileset dir="${classes_dir}" includes="dom/TridentSelection.js" />
<fileset dir="${classes_dir}" includes="dom/Sizzle.js" />
<fileset dir="${classes_dir}" includes="dom/EventUtils.js" />
<fileset dir="${classes_dir}" includes="dom/Element.js" />
<fileset dir="${classes_dir}" includes="dom/Selection.js" />
<fileset dir="${classes_dir}" includes="dom/XMLWriter.js" />
<fileset dir="${classes_dir}" includes="dom/StringWriter.js" />
<fileset dir="${classes_dir}" includes="dom/Serializer.js" />
<fileset dir="${classes_dir}" includes="dom/ScriptLoader.js" />
<fileset dir="${classes_dir}" includes="dom/TreeWalker.js" />
<fileset dir="${classes_dir}" includes="dom/Schema.js" />
<fileset dir="${classes_dir}" includes="dom/RangeUtils.js" />
<fileset dir="${classes_dir}" includes="ui/KeyboardNavigation.js" />
<fileset dir="${classes_dir}" includes="ui/Control.js" />
<fileset dir="${classes_dir}" includes="ui/Container.js" />
<fileset dir="${classes_dir}" includes="ui/Separator.js" />
<fileset dir="${classes_dir}" includes="ui/MenuItem.js" />
<fileset dir="${classes_dir}" includes="ui/Menu.js" />
<fileset dir="${classes_dir}" includes="ui/DropMenu.js" />
<fileset dir="${classes_dir}" includes="ui/Button.js" />
<fileset dir="${classes_dir}" includes="ui/ListBox.js" />
<fileset dir="${classes_dir}" includes="ui/NativeListBox.js" />
<fileset dir="${classes_dir}" includes="ui/MenuButton.js" />
<fileset dir="${classes_dir}" includes="ui/SplitButton.js" />
<fileset dir="${classes_dir}" includes="ui/ColorSplitButton.js" />
<fileset dir="${classes_dir}" includes="ui/ToolbarGroup.js" />
<fileset dir="${classes_dir}" includes="ui/Toolbar.js" />
<fileset dir="${classes_dir}" includes="AddOnManager.js" />
<fileset dir="${classes_dir}" includes="EditorManager.js" />
<fileset dir="${classes_dir}" includes="Editor.js" />
<fileset dir="${classes_dir}" includes="EditorCommands.js" />
<fileset dir="${classes_dir}" includes="UndoManager.js" />
<fileset dir="${classes_dir}" includes="ForceBlocks.js" />
<fileset dir="${classes_dir}" includes="ControlManager.js" />
<fileset dir="${classes_dir}" includes="WindowManager.js" />
<fileset dir="${classes_dir}" includes="CommandManager.js" />
<fileset dir="${classes_dir}" includes="Formatter.js" />
<fileset dir="${classes_dir}" includes="LegacyInput.js" />
</concat>
<!-- Remove all jsdoc style comments -->
<replaceregexp match="/\*\*(.*?)\*\/\s*" replace="" flags="gs" byline="false" file="${build_dir}/tiny_mce_tmp.js" />
<!-- Preprocess core -->
<preprocess infile="${build_dir}/tiny_mce_tmp.js" outfile="${build_dir}/tiny_mce_src.js" />
<preprocess infile="${build_dir}/tiny_mce_tmp.js" outfile="${build_dir}/tiny_mce_prototype_src.js" defines="prototype,prototype_adapter" />
<preprocess infile="${build_dir}/tiny_mce_tmp.js" outfile="${build_dir}/tiny_mce_jquery_src.js" defines="jquery,jquery_adapter" />
<!-- Compress core -->
<yuicompress infile="${build_dir}/tiny_mce_src.js" outfile="${build_dir}/tiny_mce.js" />
<yuicompress infile="${build_dir}/tiny_mce_prototype_src.js" outfile="${build_dir}/tiny_mce_prototype.js" />
<yuicompress infile="${build_dir}/tiny_mce_jquery_src.js" outfile="${build_dir}/tiny_mce_jquery.js" />
<!-- Compress popup -->
<yuicompress infile="${build_dir}/classes/Popup.js" outfile="${build_dir}/tiny_mce_popup.js" />
<concat destfile="${build_dir}/tiny_mce_popup.js.tmp">
<header filtering="no" trimleading="yes">
// Uncomment and change this document.domain value if you are loading the script cross subdomains
// document.domain = 'moxiecode.com';
</header>
<fileset file="${build_dir}/tiny_mce_popup.js" />
</concat>
<move file="${build_dir}/tiny_mce_popup.js.tmp" tofile="${build_dir}/tiny_mce_popup.js" overwrite="true" />
<!-- Compress themes -->
<yuicompress infile="${build_dir}/themes/simple/editor_template_src.js" outfile="${build_dir}/themes/simple/editor_template.js" />
<yuicompress infile="${build_dir}/themes/advanced/editor_template_src.js" outfile="${build_dir}/themes/advanced/editor_template.js" />
<!-- Compress plugins -->
<for param="file">
<path>
<fileset dir="${build_dir}/plugins/" includes="*/editor_plugin_src.js" />
</path>
<sequential>
<propertyregex property="file.compressed" input="@{file}" regexp="_src.js$" replace=".js" override="yes" />
<yuicompress infile="@{file}" outfile="${file.compressed}" />
</sequential>
</for>
<!-- Compress jQuery plugin -->
<yuicompress infile="${classes_dir}/adapter/jquery/jquery.tinymce.js" outfile="${build_dir}/jquery.tinymce.js" />
<!-- Cleanup -->
<delete file="${build_dir}/tiny_mce_tmp.js" quiet="true"/>
</target>
<target name="build_full" depends="build" description="Builds a complete package">
<!-- Combine all files -->
<concat destfile="${build_dir}/tiny_mce_full.js">
<fileset dir="${build_dir}" includes="tiny_mce.js" />
<fileset dir="${build_dir}" includes="langs/en.js" />
<fileset dir="${build_dir}" includes="plugins/advhr/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/advimage/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/advlink/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/advlist/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/emotions/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/iespell/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/insertdatetime/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/preview/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/print/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/save/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/searchreplace/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/table/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/contextmenu/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/paste/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/fullscreen/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/directionality/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/inlinepopups/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/autosave/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/noneditable/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/fullpage/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/layer/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/style/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/media/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/visualchars/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/nonbreaking/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/xhtmlxtras/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/template/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/bbcode/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/pagebreak/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/spellchecker/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/tabfocus/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/autoresize/editor_plugin.js" />
<fileset dir="${build_dir}" includes="plugins/wordcount/editor_plugin.js" />
<fileset dir="${build_dir}" includes="themes/advanced/langs/en.js" />
<fileset dir="${build_dir}" includes="themes/advanced/editor_template.js" />
</concat>
</target>
<target name="prepare-release-files" depends="build,moxiedoc">
<delete dir="${temp_dir}" quiet="true" />
<!-- Copy the current repos and start processing it -->
<copy todir="${temp_dir}/tinymce">
<fileset dir=".">
<include name="**"/>
<exclude name="**/.*/**"/>
<exclude name="**/.*"/>
<exclude name="build-utils/**" />
</fileset>
</copy>
</target>
<target name="prepare-versions" depends="init-build-number,prepare-release-files" description="Builds release packages">
<!-- Parse minor version, major version and release date from changelog -->
<loadfile property="changelog" srcFile="${temp_dir}/tinymce/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="version.major" input="${version}" regexp="^([0-9]+)\." select="\1" />
<propertyregex property="version.minor.upstream" input="${version}" regexp="^[^\.]+.([0-9xabrc.]+)" select="\1" />
<property name="version.minor" value="${version.minor.upstream}" />
<property name="file_version" value="${version}-${build-number}" />
<!-- Replace major version -->
<replaceregexp byline="true">
<regexp pattern="@@tinymce_major_version@@" />
<substitution expression="${version.major}" />
<fileset dir="${temp_dir}/tinymce">
<include name="jscripts/tiny_mce/tiny_mce.js" />
<include name="jscripts/tiny_mce/tiny_mce_src.js" />
<include name="jscripts/tiny_mce/tiny_mce_jquery.js" />
<include name="jscripts/tiny_mce/tiny_mce_jquery_src.js" />
<include name="jscripts/tiny_mce/tiny_mce_prototype.js" />
<include name="jscripts/tiny_mce/tiny_mce_prototype_src.js" />
</fileset>
</replaceregexp>
<!-- Replace minor version -->
<replaceregexp byline="true">
<regexp pattern="@@tinymce_minor_version@@" />
<substitution expression="${version.minor}" />
<fileset dir="${temp_dir}/tinymce">
<include name="jscripts/tiny_mce/tiny_mce.js" />
<include name="jscripts/tiny_mce/tiny_mce_src.js" />
<include name="jscripts/tiny_mce/tiny_mce_jquery.js" />
<include name="jscripts/tiny_mce/tiny_mce_jquery_src.js" />
<include name="jscripts/tiny_mce/tiny_mce_prototype.js" />
<include name="jscripts/tiny_mce/tiny_mce_prototype_src.js" />
</fileset>
</replaceregexp>
<!-- Replace release date -->
<replaceregexp byline="true">
<regexp pattern="@@tinymce_release_date@@" />
<substitution expression="${release_date}" />
<fileset dir="${temp_dir}/tinymce">
<include name="jscripts/tiny_mce/tiny_mce.js" />
<include name="jscripts/tiny_mce/tiny_mce_src.js" />
<include name="jscripts/tiny_mce/tiny_mce_jquery.js" />
<include name="jscripts/tiny_mce/tiny_mce_jquery_src.js" />
<include name="jscripts/tiny_mce/tiny_mce_prototype.js" />
<include name="jscripts/tiny_mce/tiny_mce_prototype_src.js" />
</fileset>
</replaceregexp>
</target>
<target name="prepare-examples" depends="prepare-release-files">
<!-- Replaces the tiny_mce_dev.js with tiny_mce.js in examples -->
<replaceregexp match="tiny_mce_(dev|jquery)\.js" replace="tiny_mce.js" flags="g" byline="true">
<fileset dir="${temp_dir}/tinymce/examples">
<include name="**/*.htm*" />
</fileset>
</replaceregexp>
</target>
<target name="prepare-version-queries" depends="prepare-release-files, prepare-versions">
<!-- Add or remove version queries -->
<if>
<equals arg1="${version_queries}" arg2="true" />
<then>
<!-- Add version suffix to all file requests -->
<replaceregexp match="\?v=\{tinymce_version\}" replace="?v=${file_version}" flags="g" byline="true">
<fileset dir="${temp_dir}/tinymce">
<include name="**/*.htm*" />
<include name="**/*.css" />
</fileset>
</replaceregexp>
</then>
<else>
<!-- Remove version suffixes, so that it won't break Lotus Notes -->
<replaceregexp match="\?v=\{tinymce_version\}" replace="" flags="g" byline="true">
<fileset dir="${temp_dir}/tinymce">
<include name="**/*.htm*" />
<include name="**/*.css" />
</fileset>
</replaceregexp>
</else>
</if>
</target>
<target name="prepare-release" depends="prepare-release-files, prepare-versions, prepare-examples, prepare-version-queries" />
<!--TODO consider if the community release name is the right one for this. -->
<target name="community-release" depends="prepare-release" description="Builds release packages">
<!-- Compress development package -->
<delete file="${temp_dir}/tinymce_${file_version}_dev.zip" quiet="true" />
<zip destfile="${temp_dir}/tinymce_${file_version}_dev.zip">
<zipfileset dir="${temp_dir}/tinymce" prefix="tinymce" />
</zip>
</target>
<target name="production-release" depends="prepare-release">
<!-- Compress production package -->
<delete file="${temp_dir}/tinymce_${file_version}.zip" quiet="true" />
<zip destfile="${temp_dir}/tinymce_${file_version}.zip" excludes="**/classes">
<fileset dir="${temp_dir}">
<include name="tinymce/jscripts/**" />
<include name="tinymce/examples/**" />
<include name="tinymce/changelog.txt" />
<exclude name="tinymce/examples/full_jquery.html" />
<exclude name="tinymce/jscripts/tiny_mce/classes/**" />
<exclude name="tinymce/jscripts/tiny_mce/jquery.tinymce.js" />
<exclude name="tinymce/jscripts/tiny_mce/tiny_mce_dev.js" />
<exclude name="tinymce/jscripts/tiny_mce/tiny_mce_jquery.js" />
<exclude name="tinymce/jscripts/tiny_mce/tiny_mce_jquery_src.js" />
<exclude name="tinymce/jscripts/tiny_mce/tiny_mce_prototype.js" />
<exclude name="tinymce/jscripts/tiny_mce/tiny_mce_prototype_src.js" />
</fileset>
</zip>
</target>
<target name="jquery-release" depends="prepare-release">
<!-- Compress production package for jquery -->
<delete file="${temp_dir}/tinymce_${file_version}_jquery.zip" quiet="true" />
<zip destfile="${temp_dir}/tinymce_${file_version}_jquery.zip" excludes="**/classes">
<fileset dir="${temp_dir}">
<include name="tinymce/jscripts/**" />
<include name="tinymce/changelog.txt" />
<exclude name="tinymce/examples/**" />
<exclude name="tinymce/jscripts/tiny_mce/classes/**" />
<exclude name="tinymce/jscripts/tiny_mce/tiny_mce.js" />
<exclude name="tinymce/jscripts/tiny_mce/tiny_mce_src.js" />
<exclude name="tinymce/jscripts/tiny_mce/tiny_mce_dev.js" />
<exclude name="tinymce/jscripts/tiny_mce/tiny_mce_jquery.js" />
<exclude name="tinymce/jscripts/tiny_mce/tiny_mce_jquery_src.js" />
<exclude name="tinymce/jscripts/tiny_mce/tiny_mce_prototype.js" />
<exclude name="tinymce/jscripts/tiny_mce/tiny_mce_prototype_src.js" />
</fileset>
<zipfileset dir="${temp_dir}" includes="tinymce/examples/full_jquery.html" fullpath="tinymce/examples/index.html"/>
<zipfileset dir="${temp_dir}" includes="tinymce/jscripts/tiny_mce/tiny_mce_jquery.js" fullpath="tinymce/jscripts/tiny_mce/tiny_mce.js"/>
<zipfileset dir="${temp_dir}" includes="tinymce/jscripts/tiny_mce/tiny_mce_jquery_src.js" fullpath="tinymce/jscripts/tiny_mce/tiny_mce_src.js"/>
</zip>
</target>
<target name="release" depends="community-release, production-release, jquery-release" />
<target name="addsuffixes" description="Adds version suffixes to all requests">
<property name="version_queries" value="true" />
</target>
</project>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/swsjtx/tinymce.git
git@gitee.com:swsjtx/tinymce.git
swsjtx
tinymce
tinymce
3.3.x

搜索帮助