+ minilib has now its own project root

+ tools for phpdoc
# more directory layout refactoring (up a few levels for some)
+ more advanced and cleaner build features
This commit is contained in:
cbonar 2012-01-29 19:58:43 +01:00
parent 89aa44b909
commit 6ac42eeb24
44 changed files with 187 additions and 42 deletions

View file

@ -28,3 +28,7 @@ crypto/rsa/target
crypto/rsa/build
crypto/sha1/target
crypto/sha1/build
tools/php-5.3.9-Win32-VC9-x86
tools/PhpDocumentor-1.4.4
minilib/lib
tools/build/common.properties

View file

@ -23,17 +23,11 @@ tools.dir=../tools
# Where the source files are : here Maven-style
src.dir=${basedir}/src/main/javascript
# Directory used to put temporary files during build
# Temporary directory where to put intermediate files during build
build.dir=${basedir}/build
# Where the generated files are going
# Where the final files are going
target.dir=${basedir}/target
# Where the generated libraries are going
lib.dir=${target.dir}/lib
# Where to copy the documentation
doc.dir=${target.dir}/doc
# set to common properties file
common.properties=${tools.dir}/build/common.properties

View file

@ -14,4 +14,66 @@
<!-- template for javascript projects -->
<import file="${ant.jsproject.path}" />
<property name="src.php.dir" value="${src.dir}/php" />
<target name="phpdoc" description="Generates PHP API docs">
<mkdir dir="${target.dir}/doc/api/php" />
<exec command="${phpdoc.exe}" failonerror="true">
<arg value="--directory" />
<arg file="${src.php.dir}" />
<!--<arg file="${src.php.dir},/opt/PEAR/Crypt" />-->
<arg value="--pear"/>
<arg value="--target"/>
<arg file="${target.dir}/doc/api/php/"/>
<arg line="--output HTML:Smarty:PHP"/>
<arg line="--sourcecode on"/>
<arg value="--title"/>
<arg value="${ant.project.name} PHP API documentation"/>
<arg line="--parseprivate on"/>
</exec>
</target>
<target name="build-lib" depends="validate" description="Builds the bigsource file to work with for the 'lib' artifact" >
<tempfile property="build.bigsource.js" destDir="${build.dir}" prefix="lib${ant.project.name}" suffix=".js" />
<!-- TODO handle encoding (and eol?) -->
<concat destfile="${build.bigsource.js}">
<fileset dir="${src.dir}">
<!-- order is important because of function dependencies -->
<include name="${lib.dir}/hex*.js" />
<include name="${lib.dir}/base64*.js" />
<include name="${lib.dir}/sha1*.js" />
<include name="${lib.dir}/rsa*.js" />
<include name="${src.dir}/minilib.js" />
<include name="${src.dir}/ciform.js" />
</fileset>
</concat>
<echo message="Created : ${build.bigsource.js}" level="verbose" />
</target>
<target name="nico" >
</target>
<target name="resolve-dependencies" description="(internal) Builds an ordered list of dependent modules." >
<ivy:buildlist root="ciform" excluderoot="true" reference="build.lib.ants">
<fileset dir="." includes="build.xml" />
<fileset dir="../crypto" includes="**/build.xml"/>
<fileset dir="../minilib" includes="**/build.xml"/>
</ivy:buildlist>
</target>
<target name="install-all" depends="resolve-dependencies" description="Builds all dependent projects and installs their artifacts into the local Ivy repo.">
<!-- executes the build script on each dependent module -->
<subant buildpathref="build.lib.ants">
<target name="package" />
<target name="install" />
</subant>
</target>
<target name="clean-all" depends="resolve-dependencies" description="Builds all dependent projects and installs their artifacts into the local Ivy repo.">
<!-- executes the build script on each dependent module -->
<subant buildpathref="build.lib.ants">
<target name="clean" />
</subant>
</target>
</project>

View file

