SWF-1362 Add script to prepare custom dojo build, remove dojo and dijit directories, invoke shrinksafe to minify Spring.js and Spring-Dojo.js during the build
This commit is contained in:
3
build-spring-webflow/dojo-build/README.txt
Normal file
3
build-spring-webflow/dojo-build/README.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
This directory contains the custom build of Dojo that distributed with Spring JavaScript.
|
||||
See ../../spring-js/scripts/dojo/README.txt for details.
|
||||
BIN
build-spring-webflow/dojo-build/dojo-build.zip
Normal file
BIN
build-spring-webflow/dojo-build/dojo-build.zip
Normal file
Binary file not shown.
@@ -7,13 +7,20 @@
|
||||
<resolvers>
|
||||
<chain name="extended-external-lookup">
|
||||
<resolver ref="external-lookup"/>
|
||||
<!-- Maven central -->
|
||||
<ibiblio name="maven2" m2compatible="true"/>
|
||||
<!-- Repository for Mojarra 2.x -->
|
||||
<url name="java-net-maven2" m2compatible="true">
|
||||
<artifact pattern="http://download.java.net/maven/2/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"/>
|
||||
</url>
|
||||
<!-- Repository for PrimeFaces -->
|
||||
<url name="primefaces-maven2" m2compatible="true">
|
||||
<artifact pattern="http://repository.prime.com.tr/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"/>
|
||||
</url>
|
||||
<!-- Repository for MyFaces Core 2.0.1-SNAPSHOT -->
|
||||
<url name="apache-maven2-snapshot" m2compatible="true">
|
||||
<artifact pattern="http://people.apache.org/repo/m2-snapshot-repository/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"/>
|
||||
</url>
|
||||
<ibiblio name="maven2" m2compatible="true"/>
|
||||
</chain>
|
||||
</resolvers>
|
||||
|
||||
|
||||
93
build-spring-webflow/package-artifact.xml
Normal file
93
build-spring-webflow/package-artifact.xml
Normal file
@@ -0,0 +1,93 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="package-artifact" xmlns:ivy="antlib:org.apache.ivy.ant">
|
||||
|
||||
<target name="javadoc-all" depends="ivy.init, resolve.compile, src.init" if="src.exists"
|
||||
description="Creates javadoc documentation for all classes.">
|
||||
<java-doc input.dir="${main.java.dir}" output.dir="${javadoc-all.output.dir}" classpath.id="compile.classpath"
|
||||
access="private"/>
|
||||
<antcall target="jsdoc-api"/>
|
||||
</target>
|
||||
|
||||
<target name="javadoc-api" depends="ivy.init, resolve.compile, src.init" if="src.exists"
|
||||
description="Creates javadoc documentation for all classes.">
|
||||
<java-doc input.dir="${main.java.dir}" output.dir="${javadoc-api.output.dir}" classpath.id="compile.classpath"
|
||||
access="protected" exclude.package.names="${javadoc.exclude.package.names}"/>
|
||||
<antcall target="jsdoc-api"/>
|
||||
</target>
|
||||
|
||||
<target name="jar" depends="ivy.init, resolve.compile, compile.init, jar.init"
|
||||
description="Creates a JAR file containing the output of a compilation of the source tree.">
|
||||
|
||||
<delete quiet="true" file="${ivy.output.file}"/>
|
||||
<mkdir dir="${ivy.output.dir}"/>
|
||||
<delete quiet="true" file="${jar.output.file}"/>
|
||||
<mkdir dir="${jar.output.dir}"/>
|
||||
<delete quiet="true" file="${source-jar.output.file}"/>
|
||||
<mkdir dir="${source-jar.output.dir}"/>
|
||||
|
||||
<compile classpath.id="compile.classpath" input.dir="${main.java.dir}" output.dir="${main.output.dir}"
|
||||
resources.dir="${main.resources.dir}"/>
|
||||
|
||||
<antcall target="minify-spring-js" inheritAll="false"/>
|
||||
|
||||
<unzip src="${basedir}/../build-spring-webflow/dojo-build/dojo-build.zip"
|
||||
dest="${main.output.dir}/META-INF"/>
|
||||
|
||||
<jar destfile="${jar.output.file}" basedir="${main.output.dir}" index="true" filesetmanifest="merge">
|
||||
<manifest>
|
||||
<attribute name="Bundle-ManifestVersion" value="2"/>
|
||||
<attribute name="Bundle-Version" value="${bundle.version}"/>
|
||||
<attribute name="Implementation-Title" value="${implementation.title}"/>
|
||||
<attribute name="Implementation-Version" value="${implementation.version}"/>
|
||||
</manifest>
|
||||
</jar>
|
||||
<antcall target="bundlor"/>
|
||||
<jar destfile="${source-jar.output.file}" basedir="${main.java.dir}" index="true"/>
|
||||
<ivy:publish resolver="integration" pubdate="${timestamp}" status="${release.type}">
|
||||
<artifacts pattern="${jar.output.dir}/[artifact].[ext]"/>
|
||||
<artifacts pattern="${source-jar.output.dir}/[artifact].[ext]"/>
|
||||
<artifacts pattern="${ivy.output.dir}/[artifact].[ext]"/>
|
||||
</ivy:publish>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="minify-spring-js">
|
||||
|
||||
<ivy:cachepath resolveId="shrinksafe.path" pathid="shrinksafe.path"
|
||||
organisation="org.dojotoolkit"
|
||||
module="com.springsource.org.dojotoolkit.shrinksafe"
|
||||
revision="1.3.2"
|
||||
conf="runtime" type="jar" inline="true"
|
||||
log="download-only"/>
|
||||
|
||||
<macrodef name="compress">
|
||||
<attribute name="file"/>
|
||||
<sequential>
|
||||
<copy file="${main.output.dir}@{file}" tofile="${main.output.dir}@{file}.uncompressed.js" />
|
||||
<java classname="org.dojotoolkit.shrinksafe.Main" output="${main.output.dir}@{file}.TMP.js">
|
||||
<classpath refid="shrinksafe.path"/>
|
||||
<arg value="${main.output.dir}@{file}"/>
|
||||
</java>
|
||||
<move file="${main.output.dir}@{file}.TMP.js" toFile="${main.output.dir}@{file}">
|
||||
<filterchain>
|
||||
<filterreader classname="org.apache.tools.ant.filters.StripLineBreaks"/>
|
||||
</filterchain>
|
||||
<filterchain>
|
||||
<concatfilter prepend="${basedir}/../build-spring-webflow/resources/javascript-copyright.txt"/>
|
||||
</filterchain>
|
||||
</move>
|
||||
<delete file="${main.output.dir}@{file}.TMP.js" />
|
||||
</sequential>
|
||||
</macrodef>
|
||||
|
||||
<compress file="/META-INF/spring/Spring.js"/>
|
||||
<compress file="/META-INF/spring/Spring-Dojo.js"/>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="jsdoc-api" description="Creates JavaScript API documentation.">
|
||||
<!-- TODO -->
|
||||
</target>
|
||||
|
||||
</project>
|
||||
|
||||
15
build-spring-webflow/resources/javascript-copyright.txt
Normal file
15
build-spring-webflow/resources/javascript-copyright.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright 2004-2008 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
Reference in New Issue
Block a user