You are viewing a plain text version of this content. The canonical link for it is here.
Posted to npanday-commits@incubator.apache.org by lc...@apache.org on 2011/12/15 17:07:13 UTC
svn commit: r1214869 [4/11] - in /incubator/npanday/trunk: ./
archetypes/maven-archetype-netexecutable/src/main/resources/archetype-resources/src/main/java/
components/ components/dotnet-artifact/
components/dotnet-artifact/src/main/java/npanday/artifa...
Modified: incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/ExecutablePluginsRepository.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/ExecutablePluginsRepository.java?rev=1214869&r1=1214868&r2=1214869&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/ExecutablePluginsRepository.java (original)
+++ incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/ExecutablePluginsRepository.java Thu Dec 15 17:07:06 2011
@@ -18,116 +18,135 @@
*/
package npanday.executable.impl;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+import npanday.executable.CommandCapability;
+import npanday.executable.ExecutableCapability;
+import npanday.executable.MutableExecutableCapability;
+import npanday.model.executable.plugins.Platform;
+import npanday.model.executable.plugins.CommandFilter;
+import npanday.model.executable.plugins.ExecutablePlugin;
+import npanday.model.executable.plugins.ExecutablePluginsModel;
+import npanday.model.executable.plugins.io.xpp3.ExecutablePluginXpp3Reader;
+import npanday.registry.ModelInterpolator;
import npanday.registry.NPandayRepositoryException;
import npanday.registry.Repository;
-import npanday.registry.RepositoryRegistry;
+import npanday.registry.impl.AbstractMultisourceRepository;
+import npanday.vendor.VendorInfo;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-import java.io.InputStream;
+import javax.annotation.Nullable;
import java.io.IOException;
import java.io.Reader;
-import java.io.InputStreamReader;
-import java.util.Hashtable;
-import java.util.List;
import java.util.ArrayList;
+import java.util.Hashtable;
import java.util.Iterator;
-
-import npanday.model.compiler.plugins.io.xpp3.ExecutablePluginXpp3Reader;
-import npanday.model.compiler.plugins.*;
-import npanday.executable.ExecutableCapability;
-import npanday.executable.CommandCapability;
-import npanday.vendor.Vendor;
+import java.util.List;
/**
* Provides services for accessing the executable information within the executable-plugins.xml file.
*
* @author Shane Isbell
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ * @plexus.component role="npanday.executable.impl.ExecutablePluginsRepository"
*/
public final class ExecutablePluginsRepository
+ extends AbstractMultisourceRepository<ExecutablePluginsModel>
implements Repository
{
/**
* A list of executable capabilities as specified within the executable-plugins.xml file
*/
- private List<ExecutablePlugin> executablePlugins;
+ private List<ExecutablePlugin> executablePlugins = new ArrayList<ExecutablePlugin>();
- /**
- * Loads the repository
- *
- * @param inputStream a stream of the repository file (typically from *.xml)
- * @param properties additional user-supplied parameters used to customize the behavior of the repository
- * @throws npanday.registry.NPandayRepositoryException if there is a problem loading the repository
- */
- public void load( InputStream inputStream, Hashtable properties )
- throws NPandayRepositoryException
+ @Override
+ protected ExecutablePluginsModel loadFromReader( Reader reader, Hashtable properties ) throws
+ IOException,
+ XmlPullParserException
{
ExecutablePluginXpp3Reader xpp3Reader = new ExecutablePluginXpp3Reader();
- Reader reader = new InputStreamReader( inputStream );
- ExecutablePluginsModel plugins = null;
- try
- {
- plugins = xpp3Reader.read( reader );
- }
- catch( IOException e )
- {
- throw new NPandayRepositoryException( "NPANDAY-067-000: An error occurred while reading executable-plugins.xml", e );
- }
- catch ( XmlPullParserException e )
- {
- throw new NPandayRepositoryException( "NPANDAY-067-001: Could not read executable-plugins.xml", e );
- }
- executablePlugins = plugins.getExecutablePlugins();
- }
-
- public void setRepositoryRegistry( RepositoryRegistry repositoryRegistry )
- {
+ return xpp3Reader.read( reader );
}
- /**
- * @see Repository#setSourceUri(String)
- */
- public void setSourceUri( String fileUri )
+ @Override
+ protected void mergeLoadedModel( ExecutablePluginsModel model ) throws NPandayRepositoryException
{
- // not supported
+ executablePlugins.addAll( model.getExecutablePlugins() );
}
/**
- * @see Repository#reload()
+ * Remove all stored values in preparation for a reload.
*/
- public void reload() throws IOException
+ @Override
+ protected void clear()
{
- // not supported
+ executablePlugins.clear();
}
/**
* Returns a list of executable capabilities as specified within the executable-plugins.xml file.
*
+ * @param vendorInfo
* @return a list of executable capabilities as specified within the executable-plugins.xml file
*/
- List<ExecutableCapability> getCapabilities()
+ List<ExecutableCapability> getCapabilities( final VendorInfo vendorInfo )
{
List<ExecutableCapability> platformCapabilities = new ArrayList<ExecutableCapability>();
for ( ExecutablePlugin plugin : executablePlugins )
{
String pluginClassName = plugin.getPluginClass();
String executable = plugin.getExecutable();
- String compilerVendor = plugin.getVendor();
+ String vendor = plugin.getVendor();
+ String vendorVersion = plugin.getVendorVersion();
String identifier = plugin.getIdentifier();
String profile = plugin.getProfile();
List<String> frameworkVersions = plugin.getFrameworkVersions();
+ if ( vendor != null && !vendorInfo.getVendor().getVendorName().toLowerCase().equals( vendor.toLowerCase() ) )
+ {
+ continue;
+ }
+
+ // TODO: check with version range!
+ if ( vendorVersion != null && !vendorInfo.getVendorVersion().equals( vendorVersion ) )
+ {
+ continue;
+ }
+
+ if ( frameworkVersions != null && frameworkVersions.size() > 0 )
+ {
+ if ( !Iterables.any(
+ frameworkVersions, new Predicate<String>()
+ {
+ public boolean apply( @Nullable String frameworkVersion )
+ {
+ return vendorInfo.getFrameworkVersion().equals( frameworkVersion );
+ }
+ }
+ ) )
+ {
+ continue;
+ }
+ }
+
+ // TODO: since the platform is fix here, we could already strip it down to those actually available
List platforms = plugin.getPlatforms();
for ( Iterator j = platforms.iterator(); j.hasNext(); )
{
- ExecutableCapability platformCapability =
- ExecutableCapability.Factory.createDefaultExecutableCapability();
+ MutableExecutableCapability platformCapability = new MutableExecutableCapability();
+
+ platformCapability.setVendorInfo( vendorInfo );
+
+ // TODO: strip empty ones
+ platformCapability.setProbingPaths( plugin.getProbingPaths() );
+
Platform platform = (Platform) j.next();
String os = platform.getOperatingSystem();
platformCapability.setOperatingSystem( os );
platformCapability.setPluginClassName( pluginClassName );
- platformCapability.setExecutable( executable );
+ platformCapability.setExecutableName( executable );
platformCapability.setIdentifier( identifier );
platformCapability.setFrameworkVersions( frameworkVersions );
platformCapability.setProfile( profile );
@@ -137,31 +156,31 @@ public final class ExecutablePluginsRepo
List<String> includes = ( filter != null ) ? filter.getIncludes() : new ArrayList<String>();
List<String> excludes = ( filter != null ) ? filter.getExcludes() : new ArrayList<String>();
platformCapability.setCommandCapability(
- CommandCapability.Factory.createDefaultCommandCapability( includes, excludes ) );
+ CommandCapability.Factory.createDefaultCommandCapability( includes, excludes )
+ );
+
if ( arch != null )
{
platformCapability.setArchitecture( arch );
}
- if ( compilerVendor.trim().equalsIgnoreCase( "microsoft" ) )
- {
- platformCapability.setVendor( Vendor.MICROSOFT );
- }
- else if ( compilerVendor.trim().equalsIgnoreCase( "mono" ) )
- {
- platformCapability.setVendor( Vendor.MONO );
- }
- else if ( compilerVendor.trim().equalsIgnoreCase( "dotgnu" ) )
- {
- platformCapability.setVendor( Vendor.DOTGNU );
- }
- else
- {
- System.out.println( "NPANDAY-067-001: Unknown Vendor, skipping: Name = " + compilerVendor );
- continue;
- }
+
platformCapabilities.add( platformCapability );
}
}
return platformCapabilities;
}
+
+ // ### COMPONENTS REQUIRED BY THE BASE CLASS
+
+ /**
+ * @plexus.requirement
+ */
+ private ModelInterpolator interpolator;
+
+ @Override
+ protected ModelInterpolator getInterpolator()
+ {
+ return interpolator;
+ }
}
+
Modified: incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/MatchPolicyFactory.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/MatchPolicyFactory.java?rev=1214869&r1=1214868&r2=1214869&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/MatchPolicyFactory.java (original)
+++ incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/MatchPolicyFactory.java Thu Dec 15 17:07:06 2011
@@ -18,9 +18,8 @@
*/
package npanday.executable.impl;
-import npanday.executable.ExecutableMatchPolicy;
-import npanday.vendor.Vendor;
import npanday.executable.ExecutableCapability;
+import npanday.executable.ExecutableMatchPolicy;
import npanday.executable.compiler.CompilerCapability;
/**
@@ -85,58 +84,6 @@ final class MatchPolicyFactory
}
/**
- * Creates a policy to match the framework version
- *
- * @param frameworkVersion
- * @return a policy to match the framework version
- */
- static ExecutableMatchPolicy createFrameworkVersionPolicy( final String frameworkVersion )
- {
- return new ExecutableMatchPolicy()
- {
- public boolean match( ExecutableCapability executableCapability )
- {
- for ( String fv : executableCapability.getFrameworkVersions() )
- {
- if ( frameworkVersion.toLowerCase().trim().equals( fv.trim() ) )
- {
- return true;
- }
- }
- return false;
- }
-
- public String toString()
- {
- return "ExecutableMatchPolicy[frameworkVersion: '" + frameworkVersion + "']";
- }
- };
- }
-
- /**
- * Creates a match policy to match the vendor
- *
- * @param vendor
- * @return a match policy to match the vendor
- */
- static ExecutableMatchPolicy createVendorPolicy( final Vendor vendor )
- {
- return new ExecutableMatchPolicy()
- {
- public boolean match( ExecutableCapability executableCapability )
- {
- return vendor.getVendorName().toLowerCase().trim()
- .contains( executableCapability.getVendor().getVendorName().toLowerCase().trim() );
- }
-
- public String toString()
- {
- return "ExecutableMatchPolicy[vendor: '" + vendor + "']";
- }
- };
- }
-
- /**
* Creates a match policy to match the .NET language
*
* @param language
Modified: incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/NetExecutableFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/NetExecutableFactoryImpl.java?rev=1214869&r1=1214868&r2=1214869&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/NetExecutableFactoryImpl.java (original)
+++ incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/NetExecutableFactoryImpl.java Thu Dec 15 17:07:06 2011
@@ -18,133 +18,162 @@
*/
package npanday.executable.impl;
-import npanday.executable.*;
-import npanday.executable.compiler.CompilerRequirement;
+import npanday.InitializationException;
+import npanday.PathUtil;
+import npanday.PlatformUnsupportedException;
+import npanday.artifact.ArtifactContext;
+import npanday.executable.CapabilityMatcher;
+import npanday.executable.ExecutableCapability;
+import npanday.executable.ExecutableConfig;
+import npanday.executable.ExecutableContext;
+import npanday.executable.ExecutableRequirement;
+import npanday.executable.ExecutionException;
+import npanday.executable.NetExecutable;
+import npanday.executable.NetExecutableFactory;
+import npanday.executable.RepositoryExecutableContext;
+import npanday.executable.compiler.CompilerCapability;
import npanday.executable.compiler.CompilerConfig;
import npanday.executable.compiler.CompilerContext;
import npanday.executable.compiler.CompilerExecutable;
-import npanday.vendor.*;
-import npanday.vendor.IllegalStateException;
+import npanday.executable.compiler.CompilerRequirement;
import npanday.registry.RepositoryRegistry;
-import npanday.artifact.ArtifactContext;
-import npanday.PathUtil;
-import npanday.InitializationException;
-import npanday.PlatformUnsupportedException;
-import org.apache.maven.project.MavenProject;
+import npanday.vendor.IllegalStateException;
+import npanday.vendor.StateMachineProcessor;
+import npanday.vendor.Vendor;
+import npanday.vendor.VendorInfo;
+import npanday.vendor.VendorInfoRepository;
+import npanday.vendor.VendorRequirement;
import org.apache.maven.artifact.Artifact;
-import org.codehaus.plexus.logging.LogEnabled;
-import org.codehaus.plexus.logging.Logger;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
-import java.util.List;
+import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
-import java.io.File;
+import java.util.List;
/**
* Provides an implementation of <code>NetExecutableFactory</code>.
*
* @author Shane Isbell
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ * @plexus.component role="npanday.executable.NetExecutableFactory"
*/
public class NetExecutableFactoryImpl
- implements NetExecutableFactory, LogEnabled
+ extends AbstractLogEnabled
+ implements NetExecutableFactory
{
/**
- * The capability matcher
+ * @plexus.requirement
*/
private CapabilityMatcher capabilityMatcher;
+ /**
+ * @plexus.requirement
+ */
private ArtifactContext artifactContext;
+ /**
+ * @plexus.requirement
+ */
private RepositoryExecutableContext repositoryExecutableContext;
+ /**
+ * @plexus.requirement
+ */
private ExecutableContext executableContext;
+ /**
+ * @plexus.requirement
+ */
private CompilerContext compilerContext;
+ /**
+ * @plexus.requirement
+ */
private RepositoryRegistry repositoryRegistry;
- private VendorInfoRepository vendorInfoRepository;
-
- private StateMachineProcessor processor;
-
/**
- * A logger for writing log messages
+ * @plexus.requirement
*/
- private Logger logger;
+ private VendorInfoRepository vendorInfoRepository;
/**
- * @see LogEnabled#enableLogging(org.codehaus.plexus.logging.Logger)
+ * @plexus.requirement
*/
- public void enableLogging( Logger logger )
- {
- this.logger = logger;
- }
+ private StateMachineProcessor processor;
+
/**
- * @see NetExecutableFactory#getCompilerExecutableFor(npanday.executable.compiler.CompilerRequirement,
- * npanday.executable.compiler.CompilerConfig, org.apache.maven.project.MavenProject, java.io.File)
+ * @see NetExecutableFactory
*/
- public CompilerExecutable getCompilerExecutableFor( CompilerRequirement compilerRequirement,
- CompilerConfig compilerConfig, MavenProject project,
- File assemblyPath )
+ public NetExecutable getNetExecutableFor( ExecutableRequirement executableRequirement, List<String> commands, File netHome )
throws PlatformUnsupportedException
{
- File targetDir = PathUtil.getPrivateApplicationBaseDirectory( project );
+ // TODO: construct ExcecutableConfig from the outside
+ ExecutableConfig executableConfig = new ExecutableConfig();
+ executableConfig.setCommands( commands );
- VendorInfo vendorInfo = VendorInfo.Factory.createDefaultVendorInfo();
- vendorInfo.setVendorVersion( compilerRequirement.getVendorVersion() );
- vendorInfo.setFrameworkVersion( compilerRequirement.getFrameworkVersion() );
- vendorInfo.setVendor( compilerRequirement.getVendor() );
- try
+
+ List<String> executablePaths = ( executableConfig.getExecutionPaths() == null )
+ ? new ArrayList<String>()
+ : executableConfig.getExecutionPaths();
+
+ if ( netHome != null )
{
- logger.debug("NPANDAY-066-025 - Try to find executable for vendor:" + vendorInfo + ":processor:" + processor);
- processor.process( vendorInfo );
+ getLogger().info( "NPANDAY-066-014: Found executable path in pom: Path = " + netHome.getAbsolutePath() );
+ executableConfig.getExecutionPaths().add( netHome.getAbsolutePath() );
}
- catch ( IllegalStateException e )
+
+
+ executableConfig.setExecutionPaths( executablePaths );
+
+ final ExecutableCapability executableCapability =
+ capabilityMatcher.matchExecutableCapabilityFor( executableRequirement );
+
+ executableContext.init( executableCapability, executableConfig );
+
+ try
{
- throw new PlatformUnsupportedException( "NPANDAY-066-011: Illegal State: Vendor Info = " + vendorInfo, e );
+ return executableContext.getNetExecutable();
}
-
- if ( vendorInfo.getVendor() == null || vendorInfo.getFrameworkVersion() == null )
+ catch ( ExecutionException e )
{
- throw new PlatformUnsupportedException( "NPANDAY-066-012: Missing Vendor Information: " + vendorInfo );
+ throw new PlatformUnsupportedException( "NPANDAY-066-001: Unable to find net executable", e );
}
+ }
- logger.info( "NPANDAY-066-013: Found Vendor = " + vendorInfo );
- compilerRequirement.setVendor( vendorInfo.getVendor() );
- compilerRequirement.setVendorVersion( vendorInfo.getVendorVersion() );
- compilerRequirement.setFrameworkVersion( vendorInfo.getFrameworkVersion() );
+ /**
+ * @see NetExecutableFactory#getCompilerExecutableFor(npanday.executable.compiler.CompilerRequirement,
+ * npanday.executable.compiler.CompilerConfig, org.apache.maven.project.MavenProject)
+ */
+ public CompilerExecutable getCompilerExecutableFor( CompilerRequirement compilerRequirement,
+ CompilerConfig compilerConfig, MavenProject project)
+ throws PlatformUnsupportedException
+ {
+ File targetDir = PathUtil.getPrivateApplicationBaseDirectory( project );
- // init does not need the executable paths to be set
- compilerContext.init( compilerRequirement, compilerConfig, project, capabilityMatcher );
+ final CompilerCapability compilerCapability =
+ capabilityMatcher.matchCompilerCapabilityFor( compilerRequirement );
- if ( assemblyPath != null )
- {
- compilerContext.getCompilerCapability().setAssemblyPath( assemblyPath.getAbsolutePath() );
- }
+ // init does not need the executable paths to be set
+ compilerContext.init( compilerCapability, compilerConfig, project );
- List<String> executionPaths = ( compilerConfig.getExecutionPaths() == null ) ? new ArrayList<String>()
+ List<String> executionPaths = ( compilerConfig.getExecutionPaths() == null )
+ ? new ArrayList<String>()
: compilerConfig.getExecutionPaths();
- if (executionPaths == null || executionPaths.size() == 0 )
- {
- if (vendorInfo.getExecutablePaths() != null) {
- for(File path : vendorInfo.getExecutablePaths()){
- executionPaths.add(path.getAbsolutePath());
- }
- }
-
- String netDependencyId = compilerContext.getCompilerCapability().getNetDependencyId();
+ if ( executionPaths == null || executionPaths.size() == 0 )
+ {
+ String netDependencyId = compilerCapability.getNetDependencyId();
if ( netDependencyId != null )
{
Artifact artifact = artifactContext.getArtifactByID( netDependencyId );
if ( artifact != null )
{
- File artifactPath = PathUtil.getPrivateApplicationBaseFileFor( artifact,
- compilerConfig.getLocalRepository(),
- targetDir );
+ File artifactPath = PathUtil.getPrivateApplicationBaseFileFor( artifact, compilerConfig.getLocalRepository(), targetDir );
executionPaths.add( artifactPath.getParentFile().getAbsolutePath() );
}
}
@@ -162,67 +191,9 @@ public class NetExecutableFactoryImpl
}
}
- /**
- * @see NetExecutableFactory#getPluginLoaderFor(String, String, npanday.vendor.VendorInfo, String, java.io.File, String, java.io.File)
- */
- public NetExecutable getPluginLoaderFor( String groupId, String artifactId, VendorInfo vendorInfo,
- String localRepository, File parameterFile, String mojoName,
- File targetDir )
- throws PlatformUnsupportedException
- {
- Artifact artifact = getArtifactFor(groupId, artifactId);
- return getPluginLoaderFor(artifact, vendorInfo, localRepository, parameterFile, mojoName, targetDir );
- }
-
- public NetExecutable getPluginLoaderFor( Artifact artifact, VendorInfo vendorInfo, String localRepository, File parameterFile, String mojoName,
- File targetDir ) throws PlatformUnsupportedException {
- //AssemblyRepositoryLayout layout = new AssemblyRepositoryLayout();
- File artifactPath = PathUtil.getPrivateApplicationBaseFileFor( artifact, new File( localRepository ), targetDir );
-
- List<String> commands = new ArrayList<String>();
- commands.add( "parameterFile=" + parameterFile.getAbsolutePath() );
- commands.add( "assemblyFile=" + artifactPath.getAbsolutePath() );
- commands.add( "mojoName=" + mojoName );//ArtifactId = namespace
-
- // make sure plugin artifact is present to run with in the application base
- // TODO: can we do this transitively from the loader or the plugin artifact? Hardcoding the transitive deps here
- Artifact modelArtifact = artifactContext.getArtifactsFor( "org.apache.npanday", "NPanday.Model.Pom", null,
- null ).get( 0 );
- PathUtil.getPrivateApplicationBaseFileFor( modelArtifact, new File( localRepository ), targetDir );
- Artifact pluginArtifact = artifactContext.getArtifactsFor( "org.apache.npanday.plugins", "NPanday.Plugin", null,
- null ).get( 0 );
- PathUtil.getPrivateApplicationBaseFileFor( pluginArtifact, new File( localRepository ), targetDir );
-
- Artifact pluginLoaderArtifact =
- artifactContext.getArtifactsFor( "org.apache.npanday.plugins", "NPanday.Plugin.Loader", null, null ).get( 0 );
- artifactPath = PathUtil.getPrivateApplicationBaseFileFor( pluginLoaderArtifact, new File( localRepository ), targetDir );
- commands.add( "startProcessAssembly=" + artifactPath.getAbsolutePath() );
-
- return getNetExecutableFromRepository( "org.apache.npanday.plugins", "NPanday.Plugin.Runner", vendorInfo,
- new File( localRepository ), commands, false, targetDir );
- }
-
- public Artifact getArtifactFor(String groupId, String artifactId) throws PlatformUnsupportedException {
- List<Artifact> artifacts = artifactContext.getArtifactsFor( groupId, artifactId, null, null );
- if ( artifacts.size() == 0 )
- {
- throw new PlatformUnsupportedException(
- "NPANDAY-066-023: Could not locate the plugin - missing entry in the net-dependencies.xml file: GroupId = " +
- groupId + ", ArtifactId = " + artifactId );
- }
-
- Artifact artifact = artifacts.get( 0 );
- if ( artifact == null )
- {
- throw new PlatformUnsupportedException(
- "NPANDAY-066-021: Could not locate the plugin: GroupId = " + groupId + ", ArtifactId = " + artifactId );
- }
- return artifact;
- }
-
- public NetExecutable getNetExecutableFromRepository( String groupId, String artifactId, VendorInfo vendorInfo,
- File localRepository, List<String> commands,
- boolean isIsolatedAppDomain, File targetDir )
+ public NetExecutable getNetExecutableFromRepository( String groupId, String artifactId,
+ VendorRequirement vendorRequirement, File localRepository,
+ List<String> commands, boolean isIsolatedAppDomain, File targetDir )
throws PlatformUnsupportedException
{
if ( isIsolatedAppDomain )
@@ -231,15 +202,16 @@ public class NetExecutableFactoryImpl
if ( artifacts.size() == 0 )
{
throw new PlatformUnsupportedException(
- "NPANDAY-066-024: Could not locate the executable - missing entry in the net-dependencies.xml file: GroupId = " +
- groupId + ", ArtifactId = " + artifactId );
+ "NPANDAY-066-024: Could not locate the executable - missing entry in the net-dependencies.xml file: GroupId = "
+ + groupId + ", ArtifactId = " + artifactId );
}
Artifact artifact = artifacts.get( 0 );
if ( artifact == null )
{
- throw new PlatformUnsupportedException( "NPANDAY-066-025: Could not locate the executable: GroupId = " +
- groupId + ", ArtifactId = " + artifactId );
+ throw new PlatformUnsupportedException(
+ "NPANDAY-066-025: Could not locate the executable: GroupId = " + groupId + ", ArtifactId = "
+ + artifactId );
}
File artifactPath = PathUtil.getPrivateApplicationBaseFileFor( artifact, localRepository, targetDir );
@@ -250,8 +222,8 @@ public class NetExecutableFactoryImpl
localRepository, targetDir ).getAbsolutePath();
commands.add( "pluginArtifactPath=" + pluginArtifactPath );
- return getNetExecutableFromRepository( "org.apache.npanday.plugins", "NPanday.Plugin.Runner", vendorInfo,
- localRepository, commands, false, targetDir );
+ return getNetExecutableFromRepository( "org.apache.npanday.plugins", "NPanday.Plugin.Runner",
+ vendorRequirement, localRepository, commands, false, targetDir );
}
if ( commands == null )
@@ -259,13 +231,15 @@ public class NetExecutableFactoryImpl
commands = new ArrayList<String>();
}
+ VendorInfo vendorInfo;
try
{
- processor.process( vendorInfo );
+ vendorInfo = processor.process( vendorRequirement );
}
catch ( IllegalStateException e )
{
- throw new PlatformUnsupportedException( "NPANDAY-066-010: Illegal State: Vendor Info = " + vendorInfo, e );
+ throw new PlatformUnsupportedException(
+ "NPANDAY-066-010: Illegal State: Vendor Info = " + vendorRequirement, e );
}
if ( vendorInfo.getVendor() == null || vendorInfo.getFrameworkVersion() == null )
@@ -276,16 +250,18 @@ public class NetExecutableFactoryImpl
if ( artifacts.size() == 0 )
{
throw new PlatformUnsupportedException(
- "NPANDAY-066-022: Could not locate the executable- missing entry in the net-dependencies.xml: GroupId = " +
- groupId + ", ArtifactId = " + artifactId );
+ "NPANDAY-066-022: Could not locate the executable- missing entry in the net-dependencies.xml: GroupId = "
+ + groupId + ", ArtifactId = " + artifactId );
}
Artifact artifact = artifacts.get( 0 );
- logger.debug( "NPANDAY-066-003: Found Vendor: " + vendorInfo );
+ getLogger().debug( "NPANDAY-066-003: Found Vendor: " + vendorInfo );
- File artifactPath = PathUtil.getPrivateApplicationBaseFileFor( artifact, localRepository, targetDir );
+ File artifactPath = PathUtil.getPrivateApplicationBaseFileFor( artifact, localRepository, targetDir );
List<String> modifiedCommands = new ArrayList<String>();
String exe = null;
+
+ // TODO: this should be a separate implementation of NetExecutable, configured only for MONO!!!
if ( vendorInfo.getVendor().equals( Vendor.MONO ) )
{
List<File> executablePaths = vendorInfo.getExecutablePaths();
@@ -304,9 +280,9 @@ public class NetExecutableFactoryImpl
if ( exe == null )
{
- logger.info(
- "NPANDAY-066-005: Executable path for mono does not exist. Will attempt to execute MONO using" +
- " the main PATH variable." );
+ getLogger().info(
+ "NPANDAY-066-005: Executable path for mono does not exist. Will attempt to execute MONO using"
+ + " the main PATH variable." );
exe = "mono";
commands.add( "vendor=MONO" );//if forked process, it needs to know.
}
@@ -322,7 +298,7 @@ public class NetExecutableFactoryImpl
modifiedCommands = commands;
}
//TODO: DotGNU on Linux?
- ExecutableConfig executableConfig = ExecutableConfig.Factory.createDefaultExecutableConfig();
+ ExecutableConfig executableConfig = new ExecutableConfig();
executableConfig.setExecutionPaths( Arrays.asList( exe ) );
executableConfig.setCommands( modifiedCommands );
@@ -346,126 +322,60 @@ public class NetExecutableFactoryImpl
}
}
- public NetExecutable getJavaExecutableFromRepository( VendorInfo vendorInfo, List<String> commands )
+ public NetExecutable getPluginLoaderFor( Artifact artifact, VendorRequirement vendorRequirement, String localRepository,
+ File parameterFile, String mojoName, File targetDir )
throws PlatformUnsupportedException
{
+ //AssemblyRepositoryLayout layout = new AssemblyRepositoryLayout();
+ File artifactPath = PathUtil.getPrivateApplicationBaseFileFor( artifact, new File( localRepository ), targetDir );
- if ( commands == null )
- {
- commands = new ArrayList<String>();
- }
+ List<String> commands = new ArrayList<String>();
+ commands.add( "parameterFile=" + parameterFile.getAbsolutePath() );
+ commands.add( "assemblyFile=" + artifactPath.getAbsolutePath() );
+ commands.add( "mojoName=" + mojoName );//ArtifactId = namespace
- try
- {
- processor.process( vendorInfo );
- }
- catch ( IllegalStateException e )
- {
- throw new PlatformUnsupportedException( "NPANDAY-066-010: Illegal State: Vendor Info = " + vendorInfo, e );
- }
+ // make sure plugin artifact is present to run with in the application base
+ // TODO: can we do this transitively from the loader or the plugin artifact? Hardcoding the transitive deps
+ // here
+ Artifact modelArtifact = artifactContext.getArtifactsFor(
+ "org.apache.npanday", "NPanday.Model.Pom", null, null
+ ).get( 0 );
- if ( vendorInfo.getVendor() == null || vendorInfo.getFrameworkVersion() == null ||
- vendorInfo.getVendorVersion() == null )
- {
- throw new PlatformUnsupportedException( "NPANDAY-066-018: Missing Vendor Information: " + vendorInfo );
- }
+ PathUtil.getPrivateApplicationBaseFileFor( modelArtifact, new File( localRepository ), targetDir );
- ExecutableRequirement executableRequirement =
- ExecutableRequirement.Factory.createDefaultExecutableRequirement();
- executableRequirement.setVendor( vendorInfo.getVendor() );
- executableRequirement.setFrameworkVersion( vendorInfo.getFrameworkVersion() );
- executableRequirement.setVendorVersion( vendorInfo.getVendorVersion() );
- executableRequirement.setProfile( "dotnet-jetty:start" );//TODO: Remove hard-coded value
+ Artifact pluginArtifact = artifactContext.getArtifactsFor(
+ "org.apache.npanday.plugins", "NPanday.Plugin", null, null
+ ).get( 0 );
- ExecutableConfig executableConfig = ExecutableConfig.Factory.createDefaultExecutableConfig();
- executableConfig.setCommands( commands );
+ PathUtil.getPrivateApplicationBaseFileFor( pluginArtifact, new File( localRepository ), targetDir );
- executableConfig.setExecutionPaths( new ArrayList<String>() );
- executableContext.init( executableRequirement, executableConfig, capabilityMatcher );
+ Artifact pluginLoaderArtifact =
+ artifactContext.getArtifactsFor( "org.apache.npanday.plugins", "NPanday.Plugin.Loader", null, null ).get(
+ 0 );
+ artifactPath = PathUtil.getPrivateApplicationBaseFileFor( pluginLoaderArtifact, new File( localRepository ), artifactPath );
+ commands.add( "startProcessAssembly=" + artifactPath.getAbsolutePath() );
- try
- {
- return executableContext.getNetExecutable();
- }
- catch ( ExecutionException e )
- {
- throw new PlatformUnsupportedException( "NPANDAY-066-001: Unable to find net executable", e );
- }
+ return getNetExecutableFromRepository( "org.apache.npanday.plugins", "NPanday.Plugin.Runner", vendorRequirement,
+ new File( localRepository ), commands, false, targetDir );
}
- /**
- * @see NetExecutableFactory
- */
- public NetExecutable getNetExecutableFor( String vendor, String frameworkVersion, String profile,
- List<String> commands, File netHome )
+ public Artifact getArtifactFor( String groupId, String artifactId )
throws PlatformUnsupportedException
{
-
- VendorInfo vendorInfo = VendorInfo.Factory.createDefaultVendorInfo();
- vendorInfo.setVendorVersion( "" );
- vendorInfo.setFrameworkVersion( frameworkVersion );
- if ( vendor != null )
- {
- vendorInfo.setVendor( VendorFactory.createVendorFromName( vendor ) );
- }
-
- try
- {
- processor.process( vendorInfo );
- }
- catch ( IllegalStateException e )
- {
- throw new PlatformUnsupportedException( "NPANDAY-066-010: Illegal State: Vendor Info = " + vendorInfo, e );
- }
-
- if ( vendorInfo.getVendor() == null || vendorInfo.getFrameworkVersion() == null )
- {
- throw new PlatformUnsupportedException( "NPANDAY-066-019: Missing Vendor Information: " + vendorInfo );
- }
-
- logger.debug( "NPANDAY-066-003: Found Vendor: " + vendorInfo );
- ExecutableRequirement executableRequirement =
- ExecutableRequirement.Factory.createDefaultExecutableRequirement();
- executableRequirement.setVendor( vendorInfo.getVendor() );
- executableRequirement.setFrameworkVersion( vendorInfo.getFrameworkVersion() );
- executableRequirement.setVendorVersion( vendorInfo.getVendorVersion() );
- executableRequirement.setProfile( profile );
-
- ExecutableConfig executableConfig = ExecutableConfig.Factory.createDefaultExecutableConfig();
- executableConfig.setCommands( commands );
-
- List<String> executablePaths = ( executableConfig.getExecutionPaths() == null ) ? new ArrayList<String>()
- : executableConfig.getExecutionPaths();
- if ( netHome != null )
- {
- logger.info( "NPANDAY-066-014: Found executable path in pom: Path = " + netHome.getAbsolutePath() );
- executablePaths.add( netHome.getAbsolutePath() );
- }
-
- // should not fallback, if there are explicit configures
- if ( executablePaths.isEmpty() && vendorInfo.getExecutablePaths() != null )
- {
- for ( File path : vendorInfo.getExecutablePaths() )
- {
- executablePaths.add( path.getAbsolutePath() );
- }
- }
-
- if (executablePaths.isEmpty())
+ List<Artifact> artifacts = artifactContext.getArtifactsFor( groupId, artifactId, null, null );
+ if ( artifacts.size() == 0 )
{
- logger.info( "NPANDAY-066-016: Did not find executable path, will try system path" );
+ throw new PlatformUnsupportedException(
+ "NPANDAY-066-023: Could not locate the plugin - missing entry in the net-dependencies.xml file: GroupId = "
+ + groupId + ", ArtifactId = " + artifactId );
}
- executableConfig.setExecutionPaths( executablePaths );
- executableContext.init( executableRequirement, executableConfig, capabilityMatcher );
-
- try
- {
- return executableContext.getNetExecutable();
- }
- catch ( ExecutionException e )
+ Artifact artifact = artifacts.get( 0 );
+ if ( artifact == null )
{
- throw new PlatformUnsupportedException( "NPANDAY-066-001: Unable to find net executable", e );
+ throw new PlatformUnsupportedException(
+ "NPANDAY-066-021: Could not locate the plugin: GroupId = " + groupId + ", ArtifactId = " + artifactId );
}
+ return artifact;
}
}
Modified: incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/RepositoryExecutableContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/RepositoryExecutableContextImpl.java?rev=1214869&r1=1214868&r2=1214869&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/RepositoryExecutableContextImpl.java (original)
+++ incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/RepositoryExecutableContextImpl.java Thu Dec 15 17:07:06 2011
@@ -18,24 +18,31 @@
*/
package npanday.executable.impl;
-import npanday.executable.*;
-import npanday.executable.ExecutionException;
-import npanday.RepositoryNotFoundException;
import npanday.InitializationException;
+import npanday.RepositoryNotFoundException;
+import npanday.executable.ExecutableConfig;
+import npanday.executable.ExecutionException;
+import npanday.executable.NetExecutable;
+import npanday.executable.RepositoryExecutableContext;
+import npanday.registry.Repository;
+import npanday.registry.RepositoryRegistry;
import org.codehaus.plexus.logging.LogEnabled;
import org.codehaus.plexus.logging.Logger;
-import npanday.registry.RepositoryRegistry;
-import npanday.registry.Repository;
/**
* Provides an implementation of the repository executable context.
*
* @author Shane Isbell
+ * @plexus.component
+ * role="npanday.executable.RepositoryExecutableContext"
*/
public class RepositoryExecutableContextImpl
implements RepositoryExecutableContext, LogEnabled
{
+ /**
+ * @plexus.requirement
+ */
private RepositoryRegistry repositoryRegistry;
private NetExecutable netExecutable;
Modified: incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/ThreadedNetExecutable.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/ThreadedNetExecutable.java?rev=1214869&r1=1214868&r2=1214869&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/ThreadedNetExecutable.java (original)
+++ incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/ThreadedNetExecutable.java Thu Dec 15 17:07:06 2011
@@ -18,18 +18,7 @@
*/
package npanday.executable.impl;
-import npanday.PathUtil;
-import npanday.executable.NetExecutable;
-import npanday.executable.ExecutableContext;
import npanday.executable.ExecutionException;
-import npanday.executable.CommandFilter;
-import npanday.executable.CommandExecutor;
-import npanday.NPandayContext;
-import npanday.vendor.Vendor;
-import org.codehaus.plexus.logging.Logger;
-
-import java.util.List;
-import java.io.File;
/**
* Provides a service for executing a command within a separate thread. This will be used for executing long-running
@@ -38,97 +27,25 @@ import java.io.File;
* @author Shane Isbell
*/
public class ThreadedNetExecutable
- implements NetExecutable, Runnable
+ extends DefaultNetExecutable
+ implements Runnable
{
- private ExecutableContext executableContext;
-
- /**
- * A logger for writing log messages
- */
- private Logger logger;
-
public void run()
{
- CommandExecutor commandExecutor = CommandExecutor.Factory.createDefaultCommmandExecutor();
try
{
- commandExecutor.setLogger( logger );
- commandExecutor.executeCommand( getExecutable(), getCommands(), getExecutionPath(), true );
+ innerExecute();
}
catch ( ExecutionException e )
{
- // throw new ExecutionException( "NPANDAY-063-000: Command = " + commands, e );
- }
- if ( commandExecutor.getStandardOut().contains( "error" ) )
- {
- // t/w new ExecutionException( "NPANDAY-063-001: Command = " + commands );
+ logger.error( "NPANDAY-116-000: Error occurred in long running executable", e );
}
}
- public List<String> getCommands()
- throws ExecutionException
- {
- CommandFilter filter = executableContext.getCommandFilter();
- return filter.filter( executableContext.getExecutableConfig().getCommands() );
- }
-
- public void resetCommands( List<String> commands )
- {
-
- }
-
-
- public File getExecutionPath()
- {
- String executable;
- try
- {
- executable = getExecutable();
- }
- catch ( ExecutionException e )
- {
- return null;
- }
- List<String> executablePaths = executableContext.getExecutableConfig().getExecutionPaths();
- if ( executablePaths != null )
- {
- for ( String executablePath : executablePaths )
- {
- if ( PathUtil.containsExecutable(executablePath, executable) )
- {
- logger.info("NPANDAY-063-005: Found executable path for " + executable + ": " + executablePath);
- return new File( executablePath );
- }
- }
- }
- logger.warn("NPANDAY-063-006: Did not find path for " + executable + " in " + executablePaths);
- return null;
- }
-
public void execute()
throws ExecutionException
{
- }
-
-
- public String getExecutable()
- throws ExecutionException
- {
- if ( executableContext == null )
- {
- throw new ExecutionException( "NPANDAY-063-002: Executable has not been initialized with a context" );
- }
- return executableContext.getExecutableCapability().getExecutable();
- }
-
- public Vendor getVendor()
- {
- return executableContext.getExecutableCapability().getVendor();
- }
-
- public void init( NPandayContext npandayContext )
- {
- this.executableContext = (ExecutableContext) npandayContext;
- this.logger = executableContext.getLogger();
+ throw new ExecutionException( "NPANDAY-116-001: Create a thread, then use RUN - or refactor ThreadedNetExecutable");
+ // new Thread(this).start();
}
}
Modified: incubator/npanday/trunk/components/dotnet-executable/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-executable/src/main/resources/META-INF/plexus/components.xml?rev=1214869&r1=1214868&r2=1214869&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-executable/src/main/resources/META-INF/plexus/components.xml (original)
+++ incubator/npanday/trunk/components/dotnet-executable/src/main/resources/META-INF/plexus/components.xml Thu Dec 15 17:07:06 2011
@@ -17,75 +17,7 @@ specific language governing permissions
under the License.
-->
<component-set>
- <components>
- <component>
- <role>npanday.executable.compiler.CompilerContext</role>
- <implementation>npanday.executable.impl.CompilerContextImpl</implementation>
- <requirements>
- <requirement>
- <role>npanday.artifact.ArtifactContext</role>
- </requirement>
- <requirement>
- <role>npanday.registry.RepositoryRegistry</role>
- </requirement>
- </requirements>
- </component>
- <component>
- <role>npanday.executable.ExecutableContext</role>
- <implementation>npanday.executable.impl.ExecutableContextImpl</implementation>
- <requirements>
- <requirement>
- <role>npanday.registry.RepositoryRegistry</role>
- </requirement>
- </requirements>
- </component>
- <component>
- <role>npanday.executable.RepositoryExecutableContext</role>
- <implementation>npanday.executable.impl.RepositoryExecutableContextImpl</implementation>
- <requirements>
- <requirement>
- <role>npanday.registry.RepositoryRegistry</role>
- </requirement>
- </requirements>
- </component>
- <component>
- <role>npanday.executable.NetExecutableFactory</role>
- <implementation>npanday.executable.impl.NetExecutableFactoryImpl</implementation>
- <requirements>
- <requirement>
- <role>npanday.vendor.StateMachineProcessor</role>
- </requirement>
- <requirement>
- <role>npanday.registry.RepositoryRegistry</role>
- </requirement>
- <requirement>
- <role>npanday.vendor.VendorInfoRepository</role>
- </requirement>
- <requirement>
- <role>npanday.executable.CapabilityMatcher</role>
- </requirement>
- <requirement>
- <role>npanday.executable.RepositoryExecutableContext</role>
- </requirement>
- <requirement>
- <role>npanday.executable.ExecutableContext</role>
- </requirement>
- <requirement>
- <role>npanday.executable.compiler.CompilerContext</role>
- </requirement>
- <requirement>
- <role>npanday.artifact.ArtifactContext</role>
- </requirement>
- </requirements>
- </component>
- <component>
- <role>npanday.executable.CapabilityMatcher</role>
- <implementation>npanday.executable.impl.CapabilityMatcherImpl</implementation>
- <requirements>
- <requirement>
- <role>npanday.registry.RepositoryRegistry</role>
- </requirement>
- </requirements>
- </component>
- </components>
+ <components>
+ <!-- created through annotations -->
+ </components>
</component-set>
Modified: incubator/npanday/trunk/components/dotnet-executable/src/test/java/npanday/executable/CommandExecutorTest.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-executable/src/test/java/npanday/executable/CommandExecutorTest.java?rev=1214869&r1=1214868&r2=1214869&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-executable/src/test/java/npanday/executable/CommandExecutorTest.java (original)
+++ incubator/npanday/trunk/components/dotnet-executable/src/test/java/npanday/executable/CommandExecutorTest.java Thu Dec 15 17:07:06 2011
@@ -18,14 +18,15 @@
*/
package npanday.executable;
+import org.codehaus.plexus.logging.Logger;
import org.codehaus.plexus.logging.console.ConsoleLogger;
import org.junit.Test;
-import static org.junit.Assert.*;
-
import java.io.File;
-import java.util.List;
import java.util.ArrayList;
+import java.util.List;
+
+import static org.junit.Assert.*;
public class CommandExecutorTest
@@ -50,6 +51,7 @@ public class CommandExecutorTest
}
cmdExecutor = CommandExecutor.Factory.createDefaultCommmandExecutor();
+ cmdExecutor.setLogger( new ConsoleLogger( Logger.LEVEL_DEBUG, "Command Executor") );
}
@Test
Modified: incubator/npanday/trunk/components/dotnet-model/assembly-plugins/assembly-plugins.mdo
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-model/assembly-plugins/assembly-plugins.mdo?rev=1214869&r1=1214868&r2=1214869&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-model/assembly-plugins/assembly-plugins.mdo (original)
+++ incubator/npanday/trunk/components/dotnet-model/assembly-plugins/assembly-plugins.mdo Thu Dec 15 17:07:06 2011
@@ -16,7 +16,8 @@ KIND, either express or implied. See th
specific language governing permissions and limitations
under the License.
-->
-<model>
+<model xmlns="http://modello.codehaus.org/MODELLO/1.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://modello.codehaus.org/MODELLO/1.4.0 http://modello.codehaus.org/xsd/modello-1.4.0.xsd">
<id>assembly-plugin</id>
<name>AssemblyPlugin</name>
<description>Assembly Info Plugin</description>
@@ -27,19 +28,19 @@ under the License.
</default>
</defaults>
<classes>
- <class rootElement="true" xml.tagName="assemblyPluginsXml">
+ <class rootElement="true" xml.tagName="assemblyPlugins">
<name>AssemblyPluginsModel</name>
<fields>
<field>
<name>assemblyPlugins</name>
- <association>
+ <association xml.itemsStyle="flat">
<type>AssemblyPlugin</type>
<multiplicity>*</multiplicity>
</association>
</field>
</fields>
</class>
- <class xml.tagName="assemblyPlugins">
+ <class>
<name>AssemblyPlugin</name>
<fields>
<field>
Modified: incubator/npanday/trunk/components/dotnet-model/assembly-plugins/pom.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-model/assembly-plugins/pom.xml?rev=1214869&r1=1214868&r2=1214869&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-model/assembly-plugins/pom.xml (original)
+++ incubator/npanday/trunk/components/dotnet-model/assembly-plugins/pom.xml Thu Dec 15 17:07:06 2011
@@ -29,17 +29,14 @@ under the License.
<name>NPanday :: Model :: Assembly Plugins</name>
<description>Assembly model used for reading in information about assembly info marshallers.</description>
<build>
- <resources>
- <resource>
- <directory>${basedir}/src/site</directory>
- </resource>
- </resources>
- <plugins>
+ <plugins>
<plugin>
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
- <configuration>
- <model>assembly-plugins.mdo</model>
+ <configuration>
+ <models>
+ <model>assembly-plugins.mdo</model>
+ </models>
<version>1.0.0</version>
</configuration>
</plugin>
Added: incubator/npanday/trunk/components/dotnet-model/assembly-plugins/src/test/groovy/AssemblyPluginXpp3ReaderTest.groovy
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-model/assembly-plugins/src/test/groovy/AssemblyPluginXpp3ReaderTest.groovy?rev=1214869&view=auto
==============================================================================
--- incubator/npanday/trunk/components/dotnet-model/assembly-plugins/src/test/groovy/AssemblyPluginXpp3ReaderTest.groovy (added)
+++ incubator/npanday/trunk/components/dotnet-model/assembly-plugins/src/test/groovy/AssemblyPluginXpp3ReaderTest.groovy Thu Dec 15 17:07:06 2011
@@ -0,0 +1,36 @@
+/* Copyright 2010 NPanday
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+import npanday.model.assembly.plugins.io.xpp3.AssemblyPluginXpp3Reader
+
+class AssemblyPluginXpp3ReaderTest
+{
+ @org.junit.Test
+ void passes()
+ {
+ def xpp3Reader = new AssemblyPluginXpp3Reader();
+ def stream = getClass().getResourceAsStream("/sample-assembly-plugins.xml")
+ assert stream != null : "couldn't find sample xml"
+ def xmlStream = new InputStreamReader(stream)
+ def model = xpp3Reader.read(xmlStream)
+
+ assert model != null
+ assert model.assemblyPlugins != null
+ assert model.assemblyPlugins.size() == 1
+ }
+}
Added: incubator/npanday/trunk/components/dotnet-model/assembly-plugins/src/test/resources/sample-assembly-plugins.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-model/assembly-plugins/src/test/resources/sample-assembly-plugins.xml?rev=1214869&view=auto
==============================================================================
--- incubator/npanday/trunk/components/dotnet-model/assembly-plugins/src/test/resources/sample-assembly-plugins.xml (added)
+++ incubator/npanday/trunk/components/dotnet-model/assembly-plugins/src/test/resources/sample-assembly-plugins.xml Thu Dec 15 17:07:06 2011
@@ -0,0 +1,26 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you 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.
+-->
+<assemblyPlugins>
+ <assemblyPlugin>
+ <identifier>CS</identifier>
+ <pluginClass>npanday.assembler.impl.DefaultAssemblyInfoMarshaller</pluginClass>
+ <language>C_SHARP</language>
+ <extension>cs</extension>
+ </assemblyPlugin>
+</assemblyPlugins>
Modified: incubator/npanday/trunk/components/dotnet-model/compiler-plugins/compiler-plugins.mdo
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-model/compiler-plugins/compiler-plugins.mdo?rev=1214869&r1=1214868&r2=1214869&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-model/compiler-plugins/compiler-plugins.mdo (original)
+++ incubator/npanday/trunk/components/dotnet-model/compiler-plugins/compiler-plugins.mdo Thu Dec 15 17:07:06 2011
@@ -16,7 +16,8 @@ KIND, either express or implied. See th
specific language governing permissions and limitations
under the License.
-->
-<model>
+<model xmlns="http://modello.codehaus.org/MODELLO/1.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://modello.codehaus.org/MODELLO/1.4.0 http://modello.codehaus.org/xsd/modello-1.4.0.xsd">
<id>compiler-plugin</id>
<name>CompilerPlugin</name>
<description>A configuration file for compilers.</description>
@@ -27,31 +28,31 @@ under the License.
</default>
</defaults>
<classes>
- <class rootElement="true">
+ <class rootElement="true" xml.tagName="compilerPlugins">
<name>CompilerPluginsModel</name>
<fields>
<field>
<name>compilerPlugins</name>
<description>Plugin configurations.</description>
- <association>
+ <association xml.itemsStyle="flat">
<type>CompilerPlugin</type>
<multiplicity>*</multiplicity>
</association>
</field>
</fields>
</class>
- <class xml.tagName="compilerPlugin">
+ <class>
<name>CompilerPlugin</name>
<fields>
<field>
<name>identifier</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<type>String</type>
<description>An id for the compiler. It should be (but is not required to be) unique.</description>
</field>
<field>
<name>pluginClass</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<type>String</type>
<description>
Class name of the compiler. NPanday will pass an instance of this class to the
@@ -60,31 +61,52 @@ under the License.
</field>
<field>
<name>vendor</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<type>String</type>
<description>Vendor of the compiler: MICROSOFT, MONO, DotGNU</description>
</field>
<field>
+ <name>vendorVersion</name>
+ <!-- since NPanday 1.5.0 -->
+ <version>1.5.0+</version>
+ <type>String</type>
+ <description>The vendor version the executable is provided by or compatible with.</description>
+ </field>
+ <field>
<name>language</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<type>String</type>
<description>The .NET language to use for compilation.</description>
</field>
<field>
<name>profile</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<type>String</type>
<description>Profile for the plugin.</description>
</field>
<field>
<name>executable</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<type>String</type>
<description>Executable, as run from the command line.</description>
</field>
<field>
+ <name>probingPaths</name>
+ <version>1.5.0+</version>
+ <description>
+ The paths this executable is likely to be found on. You can use expressions
+ referring to the pom or registry here. $(project.build.directory) would expect the executable
+ in the target directory, and $(HKLM/MyComp/MySoftware@InstallDir) would look up a path in the
+ windows registry.
+ </description>
+ <association>
+ <type>String</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
+ <field>
<name>netDependencyId</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<type>String</type>
</field>
<field>
@@ -124,7 +146,7 @@ under the License.
</field>
<field>
<name>platforms</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<description>Platform configuration capabilities.</description>
<association>
<type>Platform</type>
@@ -133,7 +155,7 @@ under the License.
</field>
<field>
<name>commandFilter</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<description>A filter for including/excluding user-passed commands options.</description>
<association>
<type>CommandFilter</type>
@@ -146,7 +168,7 @@ under the License.
<fields>
<field>
<name>excludes</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<description>
The command options to exclude from the user specified pass-through parameters (Currently unused)
</description>
@@ -157,7 +179,7 @@ under the License.
</field>
<field>
<name>includes</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<description>
The command options to allow from the user specified pass-through parameters.
</description>
@@ -173,16 +195,15 @@ under the License.
<fields>
<field>
<name>operatingSystem</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<type>String</type>
<description>The operating system that the compiler is capable of running on.</description>
</field>
<field>
<name>architecture</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<type>String</type>
- <description>The architecture that the compiler is capable of running on (Currently
- unused).</description>
+ <description>The architecture that the compiler is capable of running on.</description>
</field>
</fields>
</class>
Modified: incubator/npanday/trunk/components/dotnet-model/compiler-plugins/pom.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-model/compiler-plugins/pom.xml?rev=1214869&r1=1214868&r2=1214869&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-model/compiler-plugins/pom.xml (original)
+++ incubator/npanday/trunk/components/dotnet-model/compiler-plugins/pom.xml Thu Dec 15 17:07:06 2011
@@ -32,9 +32,11 @@ under the License.
<plugin>
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
- <configuration>
- <model>compiler-plugins.mdo</model>
- <version>1.0.0</version>
+ <configuration>
+ <models>
+ <model>compiler-plugins.mdo</model>
+ </models>
+ <version>1.5.0</version>
</configuration>
</plugin>
</plugins>
Added: incubator/npanday/trunk/components/dotnet-model/compiler-plugins/src/test/groovy/npanday/model/compiler/plugins/io/CompilerPluginXpp3ReaderTest.groovy
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-model/compiler-plugins/src/test/groovy/npanday/model/compiler/plugins/io/CompilerPluginXpp3ReaderTest.groovy?rev=1214869&view=auto
==============================================================================
--- incubator/npanday/trunk/components/dotnet-model/compiler-plugins/src/test/groovy/npanday/model/compiler/plugins/io/CompilerPluginXpp3ReaderTest.groovy (added)
+++ incubator/npanday/trunk/components/dotnet-model/compiler-plugins/src/test/groovy/npanday/model/compiler/plugins/io/CompilerPluginXpp3ReaderTest.groovy Thu Dec 15 17:07:06 2011
@@ -0,0 +1,38 @@
+/* Copyright 2010 NPanday
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+package npanday.model.compiler.plugins.io;
+
+import npanday.model.compiler.plugins.io.xpp3.CompilerPluginXpp3Reader
+
+class CompilerPluginXpp3ReaderTest
+{
+ @org.junit.Test
+ void passes()
+ {
+ def xpp3Reader = new CompilerPluginXpp3Reader();
+ def stream = getClass().getResourceAsStream("/sample-compiler-plugins.xml")
+ assert stream != null : "couldn't find sample xml"
+ def xmlStream = new InputStreamReader(stream)
+ def model = xpp3Reader.read(xmlStream)
+
+ assert model != null
+ assert model.compilerPlugins != null
+ assert model.compilerPlugins.size() == 1
+ assert model.compilerPlugins[0].vendorVersion == "1"
+ }
+}
Added: incubator/npanday/trunk/components/dotnet-model/compiler-plugins/src/test/resources/sample-compiler-plugins.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-model/compiler-plugins/src/test/resources/sample-compiler-plugins.xml?rev=1214869&view=auto
==============================================================================
--- incubator/npanday/trunk/components/dotnet-model/compiler-plugins/src/test/resources/sample-compiler-plugins.xml (added)
+++ incubator/npanday/trunk/components/dotnet-model/compiler-plugins/src/test/resources/sample-compiler-plugins.xml Thu Dec 15 17:07:06 2011
@@ -0,0 +1,39 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you 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.
+-->
+<compilerPlugins>
+ <compilerPlugin>
+ <identifier>Ruby</identifier>
+ <pluginClass>npanday.executable.compiler.impl.RubyCompiler</pluginClass>
+ <vendor>MICROSOFT</vendor>
+ <vendorVersion>1</vendorVersion>
+ <executable>RubyCompiler.exe</executable>
+ <netDependencyId>RubyCompiler</netDependencyId>
+ <language>RUBY</language>
+ <profile>FULL</profile>
+ <frameworkVersions>
+ <frameworkVersion>2.0.50727</frameworkVersion>
+ </frameworkVersions>
+ <platforms>
+ <platform>
+ <operatingSystem>Windows</operatingSystem>
+ <architecture>x86</architecture>
+ </platform>
+ </platforms>
+ </compilerPlugin>
+</compilerPlugins>
Modified: incubator/npanday/trunk/components/dotnet-model/configuration-appenders/configurationAppenders.mdo
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-model/configuration-appenders/configurationAppenders.mdo?rev=1214869&r1=1214868&r2=1214869&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-model/configuration-appenders/configurationAppenders.mdo (original)
+++ incubator/npanday/trunk/components/dotnet-model/configuration-appenders/configurationAppenders.mdo Thu Dec 15 17:07:06 2011
@@ -16,7 +16,8 @@ KIND, either express or implied. See th
specific language governing permissions and limitations
under the License.
-->
-<model>
+<model xmlns="http://modello.codehaus.org/MODELLO/1.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://modello.codehaus.org/MODELLO/1.4.0 http://modello.codehaus.org/xsd/modello-1.4.0.xsd">
<id>configurationappenders</id>
<name>ConfigurationAppenders</name>
<description></description>
@@ -27,25 +28,25 @@ under the License.
</default>
</defaults>
<classes>
- <class rootElement="true">
+ <class rootElement="true" xml.tagName="configurationAppenders">
<name>ConfigurationAppenderModel</name>
<fields>
<field>
<name>configurationAppenders</name>
<description></description>
- <association>
+ <association xml.itemsStyle="flat">
<type>ConfigurationAppender</type>
<multiplicity>*</multiplicity>
</association>
</field>
</fields>
</class>
- <class xml.tagName="configurationAppender">
+ <class>
<name>ConfigurationAppender</name>
<fields>
<field>
<name>name</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<type>String</type>
<description></description>
</field>
Modified: incubator/npanday/trunk/components/dotnet-model/configuration-appenders/pom.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-model/configuration-appenders/pom.xml?rev=1214869&r1=1214868&r2=1214869&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-model/configuration-appenders/pom.xml (original)
+++ incubator/npanday/trunk/components/dotnet-model/configuration-appenders/pom.xml Thu Dec 15 17:07:06 2011
@@ -33,8 +33,10 @@ under the License.
<plugin>
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
- <configuration>
- <model>configurationAppenders.mdo</model>
+ <configuration>
+ <models>
+ <model>configurationAppenders.mdo</model>
+ </models>
<version>1.0.0</version>
</configuration>
</plugin>
Modified: incubator/npanday/trunk/components/dotnet-model/entries/entries.mdo
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-model/entries/entries.mdo?rev=1214869&r1=1214868&r2=1214869&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-model/entries/entries.mdo (original)
+++ incubator/npanday/trunk/components/dotnet-model/entries/entries.mdo Thu Dec 15 17:07:06 2011
@@ -16,7 +16,8 @@ KIND, either express or implied. See th
specific language governing permissions and limitations
under the License.
-->
-<model>
+<model xmlns="http://modello.codehaus.org/MODELLO/1.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://modello.codehaus.org/MODELLO/1.4.0 http://modello.codehaus.org/xsd/modello-1.4.0.xsd">
<id>entries</id>
<name>Entries</name>
<description></description>
@@ -32,14 +33,14 @@ under the License.
<fields>
<field>
<name>entry</name>
- <association>
+ <association xml.itemsStyle="flat">
<type>Entry</type>
<multiplicity>*</multiplicity>
</association>
</field>
</fields>
</class>
- <class xml.tagName="entry">
+ <class>
<name>Entry</name>
<fields>
<field>
Modified: incubator/npanday/trunk/components/dotnet-model/entries/pom.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-model/entries/pom.xml?rev=1214869&r1=1214868&r2=1214869&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-model/entries/pom.xml (original)
+++ incubator/npanday/trunk/components/dotnet-model/entries/pom.xml Thu Dec 15 17:07:06 2011
@@ -42,7 +42,9 @@ under the License.
</execution>
</executions>
<configuration>
- <model>entries.mdo</model>
+ <models>
+ <model>entries.mdo</model>
+ </models>
<version>1.0.0</version>
</configuration>
</plugin>
Modified: incubator/npanday/trunk/components/dotnet-model/executable-plugins/executable-plugins.mdo
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-model/executable-plugins/executable-plugins.mdo?rev=1214869&r1=1214868&r2=1214869&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-model/executable-plugins/executable-plugins.mdo (original)
+++ incubator/npanday/trunk/components/dotnet-model/executable-plugins/executable-plugins.mdo Thu Dec 15 17:07:06 2011
@@ -16,70 +16,99 @@ KIND, either express or implied. See th
specific language governing permissions and limitations
under the License.
-->
-<model>
+<model xmlns="http://modello.codehaus.org/MODELLO/1.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://modello.codehaus.org/MODELLO/1.4.0 http://modello.codehaus.org/xsd/modello-1.4.0.xsd"
+ xml.namespace="http://npanday.apacha.org/executable/1.5.0">
<id>executable-plugin</id>
<name>ExecutablePlugin</name>
- <description>A configuration file for compilers.</description>
+ <description>
+ A configuration file for defining how npanday should locate exectuables
+ to be run in the context of a plugin.
+ </description>
<defaults>
<default>
<key>package</key>
- <value>npanday.model.compiler.plugins</value>
+ <value>npanday.model.executable.plugins</value>
</default>
</defaults>
+ <versionDefinition>
+ <type>namespace</type>
+ </versionDefinition>
<classes>
- <class rootElement="true">
+ <class rootElement="true" xml.tagName="executablePlugins" xsd.compositor="sequence">
<name>ExecutablePluginsModel</name>
<fields>
<field>
<name>executablePlugins</name>
<description>Plugin configurations.</description>
- <association>
+ <association xml.itemsStyle="flat">
<type>ExecutablePlugin</type>
<multiplicity>*</multiplicity>
</association>
</field>
</fields>
</class>
-
- <class xml.tagName="executablePlugin">
+ <class>
<name>ExecutablePlugin</name>
<fields>
<field>
<name>identifier</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<type>String</type>
- <description>An id for the compiler. It should be (but is not required to be) unique.</description>
+ <description>An id for the executable. It should be (but is not required to be) unique.</description>
</field>
<field>
<name>pluginClass</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<type>String</type>
<description>
- Class name of the compiler. NPanday will pass an instance of this class to the
- requesting plugin.
+ Class name of the executable implementation. Must implement npanday.executable.NetExecutable.
</description>
</field>
<field>
<name>vendor</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<type>String</type>
- <description>Vendor of the compiler: MICROSOFT, MONO, DotGNU</description>
+ <description>Vendor this executable is provided by or compatible with: MICROSOFT, MONO, DotGNU</description>
+ </field>
+ <field>
+ <name>vendorVersion</name>
+ <!-- since NPanday 1.5.0 -->
+ <version>1.5.0+</version>
+ <type>String</type>
+ <description>The vendor version the executable is provided by or compatible with.</description>
</field>
<field>
<name>profile</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<type>String</type>
<description>Profile for the plugin.</description>
</field>
<field>
<name>executable</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<type>String</type>
- <description>Executable, as run from the command line.</description>
+ <required>true</required>
+ <description>Executable name without extension, as run from the command line.</description>
+ </field>
+ <field>
+ <name>probingPaths</name>
+ <version>1.5.0+</version>
+ <description>
+ The paths this executable is likely to be found on. You can use expressions
+ referring to the pom or registry here. $(project.build.directory) would expect the executable
+ in the target directory, and $(HKLM/Software/MyComp/MySoftware@InstallDir) would look up a path in the
+ windows registry.
+ </description>
+ <association>
+ <type>String</type>
+ <multiplicity>*</multiplicity>
+ </association>
</field>
<field>
<name>frameworkVersions</name>
- <description>Supported framework version(s) of the compiler: 1.1.4322, 2.0.50727, 3.0</description>
+ <description>Supported framework version(s): 1.1.4322, 2.0.50727, 3.0, ..</description>
+ <version>1.0.0+</version>
<association>
<type>String</type>
<multiplicity>*</multiplicity>
@@ -87,8 +116,8 @@ under the License.
</field>
<field>
<name>platforms</name>
- <version>1.0.0</version>
- <description>Platform configuration capabilities.</description>
+ <version>1.0.0+</version>
+ <description>The platform this executable is compatible with.</description>
<association>
<type>Platform</type>
<multiplicity>*</multiplicity>
@@ -96,7 +125,7 @@ under the License.
</field>
<field>
<name>commandFilter</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<description>A filter for including/excluding user-passed commands options.</description>
<association>
<type>CommandFilter</type>
@@ -110,10 +139,9 @@ under the License.
<fields>
<field>
<name>excludes</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<description>
- The command options to exclude from the user specified pass-through parameters (Currently
- unused)
+ The command options to exclude from the user specified pass-through parameters.
</description>
<association>
<type>String</type>
@@ -122,7 +150,7 @@ under the License.
</field>
<field>
<name>includes</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<description>
The command options to allow from the user specified pass-through parameters.
</description>
@@ -139,16 +167,15 @@ under the License.
<fields>
<field>
<name>operatingSystem</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<type>String</type>
- <description>The operating system that the compiler is capable of running on.</description>
+ <description>The operating system that the executable is compatible with.</description>
</field>
<field>
<name>architecture</name>
- <version>1.0.0</version>
+ <version>1.0.0+</version>
<type>String</type>
- <description>The architecture that the compiler is capable of running on (Currently
- unused).</description>
+ <description>The architecture that the executable is compatible with.</description>
</field>
</fields>
</class>
Modified: incubator/npanday/trunk/components/dotnet-model/executable-plugins/pom.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-model/executable-plugins/pom.xml?rev=1214869&r1=1214868&r2=1214869&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-model/executable-plugins/pom.xml (original)
+++ incubator/npanday/trunk/components/dotnet-model/executable-plugins/pom.xml Thu Dec 15 17:07:06 2011
@@ -32,10 +32,25 @@ under the License.
<plugin>
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
- <configuration>
- <model>executable-plugins.mdo</model>
- <version>1.0.0</version>
- </configuration>
+ <configuration>
+ <models>
+ <model>executable-plugins.mdo</model>
+ </models>
+ <version>1.5.0</version>
+ </configuration>
+ <!-- add xsd generation -->
+ <executions>
+ <execution>
+ <id>mdo-xsd</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>xsd</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.outputDirectory}/xsd</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
</plugins>
</build>
Added: incubator/npanday/trunk/components/dotnet-model/executable-plugins/src/test/groovy/npanday/model/compiler/plugins/io/ExecutablePluginXpp3ReaderTest.groovy
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-model/executable-plugins/src/test/groovy/npanday/model/compiler/plugins/io/ExecutablePluginXpp3ReaderTest.groovy?rev=1214869&view=auto
==============================================================================
--- incubator/npanday/trunk/components/dotnet-model/executable-plugins/src/test/groovy/npanday/model/compiler/plugins/io/ExecutablePluginXpp3ReaderTest.groovy (added)
+++ incubator/npanday/trunk/components/dotnet-model/executable-plugins/src/test/groovy/npanday/model/compiler/plugins/io/ExecutablePluginXpp3ReaderTest.groovy Thu Dec 15 17:07:06 2011
@@ -0,0 +1,41 @@
+package npanday.model.compiler.plugins.io
+/* Copyright 2010 NPanday
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+
+import npanday.model.executable.plugins.io.xpp3.ExecutablePluginXpp3Reader
+
+class ExecutablePluginXpp3ReaderTest
+{
+ @org.junit.Test
+ void passes()
+ {
+ def xpp3Reader = new ExecutablePluginXpp3Reader();
+ def stream = getClass().getResourceAsStream("/sample-executable-plugins.xml")
+ assert stream != null : "couldn't find sample xml"
+ def xmlStream = new InputStreamReader(stream)
+ def model = xpp3Reader.read(xmlStream)
+
+ assert model != null
+ assert model.executablePlugins != null
+ assert model.executablePlugins.size() == 1
+ assert model.executablePlugins[0].probingPaths != null
+ assert model.executablePlugins[0].probingPaths.size() == 2
+ assert model.executablePlugins[0].probingPaths[0] == "one"
+ }
+}