@ -1,5 +1,5 @@
<ivy-module version="2.0">
<info organisation="ciform" module="" revision="1.0.0" status="integration" publication="20120127183109">
<info organisation="nicobo" module="ciform" revision="1.0.0" status="integration" publication="20120127183109">
<license name="LGPL" url="http://plugnauth.sf.net/ciform/license"/>
<ivyauthor name="Nicolas BONARDELLE" url="http://nicobo.net/contact?subject=ciform+ivy"/>
<description homepage="http://plugnauth.sourceforge.net/ciform">
@ -7,19 +7,20 @@
</description>
</info>
<configurations>
<conf name="core"/>
<conf name="standalone"/>
<conf name="source"/>
<conf name="minified"/>
</configurations>
<publications>
<artifact name="ciform" type="js" conf="core"/>
<artifact name="ciform-min" type="js" conf="core"/>
<artifact name="minilib" type="js" conf="core"/>
<artifact name="minilib-min" type="js" conf="core"/>
<artifact name="libciform" type="js" conf="standalone"/>
<artifact name="libciform-min" type="js" conf="standalone"/>
<artifact name="ciform" type="js" conf="source"/>
<artifact name="ciform-min" type="js" conf="minified"/>
<artifact name="libciform" type="js" conf="source"/>
<artifact name="libciform-min" type="js" conf="minified"/>
</publications>
<dependencies>
<dependency org="crypto" name="rsa" rev="1.0.0" revConstraint="latest.integration" conf="core->minified;standalone->minified"/>
<dependency org="crypto" name="sha1" rev="1.0.0" revConstraint="latest.integration" conf="core->minified;standalone->minified"/>
<dependency org="nicobo" name="minilib" rev="latest.integration" conf="*->source" />
<dependency org="crypto" name="hex" rev="latest.integration" conf="*->source" />
<dependency org="crypto" name="base64" rev="latest.integration" conf="*->source" />
<dependency org="crypto" name="sha1" rev="latest.integration" conf="*->source" />
<dependency org="crypto" name="rsa" rev="latest.integration" conf="*->source" />
</dependencies>
</ivy-module>

View file

Before

Width:  |  Height:  |  Size: 333 B

After

Width:  |  Height:  |  Size: 333 B

View file

Before

Width:  |  Height:  |  Size: 344 B

After

Width:  |  Height:  |  Size: 344 B

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 341 B

After

Width:  |  Height:  |  Size: 341 B

View file

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View file

Before

Width:  |  Height:  |  Size: 230 B

After

Width:  |  Height:  |  Size: 230 B

View file

@ -17,8 +17,7 @@
#
########################################
basedir=.
tools.dir=../../tools
tools.dir=${basedir}/../../tools
# Where the source files are : here Maven-style
src.dir=${basedir}/src/main/javascript

View file

@ -11,7 +11,7 @@
<property file="build.properties"/>
<!-- common properties for all projects -->
<property file="${common.properties}"/>
<property file="${common.properties}" relative="true" />
<!-- template for javascript projects -->
<import file="${ant.jsproject.path}" />

View file

@ -1,5 +1,5 @@
<ivy-module version="2.0">
<info organisation="crypto" module="rsa" revision="1.0.0" status="integration" publication="20120127183302">
<info organisation="crypto" module="rsa" revision="1.0.0" status="integration" publication="20120127235629">
<license name="Copyright 2000 by John M Hanna" url="http://sourceforge.net/projects/shop-js"/>
<license name="GNU General Public License (GPL)" url="http://www.gnu.org/copyleft/gpl.html"/>
<ivyauthor name="Nicolas BONARDELLE" url="http://nicobo.net/contact?subject=crypto+rsa+ivy"/>

View file

@ -1,5 +1,5 @@
<ivy-module version="2.0">
<info organisation="crypto" module="sha1" revision="1.0.0" status="integration" publication="20120127183603">
<info organisation="crypto" module="sha1" revision="1.0.0" status="integration" publication="20120127235637">
<license name="Copyright Paul Johnston 2000 - 2002" url="http://pajhome.org.uk/crypt/md5"/>
<license name="BSD License"/>
<ivyauthor name="Nicolas BONARDELLE" url="http://nicobo.net/contact?subject=crypto+base64+ivy"/>

33
minilib/build.properties Normal file
View file

