You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by ha...@apache.org on 2004/02/01 14:32:18 UTC
cvs commit: avalon-sandbox/avalon-net/cscontainer/Samples/bin/Samples Samples.Components.dll
hammett 2004/02/01 05:32:18
Modified: avalon-net/cscontainer/AvalonContainerTest TestContainer.cs
avalon-net/cscontainer/AvalonContainer Component.cs
ContainerException.cs DefaultContainer.cs
LifestyleManager.cs
avalon-net/cscontainer/AvalonContainer/Configuration
ContainerConfiguration.cs
ContainerConfigurationSectionHandler.cs
Added: avalon-net/cscontainer AvalonContainer-compilations.build
AvalonContainer-helper.build AvalonContainer.build
README.txt default.build
avalon-net/cscontainer/AvalonContainerTest/Configuration
ContainerConfigurationTestCase.cs
Removed: avalon-net/cscontainer/Samples/bin/Samples
Samples.Components.dll
Log:
Container (not working) uploaded just to let people interested to help in the evolving :-)
Revision Changes Path
1.2 +2 -2 avalon-sandbox/avalon-net/cscontainer/AvalonContainerTest/TestContainer.cs
Index: TestContainer.cs
===================================================================
RCS file: /home/cvs/avalon-sandbox/avalon-net/cscontainer/AvalonContainerTest/TestContainer.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TestContainer.cs 22 Sep 2003 23:49:23 -0000 1.1
+++ TestContainer.cs 1 Feb 2004 13:32:18 -0000 1.2
@@ -56,7 +56,6 @@
using Apache.Avalon.Container;
using Apache.Avalon.Container.Configuration;
- using Apache.Avalon.Container.Util.Dag;
using Apache.Avalon.Framework;
/// <summary>
@@ -82,12 +81,13 @@
return new TestContainer(config);
}
+ /*
public Vertex[] ShutDownOrder
{
get
{
return base.m_shutDownOrder;
}
- }
+ }*/
}
}
1.3 +23 -33 avalon-sandbox/avalon-net/cscontainer/AvalonContainer/Component.cs
Index: Component.cs
===================================================================
RCS file: /home/cvs/avalon-sandbox/avalon-net/cscontainer/AvalonContainer/Component.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Component.cs 3 Oct 2003 03:13:14 -0000 1.2
+++ Component.cs 1 Feb 2004 13:32:18 -0000 1.3
@@ -55,26 +55,22 @@
using Apache.Avalon.Container.Util;
using Apache.Avalon.Container.Services;
+ using Apache.Avalon.Meta;
+
/// <summary>
///
/// </summary>
public sealed class ComponentEntry : IDisposable
{
- private Lifestyle m_lifestyle;
- private Type m_componentType;
- private String m_configName;
- private String m_loggerName;
- private IConfiguration m_configuration;
- private AvalonDependencyAttribute[] m_dependencies;
- private IComponentHandler m_handler;
-
- public ComponentEntry(AvalonComponentAttribute attribute, Type type, AvalonDependencyAttribute[] dependencies)
- {
- m_lifestyle = attribute.Lifestyle;
- m_configName = attribute.Name;
- m_loggerName = attribute.LoggerName;
- m_componentType = type;
- m_dependencies = dependencies;
+ private TypeDescriptor m_descriptor;
+ private IConfiguration m_configuration;
+ private Type m_type;
+ private IComponentHandler m_handler;
+
+ public ComponentEntry(TypeDescriptor descriptor)
+ {
+ m_descriptor = descriptor;
+ m_type = Type.GetType( descriptor.Info.Typename, true, true );
m_configuration = DefaultConfiguration.EmptyConfiguration;
}
@@ -82,7 +78,7 @@
{
get
{
- return m_lifestyle;
+ return m_descriptor.Info.Lifestyle;
}
}
@@ -90,7 +86,7 @@
{
get
{
- return m_componentType;
+ return m_type;
}
}
@@ -106,7 +102,7 @@
{
get
{
- return m_configName;
+ return Name;
}
}
@@ -114,7 +110,11 @@
{
get
{
- return m_loggerName;
+ if (m_descriptor.Categories != null && m_descriptor.Categories.Length != 0)
+ {
+ return m_descriptor.Categories[0].Name;
+ }
+ return Name;
}
}
@@ -122,7 +122,7 @@
{
get
{
- return m_componentType.FullName;
+ return m_descriptor.Info.Name;
}
}
@@ -138,16 +138,11 @@
}
}
- public AvalonDependencyAttribute[] Dependencies
+ public DependencyDescriptor[] Dependencies
{
get
{
- if (m_dependencies == null)
- {
- m_dependencies = new AvalonDependencyAttribute[0];
- }
-
- return m_dependencies;
+ return m_descriptor.Dependencies;
}
}
@@ -165,12 +160,7 @@
public void Dispose()
{
- m_componentType = null;
- m_configName = null;
- m_loggerName = null;
- m_configuration = null;
- m_dependencies = null;
- ContainerUtil.Shutdown( m_handler );
+ ContainerUtil.Dispose( m_handler );
}
#endregion
1.2 +6 -1 avalon-sandbox/avalon-net/cscontainer/AvalonContainer/ContainerException.cs
Index: ContainerException.cs
===================================================================
RCS file: /home/cvs/avalon-sandbox/avalon-net/cscontainer/AvalonContainer/ContainerException.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ContainerException.cs 22 Sep 2003 23:49:23 -0000 1.1
+++ ContainerException.cs 1 Feb 2004 13:32:18 -0000 1.2
@@ -52,9 +52,14 @@
/// <summary>
/// Summary description for ContainerException.
/// </summary>
- public class ContainerException : ApplicationException
+ [Serializable]
+ public class ContainerException : System.Exception
{
public ContainerException(String message) : base(message)
+ {
+ }
+
+ public ContainerException(String message, Exception inner) : base(message, inner)
{
}
}
1.7 +90 -400 avalon-sandbox/avalon-net/cscontainer/AvalonContainer/DefaultContainer.cs
Index: DefaultContainer.cs
===================================================================
RCS file: /home/cvs/avalon-sandbox/avalon-net/cscontainer/AvalonContainer/DefaultContainer.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- DefaultContainer.cs 23 Nov 2003 13:00:55 -0000 1.6
+++ DefaultContainer.cs 1 Feb 2004 13:32:18 -0000 1.7
@@ -49,20 +49,17 @@
{
using System;
using System.Collections;
- using System.Reflection;
using System.Configuration;
- using System.Diagnostics;
using Apache.Avalon.Framework;
+ using ConfigurationException = Apache.Avalon.Framework.ConfigurationException;
+ using Apache.Avalon.Composition.Data;
+ using Apache.Avalon.Composition.Data.Builder;
+ using Apache.Avalon.Composition.Logging;
+ using Apache.Avalon.Composition.Logging.Default;
+ // using Apache.Avalon.Composition.Model;
+ // using Apache.Avalon.Composition.Model.Default;
using Apache.Avalon.Container.Configuration;
- using Apache.Avalon.Container.Context;
- using Apache.Avalon.Container.Lookup;
- using Apache.Avalon.Container.Services;
- using Apache.Avalon.Container.Handler;
- using Apache.Avalon.Container.Factory;
- using Apache.Avalon.Container.Logger;
- using Apache.Avalon.Container.Util;
- using Apache.Avalon.Container.Util.Dag;
/// <summary>
/// This is the default implementation of <b>Avalon Container</b>. It
@@ -76,462 +73,155 @@
/// constructor or implicitly, through Configuration files.
/// </para>
/// </remarks>
- /// <example>
- /// <code>
- /// <![CDATA[
- ///
- /// <!-- Sample configuration file -->
- ///
- /// <?xml version="1.0" encoding="utf-8" ?>
- /// <configuration>
- ///
- /// <avalon.container>
- ///
- /// <extensionModules>
- /// <add type="Namespace.Class, AssemblyName" />
- /// </extensionModules>
- ///
- /// <logger>
- /// </logger>
- ///
- /// <components>
- ///
- /// <assembly type="Components.Assembly.Name1" />
- /// <assembly type="Components.Assembly.Name2" />
- ///
- /// <component configurationName="Authentication" >
- /// <!-- component configuration here -->
- /// </component>
- ///
- /// </components>
- ///
- /// </avalon.container>
- ///
- /// </configuration>
- /// ]]>
- /// </code>
- /// </example>
- public class DefaultContainer : MarshalByRefObject, IDisposable
+ public class DefaultContainer : IInitializable
{
- #region Fields
- protected ILoggerManager m_loggerManager;
- protected LifecycleManager m_lifestyleManager;
- protected Vertex[] m_shutDownOrder;
- private ComponentCollection m_components;
- private IComponentFactoryManager m_factoryManager;
- private ILookupManager m_lookupManager;
- private IContext m_context;
- private ILogger m_baseLogger;
- #endregion
+ private static ContainmentProfileCreator CREATOR = new ContainmentProfileCreator();
- #region Constructors
-
- /// <summary>
- /// Constructs a <b>DefaultContainer</b>.
- /// </summary>
- /// <remarks>
- /// This constructor searchs for a <avalon.container> section
- /// in the AppDomain configuration file. If the configuration file
- /// is not found, an exception is throwed.
- /// </remarks>
- /// <exception cref="ContainerException">If the configuration file is not found.</exception>
- public DefaultContainer() : this( GetDefaultConfiguration() )
- {
- }
+ protected IConfiguration m_rootConfiguration;
- /// <summary>
- /// Constructs a <b>DefaultContainer</b>.
- /// </summary>
- /// <remarks>
- /// This constructor needs a valid
- /// <see cref="Apache.Avalon.Container.Configuration.ContainerConfiguration"/>.
- /// <seealso cref="Apache.Avalon.Container.Configuration.ContainerConfiguration"/>
- /// </remarks>
- /// <param name="config"></param>
- public DefaultContainer(ContainerConfiguration config) : this( config, null )
- {
- }
+ protected ILoggingManager m_loggingManager;
- /// <summary>
- /// Constructs a <b>DefaultContainer</b>.
- /// </summary>
- /// <param name="context"></param>
- public DefaultContainer(IContext context) : this( null, context )
- {
- }
+ protected ILogger m_logger;
- /// <summary>
- /// Constructs a <b>DefaultContainer</b>.
- /// </summary>
- /// <param name="config"></param>
- /// <param name="context"></param>
- public DefaultContainer(ContainerConfiguration config, IContext context)
+ public DefaultContainer()
{
- this.m_context = ( context == null ) ? new DefaultContext() : context;
- Setup(config);
+ ContainerConfiguration containerConf =
+ (ContainerConfiguration)
+ ConfigurationSettings.GetConfig( ContainerConfigurationSectionHandler.Section );
+
+ m_rootConfiguration = containerConf.Configuration;
}
- #endregion
- #region Methods
- private static ContainerConfiguration GetDefaultConfiguration()
+ public DefaultContainer(ContainerConfiguration configuration)
{
- ContainerConfiguration config = (ContainerConfiguration)
- ConfigurationSettings.GetConfig(ContainerConfigurationSectionHandler.Section);
- return config;
+ m_rootConfiguration = configuration.Configuration;
}
- private void Setup(ContainerConfiguration config)
- {
- if (config == null)
- {
- MissingConfigurationError();
- }
-
- InitializeHooks();
- InitializeLogger(config);
- InitializeFactoryManager();
- InitializeLifestyleManager(config);
- FindComponents(config.Assemblies);
- VerifyComponentsDependencies();
- SetupComponents(config.ComponentConfiguration);
- }
+ #region IInitializable Members
- private void InitializeHooks()
+ public void Initialize()
{
- AppDomain.CurrentDomain.DomainUnload += new EventHandler(OnDomainUnload);
- }
+ InitializeLogger();
- private void OnDomainUnload(object sender, EventArgs e)
- {
- ContainerUtil.Shutdown(this);
+ InitializeContainerApplication();
}
- /// <summary>
- /// Initialize LoggerManager for the container.
- /// </summary>
- /// <remarks>
- /// <para>
- /// <see cref="ContainerConfiguration"/> exposes the configuration
- /// for the logger manager in the <c><logger></c> xml element.
- /// </para>
- /// </remarks>
- /// <example>
- /// <code>
- /// <![CDATA[
- ///
- /// <!-- Sample configuration file -->
- ///
- /// <?xml version="1.0" encoding="utf-8" ?>
- /// <configuration>
- ///
- /// <configSections>
- /// <section
- /// name="avalon.container"
- /// type="Apache.Avalon.Container.Configuration.ContainerConfigurationSectionHandler, Apache.Avalon.Container" />
- /// </configSections>
- ///
- /// <avalon.container>
- /// <logger>
- /// <manager type="fullTypeName, AssemblyName" />
- /// </logger>
- /// </avalon.container>
- ///
- /// </configuration>
- /// ]]>
- /// </code>
- ///
- /// The <c>manager</c> element should be used to
- /// override the default <see cref="LoggerManager"/>. If the element
- /// isn't present, the default <see cref="LoggerManager"/> will
- /// be used.
- /// </example>
- /// <param name="config"></param>
- protected virtual void InitializeLogger(ContainerConfiguration config)
- {
- m_baseLogger = new ConsoleLogger(ConsoleLogger.LEVEL_DEBUG);
-
- Type loggerType = null;
-
- IConfiguration loggerConfiguration =
- ConfigurationUtil.GetConfiguration(config.LoggerNode);
-
- IConfiguration managerConfig = loggerConfiguration.GetChild("manager", false);
-
- if (managerConfig == null)
- {
- // If nothing different was specified, we instantiate
- // or well know LoggerManager implementantion
-
- loggerType = typeof( LoggerManager );
- }
- else
- {
- String typeName = (String) managerConfig.Attributes["type"];
- loggerType = Type.GetType( typeName, true, true );
- }
+ #endregion
- IComponentHandler handler =
- new InternalComponentHandler( m_baseLogger, m_context, loggerConfiguration, loggerType );
-
- m_loggerManager = (ILoggerManager) handler.GetInstance();
- }
+ #region Logger
- protected virtual void InitializeFactoryManager()
+ private void InitializeLogger()
{
- IConfiguration extensionsConfiguration =
- ConfigurationUtil.GetConfiguration( null );
+ IConfiguration loggerConfig = m_rootConfiguration.GetChild( "logging", true );
- ILogger logger = m_loggerManager["FactoryManager"];
+ LoggingDescriptor loggingDescriptor = CreateLoggingDescriptor( loggerConfig );
- Type factoryManagerType = typeof( ComponentFactoryManager );
+ m_loggingManager = new DefaultLoggingManager();
- InternalComponentHandler handler =
- new InternalComponentHandler( logger, m_context, extensionsConfiguration, factoryManagerType );
-
- m_factoryManager = (IComponentFactoryManager) handler.GetInstance();
+ m_logger = m_loggingManager.GetLoggerForCategory( loggingDescriptor.Name );
}
- /// <summary>
- /// TODO: Add summary
- /// </summary>
- /// <param name="config"></param>
- protected virtual void InitializeLifestyleManager(ContainerConfiguration config)
+ private LoggingDescriptor CreateLoggingDescriptor( IConfiguration configuration )
{
- IConfiguration extensionsConfiguration =
- ConfigurationUtil.GetConfiguration( config.ExtensionsNode );
- ILogger logger = m_loggerManager["LifestyleManager"];
-
- Type lifestyleManager = typeof( LifecycleManager );
-
- InternalComponentHandler handler =
- new InternalComponentHandler( logger, m_context, extensionsConfiguration, lifestyleManager );
-
- InternalLookupManager lookUpManager = new InternalLookupManager();
- lookUpManager.Add( typeof(IComponentFactoryManager).FullName, m_factoryManager );
- lookUpManager.Add( typeof(ILoggerManager).FullName, m_loggerManager );
- lookUpManager.Add( "Container", this );
- handler.LookupManager = lookUpManager;
-
- m_lifestyleManager = (LifecycleManager) handler.GetInstance();
- }
+ String name = (String) configuration.GetAttribute( "name", "kernel" );
- protected virtual void FindComponents(Assembly[] assemblies)
- {
- foreach(Assembly assembly in assemblies)
- {
- Pair[] pairs = AssemblyUtil.FindTypesUsingAttribute(
- assembly, typeof( AvalonServiceAttribute ), true);
-
- foreach(Pair pair in pairs)
- {
- Type componentType = (Type) pair.First;
- AvalonServiceAttribute serviceAttribute =
- (AvalonServiceAttribute) pair.Second;
-
- object[] dependencies = componentType.GetCustomAttributes(
- typeof( AvalonDependencyAttribute ), true);
-
- object[] avalonComponent = componentType.GetCustomAttributes(
- typeof( AvalonComponentAttribute ), false);
-
- Debug.Assert(serviceAttribute != null, "Component doesnt specified a AvalonServiceAttribute attribute");
- Debug.Assert(avalonComponent.Length != 0, "Component doesnt specified a AvalonComponentAttribute attribute");
- Debug.Assert(avalonComponent.Length == 1, "Component specified more than one AvalonComponentAttribute attribute");
-
- AddComponent(serviceAttribute, componentType, avalonComponent,
- dependencies);
- }
- }
- }
+ CategoriesDirective categories = null;
- protected virtual void AddComponent(AvalonServiceAttribute serviceAttribute, Type type,
- object[] componentAttribute, object[] dependencies)
- {
- if ( serviceAttribute == null )
- {
- throw new ArgumentNullException( "serviceAttribute" );
- }
- if ( type == null )
+ try
{
- throw new ArgumentNullException( "type" );
+ categories = CREATOR.GetCategoriesDirective( configuration, name );
}
- if ( componentAttribute == null || componentAttribute.Length == 0 )
+ catch(Exception e)
{
- throw new ArgumentNullException( "componentAttribute" );
+ throw new ContainerException("Exception obtaining logging directive.", e);
}
- String role = serviceAttribute.ServiceType.FullName;
-
- AvalonComponentAttribute attribute = null;
- attribute = (AvalonComponentAttribute) componentAttribute[0];
-
- AvalonDependencyAttribute[] dependenciesAttribute = null;
-
- if (dependencies.Length != 0)
- {
- dependenciesAttribute = new AvalonDependencyAttribute[dependencies.Length];
- dependencies.CopyTo(dependenciesAttribute, 0L);
- }
-
- ComponentEntry entry = new ComponentEntry(
- attribute, type, dependenciesAttribute);
-
- m_lifestyleManager.PrepareComponent( entry );
-
- Components.Add(role, entry);
- }
-
- protected virtual void VerifyComponentsDependencies()
- {
- Hashtable vertexMap =
- new Hashtable(CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default);
-
- foreach(DictionaryEntry dicEntry in Components.GetEntries())
+ ArrayList list = new ArrayList();
+ ConfigurationCollection configs = configuration.GetChildren( "target" );
+ foreach( IConfiguration conf in configs )
{
- String role = (String) dicEntry.Key;
- ComponentEntry entry = (ComponentEntry) dicEntry.Value;
-
- Vertex vertex = vertexMap[role] as Vertex;
-
- if (vertex == null)
+ try
{
- vertex = new Vertex(role, entry);
- vertexMap.Add(role, vertex);
+ list.Add( CreateTargetDescriptor( conf ) );
}
-
- foreach(AvalonDependencyAttribute dependency in entry.Dependencies)
+ catch( Exception e )
{
- String dependencyRole = dependency.DependencyType.FullName;
- ComponentEntry depEntry = Components[dependencyRole];
-
- if (depEntry == null && dependency.IsOptional == false)
- {
- MissingDependencyError(entry, dependencyRole);
- }
-
- Vertex child = new Vertex(dependencyRole, entry);
- vertex.AddDependency(child);
+ throw new ContainerException( "Invalid target descriptor.", e );
}
}
- Vertex[] vertices = new Vertex[vertexMap.Count];
- vertexMap.Values.CopyTo(vertices, 0);
-
- DirectedAcyclicGraphVerifier.TopologicalSort( vertices );
+ TargetDescriptor[] targets = (TargetDescriptor[]) list.ToArray( typeof(TargetDescriptor) );
- Array.Reverse( vertices );
+ //
+ // return the logging descriptor
+ //
- m_shutDownOrder = vertices;
+ return new LoggingDescriptor(
+ categories.Name,
+ categories.Priority,
+ categories.Target,
+ categories.Categories,
+ targets );
}
- protected virtual void SetupComponents(IDictionary componentConfiguration)
+ private TargetDescriptor CreateTargetDescriptor( IConfiguration config )
{
- foreach(ComponentEntry entry in Components)
+ String name = (String) config.GetAttribute( "name", String.Empty );
+
+ if( config.Children.Count == 0 )
{
- entry.ExtractConfigurationNode(componentConfiguration);
+ throw new ConfigurationException(
+ String.Format("Missing target provider element in '{0}'", config.Name) );
}
- }
-
- internal IComponentHandler GetComponentHandler(String role)
- {
- IComponentHandler handler = null;
- ComponentEntry entry = Components[role];
-
- if (entry != null)
+ IConfiguration conf = config.Children[0];
+
+ TargetProvider provider = null;
+
+ if( conf.Name.Equals( "file" ) )
{
- handler = entry.Handler;
+ // TODO: FileTargetProvider not supported yet
+ // throw new ConfigurationException(
+ // "FileTargetProvider not supported yet." );
+ // provider = createFileTargetProvider( conf );
+ }
+ else
+ {
+ throw new ConfigurationException(
+ String.Format( "Unrecognized provider: {0} in {1}.", conf.Name, config.Name ) );
}
- return handler;
- }
- #endregion
-
- #region ErrorMethod
- private void MissingDependencyError(ComponentEntry entry, String dependentRole)
- {
- String message = String.Format("Component {0} depends on {1} which has not been found.", entry.Name, dependentRole);
- throw new ContainerException(message);
+ return new TargetDescriptor( name, provider );
}
- private void MissingConfigurationError()
- {
- String message = "Impossible to start up the container while a configuration is not supplied. "
- + "The configuration can be supplied using a configuration file or creating manually a ContainerConfiguration.";
- throw new ContainerException(message);
- }
#endregion
- #region Properties
- internal ComponentCollection Components
- {
- get
- {
- if (m_components == null)
- {
- m_components = new ComponentCollection();
- }
- return m_components;
- }
- }
+ #region Application
- public ILookupManager LookupManager
+ private void InitializeContainerApplication()
{
- get
- {
- if (m_lookupManager == null)
- {
- m_lookupManager = new DefaultLookupManager(this);
- }
+ IConfiguration config = m_rootConfiguration.GetChild( "container", false );
- return m_lookupManager;
- }
+ // IContainmentModel application = CreateContainmentModel( config );
+ CreateContainmentModel( config );
}
- #endregion
- #region IDisposable Members
- public void Dispose()
+ private void CreateContainmentModel( IConfiguration config )
{
- if (m_baseLogger.IsDebugEnabled)
- {
- m_baseLogger.Debug("DefaultContainer: Dispose");
- }
-
- foreach(Vertex vertex in m_shutDownOrder)
- {
- if (m_baseLogger.IsDebugEnabled)
- {
- m_baseLogger.Debug("DefaultContainer: Disposing handler of {0} ...",
- vertex.Entry.ComponentType.FullName );
- }
+ //m_logger.Info( "building application model" );
- ContainerUtil.Shutdown(vertex.Entry);
- }
+ ContainmentProfile profile = CREATOR.CreateContainmentProfile( config );
- if (m_baseLogger.IsDebugEnabled)
- {
- m_baseLogger.Debug("DefaultContainer: Disposing ComponentFactoryManager");
- }
- ContainerUtil.Shutdown(m_factoryManager);
+ // return null;
- if (m_baseLogger.IsDebugEnabled)
- {
- m_baseLogger.Debug("DefaultContainer: Disposing LifecycleManager");
- }
- ContainerUtil.Shutdown(m_lifestyleManager);
+ /* m_loggingManager.AddCategories( profile.Categories );
- if (m_baseLogger.IsDebugEnabled)
- {
- m_baseLogger.Debug("DefaultContainer: Disposing LoggerManager");
- }
- ContainerUtil.Shutdown(m_loggerManager);
+ ITypeLoaderContext loaderContext = new DefaultTypeLoaderContext( m_logger,
+ null, baseDir, typeRepository, serviceRepository, typeLoaderDirec, assm);
- if (m_baseLogger.IsDebugEnabled)
- {
- m_baseLogger.Debug("DefaultContainer: Disposing Logger - bye");
- }
- ContainerUtil.Shutdown(m_baseLogger);
+ ITypeLoaderModel loaderModel = new DefaultTypeLoaderModel( loaderContext );*/
}
+
#endregion
}
}
1.6 +12 -14 avalon-sandbox/avalon-net/cscontainer/AvalonContainer/LifestyleManager.cs
Index: LifestyleManager.cs
===================================================================
RCS file: /home/cvs/avalon-sandbox/avalon-net/cscontainer/AvalonContainer/LifestyleManager.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- LifestyleManager.cs 23 Nov 2003 13:00:55 -0000 1.5
+++ LifestyleManager.cs 1 Feb 2004 13:32:18 -0000 1.6
@@ -48,9 +48,9 @@
namespace Apache.Avalon.Container
{
using System;
- using System.ComponentModel;
using System.Reflection;
using System.Collections;
+ using EventHandlerList = System.ComponentModel.EventHandlerList;
using Apache.Avalon.Framework;
using Apache.Avalon.Container.Configuration;
@@ -61,6 +61,8 @@
using Apache.Avalon.Container.Factory;
using Apache.Avalon.Container.Logger;
+ using Apache.Avalon.Meta;
+
/// <summary>
/// Basic handler to listen to Container events.
/// </summary>
@@ -95,10 +97,7 @@
public void PrepareComponent(ComponentEntry entry)
{
- if (m_logger.IsDebugEnabled)
- {
- m_logger.Debug("Preparing component '{0}'", entry.ComponentType.FullName);
- }
+ m_logger.Debug("Preparing component '{0}'", entry.ComponentType.FullName);
IComponentFactory factory = m_factoryManager.GetFactory(entry);
DelegateHandler handler = new DelegateHandler(factory, entry);
@@ -107,10 +106,7 @@
internal void BeforeGetInstance(DelegateHandler handler)
{
- if (m_logger.IsDebugEnabled)
- {
- m_logger.Debug("BeforeGetInstance '{0}'", handler.ComponentEntry.ComponentType.FullName);
- }
+ m_logger.Debug("BeforeGetInstance '{0}'", handler.ComponentEntry.ComponentType.FullName);
OnBeforeCreation(handler.ComponentEntry);
}
@@ -362,7 +358,7 @@
try
{
- Type type = Type.GetType(typeName);
+ Type type = Type.GetType(typeName, true, true);
loadedTypes.Add(type);
}
@@ -444,9 +440,9 @@
// TODO: There are a lot of to-dos here. As we are focusing
// the simplest case, they should not be an issue.
- foreach(AvalonDependencyAttribute dep in entry.Dependencies)
+ foreach(DependencyDescriptor dependency in entry.Dependencies)
{
- String depRole = dep.DependencyType.FullName;
+ String depRole = dependency.Service.Typename;
ComponentEntry depEntry = m_container.Components[depRole];
if (depEntry != null && entry != depEntry)
@@ -456,9 +452,11 @@
m_logger.Debug(" Dependency: '{0}'", depEntry.ComponentType.FullName);
}
- lookupManager.Add(dep.Key, dep.DependencyType);
+ Type dependencyType = Type.GetType( dependency.Service.Typename, true, true );
+
+ lookupManager.Add(dependency.Key, dependencyType);
- OnSetupDependencies(instance, entry, depRole, dep.Key, lookupManager);
+ OnSetupDependencies(instance, entry, depRole, dependency.Key, lookupManager);
}
}
}
1.2 +59 -220 avalon-sandbox/avalon-net/cscontainer/AvalonContainer/Configuration/ContainerConfiguration.cs
Index: ContainerConfiguration.cs
===================================================================
RCS file: /home/cvs/avalon-sandbox/avalon-net/cscontainer/AvalonContainer/Configuration/ContainerConfiguration.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ContainerConfiguration.cs 22 Sep 2003 23:49:23 -0000 1.1
+++ ContainerConfiguration.cs 1 Feb 2004 13:32:18 -0000 1.2
@@ -1,127 +1,80 @@
-// ============================================================================
-// The Apache Software License, Version 1.1
-// ============================================================================
-//
-// Copyright (C) 2002-2003 The Apache Software Foundation. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without modifica-
-// tion, are permitted provided that the following conditions are met:
-//
-// 1. Redistributions of source code must retain the above copyright notice,
-// this list of conditions and the following disclaimer.
-//
-// 2. 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.
-//
-// 3. The end-user documentation included with the redistribution, if any, must
-// include the following acknowledgment: "This product includes software
-// developed by the Apache Software Foundation (http://www.apache.org/)."
-// Alternately, this acknowledgment may appear in the software itself, if
-// and wherever such third-party acknowledgments normally appear.
-//
-// 4. The names "Jakarta", "Avalon", "Excalibur" and "Apache Software Foundation"
-// must not be used to endorse or promote products derived from this software
-// without prior written permission. For written permission, please contact
-// apache@apache.org.
-//
-// 5. Products derived from this software may not be called "Apache", nor may
-// "Apache" appear in their name, without prior written permission of the
-// Apache Software Foundation.
-//
-// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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
-// APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
-// DING, 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.
-//
-// This software consists of voluntary contributions made by many individuals
-// on behalf of the Apache Software Foundation. For more information on the
-// Apache Software Foundation, please see <http://www.apache.org/>.
-// ============================================================================
+// Copyright 2004 Apache Software Foundation
+//
+// 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.
namespace Apache.Avalon.Container.Configuration
{
using System;
- using System.Collections;
- using System.Collections.Specialized;
using System.Xml;
- using System.Reflection;
using System.IO;
- using System.Security;
using Apache.Avalon.Framework;
/// <summary>
- /// Summary description for ContainerConfiguration.
+ /// Keeps the container configuration.
/// </summary>
- public sealed class ContainerConfiguration
+ public class ContainerConfiguration
{
- private static readonly String ComponentNodeName = "component";
- private static readonly String ComponentsNodeName = "components";
- private static readonly String LoggerNodeName = "component";
- private static readonly String AssemblyNodeName = "assembly";
- private static readonly String ExtensionNodeName = "extensionModule";
-
- private static readonly String TypeAttributeName = "type";
- private static readonly String ConfigAttributeName = "configurationName";
-
- private ArrayList m_assemblies;
- private Hashtable m_componentConfig;
- private XmlNode m_extensionsNode;
- private XmlNode m_loggerNode;
+ private IConfiguration m_configuration;
- private ContainerConfiguration(ContainerConfiguration parent)
+ /// <summary>
+ /// Constructs a ContainerConfiguration with an optional parent.
+ /// </summary>
+ /// <param name="parent">The ContainerConfiguration parent. Can be null</param>
+ public ContainerConfiguration(ContainerConfiguration parent)
{
- m_loggerNode = null;
-
- if (parent == null)
- {
- m_assemblies = new ArrayList();
-
- m_componentConfig = new Hashtable(
- CaseInsensitiveHashCodeProvider.Default,
- CaseInsensitiveComparer.Default);
-
- m_extensionsNode = m_loggerNode = null;
- }
- else
- {
- m_assemblies = new ArrayList(parent.Assemblies);
-
- m_componentConfig = new Hashtable(parent.ComponentConfiguration,
- CaseInsensitiveHashCodeProvider.Default,
- CaseInsensitiveComparer.Default);
-
- m_extensionsNode = parent.ExtensionsNode;
- m_loggerNode = parent.LoggerNode;
- }
}
- public ContainerConfiguration(ContainerConfiguration parent, XmlNode node) : this(parent)
+ /// <summary>
+ /// Constructs a ContainerConfiguration with an optional parent.
+ /// </summary>
+ /// <param name="parent">The ContainerConfiguration parent. Can be null</param>
+ /// <param name="section">XmlNode to be parsed.</param>
+ public ContainerConfiguration(ContainerConfiguration parent, XmlNode section) : this( parent )
{
- if (parent != null)
+ if ( section == null )
{
- m_assemblies.AddRange( parent.Assemblies );
+ throw new ArgumentNullException( "section" );
}
- Parse(node);
+ Deserialize( section );
}
- public ContainerConfiguration(XmlNode node) : this(null, node)
+ /// <summary>
+ /// Constructs a ContainerConfiguration with the
+ /// <see cref="XmlNode"/> to be parsed.
+ /// </summary>
+ /// <param name="parent">The ContainerConfiguration parent. Can be null</param>
+ /// <param name="section">XmlNode to be parsed.</param>
+ public ContainerConfiguration(XmlNode section) : this(null, section)
{
}
+ /// <summary>
+ /// Constructs a ContainerConfiguration with the filename containing
+ /// the xml to be parsed.
+ /// </summary>
+ /// <param name="filename">The filename to be parsed.</param>
public ContainerConfiguration(String filename) : this(null as ContainerConfiguration)
{
ParseFromFile(filename);
}
+ /// <summary>
+ /// Parses a configuration file. Looks for a node
+ /// 'configuration/avalon.container'
+ /// </summary>
+ /// <param name="filename">The xml full file name</param>
private void ParseFromFile(String filename)
{
XmlTextReader reader = new XmlTextReader(
@@ -133,140 +86,26 @@
XmlNode avalonNode =
doc.SelectSingleNode("configuration/" + ContainerConfigurationSectionHandler.Section);
- Parse(avalonNode);
- }
-
- private void Parse(XmlNode node)
- {
- foreach(XmlNode childNode in node)
- {
- if (childNode.NodeType != XmlNodeType.Element)
- {
- continue;
- }
-
- if (childNode.Name.Equals( ComponentsNodeName ))
- {
- foreach(XmlNode componentChild in childNode)
- {
- ParseChildNode( componentChild );
- }
- }
- else if ( childNode.Name.Equals( ExtensionNodeName ) )
- {
- this.m_extensionsNode = childNode;
- }
- else if ( childNode.Name.Equals( LoggerNodeName ) )
- {
- this.m_loggerNode = childNode;
- }
- }
- }
-
- private void ParseChildNode(XmlNode childNode)
- {
- if ( childNode.Name.Equals( AssemblyNodeName ) )
- {
- ParseAssemblyNode( childNode );
- }
- else if ( childNode.Name.Equals( ComponentNodeName ) )
- {
- ParseComponentNode( childNode );
- }
- }
-
- private void ParseAssemblyNode(XmlNode childNode)
- {
- XmlAttribute typeAtt = childNode.Attributes[TypeAttributeName];
-
- if (typeAtt == null)
- {
- MissingAttributeError(TypeAttributeName, AssemblyNodeName);
- }
-
- String assemblyType = typeAtt.Value;
-
- try
- {
- Assembly assembly = Assembly.Load(assemblyType);
-
- m_assemblies.Add(assembly);
- }
- catch(FileNotFoundException inner)
- {
- throw new ConfigurationException("Can't load assembly. File not found.", inner);
- }
- catch(BadImageFormatException inner)
- {
- throw new ConfigurationException("The assembly file was found, but was corrupted.", inner);
- }
- catch(SecurityException inner)
- {
- throw new ConfigurationException("Due a security exception, we cannot load the assembly.", inner);
- }
- }
-
- private void ParseComponentNode(XmlNode childNode)
- {
- XmlAttribute configNameAtt = childNode.Attributes[ConfigAttributeName];
-
- if (configNameAtt == null)
- {
- MissingAttributeError(ConfigAttributeName, ComponentNodeName);
- }
-
- m_componentConfig[configNameAtt.Value] = childNode;
- }
-
- private void MissingAttributeError(String attribute, String parentElement)
- {
- String message =
- String.Format("Missing attribute '{0}' in element '{1}'.",
- attribute, parentElement);
-
- throw new ConfigurationException(message);
+ Deserialize( avalonNode );
}
- private void UnexpectedNodeError(String expected, String current, String parent)
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="section"></param>
+ private void Deserialize( XmlNode section )
{
- String message =
- String.Format("Unexpected node '{0}' found instead of '{1}' in element '{2}'.",
- current, expected, parent);
-
- throw new ConfigurationException(message);
- }
-
- internal Assembly[] Assemblies
- {
- get
- {
- Assembly[] assemblies = new Assembly[m_assemblies.Count];
- m_assemblies.CopyTo( assemblies, 0 );
- return assemblies;
- }
- }
-
- internal IDictionary ComponentConfiguration
- {
- get
- {
- return m_componentConfig;
- }
- }
-
- internal XmlNode ExtensionsNode
- {
- get
- {
- return m_extensionsNode;
- }
+ m_configuration = DefaultConfigurationSerializer.Deserialize( section );
}
- internal XmlNode LoggerNode
+ /// <summary>
+ ///
+ /// </summary>
+ public IConfiguration Configuration
{
get
{
- return m_loggerNode;
+ return m_configuration;
}
}
}
1.2 +39 -50 avalon-sandbox/avalon-net/cscontainer/AvalonContainer/Configuration/ContainerConfigurationSectionHandler.cs
Index: ContainerConfigurationSectionHandler.cs
===================================================================
RCS file: /home/cvs/avalon-sandbox/avalon-net/cscontainer/AvalonContainer/Configuration/ContainerConfigurationSectionHandler.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ContainerConfigurationSectionHandler.cs 22 Sep 2003 23:49:23 -0000 1.1
+++ ContainerConfigurationSectionHandler.cs 1 Feb 2004 13:32:18 -0000 1.2
@@ -1,49 +1,16 @@
-// ============================================================================
-// The Apache Software License, Version 1.1
-// ============================================================================
-//
-// Copyright (C) 2002-2003 The Apache Software Foundation. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without modifica-
-// tion, are permitted provided that the following conditions are met:
-//
-// 1. Redistributions of source code must retain the above copyright notice,
-// this list of conditions and the following disclaimer.
-//
-// 2. 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.
-//
-// 3. The end-user documentation included with the redistribution, if any, must
-// include the following acknowledgment: "This product includes software
-// developed by the Apache Software Foundation (http://www.apache.org/)."
-// Alternately, this acknowledgment may appear in the software itself, if
-// and wherever such third-party acknowledgments normally appear.
-//
-// 4. The names "Jakarta", "Avalon", "Excalibur" and "Apache Software Foundation"
-// must not be used to endorse or promote products derived from this software
-// without prior written permission. For written permission, please contact
-// apache@apache.org.
-//
-// 5. Products derived from this software may not be called "Apache", nor may
-// "Apache" appear in their name, without prior written permission of the
-// Apache Software Foundation.
-//
-// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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
-// APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
-// DING, 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.
-//
-// This software consists of voluntary contributions made by many individuals
-// on behalf of the Apache Software Foundation. For more information on the
-// Apache Software Foundation, please see <http://www.apache.org/>.
-// ============================================================================
+// Copyright 2004 Apache Software Foundation
+//
+// 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.
namespace Apache.Avalon.Container.Configuration
{
@@ -52,26 +19,48 @@
using System.Xml;
/// <summary>
- /// Summary description for ContainerConfigurationSectionHandler.
+ /// Implementation of <see cref="System.Configuration.IConfigurationSectionHandler"/>
+ /// to allow natural mapping of a section in the configuration file associated with an
+ /// AppDomain to a <see cref="ContainerConfiguration"/>.
/// </summary>
public class ContainerConfigurationSectionHandler : IConfigurationSectionHandler
{
- private static readonly String SectionName = "avalon.container";
-
+ /// <summary>
+ /// The static name of the section in the configuration file.
+ /// </summary>
+ private static readonly String SECTION_NAME = "avalon.container";
+
+ /// <summary>
+ /// Constructs a ContainerConfigurationSectionHandler.
+ /// </summary>
public ContainerConfigurationSectionHandler()
{
}
+ /// <summary>
+ /// Returns the default name of the section in the
+ /// configuration file.
+ /// </summary>
internal static String Section
{
get
{
- return SectionName;
+ return SECTION_NAME;
}
}
#region IConfigurationSectionHandler Members
+ /// <summary>
+ /// Invoke by Configuration API - Should return any object represeting the
+ /// actual configuration
+ /// </summary>
+ /// <param name="parent">If hierarquical configuration is being used,
+ /// a non-null ContainerConfiguration to be overrided.
+ /// </param>
+ /// <param name="configContext">API specific.</param>
+ /// <param name="section">The <see cref="XmlNode"/> to be parsed.</param>
+ /// <returns>A ContainerConfiguration instance.</returns>
public object Create(object parent, object configContext, XmlNode section)
{
return new ContainerConfiguration(
1.1 avalon-sandbox/avalon-net/cscontainer/AvalonContainer-compilations.build
Index: AvalonContainer-compilations.build
===================================================================
<?xml version="1.0" ?>
<project name="avalon-container-helper" xmlnds="http://tempuri.org/nant-vs.xsd">
<target name="compile-runtime" description="Compile all build configurations for the current runtime configuration"
depends="check-current-runtime-config, check-current-runtime-version">
<echo message="Compiling all build configurations for the ${current.runtime.config}-${current.runtime.version} runtime configuration." />
<call target="set-debug-build-configuration" />
<!-- make sure that the runtime properties that rely on build configuration information are refreshed -->
<call target="set-runtime-configuration" />
<call target="compile-${current.runtime.config}-${current.runtime.version}" />
<call target="set-release-build-configuration" />
<!-- make sure that the runtime properties that rely on build configuration information are refreshed -->
<call target="set-runtime-configuration" />
<call target="compile-${current.runtime.config}-${current.runtime.version}" />
</target>
<target name="compile-build" description="Compile current build configurations for all runtime configurations">
<echo message="Compiling all runtime configurations for the ${current.build.config} build configuration." />
<available type="Framework" resource="net-1.0" property="temp.framework.available" />
<if propertytrue="temp.framework.available">
<call target="set-net-1.0-runtime-configuration" />
<call target="compile-${current.runtime.config}-${current.runtime.version}" />
</if>
<ifnot propertytrue="temp.framework.available">
<if propertyexists="project.build.package" propertytrue="project.build.package">
<fail message="The .NET Framework 1.0 is not available." />
</if>
<ifnot propertyexists="project.build.package" propertytrue="project.build.package">
<echo message="The .NET Framework 1.0 is not available. Build skipped." />
</ifnot>
</ifnot>
<available type="Framework" resource="net-1.1" property="temp.framework.available" />
<if propertytrue="temp.framework.available">
<call target="set-net-1.1-runtime-configuration" />
<call target="compile-${current.runtime.config}-${current.runtime.version}" />
</if>
<ifnot propertytrue="temp.framework.available">
<if propertyexists="project.build.package" propertytrue="project.build.package">
<fail message="The .NET Framework 1.1 is not available." />
</if>
<ifnot propertyexists="project.build.package" propertytrue="project.build.package">
<echo message="The .NET Framework 1.1 is not available. Build skipped." />
</ifnot>
</ifnot>
<available type="Framework" resource="mono-1.0" property="temp.framework.available" />
<if propertytrue="temp.framework.available">
<call target="set-mono-1.0-runtime-configuration" />
<call target="compile-${current.runtime.config}-${current.runtime.version}" />
</if>
<ifnot propertytrue="temp.framework.available">
<if propertyexists="project.build.package" propertytrue="project.build.package">
<fail message="Mono 1.0 is not available." />
</if>
<ifnot propertyexists="project.build.package" propertytrue="project.build.package">
<echo message="Mono 1.0 is not available. Build skipped." />
</ifnot>
</ifnot>
<available type="Framework" resource="sscli-1.0" property="temp.framework.available" />
<if propertytrue="temp.framework.available">
<call target="set-sscli-1.0-runtime-configuration" />
<call target="compile-${current.runtime.config}-${current.runtime.version}" />
</if>
<ifnot propertytrue="temp.framework.available">
<if propertyexists="project.build.package" propertytrue="project.build.package">
<fail message="SSCLI 1.0 is not available." />
</if>
<ifnot propertyexists="project.build.package" propertytrue="project.build.package">
<echo message="SSCLI 1.0 is not available. Build skipped." />
</ifnot>
</ifnot>
</target>
<target name="compile" description="Builds the current build configuration for the current runtime configuration."
depends="check-current-build-config, check-current-runtime-config, check-current-runtime-version">
<call target="compile-${current.runtime.config}-${current.runtime.version}" />
</target>
<target name="compile-net-1.0" description="Builds .NET Framework 1.0 version" depends="set-net-1.0-runtime-configuration, check-avalon-container-basedir">
<!-- make sure the current binaries directory exists and is cleaned -->
<call target="clean-current-bin-dir" />
<!-- initialize the temp.build.skip property to false -->
<property name="temp.build.skip" value="false" readonly="false" />
<if propertytrue="current.build.config.release">
<!-- check if the Avalon key file is available -->
<available type="File" resource="${avalon-container.basedir}/${avalon-container.key}" property="temp.avalon.keyfile.available" />
<ifnot propertytrue="temp.avalon.keyfile.available">
<if propertyexists="project.build.package" propertytrue="project.build.package">
<fail message="Key file not found." />
</if>
<ifnot propertyexists="project.build.package" propertytrue="project.build.package">
<echo message="Key file not found. You can generate a key file by running 'sn -k ${avalon-container.key}'." />
<echo message="The generated key file should be stored in the Avalon Container base directory." />
<echo message="The release build will be skipped." />
<property name="temp.build.skip" value="true" readonly="false" />
</ifnot>
</ifnot>
<if propertytrue="temp.avalon.keyfile.available">
<!-- copy the Avalon key file to the location where the compiler expects it to be -->
<copy file="${avalon-container.basedir}/${avalon-container.key}" todir="${current.bin.dir}/../../../" if="${current.build.config.release}" />
</if>
</if>
<ifnot propertytrue="temp.build.skip">
<csc nostdlib="true" noconfig="true" warnaserror="false" target="library" debug="${current.build.debug}"
define="${current.build.defines.csc}" output="${current.bin.dir}/${avalon-container.assembly}" doc="${current.bin.dir}/${avalon-container.doc}">
<sources basedir="${avalon-container.src}" defaultexcludes="true">
<includes name="**/*.cs" />
</sources>
<references defaultexcludes="true">
<includes name="${nant.settings.currentframework.frameworkassemblydirectory}/mscorlib.dll"
fromPath="false" />
<includes name="${nant.settings.currentframework.frameworkassemblydirectory}/System.dll"
fromPath="false" />
<includes name="${nant.settings.currentframework.frameworkassemblydirectory}/System.Xml.dll"
fromPath="false" />
<!-- allow for third party assemblies to be referenced by just storing them in the lib/<framework>/<framework version>/<build configuration> directory -->
<includes name="lib/${current.runtime.config}/${current.runtime.version}/${current.build.config}/*.dll"
fromPath="false" />
</references>
</csc>
</ifnot>
<!-- Execute the testcases -->
<call target="run-tests" />
</target>
<target name="compile-net-1.1" description="Builds .NET Framework 1.1 version" depends="set-net-1.1-runtime-configuration, check-avalon-container-basedir">
<!-- make sure the current binaries directory exists and is cleaned -->
<call target="clean-current-bin-dir" />
<!-- initialize the temp.build.skip property to false -->
<property name="temp.build.skip" value="false" readonly="false" />
<if propertytrue="current.build.config.release">
<!-- check if the Avalon key file is available -->
<available type="File" resource="${avalon-container.basedir}/${avalon-container.key}" property="temp.avalon.keyfile.available" />
<ifnot propertytrue="temp.avalon.keyfile.available">
<if propertyexists="project.build.package" propertytrue="project.build.package">
<fail message="Key file not found." />
</if>
<ifnot propertyexists="project.build.package" propertytrue="project.build.package">
<echo message="Key file not found. You can generate a key file by running 'sn -k ${avalon-container.key}'." />
<echo message="The generated key file should be stored in the Avalon Container base directory." />
<echo message="The release build will be skipped." />
<property name="temp.build.skip" value="true" readonly="false" />
</ifnot>
</ifnot>
<if propertytrue="temp.avalon.keyfile.available">
<!-- copy the Avalon key file to the location where the compiler expects it to be -->
<copy file="${avalon-container.basedir}/${avalon-container.key}" todir="${current.bin.dir}/../../../" if="${current.build.config.release}" />
</if>
</if>
<ifnot propertytrue="temp.build.skip">
<csc nostdlib="true" noconfig="true" warnaserror="false" target="library" debug="${current.build.debug}"
define="${current.build.defines.csc}" output="${current.bin.dir}/${avalon-container.assembly}" doc="${current.bin.dir}/${avalon-container.doc}">
<sources basedir="${avalon-container.src}" defaultexcludes="true">
<includes name="**/*.cs" />
</sources>
<references defaultexcludes="true">
<includes name="${nant.settings.currentframework.frameworkassemblydirectory}/mscorlib.dll"
fromPath="false" />
<includes name="${nant.settings.currentframework.frameworkassemblydirectory}/System.dll"
fromPath="false" />
<includes name="${nant.settings.currentframework.frameworkassemblydirectory}/System.Xml.dll"
fromPath="false" />
<!-- allow for third party assemblies to be referenced by just storing them in the lib/<framework>/<framework version>/<build configuration> directory -->
<includes name="lib/${current.runtime.config}/${current.runtime.version}/${current.build.config}/*.dll"
fromPath="false" />
</references>
</csc>
</ifnot>
<!-- Execute the testcases -->
<call target="run-tests" />
</target>
<target name="compile-mono-1.0" description="Builds Mono 1.0 version" depends="set-mono-1.0-runtime-configuration, check-avalon-container-basedir">
<!-- make sure the current binaries directory exists and is cleaned -->
<call target="clean-current-bin-dir" />
<!-- initialize the temp.build.skip property to false -->
<property name="temp.build.skip" value="false" readonly="false" />
<if propertytrue="current.build.config.release">
<!-- check if the Avalon key file is available -->
<available type="File" resource="${avalon-container.basedir}/${avalon-container.key}" property="temp.avalon.keyfile.available" />
<ifnot propertytrue="temp.avalon.keyfile.available">
<if propertyexists="project.build.package" propertytrue="project.build.package">
<fail message="Key file not found." />
</if>
<ifnot propertyexists="project.build.package" propertytrue="project.build.package">
<echo message="Key file not found. You can generate a key file by running 'sn -k ${avalon-container.key}'." />
<echo message="The generated key file should be stored in the Avalon Container base directory." />
<echo message="The release build will be skipped." />
<property name="temp.build.skip" value="true" readonly="false" />
</ifnot>
</ifnot>
<if propertytrue="temp.avalon.keyfile.available">
<!-- copy the Avalon key file to the location where the compiler expects it to be -->
<copy file="${avalon-container.basedir}/${avalon-container.key}" todir="${current.bin.dir}/../../../" if="${current.build.config.release}" />
</if>
</if>
<ifnot propertytrue="temp.build.skip">
<csc nostdlib="false" noconfig="true" warnaserror="false" target="library" debug="${current.build.debug}"
define="${current.build.defines.csc}" output="${current.bin.dir}/${avalon-container.assembly}">
<sources basedir="${avalon-container.src}" defaultexcludes="true">
<includes name="**/*.cs" />
</sources>
<references defaultexcludes="true">
<includes name="${nant.settings.currentframework.frameworkassemblydirectory}/mscorlib.dll"
fromPath="false" />
<includes name="${nant.settings.currentframework.frameworkassemblydirectory}/System.dll"
fromPath="false" />
<includes name="${nant.settings.currentframework.frameworkassemblydirectory}/System.Xml.dll"
fromPath="false" />
<!-- allow for third party assemblies to be referenced by just storing them in the lib/<framework>/<framework version>/<build configuration> directory -->
<includes name="lib/${current.runtime.config}/${current.runtime.version}/${current.build.config}/*.dll"
fromPath="false" />
</references>
</csc>
</ifnot>
<!-- Execute the testcases -->
<call target="run-tests" />
</target>
<target name="compile-sscli-1.0" description="Builds SSCLI 1.0 version" depends="set-sscli-1.0-runtime-configuration, check-avalon-container-basedir">
<!-- make sure the current binaries directory exists and is cleaned -->
<call target="clean-current-bin-dir" />
<!-- initialize the temp.build.skip property to false -->
<property name="temp.build.skip" value="false" readonly="false" />
<if propertytrue="current.build.config.release">
<!-- check if the Avalon key file is available -->
<available type="File" resource="${avalon-container.basedir}/${avalon-container.key}" property="temp.avalon.keyfile.available" />
<ifnot propertytrue="temp.avalon.keyfile.available">
<if propertyexists="project.build.package" propertytrue="project.build.package">
<fail message="Key file not found." />
</if>
<ifnot propertyexists="project.build.package" propertytrue="project.build.package">
<echo message="Key file not found. You can generate a key file by running 'sn -k ${avalon-container.key}'." />
<echo message="The generated key file should be stored in the Avalon Container base directory." />
<echo message="The release build will be skipped." />
<property name="temp.build.skip" value="true" readonly="false" />
</ifnot>
</ifnot>
<if propertytrue="temp.avalon.keyfile.available">
<!-- copy the Avalon key file to the location where the compiler expects it to be -->
<copy file="${avalon-container.basedir}/${avalon-container.key}" todir="${current.bin.dir}/../../../" if="${current.build.config.release}" />
</if>
</if>
<ifnot propertytrue="temp.build.skip">
<csc nostdlib="true" noconfig="true" warnaserror="false" target="library" debug="${current.build.debug}"
define="${current.build.defines.csc}" output="${current.bin.dir}/${avalon-container.assembly}">
<sources basedir="${avalon-container.src}" defaultexcludes="true">
<includes name="**/*.cs" />
</sources>
<references defaultexcludes="true">
<includes name="${nant.settings.currentframework.frameworkassemblydirectory}/mscorlib.dll"
fromPath="false" />
<includes name="${nant.settings.currentframework.frameworkassemblydirectory}/System.dll"
fromPath="false" />
<includes name="${nant.settings.currentframework.frameworkassemblydirectory}/System.Xml.dll"
fromPath="false" />
<!-- allow for third party assemblies to be referenced by just storing them in the lib/<framework>/<framework version>/<build configuration> directory -->
<includes name="lib/${current.runtime.config}/${current.runtime.version}/${current.build.config}/*.dll"
fromPath="false" />
</references>
</csc>
</ifnot>
<!-- Execute the testcases -->
<call target="run-tests" />
</target>
<target name="compile-tests" description="Compile test cases">
<echo message="NAnt location is ${nant.location}" />
<csc nostdlib="true" noconfig="true" warnaserror="false" target="library" debug="${current.build.debug}"
define="${current.build.defines.csc}" output="${current.bin.dir}/${avalon-container.test.assembly}">
<sources basedir="${avalon-container.test.src}" defaultexcludes="true">
<includes name="**/*.cs" />
</sources>
<references defaultexcludes="true">
<includes name="${nant.settings.currentframework.frameworkassemblydirectory}/mscorlib.dll"
fromPath="false" />
<includes name="${nant.settings.currentframework.frameworkassemblydirectory}/System.dll"
fromPath="false" />
<includes name="${nant.settings.currentframework.frameworkassemblydirectory}/System.Xml.dll"
fromPath="false" />
<includes name="${nant.location}/nunit.framework.dll"
fromPath="false" />
<includes name="${current.bin.dir}/${avalon-container.assembly}" fromPath="false" />
<!-- allow for third party assemblies to be referenced by just storing them in the lib/<framework>/<framework version>/<build configuration> directory -->
<includes name="lib/${current.runtime.config}/${current.runtime.version}/${current.build.config}/*.dll"
fromPath="false" />
</references>
</csc>
</target>
</project>
1.1 avalon-sandbox/avalon-net/cscontainer/AvalonContainer-helper.build
Index: AvalonContainer-helper.build
===================================================================
<?xml version="1.0" ?>
<project name="avalon-container-helper" xmlnds="http://tempuri.org/nant-vs.xsd">
<target name="check-bin-dir">
<ifnot propertyexists="bin.dir">
<property name="bin.dir" value="bin" readonly="false" />
</ifnot>
<mkdir dir="${bin.dir}" />
</target>
<target name="check-build-debug">
<ifnot propertyexists="build.debug">
<fail message="The build debug setting has not been specified." />
</ifnot>
</target>
<target name="check-build-defines">
<ifnot propertyexists="build.defines.csc">
<fail message="The build defines for the csc task have not been specified." />
</ifnot>
<ifnot propertyexists="build.defines.jsc">
<fail message="The build defines for the jsc task have not been specified." />
</ifnot>
<ifnot propertyexists="build.defines.vbc">
<fail message="The build defines for the vbc task have not been specified." />
</ifnot>
<ifnot propertyexists="build.defines.vjc">
<fail message="The build defines for the vjc task have not been specified." />
</ifnot>
<ifnot propertyexists="build.defines.cl">
<fail message="The build defines for the cl task have not been specified." />
</ifnot>
</target>
<target name="check-doc-dir">
<ifnot propertyexists="doc.dir">
<property name="doc.dir" value="doc" readonly="false" />
</ifnot>
<mkdir dir="${doc.dir}" />
</target>
<target name="check-sdkdoc-dir" depends="check-doc-dir">
<ifnot propertyexists="sdkdoc.dir">
<property name="sdkdoc.dir" value="${doc.dir}/sdk" readonly="false" />
</ifnot>
<mkdir dir="${sdkdoc.dir}" />
</target>
<target name="check-sdkdoc-debug">
<ifnot propertyexists="sdkdoc.debug">
<fail message="The sdk documentation debug setting has not been specified." />
</ifnot>
</target>
<target name="check-current-bin-dir">
<ifnot propertyexists="current.bin.dir">
<fail message="The current binaries directory has not been specified." />
</ifnot>
<mkdir dir="${current.bin.dir}" />
</target>
<target name="check-current-build-debug">
<ifnot propertyexists="current.build.debug">
<fail message="The current build debug setting has not been specified." />
</ifnot>
</target>
<target name="check-current-build-defines">
<ifnot propertyexists="current.build.defines.csc">
<fail message="The current build defines for the csc task have not been specified." />
</ifnot>
<ifnot propertyexists="current.build.defines.jsc">
<fail message="The current build defines for the jsc task have not been specified." />
</ifnot>
<ifnot propertyexists="current.build.defines.vbc">
<fail message="The current build defines for the vbc task have not been specified." />
</ifnot>
<ifnot propertyexists="current.build.defines.vjc">
<fail message="The current build defines for the vjc task have not been specified." />
</ifnot>
<ifnot propertyexists="current.build.defines.cl">
<fail message="The current build defines for the cl task have not been specified." />
</ifnot>
</target>
<target name="check-current-sdkdoc-dir">
<ifnot propertyexists="current.sdkdoc.dir">
<fail message="The current sdk document directory has not been specified." />
</ifnot>
<mkdir dir="${sdkdoc.dir}" />
</target>
<target name="check-current-sdkdoc-debug">
<ifnot propertyexists="current.sdkdoc.debug">
<fail message="The curernt sdk documentation debug setting has not been specified." />
</ifnot>
</target>
<target name="check-current-runtime-config">
<ifnot propertyexists="current.runtime.config">
<fail message="The current runtime configuration has not been specified." />
</ifnot>
</target>
<target name="check-current-runtime-version">
<ifnot propertyexists="current.runtime.config">
<fail message="The current runtime version has not been specified." />
</ifnot>
</target>
<target name="check-current-runtime-description">
<ifnot propertyexists="current.runtime.description">
<ifnot propertyexists="project.runtime.description">
<fail message="The runtime description has not been specified and no default runtime description is available." />
</ifnot>
<if propertyexists="project.runtime.description">
<property name="current.runtime.description" value="${project.runtime.description}" readonly="false" />
</if>
</ifnot>
</target>
<target name="check-current-build-config">
<ifnot propertyexists="current.build.config">
<ifnot propertyexists="project.build.config">
<fail message="The build configuration has not been specified and no default build configuration is available." />
</ifnot>
<if propertyexists="project.build.config">
<property name="current.build.config" value="${project.build.config}" readonly="false" />
</if>
</ifnot>
</target>
<target name="check-avalon-container-basedir">
<ifnot propertyexists="avalon-container.basedir">
<fail message="The avalon-container base directory has not been specified." />
</ifnot>
</target>
<target name="check-avalon-container-assembly" depends="check-current-runtime-config, check-current-runtime-version, check-current-build-config, check-avalon-container-basedir">
<available type="File" resource="${avalon-container.basedir}/bin/${current.runtime.config}/${current.runtime.version}/${current.build.config}/${avalon-container.assembly}"
property="temp.avalon-container.assembly.available" />
<ifnot propertyexists="temp.avalon-container.assembly.available">
<fail message="The Avalon Container '${current.build.config}' assembly for runtime '${current.runtime.config}-${current.runtime.version}' is not available." />
</ifnot>
</target>
<target name="check-current-runtime-available" depends="check-current-runtime-config, check-current-runtime-version">
<available type="Framework" resource="${current.runtime.config}-${current.runtime.version}"
property="current.runtime.available" />
</target>
<!-- Targets for cleaning up -->
<target name="clean-current-bin-dir" depends="check-current-bin-dir" description="Cleans the current binaries directory">
<echo message="Cleaning the ${current.bin.dir} binaries directory." />
<available type="Directory" resource="${current.bin.dir}" property="temp.current.bin.dir.available" />
<if propertyexists="temp.current.bin.dir.available">
<delete dir="${current.bin.dir}" />
</if>
<mkdir dir="${current.bin.dir}" />
</target>
<target name="clean-current-sdkdoc-dir" depends="check-current-sdkdoc-dir" description="cleaning the current SDK documentation directory">
<echo message="Cleaning the ${current.sdkdoc.dir} SDK documentation directory." />
<available type="Directory" resource="${current.sdkdoc.dir}" property="temp.current.sdkdoc.dir.available" />
<if propertyexists="temp.current.sdkdoc.dir.available">
<delete dir="${current.sdkdoc.dir}" />
</if>
<mkdir dir="${current.sdkdoc.dir}" />
</target>
<!-- Targets for setting up the environment -->
<target name="set-build-configuration" depends="check-current-build-config">
<!--<if test="${not nant::target-exists('set-${current.build.config}-build-configuration">-->
<ifnot targetexists="set-${current.build.config}-build-configuration">
<fail message="The ${current.build.config} build configuration is not supported by Avalon Container." />
</ifnot>
<!--</if>-->
<call target="set-${current.build.config}-build-configuration" />
</target>
<target name="set-debug-build-configuration">
<property name="build.debug" value="true" readonly="false" />
<property name="build.defines.csc" value="DEBUG,TRACE" readonly="false" />
<property name="build.defines.jsc" value="DEBUG,TRACE" readonly="false" />
<property name="build.defines.vbc" value="DEBUG=True,TRACE=True" readonly="false" />
<property name="build.defines.vjc" value="DEBUG,TRACE" readonly="false" />
<property name="build.defines.cl" value="/D _DEBUG" readonly="false" />
<property name="sdkdoc.debug" value="false" readonly="false" />
<property name="current.build.config" value="debug" readonly="false" />
<call target="set-build-configuration-flags" />
</target>
<target name="set-release-build-configuration">
<property name="build.debug" value="false" readonly="false" />
<property name="build.defines.csc" value="TRACE,STRONG" readonly="false" />
<property name="build.defines.jsc" value="TRACE,STRONG" readonly="false" />
<property name="build.defines.vbc" value="TRACE=True,STRONG=True" readonly="false" />
<property name="build.defines.vjc" value="TRACE,STRONG" readonly="false" />
<property name="build.defines.cl" value="/D STRONG" readonly="false" />
<property name="sdkdoc.debug" value="false" readonly="false" />
<property name="current.build.config" value="release" readonly="false" />
<call target="set-build-configuration-flags" />
</target>
<target name="set-build-configuration-flags" depends="check-current-build-config">
<property name="current.build.config.debug" value="false" readonly="false" />
<property name="current.build.config.release" value="false" readonly="false" />
<property name="current.build.config.${current.build.config}" value="true" readonly="false" />
</target>
<target name="set-runtime-configuration" depends="check-current-build-config">
<ifnot propertyexists="current.runtime.config">
<ifnot propertyexists="nant.settings.currentframework">
<fail message="No runtime configuration was specified and the default NAnt runtime is not available." />
</ifnot>
<!-- <if test="${not nant::target-exists('set-${nant.settings.currentframework}-runtime-configuration"> -->
<ifnot targetexists="set-${nant.settings.currentframework}-runtime-configuration">
<fail message="No runtime configuration was specified and the current runtime (${nant.settings.currentframework}) is not supported by Avalon Container." />
<!-- </if> -->
</ifnot>
<call target="set-${nant.settings.currentframework}-runtime-configuration" />
</ifnot>
<ifnot propertyexists="current.runtime.version">
<ifnot propertyexists="nant.settings.currentframework">
<fail message="No runtime configuration was specified and the default NAnt runtime is not available." />
</ifnot>
<!-- <if test="${not nant::target-exists('set-${nant.settings.currentframework}-runtime-configuration"> -->
<ifnot targetexists="set-${nant.settings.currentframework}-runtime-configuration">
<fail message="No runtime configuration was specified and the current runtime (${nant.settings.currentframework}) is not supported by Avalon Container." />
</ifnot>
<!-- </if> -->
<call target="set-${nant.settings.currentframework}-runtime-configuration" />
</ifnot>
<!-- <if test="${not nant::target-exists('set-${current.runtime.config}-${current.runtime.version}-runtime-configuration"> -->
<ifnot targetexists="set-${current.runtime.config}-${current.runtime.version}-runtime-configuration">
<fail message="The ${current.runtime.config}-${current.runtime.version} runtime is not supported by Avalon Container." />
</ifnot>
<!-- </if> -->
<call target="set-${current.runtime.config}-${current.runtime.version}-runtime-configuration" />
</target>
<target name="set-net-1.0-runtime-configuration" depends="check-bin-dir, check-sdkdoc-dir, check-sdkdoc-debug, check-current-build-config, check-build-debug, check-build-defines">
<property name="current.runtime.config" value="net" readonly="false" />
<property name="current.runtime.version" value="1.0" readonly="false" />
<property name="current.runtime.description" value="Microsoft .NET Framework 1.0" readonly="false" />
<property name="current.build.debug" value="${build.debug}" readonly="false" />
<property name="current.build.defines.csc" value="${build.defines.csc},NET,NET_1_0" readonly="false" />
<property name="current.build.defines.jsc" value="${build.defines.jsc},NET,NET_1_0" readonly="false" />
<property name="current.build.defines.vbc" value="${build.defines.vbc},NET=True,NET_1_0=True"
readonly="false" />
<property name="current.build.defines.vjc" value="${build.defines.vjc},NET,NET_1_0" readonly="false" />
<property name="current.build.defines.cl" value="${build.defines.cl} /D NET /D NET_1_0" readonly="false" />
<property name="current.bin.dir" value="${bin.dir}/${current.runtime.config}/${current.runtime.version}/${current.build.config}"
readonly="false" />
<property name="current.sdkdoc.dir" value="${sdkdoc.dir}/${current.runtime.config}/${current.runtime.version}"
readonly="false" />
<property name="current.sdkdoc.debug" value="${sdkdoc.debug}" readonly="false" />
<property name="nant.settings.currentframework" value="${current.runtime.config}-${current.runtime.version}" />
</target>
<target name="set-net-1.1-runtime-configuration" depends="check-bin-dir, check-sdkdoc-dir, check-sdkdoc-debug, check-current-build-config, check-build-debug, check-build-defines">
<property name="current.runtime.config" value="net" readonly="false" />
<property name="current.runtime.version" value="1.1" readonly="false" />
<property name="current.runtime.description" value="Microsoft .NET Framework 1.1" readonly="false" />
<property name="current.build.debug" value="${build.debug}" readonly="false" />
<property name="current.build.defines.csc" value="${build.defines.csc},NET,NET_1_1" readonly="false" />
<property name="current.build.defines.jsc" value="${build.defines.jsc},NET,NET_1_1" readonly="false" />
<property name="current.build.defines.vbc" value="${build.defines.vbc},NET=True,NET_1_1=True"
readonly="false" />
<property name="current.build.defines.vjc" value="${build.defines.vjc},NET,NET_1_1" readonly="false" />
<property name="current.build.defines.cl" value="${build.defines.cl} /D NET /D NET_1_1" readonly="false" />
<property name="current.bin.dir" value="${bin.dir}/${current.runtime.config}/${current.runtime.version}/${current.build.config}"
readonly="false" />
<property name="current.sdkdoc.dir" value="${sdkdoc.dir}/${current.runtime.config}/${current.runtime.version}"
readonly="false" />
<property name="current.sdkdoc.debug" value="${sdkdoc.debug}" readonly="false" />
<property name="nant.settings.currentframework" value="${current.runtime.config}-${current.runtime.version}" />
</target>
<target name="set-netcf-1.0-runtime-configuration" depends="check-bin-dir, check-sdkdoc-dir, check-sdkdoc-debug, check-current-build-config, check-build-debug, check-build-defines">
<property name="current.runtime.config" value="netcf" readonly="false" />
<property name="current.runtime.version" value="1.0" readonly="false" />
<property name="current.runtime.description" value="Microsoft .NET Compact Framework 1.0"
readonly="false" />
<property name="current.build.debug" value="${build.debug}" readonly="false" />
<property name="current.build.defines.csc" value="${build.defines.csc},NETCF,NETCF_1_0" readonly="false" />
<property name="current.build.defines.jsc" value="${build.defines.jsc},NETCF,NETCF_1_0" readonly="false" />
<property name="current.build.defines.vbc" value="${build.defines.vbc},NETCF=True" readonly="false" />
<property name="current.build.defines.vjc" value="${build.defines.vjc},NETCF" readonly="false" />
<property name="current.build.defines.cl" value="${build.defines.cl} /D NETCF /D NETCF_1_0"
readonly="false" />
<property name="current.bin.dir" value="${bin.dir}/${current.runtime.config}/${current.runtime.version}/${current.build.config}"
readonly="false" />
<property name="current.sdkdoc.dir" value="${sdkdoc.dir}/${current.runtime.config}/${current.runtime.version}"
readonly="false" />
<property name="current.sdkdoc.debug" value="${sdkdoc.debug}" readonly="false" />
<property name="nant.settings.currentframework" value="${current.runtime.config}-${current.runtime.version}" />
</target>
<target name="set-mono-1.0-runtime-configuration" depends="check-bin-dir, check-sdkdoc-dir, check-sdkdoc-debug, check-current-build-config, check-build-debug, check-build-defines">
<property name="current.runtime.config" value="mono" readonly="false" />
<property name="current.runtime.version" value="1.0" readonly="false" />
<property name="current.runtime.description" value="Mono 1.0" readonly="false" />
<property name="current.build.debug" value="${build.debug}" readonly="false" />
<property name="current.build.defines.csc" value="${build.defines.csc},MONO,MONO_1_0" readonly="false" />
<property name="current.build.defines.jsc" value="${build.defines.jsc},MONO,MONO_1_0" readonly="false" />
<property name="current.build.defines.vbc" value="${build.defines.vbc},MONO=True,MONO_1_0=True"
readonly="false" />
<property name="current.build.defines.vjc" value="${build.defines.vjc},MONO,MONO_1_0" readonly="false" />
<property name="current.build.defines.cl" value="${build.defines.cl} /D MONO /D MONO_1_0"
readonly="false" />
<property name="current.bin.dir" value="${bin.dir}/${current.runtime.config}/${current.runtime.version}/${current.build.config}"
readonly="false" />
<property name="current.sdkdoc.dir" value="${sdkdoc.dir}/${current.runtime.config}/${current.runtime.version}"
readonly="false" />
<property name="current.sdkdoc.debug" value="${sdkdoc.debug}" readonly="false" />
<property name="nant.settings.currentframework" value="${current.runtime.config}-${current.runtime.version}" />
</target>
<target name="set-sscli-1.0-runtime-configuration" depends="check-bin-dir, check-sdkdoc-dir, check-sdkdoc-debug, check-current-build-config, check-build-debug, check-build-defines">
<property name="current.runtime.config" value="sscli" readonly="false" />
<property name="current.runtime.version" value="1.0" readonly="false" />
<property name="current.runtime.description" value="Microsoft Shared Source CLI 1.0" readonly="false" />
<property name="current.build.debug" value="${build.debug}" readonly="false" />
<property name="current.build.defines.csc" value="${build.defines.csc},SSCLI,SSCLI_1_0" readonly="false" />
<property name="current.build.defines.jsc" value="${build.defines.jsc},SSCLI,SSCLI_1_0" readonly="false" />
<property name="current.build.defines.vbc" value="${build.defines.vbc},SSCLI=True,SSCLI_1_0=True"
readonly="false" />
<property name="current.build.defines.vjc" value="${build.defines.vjc},SSCLI,SSCLI_1_0" readonly="false" />
<property name="current.build.defines.cl" value="${build.defines.cl} /D SSCLI /D SSCLI_1_0"
readonly="false" />
<property name="current.bin.dir" value="${bin.dir}/${current.runtime.config}/${current.runtime.version}/${current.build.config}"
readonly="false" />
<property name="current.sdkdoc.dir" value="${sdkdoc.dir}/${current.runtime.config}/${current.runtime.version}"
readonly="false" />
<property name="current.sdkdoc.debug" value="${sdkdoc.debug}" readonly="false" />
<property name="nant.settings.currentframework" value="${current.runtime.config}-${current.runtime.version}" />
</target>
</project>
1.3 +49 -80 avalon-sandbox/avalon-net/cscontainer/AvalonContainer.build
1.1 avalon-sandbox/avalon-net/cscontainer/README.txt
Index: README.txt
===================================================================
To Build Avalon# you'll need:
NAnt -> http://nant.sourceforge.net
(Tested against version 0.84)
NUnit is not a requirement as NAnt already includes it.
We cannot provide them for you due to licensing issues.
Nant is a 100% .NET implmented build tool inspired by
ANT (http://ant.apache.org). It is licensed under the
GPL, but if you install it separately as a tool (preferred)
then all is well. NUnit is a testing framework inspired
by JUnit (http://junit.org), and has an installer for
you.
Once your environment is set up you can type:
> nant -defaultframework:?????? compile
Where ?????? is one of the following:
mono-1.0 for Mono 1.0
net-1.1 for Microsoft .NET Framework 1.1
net-1.0 for Microsoft .NET Framework 1.0
sscli-1.0 for Shared CLI 1.0
For example:
> nant -defaultframework:net-1.1 compile
You may also type:
> nant
To build everything that is supported by your machine configuration.
Enjoy!
-- The Avalon Team
1.1 avalon-sandbox/avalon-net/cscontainer/default.build
Index: default.build
===================================================================
<?xml version="1.0"?>
<project name="avalon-container" default="compile" xmlnds="http://tempuri.org/nant-vs.xsd">
<include buildfile="./AvalonContainer.build" />
</project>
1.1 avalon-sandbox/avalon-net/cscontainer/AvalonContainerTest/Configuration/ContainerConfigurationTestCase.cs
Index: ContainerConfigurationTestCase.cs
===================================================================
// Copyright 2004 Apache Software Foundation
//
// 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.
namespace Apache.Avalon.Container.Test.Configuration
{
using System;
using System.IO;
using NUnit.Framework;
using Apache.Avalon.Framework;
using Apache.Avalon.Container.Configuration;
/// <summary>
/// Summary description for ContainerConfigurationTestCase.
/// </summary>
[TestFixture]
public class ContainerConfigurationTestCase : Assertion
{
String m_basePath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
[Test]
public void TestConfiguration()
{
String file = Path.Combine( m_basePath, "ConfigurationTest1.xml.config" );
ContainerConfiguration config = new ContainerConfiguration(file);
AssertNotNull( config );
AssertNotNull( config.Configuration );
AssertEquals( 2, config.Configuration.Children.Count );
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org