shiro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lhazlew...@apache.org
Subject svn commit: r732934 - in /incubator/jsecurity/trunk: ./ core/ core/src/org/jsecurity/mgt/ support/ehcache/ support/quartz/ support/spring/ web/
Date Fri, 09 Jan 2009 05:52:25 GMT
Author: lhazlewood
Date: Thu Jan  8 21:52:25 2009
New Revision: 732934

URL: http://svn.apache.org/viewvc?rev=732934&view=rev
Log:
Modularized the build files to correspond to the new modular structure.  Ensured the default
CacheManager is a DefaultCacheManager (not EhCacheManager), pending final outcome on dev list
whether or not enable or disable caching expliclity.

Added:
    incubator/jsecurity/trunk/common.ant.xml
    incubator/jsecurity/trunk/core/build.xml
    incubator/jsecurity/trunk/support/ehcache/build.xml
    incubator/jsecurity/trunk/support/quartz/build.xml
    incubator/jsecurity/trunk/support/spring/build.xml
    incubator/jsecurity/trunk/web/build.xml
Modified:
    incubator/jsecurity/trunk/build.xml
    incubator/jsecurity/trunk/core/src/org/jsecurity/mgt/CachingSecurityManager.java
    incubator/jsecurity/trunk/ivy.xml
    incubator/jsecurity/trunk/jsecurity.ipr

Modified: incubator/jsecurity/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/jsecurity/trunk/build.xml?rev=732934&r1=732933&r2=732934&view=diff
==============================================================================
--- incubator/jsecurity/trunk/build.xml (original)
+++ incubator/jsecurity/trunk/build.xml Thu Jan  8 21:52:25 2009
@@ -29,17 +29,7 @@
 -->
 <project name="jsecurity" default="all" xmlns:ivy="antlib:org.apache.ivy.ant">
 
-    <!-- Static property definitions.  These will remain the same for any module or submodule.
-->
-    <property name="project.name" value="jsecurity"/>
-
-    <property name="root.base.dir" value="${basedir}"/>
-
-    <!-- Allow override of default build properties from properties file. -->
-    <property file="build.properties"/>
-    <property file="${user.home}/.jsecurity/build.properties"/>
-
-    <!-- Environment variables (e.g. to pickup CATALINA_HOME for test deployment) -->
-    <property environment="env"/>
+    <import file="./common.ant.xml"/>
 
     <property name="ivy.install.version" value="2.0.0-beta2"/>
     <condition property="ivy.home" value="${env.IVY_HOME}">
@@ -49,66 +39,23 @@
     <property name="ivy.jar.dir" value="${ivy.home}/lib"/>
     <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/>
 
-    <!-- version of the product, see http://apr.apache.org/versioning.html for
-         details on this convention -->
-    <property name="major.version" value="0"/>
-    <property name="minor.version" value="9"/>
-    <property name="patch.version" value="0"/>
-    <property name="version" value="${major.version}.${minor.version}.${patch.version}"/>
-    <property name="release.name" value="${project.name}-${version}"/>
-
-    <!-- application-wide config files: (all other config files should be in a
-         respective module or submodule) -->
-    <property name="root.etc.dir" value="${root.base.dir}/etc"/>
-    <property name="root.dist.dir" value="${root.base.dir}/build/${project.name}-${version}"/>
-
-    <!-- All 3rd party libraries are in here: -->
-    <property name="lib.dir" value="${root.base.dir}/lib"/>
-
-    <!-- *RELATIVE* definitions.  These properties will reflect a directory
-         structure relative to where the build is being executed -->
-    <property name="base.dir" value="."/>
-    <property name="etc.dir" value="${base.dir}/etc"/>
-    <property name="src.dir" value="${base.dir}/src"/>
-    <property name="test.dir" value="${base.dir}/test"/>
-    <property name="build.dir" value="${base.dir}/build"/>
-    <property name="classes.dir" value="${build.dir}/classes"/>
-    <property name="test.classes.dir" value="${build.dir}/test-classes"/>
-    <!-- <property name="dist.dir" value="${build.dir}/dist"/> -->
-
-
-    <property name="docs.dir" value="${root.dist.dir}/docs"/>
     <property name="src.ref.dir" value="${root.base.dir}/docs/reference"/>
     <property name="dist.ref.dir" value="${docs.dir}/reference"/>
+    <!-- default to single sided: -->
     <property name="double.sided" value="0"/>
-    <!-- default to single-sided style -->
-    <property name="api.dir" value="${docs.dir}/api"/>
-    <property name="test.docs.dir" value="${docs.dir}/test-reports"/>
-
-    <!-- compile flags, can be overridden on the command line using the -D flag -->
-    <property name="compile.debug" value="true"/>
-    <property name="compile.deprecation" value="false"/>
-    <property name="compile.optimize" value="false"/>
-
-    <property name="dist.jarName" value="${project.name}.jar"/>
-    <property name="dist.jar" value="${root.dist.dir}/${dist.jarName}"/>
-
-    <path id="core.src">
-        <fileset dir="${base.dir}/core/src">
-            <include name="**"/>
-        </fileset>
-        <pathelement location="${root.base.dir}/support/ehcache/src"/>
-    </path>
 