@ -0,0 +1,33 @@
########################################
#
# This file defines properties specific only to this project.
#
# Some important properties are marked as "required" so you can spot them.
# They are required to have valid values for the projects to build.
#
# You should not need to override those properties.
# If you really need to, you may create a new file called "local.properties" in the same directory
# and put inside any property you want to fit your local configuration.
#
# The "local.properties" file is meant to stay local,
# therefore you won't find it on the version control system (SVN, Hg, ...).
#
# If you don't wish to create such a file, you may pass the required properties
# to ant as command line arguments using the -D option.
#
########################################
basedir=.
tools.dir=../tools
# Where the source files are : here Maven-style
src.dir=${basedir}/src/main/js
# Directory used to put temporary files during build
build.dir=${basedir}/build
# Where the generated files are going
target.dir=${basedir}/target
# set to common properties file
common.properties=${tools.dir}/build/common.properties

19
minilib/build.xml Normal file
View file

@ -0,0 +1,19 @@
<!--
Build script for the project "minilib".
This script is based on a template for Javascript projects.
-->
<project name="minilib" default="javascript.package" xmlns:ivy="antlib:org.apache.ivy.ant">
<!-- local properties for this project -->
<property file="local.properties"/>
<!-- default properties for this project -->
<property file="build.properties"/>
<!-- common properties for all projects -->
<property file="${common.properties}"/>
<!-- template for javascript projects -->
<import file="${ant.jsproject.path}" />
</project>

19
minilib/ivy.xml Normal file
View file

@ -0,0 +1,19 @@
<ivy-module version="2.0">
<info organisation="nicobo" module="minilib" revision="1.0.0" status="integration">
<license name="BSD simplified" url="http://www.opensource.org/licenses/BSD-2-Clause"/>
<ivyauthor name="Nicolas BONARDELLE" url="http://nicobo.net/contact?subject=minilib+ivy"/>
<description homepage="http://ciform.googlecode.com">
Small set of core Javascript functions to avoid dependending on bigger frameworks like jquery when possible.
</description>
</info>
<configurations>
<conf name="source"/>
<conf name="minified"/>
</configurations>
<publications>
<artifact name="minilib" type="js"/>
</publications>
<dependencies>
<!-- none -->
</dependencies>
</ivy-module>

View file

