# manys fixes regarding ivy configurations

This commit is contained in:
cbonar 2012-02-03 18:46:59 +01:00
parent 636e8b1382
commit 0c297f8784
13 changed files with 189 additions and 148 deletions

View file

@ -20,11 +20,24 @@ Each project may contain the following directories/files :
- target/doc Documents related to the project
- target/doc/api Developer docs for the project
- target/doc/ivy Dependency report for the project
- target/doc/lib Library artifacts of this project
- target/doc/lib/*-min.js Minified libraries
- target/doc/lib/lib*.js Standalone libraries (contains the project and all its dependencies)
- target/lib Library artifacts of this project
- target/lib/*-min.js Minified libraries
- target/lib/lib*.js Standalone libraries (contains the project and all its dependencies)
- test/resources Different kind of resources for the tests
The build scripts will generate files in a given <publications> directory :
nicobo/ciform/<version>/README.txt Main informations about the project
/ciform/<version>/LICENSE.txt Project's license
/ciform/<version>/NOTICE.txt Notices and attributions required by libraries that the project depends on
/ciform/<version>/ivy.xml Ivy project descriptor
/ciform/<version>/pom.xml Maven project descriptor
/ciform/<version>/ciform.js Source library
/ciform/<version>/ciform-min.js Minified source library
/ciform/<version>/libciform.js Standalone library
/ciform/<version>/libciform-min.js Minified standalone library
/ciform/<version>/doc/api/js/* API documentation
(same for all projects...)
To build the projects, you should only need to :
- extract the required binaries into the 'tools' directory
- rename 'common-sample.properties' in 'tools/build' to 'common.properties' and edit it to reflect your local configuration

View file

@ -1,2 +1,9 @@
Copyright Nicolas BONARDELLE <http://nicobo.net/contact>
All rights reserved
Copyright (c) 2008, Nicolas BONARDELLE <http://nicobo.net/contact>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

24
ciform/NOTICE.txt Normal file
View file

@ -0,0 +1,24 @@
================================================================================
The Javascript libraries "base64*.js" and "hex*.js" contain work copyrighted by Herbert Hanewinkel <www.haneWIN.de>.
================================================================================
================================================================================
The Javascript library "rsa*.js" contains work copyrighted by John M Hanna.
================================================================================
================================================================================
The Javascript library "sha1*.js" contains work copyrighted by Paul Johnston under the following BSD License.
================================================================================
Copyright (c) 1998 - 2009, Paul Johnston & Contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
================================================================================

View file

@ -2,8 +2,5 @@ This project is made to be built directly with Ant and published in different wa
Although it is not a Maven project, its structure often matches Maven's guide lines.
The main project sources lie in the "src" directory and contains one subdirectory for each module :
one for each supported programming language.
It also contains several independent libraries, each one having its own subproject,
located in the root directory of the global project.
See LICENSE.txt for using this product.
See NOTICE.txt about third party resources used by this product.

View file

@ -39,12 +39,12 @@
<concat destfile="${build.bigsource.js}">
<!-- Order is important because of function dependencies -->
<!-- TODO no direct reference to the directory where dependencies are stored : use Ivy to order them accordingly to dependency priorities -->
<fileset dir="${build.dir}/ivy/source">
<fileset dir="${build.dir}/ivy/default">
<include name="rsa*.js" />
<include name="hex*.js" />
<include name="base64*.js" />
<include name="sha1*.js" />
<include name="minilib.js" />
<include name="minilib*.js" />
</fileset>
<fileset dir="${src.dir}" includes="*.js" />
</concat>

View file

@ -7,20 +7,22 @@
</description>
</info>
<configurations>
<conf name="source" description="The library in clear, meaning visible source code and comments." />
<conf name="minified" description="An obfuscated, size-reduced version of the script. Use to speed up loading time in final environment. " />
<conf name="default" description="The library in clear, meaning visible source code and comments." />
<conf name="minified" description="An obfuscated, size-reduced version of the script. Use to speed up loading time in final environment." />
</configurations>
<publications>
<!-- ciform core library -->
<artifact name="ciform" type="js" />
<artifact name="ciform" type="js" conf="default" />
<artifact name="ciform-min" type="js" conf="minified" />
<!-- ciform and all dependencies in a single artifact -->
<artifact name="libciform" type="js" />
<artifact name="libciform" type="js" conf="default" />
<artifact name="libciform-min" type="js" conf="minified" />
</publications>
<dependencies>
<dependency org="nicommons.javascript" name="minilib" rev="latest.integration" conf="*->source" />
<dependency org="nicommons.crypto" name="hex" rev="latest.integration" conf="*->source" />
<dependency org="nicommons.crypto" name="base64" rev="latest.integration" conf="*->source" />
<dependency org="nicommons.crypto" name="sha1" rev="latest.integration" conf="*->source" />
<dependency org="nicommons.crypto" name="rsa" rev="latest.integration" conf="*->source" />
<dependency org="nicommons.javascript" name="minilib" rev="latest.integration" />
<dependency org="nicommons.crypto" name="hex" rev="latest.integration" conf="*->default" />
<dependency org="nicommons.crypto" name="base64" rev="latest.integration" conf="*->default" />
<dependency org="nicommons.crypto" name="sha1" rev="latest.integration" conf="*->default" />
<dependency org="nicommons.crypto" name="rsa" rev="latest.integration" conf="*->default" />
</dependencies>
</ivy-module>

View file

@ -7,13 +7,11 @@
</description>
</info>
<configurations>
<!-- The source script as plain text, including all inner informations and comments. -->
<conf name="source"/>
<!-- An obfuscated, size-reduced version of the script. Use to speed up loading time in final environment. -->
<conf name="minified"/>
<conf name="default" description="The library in clear, meaning visible source code and comments." />
<conf name="minified" description="An obfuscated, size-reduced version of the script. Use to speed up loading time in final environment." />
</configurations>
<publications>
<artifact name="base64" type="js" conf="source"/>
<artifact name="base64" type="js" conf="default"/>
<artifact name="base64-min" type="js" conf="minified"/>
</publications>
<dependencies>

View file

@ -6,16 +6,14 @@
</description>
</info>
<configurations>
<!-- The source script as plain text, including all inner informations and comments. -->
<conf name="source"/>
<!-- An obfuscated, size-reduced version of the script. Use to speed up loading time in final environment. -->
<conf name="minified"/>
<conf name="default" description="The library in clear, meaning visible source code and comments." />
<conf name="minified" description="An obfuscated, size-reduced version of the script. Use to speed up loading time in final environment." />
</configurations>
<publications>
<artifact name="hex" type="js" conf="source"/>
<artifact name="hex" type="js" conf="default"/>
<artifact name="hex-min" type="js" conf="minified"/>
</publications>
<dependencies>
<dependency org="nicommons.crypto" name="rsa" rev="latest.integration" conf="*->source" />
<dependency org="nicommons.crypto" name="rsa" rev="latest.integration" conf="*->default" />
</dependencies>
</ivy-module>

View file

@ -8,11 +8,11 @@
</description>
</info>
<configurations>
<conf name="source" description="The library in clear, meaning visible source code and comments." />
<conf name="minified" description="An obfuscated, size-reduced version of the script. Use to speed up loading time in final environment. " />
<conf name="default" description="The library in clear, meaning visible source code and comments." />
<conf name="minified" description="An obfuscated, size-reduced version of the script. Use to speed up loading time in final environment." />
</configurations>
<publications>
<artifact name="rsa" type="js" conf="source"/>
<artifact name="rsa" type="js" conf="default"/>
<artifact name="rsa-min" type="js" conf="minified"/>
</publications>
<dependencies>

View file

@ -1,9 +1,9 @@
<!--
Build script for the project "Crypto.Base64".
Build script for the project "Crypto.SHA1".
This script is based on a template for Javascript projects.
-->
<project name="Crypto.Base64" default="javascript.package" xmlns:ivy="antlib:org.apache.ivy.ant">
<project name="Crypto.SHA1" default="javascript.package" xmlns:ivy="antlib:org.apache.ivy.ant">
<!-- local properties for this project -->
<property file="local.properties"/>

View file

@ -1,20 +1,18 @@
<ivy-module version="2.0">
<info organisation="nicommons.crypto" module="sha1" revision="1.0.0" status="integration">
<license name="Copyright Paul Johnston 2000 - 2002" url="http://pajhome.org.uk/crypt/md5"/>
<license name="BSD License"/>
<license name="Copyright Paul Johnston 2000 - 2002" url="http://pajhome.org.uk/crypt/md5" />
<license name="BSD License" url="http://pajhome.org.uk/site/legal.html#bsdlicense"/>
<ivyauthor name="Nicolas BONARDELLE" url="http://nicobo.net/contact?subject=crypto+base64+ivy"/>
<description homepage="http://ciform.googlecode.com">
A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined in FIPS PUB 180-1
</description>
</info>
<configurations>
<!-- The source script as plain text, including all inner informations and comments. -->
<conf name="source"/>
<!-- An obfuscated, size-reduced version of the script. Use to speed up loading time in final environment. -->
<conf name="minified"/>
<conf name="default" description="The library in clear, meaning visible source code and comments." />
<conf name="minified" description="An obfuscated, size-reduced version of the script. Use to speed up loading time in final environment." />
</configurations>
<publications>
<artifact name="sha1" type="js" conf="source"/>
<artifact name="sha1" type="js" conf="default"/>
<artifact name="sha1-min" type="js" conf="minified"/>
</publications>
<dependencies>

View file

@ -6,12 +6,8 @@
Small set of core Javascript functions to avoid dependending on bigger frameworks like jquery when possible.
</description>
</info>
<configurations>
<conf name="source" description="The library in clear, meaning visible source code and comments." />
<conf name="minified" description="An obfuscated, size-reduced version of the script. Use to speed up loading time in final environment. " />
</configurations>
<publications>
<artifact name="minilib" type="js"/>
<artifact name="minilib" type="js" />
</publications>
<dependencies>
<!-- none -->

View file

@ -31,84 +31,58 @@
<!--
Main targets : they are greatly inspired from the Maven build lifecycle
Main phases : they are greatly inspired from the Maven build lifecycle
See http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference
-->
<target name="validate" description="Validates the project is correct and all necessary information is available.">
<!-- Retrieves dependencies with ivy : required to initialize the cache and to get informations about the module being built -->
<ivy:retrieve pattern="${build.dir}/ivy/[conf]/[artifact].[ext]" />
<!-- Creates required directories -->
<mkdir dir="${target.dir}" />
</target>
<extension-point name="validate" description="Validates the project is correct and all necessary information is available." />
<extension-point name="compile" depends="validate" description="Compiles the source code of the project.">
<!-- We use this target to copy all required files for the tests together in a consistent hierarchy -->
<!--
<copy file="${jsunit.coreJs}" todir="${jsunit.tmp}"/>
<copy todir="${jsunit.tmp}" overwrite="true">
<resources refid="jsunit.in.files"/>
</copy>
-->
<!-- nothing more to do -->
</extension-point>
<extension-point name="compile" depends="validate" description="Compiles the source code of the project." />
<extension-point name="test" depends="compile" description="Tests the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed." />
<extension-point name="package" depends="build-default, build-minified, test" description="Takes the compiled code and package it in its distributable format, such as a JAR." />
<extension-point name="package" depends="test" description="Takes the compiled code and package it in its distributable format, such as a JAR." />
<target name="integration-test" depends="package" description="Processes and deploys the package if necessary into an environment where integration tests can be run.">
<!-- Testing the compressed version of the library -->
<!-- Replaces the tested library with the compressed version -->
<!-- FIXME : it's not clean : it should not override a file already in build.dir -->
<!--
<copy file="${target.dir}/${ant.project.name}-compressed-${ivy.revision}.js" tofile="${build.dir}/sha1.js"/>
-->
<!--
<resources id="jsunit.in.files">
<file file="${build.dir}/sha1.js"/>
<fileset dir="${tests.dir}"/>
</resources>
-->
<!--
<antcall target="jsunit">
<reference refid="jsunit.in.files"/>
<param name="jsunit.in.testsuite" value="AllTests.html"/>
<param name="jsunit.out.logs" value="${tests.logs}"/>
</antcall>
-->
<!-- nothing more to do -->
</target>
<extension-point name="integration-test" depends="package" description="Processes and deploys the package if necessary into an environment where integration tests can be run." />
<extension-point name="verify" depends="integration-test" description="Runs any checks to verify the package is valid and meets quality criteria." />
<target name="install" depends="build-default, build-minified, test" description="Installs the package into the local repository, for use as a dependency in other projects locally.">
<!-- 'local' resolver is a default one bundled with Ivy -->
<!-- 'artifactspattern' must match the name of the files this script builds -->
<ivy:publish resolver="local" artifactspattern="${target.lib.dir}/[artifact]-[revision].[ext]" overwrite="true" forcedeliver="true" />
</target>
<extension-point name="install" description="Installs the package into the local repository, for use as a dependency in other projects locally." />
<extension-point name="deploy" depends="verify" description="Done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects." />
<target name="clean" description="Restores the initial state of the project, deleting any generated file.">
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${build.dir}" />
<fileset dir="${target.dir}" />
</delete>
</target>
<extension-point name="clean" description="Restores the initial state of the project, deleting any generated file." />
<extension-point name="site" depends="site-doc" description="Generates site (developer) documentation for this project." />
<extension-point name="site" description="Generates site documentation for this project." />
<!--
Some more specific targets
-->
<target name="site-doc" depends="validate" description="Generates site (developer) documentation for this project.">
<target name="make-validate" extensionOf="validate" description="Validates the project is correct and all necessary information is available.">
<!-- Retrieves dependencies with ivy : required to initialize the cache and to get informations about the module being built -->
<!-- We use the default pattern, but put the resolved artifacts in a directory of ours so we can delete it afterwards -->
<ivy:retrieve pattern="${build.dir}/ivy/[conf]/[artifact].[ext]" sync="true" />
<!-- Creates required directories -->
<mkdir dir="${target.dir}" />
</target>
<target name="ivy-install" extensionOf="install" depends="validate" description="Builds and installs the artifacts into the local Ivy repository.">
<!-- 'local' resolver is a default one bundled with Ivy ; it resides in the user's home directory -->
<!-- 'artifactspattern' must match the name of the files this script builds -->
<!-- Note : We use all options to force overwriting of existing (and possibly deprecated, during development) files -->
<ivy:publish resolver="local" artifactspattern="${target.lib.dir}/[artifact].[ext]" overwrite="true" forcedeliver="true" publishivy="true" />
</target>
<target name="make-clean" extensionOf="clean" description="Deletes build and target directories">
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${build.dir}" />
<fileset dir="${target.dir}" />
</delete>
</target>
<target name="doc" depends="validate" extensionOf="site" description="Generates API documentation for this project.">
<!-- Generates a report of dependencies -->
<ivy:report todir="${target.dir}/doc/ivy"/>
@ -150,8 +124,8 @@
<attribute name="module" default="${ivy.module}" />
<attribute name="revision" default="${ivy.revision}" />
<sequential>
<copy file="@{bigsource}" tofile="@{dir}/@{module}-@{revision}.js" />
<echo message="Copied : @{dir}/@{module}-@{revision}.js" />
<copy file="@{bigsource}" tofile="@{dir}/@{module}.js" />
<echo message="Copied : @{dir}/@{module}.js" />
</sequential>
</macrodef>
@ -161,34 +135,68 @@
<attribute name="module" default="${ivy.module}" />
<attribute name="revision" default="${ivy.revision}" />
<sequential>
<java jar="${yuicompressor.jar}" fork="true" output="@{dir}/@{module}-min-@{revision}.js" failonerror="true">
<java jar="${yuicompressor.jar}" fork="true" output="@{dir}/@{module}-min.js" failonerror="true">
<arg line="--type js" />
<arg file="@{bigsource}"/>
</java>
<echo message="Minified : @{dir}/@{module}-min-@{revision}.js" />
<echo message="Minified : @{dir}/@{module}-min.js" />
</sequential>
</macrodef>
<target name="build-default" depends="build-bigsource" description="Builds the default .js.">
<target name="build-default" extensionOf="package" depends="build-bigsource" description="Builds the default .js.">
<make-default bigsource="${build.bigsource.js}" />
</target>
<target name="build-minified" depends="build-bigsource" description="Builds a minified version of the .js.">
<target name="build-minified" extensionOf="package" depends="build-bigsource" description="Builds a minified version of the .js.">
<make-min bigsource="${build.bigsource.js}" />
</target>
<target name="build-pom" extensionOf="package" depends="validate, install" description="Builds a Maven POM.">
<target name="build-pom" extensionOf="package" depends="validate" description="Builds a Maven POM.">
<!-- TODO Is 'pom.xml' a standard name for this file ? -->
<ivy:makepom ivyfile="${basedir}/ivy.xml" pomfile="${target.dir}/pom.xml" />
</target>
<target name="make-deploy" extensionOf="deploy" depends="package" description="Deploys to the local 'publications' directory." >
<ivy:publish resolver="local" artifactspattern="${pub.dir}/[module]/[artifact]-[conf]-[revision].[ext]" overwrite="true" forcedeliver="true" />
</target>
<!--
TODO fix and integrate the following targets
-->
<target name="pre-test" extensionOf="test" description="Runs unit tests">
<!-- We use this target to copy all required files for the tests together in a consistent hierarchy -->
<!--
<copy file="${jsunit.coreJs}" todir="${jsunit.tmp}"/>
<copy todir="${jsunit.tmp}" overwrite="true">
<resources refid="jsunit.in.files"/>
</copy>
-->
<!-- nothing more to do -->
</target>
<target name="test-integration" extensionOf="integration-test" description="Runs integration tests" >
<!-- Testing the compressed version of the library -->
<!-- Replaces the tested library with the compressed version -->
<!-- FIXME : it's not clean : it should not override a file already in build.dir -->
<!--
<copy file="${target.dir}/${ant.project.name}-compressed-${ivy.revision}.js" tofile="${build.dir}/sha1.js"/>
-->
<!--
<resources id="jsunit.in.files">
<file file="${build.dir}/sha1.js"/>
<fileset dir="${tests.dir}"/>
</resources>
-->
<!--
<antcall target="jsunit">
<reference refid="jsunit.in.files"/>
<param name="jsunit.in.testsuite" value="AllTests.html"/>
<param name="jsunit.out.logs" value="${tests.logs}"/>
</antcall>
-->
<!-- nothing more to do -->
</target>
<!--
Runs JsUnit tests. This target saves a lot of verbosity in the projects' build scripts.