-    <path id="web.src">
-        <pathelement location="${base.dir}/web/src"/>
+    <path id="javadoc.src">
+        <pathelement location="${root.base.dir}/core/src"/>
+        <pathelement location="${root.base.dir}/web/src"/>
+        <pathelement location="${root.base.dir}/support/ehcache/src"/>
+        <pathelement location="${root.base.dir}/support/quartz/src"/>
+        <pathelement location="${root.base.dir}/support/spring/src"/>
     </path>
 
-    <path id="all.libs">
-        <fileset dir="${lib.dir}">
-            <include name="**/*.jar"/>
-        </fileset>
-        <pathelement location="${classes.dir}"/>
+    <path id="all.src">
+        <path refid="javadoc.src"/>
+        <pathelement location="${root.base.dir}/samples/spring/src"/>
+        <pathelement location="${root.base.dir}/samples/spring-hibernate/src"/>
     </path>
 
     <!-- To disable this task (maybe behind a firewall?), use the -Doffline=true command-line
switch -->
@@ -139,182 +86,59 @@
     <target name="retrieve-dependencies" depends="load-ivy"
             description="Ensures all build dependencies have been downloaded">
         <mkdir dir="${lib.dir}"/>
-        <ivy:retrieve pattern="${lib.dir}/[conf]/[artifact].[ext]" sync="true"/>
+        <ivy:retrieve pattern="${lib.dir}/[conf]/[artifact]-[revision].[ext]" sync="true"/>
     </target>
 
-    <!-- ===================================================================
- -  Clean all local and children build files
- -  =================================================================== -->
-    <target name="clean" description="Cleans the entire project">
-        <delete dir="${build.dir}"/>
-        <ant dir="samples/quickstart" target="clean"/>
-        <ant dir="samples/spring" target="clean"/>
+    <target name="init">
+        <mkdir dir="${dist.dir}"/>
     </target>
 
-    <target name="compile.core" depends="retrieve-dependencies" description="Compiles
JSecurity core API only">
-        <mkdir dir="${classes.dir}"/>
-        <mkdir dir="${classes.dir}/META-INF"/>
-
-        <javac destdir="${classes.dir}"
-               debug="${compile.debug}"
-               deprecation="${compile.deprecation}"
-               optimize="${compile.optimize}"
-               target="1.5"
-               failonerror="true"
-               srcdir="${base.dir}/core/src"
-               classpathref="all.libs"
-               sourcepathref="core.src"/>
-
-        <copy todir="${classes.dir}" preservelastmodified="true">
-            <fileset dir="${base.dir}/core/src">
-                <include name="**/*.properties"/>
-                <include name="**/*.xml"/>
-                <include name="**/*.dtd"/>
-                <include name="**/*.xsd"/>
-            </fileset>
-            <fileset dir="${root.base.dir}/support/ehcache/src">
-                <include name="**/*.properties"/>
-                <include name="**/*.xml"/>
-                <include name="**/*.dtd"/>
-                <include name="**/*.xsd"/>
-            </fileset>
-        </copy>
-
-        <copy todir="${classes.dir}/META-INF" preservelastmodified="true">
-            <fileset dir="${base.dir}/core/src">
-                <include name="**/*.tld"/>
-            </fileset>
-        </copy>
-    </target>
-
-    <target name="compile.web" depends="compile.core" description="Compiles JSecurity
web API only">
-        <mkdir dir="${classes.dir}"/>
-        <mkdir dir="${classes.dir}/META-INF"/>
-
-        <javac destdir="${classes.dir}"
-               debug="${compile.debug}"
-               deprecation="${compile.deprecation}"
-               optimize="${compile.optimize}"
-               target="1.5"
-               failonerror="true"
-               classpathref="all.libs"
-               sourcepath=""
-               srcdir="${base.dir}/web/src"/>
-
-        <copy todir="${build.dir}/web-classes" preservelastmodified="true">
-            <fileset dir="${base.dir}/web/src">
-                <include name="**/*.properties"/>
-                <include name="**/*.xml"/>
-                <include name="**/*.dtd"/>
-                <include name="**/*.xsd"/>
-            </fileset>
-        </copy>
-
-        <copy todir="${build.dir}/web-classes/META-INF" preservelastmodified="true">
-            <fileset dir="${base.dir}/web/src">
-                <include name="**/*.tld"/>
-            </fileset>
-        </copy>
+    <!-- ==================================================================
+         Template target.  Never called explicitly, only used to pass target
+         calls to the underlying modules.
+         ================================================================== -->
+    <target name="template">
+        <!-- This section defines the modules and the order in which they are
+             executed for any given target.  This means ORDER MATTERS.
+             Any dependencies that are to be satisified by one module for
+             another must be declared in the order the dependencies occur. -->
+        <echo message="Executing '${target}' for the core module..."/>
+        <ant dir="core" target="${target}"/>
+        <echo message="Executing '${target}' for the web module..."/>
+        <ant dir="web" target="${target}"/>
+        <echo message="Executing '${target}' for the ehcache module..."/>
+        <ant dir="support/ehcache" target="${target}"/>
+        <echo message="Executing '${target}' for the spring module..."/>
+        <ant dir="support/spring" target="${target}"/>
+        <echo message="Executing '${target}' for the quartz module..."/>
+        <ant dir="support/quartz" target="${target}"/>
     </target>
 