@ -11,7 +11,7 @@
@fileoverview
This library provides a very minimalistic set of functions to fill some gaps in the core Javascript language.<br>
It should be compatible with most current market's libraries, so that if size would not be a problem it <em>should</em> easily be replaced/enhanced with one of them.<br>
It should be replaced with one of the (better) frameworks on the market (jquery, mootools, ...) if size is not a problem.<br>
@author Nicolas BONARDELLE &lt;<a href="http://nicobo.net/contact">http://nicobo.net/contact</a>&gt;
*/
@ -112,6 +112,7 @@ function equals( o1, o2, noCase )
/**
@param value The value to look for
@param noCase If the value is a String, use a case insensitive test to search this object
@return true if this array contains the given value (not key)
@addon

Binary file not shown.

View file

@ -16,6 +16,8 @@
<!-- example of use : default generic properties -->
<property file="default.properties"/>
<!-- shorthand properties -->
<property name="target.lib.dir" value="${target.dir}/lib" />
<!--
Loads dependent tasks
@ -33,7 +35,7 @@
<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 />
<ivy:retrieve pattern="${build.dir}/ivy/[conf]/[artifact].[ext]" />
<!-- Creates required directories -->
<mkdir dir="${target.dir}" />
</target>
@ -54,6 +56,7 @@
</target>
<target name="package" depends="build-src, build-min, test, doc" description="Takes the compiled code and package it in its distributable format, such as a JAR.">
<!-- TODO call a target "build-<conf>" for each Ivy configuration -->
<!-- nothing more to do -->
</target>
@ -91,7 +94,7 @@
<target name="install" depends="build-src, build-min, 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" srcivypattern="ivy.xml" artifactspattern="${lib.dir}/[artifact]-[revision].[ext]" overwrite="true" forcedeliver="true" />
<ivy:publish resolver="local" artifactspattern="${target.lib.dir}/[artifact]-[revision].[ext]" overwrite="true" forcedeliver="true" />
</target>
<target 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.">
@ -100,8 +103,8 @@
<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}"/>
<fileset dir="${build.dir}" />
<fileset dir="${target.dir}" />
</delete>
</target>
@ -111,20 +114,22 @@
-->
<target name="doc" depends="validate" description="Generates developer documentation.">
<!-- Generates a report of dependencies -->
<ivy:report todir="${doc.dir}/ivy"/>
<ivy:report todir="${target.dir}/doc/ivy"/>
<!-- Generates the API doc -->
<!--<mkdir dir="${doc.dir}/api" />-->
<java jar="${jsdoc.dir}/jsrun.jar" fork="true" failonerror="true">
<arg file="${jsdoc.dir}/app/run.js" />
<arg file="${src.dir}"/>
<arg prefix="--template=" file="${jsdoc.dir}/templates/jsdoc" />
<arg value="--allfunctions" />
<arg value="--private" />
<arg prefix="--directory=" file="${doc.dir}/api"/>
<arg prefix="--directory=" file="${target.dir}/doc/api/js"/>
<arg value="--recurse"/>
<arg value="--verbose" />
</java>
<echo message="Done generating doc." />
</target>
@ -132,7 +137,7 @@
Takes all *.js files inside ${src.dir} as input.
Creates a file name after the new property 'build.bigsource.js'.
-->
<target name="concat-sources" depends="validate" description="Copies all source scripts into one big file for further work on it." >
<target name="build-bigsource" depends="validate" description="Copies all source scripts into one big file for further work on it." >
<tempfile property="build.bigsource.js" destDir="${build.dir}" prefix="${ant.project.name}" suffix=".js" />
<!-- TODO handle encoding (and eol?) -->
<concat destfile="${build.bigsource.js}">
@ -143,17 +148,17 @@
<echo message="Created : ${build.bigsource.js}" level="verbose" />
</target>
<target name="build-src" depends="concat-sources" description="Builds the default .js.">
<copy file="${build.bigsource.js}" tofile="${lib.dir}/${ivy.module}-${ivy.revision}.js" />
<echo message="Copied : ${lib.dir}/${ivy.module}-${ivy.revision}.js" />
<target name="build-src" depends="build-bigsource" description="Builds the default .js.">
<copy file="${build.bigsource.js}" tofile="${target.lib.dir}/${ivy.module}-${ivy.revision}.js" />
<echo message="Copied : ${target.lib.dir}/${ivy.module}-${ivy.revision}.js" />
</target>
<target name="build-min" depends="concat-sources" description="Builds a minified version of the .js.">
<java jar="${yuicompressor.jar}" fork="true" output="${lib.dir}/${ivy.module}-min-${ivy.revision}.js" failonerror="true">
<target name="build-min" depends="build-bigsource" description="Builds a minified version of the .js.">
<java jar="${yuicompressor.jar}" fork="true" output="${target.lib.dir}/${ivy.module}-min-${ivy.revision}.js" failonerror="true">
<arg line="--type js" />
<arg file="${build.bigsource.js}"/>
</java>
<echo message="Minified : ${lib.dir}/${ivy.module}-min-${ivy.revision}.js" />
<echo message="Minified : ${target.lib.dir}/${ivy.module}-min-${ivy.revision}.js" />
</target>
@ -214,17 +219,22 @@
<!-- Generates developer documentation using (old) jsdoc. -->
<target name="jsdoc" depends="validate">
<!-- Generates a report of dependencies -->
<ivy:report todir="${doc.dir}"/>
<ivy:report todir="${target.dir}/doc/ivy"/>
<!-- Generates the API doc -->
<exec command="${jsdoc}" failonerror="true">
<arg value="-d"/> <arg value="${doc.dir}"/>
<arg value="-d"/>
<arg value="${{target.dir}/doc/js"/>
<arg value="--no-lexical-privates"/>
<arg value="--package-naming"/>
<arg value="--nested-file-naming"/>
<arg line="--logo pix/ciform-flat-48x48.png" />
<arg line="--project-name Crypto.SHA1"/>
<arg value="${src.dir}"/>
</exec>
</target>
</project>

View file

@ -47,3 +47,6 @@ yuicompressor.jar=${tools.dir}/yuicompressor-2.4.7.jar
# Installation directory of JSDoc-toolkit (http://code.google.com/p/jsdoc-toolkit)
# (required) -> define this property in your "local.properties" file
jsdoc.dir=${tools.dir}/jsdoc-toolkit
# Command to run PHPDocumentor
phpdoc.exe=${tools.dir}/php-5.3.9-Win32-VC9-x86/php.exe ${tools.dir}/PhpDocumentor-1.4.4/phpdoc.php

Binary file not shown.