mirror of
https://github.com/Mibew/java.git
synced 2025-01-23 01:50:34 +03:00
Completely update messenger build system
This commit is contained in:
parent
053837d069
commit
47ccc46359
260
src/messenger/build.xml
Normal file
260
src/messenger/build.xml
Normal file
@ -0,0 +1,260 @@
|
|||||||
|
<project name="mibew messenger" default="usage">
|
||||||
|
|
||||||
|
|
||||||
|
<property name="webim_path" value="webim" />
|
||||||
|
<property name="closure.c" value="/opt/closure/compiler.jar" />
|
||||||
|
<property name="dialogs_styles_path" value="${webim_path}/styles/dialogs" />
|
||||||
|
<property name="js_path" value="${webim_path}/js" />
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Help message about all available targets -->
|
||||||
|
<target name="usage">
|
||||||
|
<echo>Available targets:</echo>
|
||||||
|
<echo>styles_handlebars - Compile Handlebars templates for dialogs styles</echo>
|
||||||
|
<echo>styles_js - Compile JavaScript files for all dialogs styles</echo>
|
||||||
|
<echo>styles_all - Run styles_handlebars and styles_js tasks</echo>
|
||||||
|
<echo>chat_app_js - Build JavaScript files related to chat application</echo>
|
||||||
|
<echo>default_app_js - Build JavaScript files related to default application</echo>
|
||||||
|
<echo>core_handlebars - Compile Handlebars templates of the Core</echo>
|
||||||
|
<echo>all - Build everything</echo>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Compile Handlebars templates for dialogs styles -->
|
||||||
|
<target name="styles_handlebars">
|
||||||
|
<echo>Compile Handlebars templates for dialogs styles</echo>
|
||||||
|
<apply executable="handlebars">
|
||||||
|
<arg value="-m"/>
|
||||||
|
<arg value="-f"/>
|
||||||
|
<targetfile />
|
||||||
|
<dirset dir=".">
|
||||||
|
<include name="${dialogs_styles_path}/*/handlebars_templates" />
|
||||||
|
</dirset>
|
||||||
|
<mapper type="glob" from="*/handlebars_templates" to="*/js/compiled/templates.js" />
|
||||||
|
</apply>
|
||||||
|
<echo>Done</echo>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Compile and concatenate JavaScript files for dialog styles -->
|
||||||
|
<target name="styles_js">
|
||||||
|
<echo>Compile and concatenate JavaScript files for dialogs styles:</echo>
|
||||||
|
|
||||||
|
<!-- Create temporary directories for compiled JavaScript files -->
|
||||||
|
<echo>Create temporary directories</echo>
|
||||||
|
<apply executable="mkdir" addsourcefile="false">
|
||||||
|
<targetfile />
|
||||||
|
<dirset dir=".">
|
||||||
|
<include name="${dialogs_styles_path}/*/js/source" />
|
||||||
|
</dirset>
|
||||||
|
<mapper type="glob" from="*/source" to="*/tmp" />
|
||||||
|
</apply>
|
||||||
|
|
||||||
|
<!-- Compile JavaScript files -->
|
||||||
|
<echo>Compile JavaScript files</echo>
|
||||||
|
<apply executable="java">
|
||||||
|
<arg value="-jar" />
|
||||||
|
<arg value="${closure.c}" />
|
||||||
|
<arg value="--js" />
|
||||||
|
<srcfile />
|
||||||
|
<arg value="--js_output_file" />
|
||||||
|
<targetfile />
|
||||||
|
<fileset dir=".">
|
||||||
|
<include name="${dialogs_styles_path}/*/js/source/*.js" />
|
||||||
|
</fileset>
|
||||||
|
<mapper type="regexp" from="^(.+)/source/(.+)$$" to="\1/tmp/\2" />
|
||||||
|
</apply>
|
||||||
|
|
||||||
|
<!-- Concatenate all scripts in one file. Use special script for
|
||||||
|
expanding wildcards. -->
|
||||||
|
<echo>Concatenate JavaScript files</echo>
|
||||||
|
<apply executable="build_scripts/cat">
|
||||||
|
<srcfile suffix="/*.js"/>
|
||||||
|
<targetfile />
|
||||||
|
<dirset dir=".">
|
||||||
|
<include name="${dialogs_styles_path}/*/js/tmp" />
|
||||||
|
</dirset>
|
||||||
|
<mapper type="glob" from="*/tmp" to="*/compiled/scripts.js" />
|
||||||
|
</apply>
|
||||||
|
|
||||||
|
<!-- Remove temporary directories -->
|
||||||
|
<echo>Remove temporary directories</echo>
|
||||||
|
<apply executable="rm">
|
||||||
|
<arg value="-r" />
|
||||||
|
<arg value="-f" />
|
||||||
|
<dirset dir=".">
|
||||||
|
<include name="${dialogs_styles_path}/*/js/tmp" />
|
||||||
|
</dirset>
|
||||||
|
</apply>
|
||||||
|
|
||||||
|
<echo>Done</echo>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Build all stuff related to dialogs styles -->
|
||||||
|
<target name="styles_all" depends="styles_handlebars,styles_js">
|
||||||
|
<echo>Dialogs styles built.</echo>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Compile all JavaScript files of the Mibew Core -->
|
||||||
|
<target name="compile_js">
|
||||||
|
<echo>Compile JavaScript files of the Mibew Core</echo>
|
||||||
|
|
||||||
|
<!-- Copy directory tree from source to compiled -->
|
||||||
|
<echo>Copy directory tree</echo>
|
||||||
|
<copy todir="${js_path}/compiled">
|
||||||
|
<dirset dir="${js_path}/source">
|
||||||
|
<include name="**" />
|
||||||
|
</dirset>
|
||||||
|
</copy>
|
||||||
|
|
||||||
|
<!-- Compile JavaScript files -->
|
||||||
|
<echo>Compile JavaScript files</echo>
|
||||||
|
<apply executable="java">
|
||||||
|
<arg value="-jar" />
|
||||||
|
<arg value="${closure.c}" />
|
||||||
|
<arg value="--js" />
|
||||||
|
<srcfile />
|
||||||
|
<arg value="--js_output_file" />
|
||||||
|
<targetfile />
|
||||||
|
<fileset dir=".">
|
||||||
|
<include name="${js_path}/source/**/*.js" />
|
||||||
|
</fileset>
|
||||||
|
<mapper type="regexp" from="^(.+)/source/(.+)$$" to="\1/compiled/\2" />
|
||||||
|
</apply>
|
||||||
|
|
||||||
|
<echo>Done</echo>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Build JavaScript application -->
|
||||||
|
<target name="app_js">
|
||||||
|
<echo>Build "${app_name}" JavaScript application</echo>
|
||||||
|
|
||||||
|
<!-- Initialization code goes first. Preserve header comment but strip
|
||||||
|
empty lines -->
|
||||||
|
<concat destfile="${js_path}/compiled/${app_name}_app.js" eol="lf">
|
||||||
|
<filelist dir="${js_path}/compiled/${app_name}" files="init.js" />
|
||||||
|
|
||||||
|
<!-- Apply filters -->
|
||||||
|
<filterchain>
|
||||||
|
<!-- Skip empty lines -->
|
||||||
|
<linecontainsregexp negate="true">
|
||||||
|
<regexp pattern="^\s+$$" />
|
||||||
|
</linecontainsregexp>
|
||||||
|
</filterchain>
|
||||||
|
</concat>
|
||||||
|
|
||||||
|
<!-- Append application files to the result file -->
|
||||||
|
<concat destfile="${js_path}/compiled/${app_name}_app.js" eol="lf" append="true">
|
||||||
|
|
||||||
|
<!-- Include files from ${js_path}/compiled/${app_name}/ -->
|
||||||
|
<fileset dir="${js_path}/compiled/${app_name}">
|
||||||
|
<include name="*.js" />
|
||||||
|
<exclude name="init.js" />
|
||||||
|
<exclude name="app.js" />
|
||||||
|
</fileset>
|
||||||
|
|
||||||
|
<!-- Include models files -->
|
||||||
|
<fileset dir="${js_path}/compiled/${app_name}/models">
|
||||||
|
<include name="**/base*.js" />
|
||||||
|
</fileset>
|
||||||
|
<fileset dir="${js_path}/compiled/${app_name}/models">
|
||||||
|
<include name="**/*.js" />
|
||||||
|
<!-- Exclude base files -->
|
||||||
|
<exclude name="**/base*.js" />
|
||||||
|
</fileset>
|
||||||
|
|
||||||
|
<!-- Include collections files -->
|
||||||
|
<fileset dir="${js_path}/compiled/${app_name}/collections">
|
||||||
|
<include name="**/base*.js" />
|
||||||
|
</fileset>
|
||||||
|
<fileset dir="${js_path}/compiled/${app_name}/collections">
|
||||||
|
<include name="**/*.js" />
|
||||||
|
<!-- Exclude base files -->
|
||||||
|
<exclude name="**/base*.js" />
|
||||||
|
</fileset>
|
||||||
|
|
||||||
|
<!-- Include views files -->
|
||||||
|
<fileset dir="${js_path}/compiled/${app_name}/views">
|
||||||
|
<include name="**/base*.js" />
|
||||||
|
</fileset>
|
||||||
|
<fileset dir="${js_path}/compiled/${app_name}/views">
|
||||||
|
<include name="**/*.js" />
|
||||||
|
<!-- Exclude base files -->
|
||||||
|
<exclude name="**/base*.js" />
|
||||||
|
</fileset>
|
||||||
|
|
||||||
|
<!-- Include all other files -->
|
||||||
|
<fileset dir="${js_path}/compiled/${app_name}">
|
||||||
|
<include name="**/base*.js" />
|
||||||
|
<exclude name="**/models/base*.js" />
|
||||||
|
<exclude name="**/collections/base*.js" />
|
||||||
|
<exclude name="**/views/base*.js" />
|
||||||
|
</fileset>
|
||||||
|
<fileset dir="${js_path}/compiled/${app_name}">
|
||||||
|
<include name="**/*.js" />
|
||||||
|
<!-- Exclude files from ${js_path}/compiled/${app_name}/ -->
|
||||||
|
<exclude name="*.js" />
|
||||||
|
<!-- Exclude base files -->
|
||||||
|
<exclude name="**/base*.js" />
|
||||||
|
</fileset>
|
||||||
|
|
||||||
|
<fileset dir="${js_path}/compiled/${app_name}">
|
||||||
|
<include name="app.js" />
|
||||||
|
</fileset>
|
||||||
|
|
||||||
|
<!-- Apply filters -->
|
||||||
|
<filterchain>
|
||||||
|
<stripjavacomments />
|
||||||
|
<!-- Skip empty lines -->
|
||||||
|
<linecontainsregexp negate="true">
|
||||||
|
<regexp pattern="^\s+$$" />
|
||||||
|
</linecontainsregexp>
|
||||||
|
</filterchain>
|
||||||
|
</concat>
|
||||||
|
|
||||||
|
<echo>Done</echo>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Build JavaScript files related to default application -->
|
||||||
|
<target name="default_app_js" depends="compile_js">
|
||||||
|
<antcall target="app_js">
|
||||||
|
<param name="app_name" value="default" />
|
||||||
|
</antcall>
|
||||||
|
<echo>Default JavaScript application built.</echo>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Compile and concatenate JavaScript files related to chat application -->
|
||||||
|
<target name="chat_app_js" depends="default_app_js">
|
||||||
|
<antcall target="app_js">
|
||||||
|
<param name="app_name" value="chat" />
|
||||||
|
</antcall>
|
||||||
|
<echo>Chat JavaScript application built.</echo>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!-- Compile Handlebars templates of the Core -->
|
||||||
|
<target name="core_handlebars">
|
||||||
|
<echo>Compile Handlebars templates of the Core</echo>
|
||||||
|
<apply executable="handlebars">
|
||||||
|
<arg value="-m"/>
|
||||||
|
<arg value="-f"/>
|
||||||
|
<targetfile />
|
||||||
|
<fileset dir=".">
|
||||||
|
<include name="${js_path}/templates/source/*.handlebars" />
|
||||||
|
</fileset>
|
||||||
|
<mapper type="regexp" from="^(.*)/source/(.*)\.handlebars$$" to="\1/compiled/\2.tpl.js" />
|
||||||
|
</apply>
|
||||||
|
<echo>Done</echo>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!-- Build all project -->
|
||||||
|
<target name="all" depends="core_handlebars,chat_app_js,styles_all">
|
||||||
|
<echo>Mibew Messenger built.</echo>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
|
||||||
|
</project>
|
12
src/messenger/build_scripts/cat
Executable file
12
src/messenger/build_scripts/cat
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
files=$1
|
||||||
|
|
||||||
|
if [ -e $files ]
|
||||||
|
then
|
||||||
|
cat /dev/null > $2
|
||||||
|
for file in $files
|
||||||
|
do
|
||||||
|
cat $file >> $2
|
||||||
|
done
|
||||||
|
fi
|
@ -1,66 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
|
|
||||||
<project basedir="." default="update" name="Obfuscator">
|
|
||||||
<property name="closure.c" value="/usr/local/closure/compiler.jar" />
|
|
||||||
<property name="webim.location" value="../compiled" />
|
|
||||||
|
|
||||||
<target name="update">
|
|
||||||
<java jar="${closure.c}" fork="true">
|
|
||||||
<arg value="--module_output_path_prefix"/>
|
|
||||||
<arg value="${webim.location}/"/>
|
|
||||||
<arg value="--module"/>
|
|
||||||
<arg value="common:1"/>
|
|
||||||
<arg value="--js"/>
|
|
||||||
<arg value="common.js"/>
|
|
||||||
<arg value="--module"/>
|
|
||||||
<arg value="chat:1:common"/>
|
|
||||||
<arg value="--js"/>
|
|
||||||
<arg value="chat.js"/>
|
|
||||||
<arg value="--module"/>
|
|
||||||
<arg value="users:1:common"/>
|
|
||||||
<arg value="--js"/>
|
|
||||||
<arg value="users.js"/>
|
|
||||||
<arg value="--module"/>
|
|
||||||
<arg value="brws:1:common"/>
|
|
||||||
<arg value="--js"/>
|
|
||||||
<arg value="brws.js"/>
|
|
||||||
<arg value="--module"/>
|
|
||||||
<arg value="soundcheck:1:common"/>
|
|
||||||
<arg value="--js"/>
|
|
||||||
<arg value="soundcheck.js"/>
|
|
||||||
<arg value="--module"/>
|
|
||||||
<arg value="survey:1:common"/>
|
|
||||||
<arg value="--js"/>
|
|
||||||
<arg value="survey.js"/>
|
|
||||||
<arg value="--module"/>
|
|
||||||
<arg value="invite_op:1:common"/>
|
|
||||||
<arg value="--js"/>
|
|
||||||
<arg value="invite_op.js"/>
|
|
||||||
<arg value="--module"/>
|
|
||||||
<arg value="mibew_api:1:common"/>
|
|
||||||
<arg value="--js"/>
|
|
||||||
<arg value="mibew_api.js"/>
|
|
||||||
<arg value="--module"/>
|
|
||||||
<arg value="pluginmanager:1:common"/>
|
|
||||||
<arg value="--js"/>
|
|
||||||
<arg value="pluginmanager.js"/>
|
|
||||||
<arg value="--module"/>
|
|
||||||
<arg value="handlebars_helpers:1:common"/>
|
|
||||||
<arg value="--js"/>
|
|
||||||
<arg value="handlebars_helpers.js"/>
|
|
||||||
<arg value="--module"/>
|
|
||||||
<arg value="chatserver:1:common"/>
|
|
||||||
<arg value="--js"/>
|
|
||||||
<arg value="chatserver.js"/>
|
|
||||||
<arg value="--module"/>
|
|
||||||
<arg value="invite:1"/>
|
|
||||||
<arg value="--js"/>
|
|
||||||
<arg value="invite.js"/>
|
|
||||||
<arg value="--module"/>
|
|
||||||
<arg value="request:1"/>
|
|
||||||
<arg value="--js"/>
|
|
||||||
<arg value="request.js"/>
|
|
||||||
</java>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
</project>
|
|
Loading…
Reference in New Issue
Block a user