-
-    <target name="compile.spring" depends="compile.core" description="Compiles Spring
Framework support">
-        <javac destdir="${classes.dir}"
-               debug="${compile.debug}"
-               deprecation="${compile.deprecation}"
-               optimize="${compile.optimize}"
-               target="1.5"
-               failonerror="true">
-            <classpath refid="all.libs"/>
-            <classpath location="${classes.dir}"/>
-            <src path="${root.base.dir}/support/spring/src"/>
-        </javac>
-
-        <copy todir="${classes.dir}" preservelastmodified="true">
-            <fileset dir="${root.base.dir}/support/spring/src">
-                <include name="**/*.properties"/>
-                <include name="**/*.xml"/>
-                <include name="**/*.dtd"/>
-                <include name="**/*.xsd"/>
-            </fileset>
-        </copy>
-
-        <copy todir="${classes.dir}/META-INF" preservelastmodified="true">
-            <fileset dir="${root.base.dir}/support/spring/src">
-                <include name="**/*.tld"/>
-            </fileset>
-        </copy>
+    <!-- ===================================================================
+         Clean all local and children build files
+         =================================================================== -->
+    <target name="clean" description="Cleans the entire project">
+        <echo message="Cleaning all modules..."/>
+        <antcall target="template">
+            <param name="target" value="clean"/>
+        </antcall>
+        <echo message="Cleaning root build directory."/>
+        <delete dir="${build.dir}"/>
     </target>
 
-    <target name="compile.quartz" depends="compile.core" description="Compiles Quartz
support">
-        <javac destdir="${classes.dir}"
-               debug="${compile.debug}"
-               deprecation="${compile.deprecation}"
-               optimize="${compile.optimize}"
-               target="1.5"
-               failonerror="true">
-            <classpath refid="all.libs"/>
-            <classpath location="${classes.dir}"/>
-            <src path="${root.base.dir}/support/quartz/src"/>
-        </javac>
-
-        <copy todir="${classes.dir}" preservelastmodified="true">
-            <fileset dir="${root.base.dir}/support/quartz/src">
-                <include name="**/*.properties"/>
-                <include name="**/*.xml"/>
-                <include name="**/*.dtd"/>
-                <include name="**/*.xsd"/>
-            </fileset>
-        </copy>
-
-        <copy todir="${classes.dir}/META-INF" preservelastmodified="true">
-            <fileset dir="${root.base.dir}/support/quartz/src">
-                <include name="**/*.tld"/>
-            </fileset>
-        </copy>
+    <target name="compile" depends="retrieve-dependencies,init" description="Compiles
the project">
+        <echo message="Compiling all modules..."/>
+        <antcall target="template">
+            <param name="target" value="compile"/>
+        </antcall>
     </target>
 
-    <target name="compile" depends="compile.core, compile.web, compile.spring, compile.quartz"
description="Compiles all classes"/>
-
-    <target name="jar" depends="compile" description="Create full JAR file with all JSecurity
classes">
-
-        <mkdir dir="${root.dist.dir}"/>
-
-        <jar jarfile="${dist.jar}">
-            <fileset dir="${classes.dir}">
-                <include name="org/jsecurity/**"/>
-            </fileset>
-            <metainf dir="${classes.dir}/META-INF">
-                <include name="**"/>
-            </metainf>
-            <manifest>
-                <attribute name="Implementation-Title" value="${project.name}"/>
-                <attribute name="Implementation-Version" value="${version}"/>
-                <attribute name="${project.name}-Version" value="${version}"/>
-                <!-- Allow use of this JAR as a Java agent -->
-                <!-- <attribute name="Premain-Class" value="org.jsecurity.instrument.InstrumentationSavingAgent"
/> -->
-            </manifest>
-        </jar>
-
-        <path id="retroweaver.path">
-            <fileset dir="${lib.dir}" includes="**/*"/>
-        </path>
-
-        <taskdef name="retroweaver" classname="net.sourceforge.retroweaver.ant.RetroWeaverTask"
-                 classpathref="retroweaver.path"/>
-        <retroweaver target="1.3" inputjar="${dist.jar}" outputjar="${root.dist.dir}/${project.name}-jdk13.jar"/>
-        <retroweaver target="1.4" inputjar="${dist.jar}" outputjar="${root.dist.dir}/${project.name}-jdk14.jar"/>
-
-    </target>
+    <target name="package" depends="retrieve-dependencies,init" description="Creates project
artifacts">
+        <echo message="Packaging all modules..."/>
+        <antcall target="template">
+            <param name="target" value="package"/>
+        </antcall>
 
-    <target name="jar.deploy" depends="jar,src.zip"
-            description="Copies the jar and src.zip files to a local directory specified
by build properties.  Requires creation of .jsecurity/build.properties file to specify the
deploy dir.">
-        <fail unless="jar.deploy.dir"
-              message="jar.deploy.dir property is not set. Please create ${user.home}/.jsecurity/build.properties
and specify this property before running this task."/>
-        <copy todir="${jar.deploy.dir}" preservelastmodified="true">
-            <fileset file="${dist.jar}"/>
-            <fileset file="${root.dist.dir}/${project.name}.src.zip"/>
-        </copy>
     </target>
 
     <target name="samples.quickstart" depends="jar" description="Creates the quickstart
.jar">
@@ -369,12 +193,6 @@
     <!-- =================================================================== -->
     <target name="javadoc" description="Generate Javadocs">
 
-        <path id="javadocSrcPath">
-            <path refid="core.src"/>
-            <pathelement location="${root.base.dir}/support/spring/src"/>
-            <pathelement location="${root.base.dir}/support/quartz/src"/>
-        </path>
-
         <echo message="Generating JavaDoc API..."/>
         <delete dir="${api.dir}" failonerror="false"/>
         <mkdir dir="${api.dir}"/>
@@ -383,7 +201,7 @@
                  source="1.5" access="package" author="true" version="true" use="true"
                  defaultexcludes="true"
                  header='&lt;a href=\"http://www.jsecurity.org/\" target=\"_top\"&gt;JSecurity&lt;/a&gt;'>
-            <sourcepath refid="javadocSrcPath"/>
+            <sourcepath refid="javadoc.src"/>
             <arg value="-breakiterator"/>
             <arg value="-J-Xmx128m"/>
             <arg value="-J-XX:MaxPermSize=128m"/>
@@ -410,7 +228,7 @@
                 ]]>
             </bottom>
             <classpath refid="all.libs"/>
-            <packageset dir="${base.dir}/core/src">
+            <!-- <packageset dir="${base.dir}/core/src">
                 <include name="org/jsecurity/**"/>
             </packageset>
             <packageset dir="${root.base.dir}/support/ehcache/src">
@@ -421,7 +239,7 @@
             </packageset>
             <packageset dir="${root.base.dir}/support/quartz/src">
                 <include name="org/jsecurity/**"/>
-            </packageset>
+            </packageset> -->
             <link href="http://java.sun.com/j2se/1.5/docs/api"/>
             <link href="http://java.sun.com/j2ee/1.4/docs/api"/>
             <!-- Jakarta Commons -->
@@ -430,7 +248,7 @@
             <link href="http://jakarta.apache.org/commons/logging/apidocs/"/>
             <link href="http://jakarta.apache.org/commons/codec/apidocs/"/>
             <link href="http://quartz.sourceforge.net/javadoc/"/>
-            <link href="http://static.springframework.org/spring/docs/2.0.x/api/"/>
+            <link href="http://static.springframework.org/spring/docs/2.5.x/api/"/>
             <link href="http://ehcache.sourceforge.net/javadoc/"/>
         </javadoc>
 
@@ -442,7 +260,7 @@
     <target name="doc.prepare" depends="retrieve-dependencies" description="Extra preparation
for the documentation">
 
         <!-- unzip the docbook-libs.zip file containing the necessary jars: -->
-        <unzip src="${lib.dir}/docbook/docbook-libs.zip" dest="${lib.dir}/docbook"/>
+        <unzip src="${lib.dir}/docbook/docbook-libs-1.0.0.zip" dest="${lib.dir}/docbook"/>
 
         <!-- <antcall target="tld.to.docbook"/> -->
 
@@ -711,18 +529,7 @@
         <mkdir dir="${root.dist.dir}"/>
         <delete file="${root.dist.dir}/${project.name}.src.zip"/>
         <zip destfile="${root.dist.dir}/${project.name}.src.zip">
-            <fileset dir="${base.dir}/core/src">
-                <include name="org/jsecurity/**"/>
-            </fileset>
-            <fileset dir="${root.base.dir}/support/ehcache/src">
-                <include name="org/jsecurity/**"/>
-            </fileset>
-            <fileset dir="${root.base.dir}/support/spring/src">
-                <include name="org/jsecurity/**"/>
-            </fileset>
-            <fileset dir="${root.base.dir}/support/quartz/src">
-                <include name="org/jsecurity/**"/>
-            </fileset>
+            <path refid="all.src"/>
         </zip>
     </target>
 
@@ -734,7 +541,7 @@
         </ivy:makepom>
     </target>
 
-    <target name="release" depends="jar,samples,src.zip,makepom,javadoc,doc.all"
+    <target name="release" depends="package,src.zip,makepom,javadoc,doc.all"
             description="Create all artifacts for a JSecurity release">
         <property name="release.dir.name" value="${project.name}-${version}"/>
         <property name="release.zip.name" value="${release.dir.name}.zip"/>
@@ -744,7 +551,12 @@
                 <type type="file"/>
                 <exclude name="**/build/**"/>
                 <exclude name="**/.svn/**"/>
+                <exclude name="**/out/**"/>
                 <exclude name="**/lib/**"/>
+                <exclude name="jsecurity.iml"/>
+                <exclude name="jsecurity.ipr"/>
+                <exclude name="jsecurity.iws"/>
+                <exclude name="changes.txt"/>
                 <exclude name="${release.dir.name}"/>
             </fileset>
         </copy>
@@ -772,8 +584,8 @@
     </target>
 
     <!-- ===================================================================
- -  all - everything
- -  =================================================================== -->
+         all - everything
+         =================================================================== -->
     <target name="all" depends="release" description="Do everything"/>
 
 </project>

Added: incubator/jsecurity/trunk/common.ant.xml
URL: http://svn.apache.org/viewvc/incubator/jsecurity/trunk/common.ant.xml?rev=732934&view=auto
==============================================================================
--- incubator/jsecurity/trunk/common.ant.xml (added)
+++ incubator/jsecurity/trunk/common.ant.xml Thu Jan  8 21:52:25 2009
@@ -0,0 +1,150 @@
+<?xml version="1.0"?>
+
+<project name="common" default="package">
+
+    <!-- Static property definitions.  These will remain the same for any module or submodule.
-->
+    <property name="project.name" value="jsecurity"/>
+
+    <property name="root.base.dir" value="${basedir}"/>
+
+    <!-- Allow override of default build properties from properties file. -->
+    <property file="build.properties"/>
+    <property file="${root.base.dir}/build.properties"/>
+    <property file="${user.home}/.jsecurity/build.properties"/>
+
+    <!-- Environment variables (e.g. to pickup CATALINA_HOME for test deployment) -->
+    <property environment="env"/>
+
+    <!-- version of the product, see http://apr.apache.org/versioning.html for details
on this convention -->
+    <property name="version.major" value="0"/>
+    <property name="version.minor" value="9"/>
+    <property name="version.revision" value="0"/>
+    <property name="version" value="${version.major}.${version.minor}.${version.revision}"/>
+    <property name="release.name" value="${project.name}-${version}"/>
+
+    <!-- application-wide config files: (all other config files should be in a respective
module or submodule) -->
+    <property name="root.etc.dir" value="${root.base.dir}/etc"/>
+    <property name="root.dist.dir" value="${root.base.dir}/build/${project.name}-${version}"/>
+
+    <!-- All 3rd party libraries are in here: -->
+    <property name="lib.dir" value="${root.base.dir}/lib"/>
+
+    <!-- *RELATIVE* definitions.  These properties will reflect a directory structure
relative to where the
+         sbuild is being executed -->
+    <property name="base.dir" value="."/>
+    <property name="etc.dir" value="${base.dir}/etc"/>
+    <property name="src.dir" value="${base.dir}/src"/>
+    <property name="test.dir" value="${base.dir}/test"/>
+    <property name="build.dir" value="${base.dir}/build"/>
+    <property name="classes.dir" value="${build.dir}/classes"/>
+    <property name="test.classes.dir" value="${build.dir}/test-classes"/>
+    <property name="docs.dir" value="${build.dir}/docs"/>
+    <property name="test.docs.dir" value="${docs.dir}/test-reports"/>
+    <property name="api.dir" value="${docs.dir}/api"/>
+    <property name="dist.dir" value="${root.dist.dir}"/>
+
+    <!-- compile flags, can be overridden on the command line using the -D flag -->
+    <property name="compile.debug" value="true"/>
+    <property name="compile.deprecation" value="false"/>
+    <property name="compile.optimize" value="false"/>
+
+    <path id="all.libs">
+        <fileset dir="${lib.dir}">
+            <include name="**/*.jar"/>
+        </fileset>
+        <pathelement location="${classes.dir}"/>
+    </path>
+
+    <path id="test.path">
+        <path refid="all.libs"/>
+        <fileset dir="${dist.dir}">
+            <include name="*.jar"/>
+        </fileset>
+    </path>
+
+    <!-- ===================================================================
+      -  Clean all build files
+      -  =================================================================== -->
+    <target name="clean" description="Cleans the entire project">
+        <delete file="${dist.jar}"/>
+        <delete dir="${build.dir}"/>
+    </target>
+
+    <macrodef name="compileMacro">
+        <attribute name="classpathref" default="compile.path"/>
+        <attribute name="srcdir" default="${src.dir}"/>
+        <attribute name="destdir" default="${classes.dir}"/>
+
+        <sequential>
+            <mkdir dir="@{destdir}"/>
+            <mkdir dir="@{destdir}/META-INF"/>
+
+            <!-- 'compile.path' is expected to be defined in the module build.xml file
-->
+            <javac destdir="@{destdir}"
+                   debug="${compile.debug}"
+                   deprecation="${compile.deprecation}"
+                   optimize="${compile.optimize}"
+                   failonerror="true"
+                   srcdir="@{srcdir}"
+                   classpathref="@{classpathref}">
+                <!-- <compilerarg value="-Xlint:unchecked"/> -->
+            </javac>
+            <copy todir="@{destdir}" preservelastmodified="true">
+                <fileset dir="@{srcdir}">
+                    <include name="**/*"/>
+                    <exclude name="**/*.java"/>
+                </fileset>
+            </copy>
+            <copy todir="@{destdir}" preservelastmodified="true">
+                <fileset dir="@{srcdir}">
+                    <include name="**/*.tld"/>
+                </fileset>
+            </copy>
+        </sequential>
+    </macrodef>
+
+    <target name="compile.src" description="Compiles sources">
+        <!-- defaults are fine: -->
+        <compileMacro/>
+    </target>
+
+    <target name="compile.test" description="Compiles test sources only">
+        <compileMacro classpathref="test.path" srcdir="${test.dir}" destdir="${test.classes.dir}"/>
+    </target>
+
+    <target name="compile" depends="compile.src, compile.test" description="Compiles all
sources"/>
+
+    <target name="jar.jdk15" depends="compile" description="Create module jar file">
+        <jar jarfile="${dist.jar}">
+            <fileset dir="${classes.dir}">
+                <include name="**"/>
+            </fileset>
+            <metainf dir="${classes.dir}/META-INF">
+                <include name="**"/>
+            </metainf>
+            <manifest>
+                <attribute name="Implementation-Title" value="${project.name}-${module.name}"/>
+                <attribute name="Implementation-Version" value="${version}"/>
+                <attribute name="${project.name}-Version" value="${version}"/>
+                <!-- Allow use of this JAR as a Java agent -->
+                <!-- <attribute name="Premain-Class" value="org.jsecurity.instrument.InstrumentationSavingAgent"
/> -->
+            </manifest>
+        </jar>
+    </target>
+
+    <target name="jar.retroweaver" depends="jar.jdk15" description="Create module jar
file for JDK 1.3 and 1.4">
+        <taskdef name="retroweaver" classname="net.sourceforge.retroweaver.ant.RetroWeaverTask"
+                 classpathref="all.libs"/>
+        <mkdir dir="${dist.dir}/jdk13"/>
+        <mkdir dir="${dist.dir}/jdk14"/>
+        <retroweaver target="1.3" inputjar="${dist.jar}"
+                     outputjar="${dist.dir}/jdk13/${project.name}-${module.name}-jdk13.jar"/>
+        <retroweaver target="1.4" inputjar="${dist.jar}"
+                     outputjar="${dist.dir}/jdk14/${project.name}-${module.name}-jdk14.jar"/>
+    </target>
+
+    <target name="jar" depends="jar.retroweaver"/>
+
+    <target name="package" depends="jar"/>
+
+</project>
\ No newline at end of file

Added: incubator/jsecurity/trunk/core/build.xml
URL: http://svn.apache.org/viewvc/incubator/jsecurity/trunk/core/build.xml?rev=732934&view=auto
==============================================================================
--- incubator/jsecurity/trunk/core/build.xml (added)
+++ incubator/jsecurity/trunk/core/build.xml Thu Jan  8 21:52:25 2009
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+
+<project name="core" default="package">
+
+    <property name="root.base.dir" value=".."/>
+    <property name="module.name" value="core"/>
+    <import file="${root.base.dir}/common.ant.xml"/>
+    <property name="dist.jarName" value="${project.name}-${module.name}"/>
+    <property name="dist.jar" value="${dist.dir}/${dist.jarName}.jar"/>
+
+    <path id="compile.path">
+        <fileset dir="${lib.dir}/${module.name}">
+            <include name="*.jar"/>
+        </fileset>
+    </path>
+
+
+</project>
\ No newline at end of file

Modified: incubator/jsecurity/trunk/core/src/org/jsecurity/mgt/CachingSecurityManager.java
URL: http://svn.apache.org/viewvc/incubator/jsecurity/trunk/core/src/org/jsecurity/mgt/CachingSecurityManager.java?rev=732934&r1=732933&r2=732934&view=diff
==============================================================================
--- incubator/jsecurity/trunk/core/src/org/jsecurity/mgt/CachingSecurityManager.java (original)
+++ incubator/jsecurity/trunk/core/src/org/jsecurity/mgt/CachingSecurityManager.java Thu Jan
 8 21:52:25 2009
@@ -22,7 +22,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.jsecurity.cache.CacheManager;
 import org.jsecurity.cache.CacheManagerAware;
-import org.jsecurity.cache.ehcache.EhCacheManager;
+import org.jsecurity.cache.DefaultCacheManager;
 import org.jsecurity.util.Destroyable;
 import org.jsecurity.util.LifecycleUtils;
 
@@ -120,9 +120,9 @@
      * Creates a {@link CacheManager CacheManager} instance to be used by this <code>SecurityManager</code>
      * and potentially any of its children components.
      * <p/>
-     * This default implementation attempts to create an {@link org.jsecurity.cache.ehcache.EhCacheManager
EhCacheManager}, assuming that
-     * ehcache is in the classpath.  If Ehcache is not in the classpath, no cache manager
will be created and this
-     * method does nothing.
+     * This default implementation returns a new
+     * {@link org.jsecurity.cache.DefaultCacheManager DefaultCacheManager}, which uses in-memory
(memory-leak safe)
+     * caches.
      * <p/>
      * This can be overridden by subclasses for a different implementation, but it is often
easier to set a
      * different implementation via the {@link #setCacheManager(org.jsecurity.cache.CacheManager)
setCacheManager}
@@ -132,23 +132,7 @@
      * @see #ensureCacheManager() ensureCacheManager()
      */
     protected CacheManager createCacheManager() {
-        CacheManager manager = null;
-
-        if (log.isDebugEnabled()) {
-            log.debug("Attempting to initialize default CacheManager using EhCache...");
-        }
-
-        try {
-             EhCacheManager ehCacheManager = new EhCacheManager();
-             ehCacheManager.init();
-             manager = ehCacheManager;
-        } catch (NoClassDefFoundError e) {
-            if (log.isDebugEnabled()) {
-                log.debug("Ehcache was not found in the classpath. A default EhCacheManager
cannot be created.");
-            }
-        }
-
-        return manager;
+        return new DefaultCacheManager();
     }
 
     /**

Modified: incubator/jsecurity/trunk/ivy.xml
URL: http://svn.apache.org/viewvc/incubator/jsecurity/trunk/ivy.xml?rev=732934&r1=732933&r2=732934&view=diff
==============================================================================
--- incubator/jsecurity/trunk/ivy.xml (original)
+++ incubator/jsecurity/trunk/ivy.xml Thu Jan  8 21:52:25 2009
@@ -34,13 +34,14 @@
     </info>
 
     <configurations defaultconfmapping="*->default">
-        <conf name="runtime" description="Minimum required runtime dependencies."/>
-        <conf name="runtime-web" extends="runtime"
-              description="Minimum required runtime dependencies when running a web application."/>
-        <conf name="compile" extends="runtime-web"
-              description="Required dependencies when building JSecurity from scratch."/>
-        <conf name="samples" extends="runtime-web"
+        <conf name="core" description="Dependencies for the core module."/>
+        <conf name="web" extends="core" description="Depdencies for the web module."/>
+        <conf name="ehcache" extends="core" description="Dependencies for the ehcache
module."/>
+        <conf name="quartz" extends="core" description="Dependencies for the quartz module."/>
+        <conf name="spring" extends="web" description="Dependencies for the spring module."/>
+        <conf name="samples" extends="web,ehcache,quartz,spring"
               description="Required dependencies when running one of the sample web applications."/>
+        <conf name="retroweaver"/>
         <conf name="test" extends="*" description="Any and all dependencies so all functionality
can be tested."/>
         <conf name="docbook"/>
     </configurations>
@@ -48,21 +49,22 @@
     <dependencies>
 
         <!-- Minimal deps, depending on VM: -->
-        <dependency org="commons-logging" name="commons-logging" rev="1.1.1" transitive="false"
conf="runtime"/>
-        <dependency org="commons-beanutils" name="commons-beanutils" rev="1.7.0" transitive="false"
conf="runtime-web"/>
+        <dependency org="commons-logging" name="commons-logging" rev="1.1.1" transitive="false"
conf="core"/>
+        <dependency org="commons-beanutils" name="commons-beanutils" rev="1.7.0" transitive="false"
conf="core"/>
 
         <!-- Feature-based dependencies: -->
-        <dependency org="net.sourceforge.retroweaver" name="retroweaver" rev="2.0.5" conf="compile"/>
-        <dependency org="net.sourceforge.retroweaver" name="retroweaver-rt" rev="2.0.5"
conf="compile"/>
-        <dependency org="net.sf.ehcache" name="ehcache" rev="1.4.1" transitive="false"
conf="compile,samples"/>
+        <dependency org="net.sourceforge.retroweaver" name="retroweaver" rev="2.0.5" conf="retroweaver"/>
+        <dependency org="net.sourceforge.retroweaver" name="retroweaver-rt" rev="2.0.5"
conf="retroweaver"/>
+        <dependency org="net.sf.ehcache" name="ehcache" rev="1.4.1" transitive="false"
conf="ehcache,samples"/>
         <dependency org="backport-util-concurrent" name="backport-util-concurrent" rev="3.1"
transitive="false"
                     conf="samples"/>
         <dependency org="xerces" name="xercesImpl" rev="2.8.1" transitive="false" conf="samples"/>
-        <dependency org="quartz" name="quartz" rev="1.5.2" transitive="false" conf="compile"/>
-        <dependency org="org.springframework" name="spring" rev="2.5.1" transitive="false"
conf="compile,samples"/>
-        <dependency org="org.springframework" name="spring-webmvc" rev="2.5.1" transitive="false"
conf="samples"/>
-        <dependency org="javax.servlet" name="servlet-api" rev="2.4" transitive="false"
conf="compile,samples"/>
-        <dependency org="javax.servlet.jsp" name="jsp-api" rev="2.0" transitive="false"
conf="compile"/>
+        <dependency org="quartz" name="quartz" rev="1.5.2" transitive="false" conf="quartz"/>
+        <dependency org="org.springframework" name="spring" rev="2.5.6" transitive="false"
conf="spring,samples"/>
+        <dependency org="org.springframework" name="spring-webmvc" rev="2.5.6" transitive="false"
+                    conf="spring,samples"/>
+        <dependency org="javax.servlet" name="servlet-api" rev="2.4" transitive="false"
conf="web,samples"/>
+        <dependency org="javax.servlet.jsp" name="jsp-api" rev="2.0" transitive="false"
conf="web"/>
 
         <!-- Sample application dependencies: -->
         <dependency org="log4j" name="log4j" rev="1.2.15" transitive="false" conf="samples"/>

Modified: incubator/jsecurity/trunk/jsecurity.ipr
URL: http://svn.apache.org/viewvc/incubator/jsecurity/trunk/jsecurity.ipr?rev=732934&r1=732933&r2=732934&view=diff
==============================================================================
--- incubator/jsecurity/trunk/jsecurity.ipr (original)
+++ incubator/jsecurity/trunk/jsecurity.ipr Thu Jan  8 21:52:25 2009
@@ -19,7 +19,37 @@
     <option name="USE_PROJECT_LEVEL_SETTINGS" value="false" />
   </component>
   <component name="CodeStyleSettingsManager">
-    <option name="PER_PROJECT_SETTINGS" />
+    <option name="PER_PROJECT_SETTINGS">
+      <value>
+        <ADDITIONAL_INDENT_OPTIONS fileType="java">
+          <option name="INDENT_SIZE" value="4" />
+          <option name="CONTINUATION_INDENT_SIZE" value="8" />
+          <option name="TAB_SIZE" value="4" />
+          <option name="USE_TAB_CHARACTER" value="false" />
+          <option name="SMART_TABS" value="false" />
+          <option name="LABEL_INDENT_SIZE" value="0" />
+          <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+        </ADDITIONAL_INDENT_OPTIONS>
+        <ADDITIONAL_INDENT_OPTIONS fileType="jsp">
+          <option name="INDENT_SIZE" value="4" />
+          <option name="CONTINUATION_INDENT_SIZE" value="8" />
+          <option name="TAB_SIZE" value="4" />
+          <option name="USE_TAB_CHARACTER" value="false" />
+          <option name="SMART_TABS" value="false" />
+          <option name="LABEL_INDENT_SIZE" value="0" />
+          <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+        </ADDITIONAL_INDENT_OPTIONS>
+        <ADDITIONAL_INDENT_OPTIONS fileType="xml">
+          <option name="INDENT_SIZE" value="4" />
+          <option name="CONTINUATION_INDENT_SIZE" value="8" />
+          <option name="TAB_SIZE" value="4" />
+          <option name="USE_TAB_CHARACTER" value="false" />
+          <option name="SMART_TABS" value="false" />
+          <option name="LABEL_INDENT_SIZE" value="0" />
+          <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+        </ADDITIONAL_INDENT_OPTIONS>
+      </value>
+    </option>
     <option name="USE_PER_PROJECT_SETTINGS" value="false" />
   </component>
   <component name="CompilerConfiguration">

Added: incubator/jsecurity/trunk/support/ehcache/build.xml
URL: http://svn.apache.org/viewvc/incubator/jsecurity/trunk/support/ehcache/build.xml?rev=732934&view=auto
==============================================================================
--- incubator/jsecurity/trunk/support/ehcache/build.xml (added)
+++ incubator/jsecurity/trunk/support/ehcache/build.xml Thu Jan  8 21:52:25 2009
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+
+<project name="ehcache" default="package">
+
+    <property name="root.base.dir" value="../.."/>
+    <property name="module.name" value="ehcache"/>
+    <import file="${root.base.dir}/common.ant.xml"/>
+    <property name="dist.jarName" value="${project.name}-${module.name}"/>
+    <property name="dist.jar" value="${dist.dir}/${dist.jarName}.jar"/>
+
+    <path id="compile.path">
+        <fileset dir="${lib.dir}/${module.name}">
+            <include name="*.jar"/>
+        </fileset>
+        <fileset dir="${dist.dir}">
+            <include name="${project.name}-core.jar"/>
+        </fileset>
+    </path>
+
+    <target name="compile" depends="compile.src"/>
+
+
+</project>
\ No newline at end of file

Added: incubator/jsecurity/trunk/support/quartz/build.xml
URL: http://svn.apache.org/viewvc/incubator/jsecurity/trunk/support/quartz/build.xml?rev=732934&view=auto
==============================================================================
--- incubator/jsecurity/trunk/support/quartz/build.xml (added)
+++ incubator/jsecurity/trunk/support/quartz/build.xml Thu Jan  8 21:52:25 2009
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+
+<project name="quartz" default="package">
+
+    <property name="root.base.dir" value="../.."/>
+    <property name="module.name" value="quartz"/>
+    <import file="${root.base.dir}/common.ant.xml"/>
+    <property name="dist.jarName" value="${project.name}-${module.name}"/>
+    <property name="dist.jar" value="${dist.dir}/${dist.jarName}.jar"/>
+
+    <path id="compile.path">
+        <fileset dir="${lib.dir}/${module.name}">
+            <include name="*.jar"/>
+        </fileset>
+        <fileset dir="${dist.dir}">
+            <include name="${project.name}-core.jar"/>
+        </fileset>
+    </path>
+
+    <target name="compile" depends="compile.src"/>
+
+
+</project>
\ No newline at end of file

Added: incubator/jsecurity/trunk/support/spring/build.xml
URL: http://svn.apache.org/viewvc/incubator/jsecurity/trunk/support/spring/build.xml?rev=732934&view=auto
==============================================================================
--- incubator/jsecurity/trunk/support/spring/build.xml (added)
+++ incubator/jsecurity/trunk/support/spring/build.xml Thu Jan  8 21:52:25 2009
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+
+<project name="spring" default="package">
+
+    <property name="root.base.dir" value="../.."/>
+    <property name="module.name" value="spring"/>
+    <import file="${root.base.dir}/common.ant.xml"/>
+    <property name="dist.jarName" value="${project.name}-${module.name}"/>
+    <property name="dist.jar" value="${dist.dir}/${dist.jarName}.jar"/>
+
+    <path id="compile.path">
+        <fileset dir="${lib.dir}/${module.name}">
+            <include name="*.jar"/>
+        </fileset>
+        <fileset dir="${dist.dir}">
+            <include name="${project.name}-core.jar"/>
+            <include name="${project.name}-web.jar"/>
+        </fileset>
+    </path>
+
+
+</project>
\ No newline at end of file

Added: incubator/jsecurity/trunk/web/build.xml
URL: http://svn.apache.org/viewvc/incubator/jsecurity/trunk/web/build.xml?rev=732934&view=auto
==============================================================================
--- incubator/jsecurity/trunk/web/build.xml (added)
+++ incubator/jsecurity/trunk/web/build.xml Thu Jan  8 21:52:25 2009
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+
+<project name="web" default="package">
+
+    <property name="root.base.dir" value=".."/>
+    <property name="module.name" value="web"/>
+    <import file="${root.base.dir}/common.ant.xml"/>
+    <property name="dist.jarName" value="${project.name}-${module.name}"/>
+    <property name="dist.jar" value="${dist.dir}/${dist.jarName}.jar"/>
+
+    <path id="compile.path">
+        <fileset dir="${lib.dir}/${module.name}">
+            <include name="*.jar"/>
+        </fileset>
+        <fileset dir="${dist.dir}">
+            <include name="${project.name}-core.jar"/>
+        </fileset>
+    </path>
+
+
+</project>
\ No newline at end of file



Mime
View raw message