incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r485313 [5/15] - in /incubator/nmaven/trunk: components/ components/dotnet-artifact/ components/dotnet-artifact/src/ components/dotnet-artifact/src/main/ components/dotnet-artifact/src/main/java/ components/dotnet-artifact/src/main/java/org...
Date Sun, 10 Dec 2006 23:44:12 GMT
Added: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableCapability.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableCapability.java?view=auto&rev=485313
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableCapability.java (added)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableCapability.java Sun Dec 10 15:43:51 2006
@@ -0,0 +1,360 @@
+/*
+ * 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.
+ */
+package org.apache.maven.dotnet.executable;
+
+import org.apache.maven.dotnet.vendor.Vendor;
+import org.apache.maven.dotnet.executable.compiler.CompilerCapability;
+
+import java.util.List;
+
+/**
+ * Provides information about the capability of a specific executable or compiler plugin. The framework will match this
+ * capability to an <code>ExecutableRequirement</code>. The framework can then use the
+ * <code>getPluginClassName</code> method to instantiate an appropriate class that is capable of
+ * supporting the <code>ExecutableRequirement</code>.
+ *
+ * Executable capabilities are specified within the executable-plugins.xml file.
+ *
+ * @author Shane Isbell
+ * @see ExecutableRequirement
+ * @see CapabilityMatcher
+ */
+public interface ExecutableCapability
+{
+
+    /**
+     * Returns the command options that the executable is capable of supporting.
+     *
+     * @return the command capability that the executable is capable of supporting. This capability is used to determine
+     *         the command line parameters that the executable supports.
+     */
+    CommandCapability getCommandCapability();
+
+    /**
+     * Sets the command options that the executable is capable of supporting.
+     *
+     * @param commandCapability the command capability, which is used to determine the command line parameters that
+     *                          the executable supports.
+     */
+    void setCommandCapability( CommandCapability commandCapability );
+
+    /**
+     * Returns the ID for this capability.
+     *
+     * @return the ID for this capability
+     */
+    String getIdentifier();
+
+    /**
+     * Sets the ID for this capability.
+     *
+     * @param identifier the ID of the capability
+     */
+    void setIdentifier( String identifier );
+
+    /**
+     * Returns the vendor capability of the executable: currently only - MS, MONO, DotGNU
+     *
+     * @return the vendor capability of the executable
+     */
+    Vendor getVendor();
+
+    /**
+     * Sets the vendor capability of the executable: currently only - MS, MONO, DotGNU
+     *
+     * @param vendor
+     */
+    void setVendor( Vendor vendor );
+
+    /**
+     * Returns the supported profile. A profile is used to differentiate a capability beyond the standard
+     * vendor/OS/profile/frameworkVersion parameters.
+     *
+     * @return the supported profile
+     */
+    String getProfile();
+
+    /**
+     * Sets the supported profile. A profile is used to differentiate a capability beyond the standard
+     * vendor/OS/profile/frameworkVersion parameters.
+     *
+     * @param profile the profile of the executable.
+     */
+    void setProfile( String profile );
+
+    /**
+     * Returns the operating system that the executable is capable of supporting.
+     *
+     * @return the operating system that the executable is capable of supporting
+     */
+    String getOperatingSystem();
+
+    /**
+     * Sets the operating system that the executable is capable of supporting.
+     *
+     * @param operatingSystem
+     */
+    void setOperatingSystem( String operatingSystem );
+
+    /**
+     * Returns the architecture that the executable is capable of supporting.
+     *
+     * @return the architecture that the executable is capable of supporting
+     */
+    String getArchitecture();
+
+    /**
+     * Sets the architecture that the executable is capable of supporting.
+     *
+     * @param architecture the architecture that the executable is capable of supporting
+     */
+    void setArchitecture( String architecture );
+
+    /**
+     * Returns a list of all .NET frameworks versions that the executable is capable of supporting.
+     *
+     * @return a list of all .NET frameworks versions that the executable is capable of supporting
+     */
+    List<String> getFrameworkVersions();
+
+    /**
+     * Sets a list of all .NET frameworks versions that the executable is capable of supporting.
+     *
+     * @param frameworkVersions a list of all .NET frameworks versions that the executable is capable of supporting
+     */
+    void setFrameworkVersions( List<String> frameworkVersions );
+
+    /**
+     * Returns the executable as it is given on the commandline.
+     *
+     * @return the executable as it is given on the commandline
+     */
+    String getExecutable();
+
+    /**
+     * Sets the executable as it is given on the commandline.
+     *
+     * @param executable the executable as it is given on the commandline
+     */
+    void setExecutable( String executable );
+
+    /**
+     * Returns the class name of the executable plugin that knows how to handle the execution request.
+     *
+     * @return the class name of the executable plugin that knows how to handle the execution request
+     */
+    String getPluginClassName();
+
+    /**
+     * Sets the class name of the executable plugin that knows how to handle the execution request.
+     *
+     * @param pluginClassName the class name of the executable plugin that knows how to handle the execution request
+     */
+    void setPluginClassName( String pluginClassName );
+
+    /**
+     * Provides factory services for creating a default instance of the executable capability.
+     */
+    public static class Factory
+    {
+        /**
+         * Default constructor
+         */
+        private Factory()
+        {
+        }
+
+        /**
+         * Returns a default instance of the executable capability.
+         *
+         * @return a default instance of the executable capability
+         */
+        public static ExecutableCapability createDefaultExecutableCapability()
+        {
+            return new CompilerCapability()
+            {
+
+                private Vendor vendor;
+
+                private String language;
+
+                private String operatingSystem;
+
+                private String architecture;
+
+                private boolean hasJustInTime;
+
+                private String pluginClassName;
+
+                private String executable;
+
+                private String identifier;
+
+                private CommandCapability commandCapability;
+
+                private List<String> frameworkVersions;
+
+                private List<String> coreAssemblies;
+
+                private String profile;
+
+                private String assemblyPath;
+
+                public String getAssemblyPath()
+                {
+                    return assemblyPath;
+                }
+
+                public void setAssemblyPath( String assemblyPath )
+                {
+                    this.assemblyPath = assemblyPath;
+                }
+
+                public String getProfile()
+                {
+                    return profile;
+                }
+
+                public void setProfile( String profile )
+                {
+                    this.profile = profile;
+                }
+
+                public List<String> getCoreAssemblies()
+                {
+                    return coreAssemblies;
+                }
+
+                public void setCoreAssemblies( List<String> coreAssemblies )
+                {
+                    this.coreAssemblies = coreAssemblies;
+                }
+
+                public List<String> getFrameworkVersions()
+                {
+                    return frameworkVersions;
+                }
+
+                public void setFrameworkVersions( List<String> frameworkVersions )
+                {
+                    this.frameworkVersions = frameworkVersions;
+                }
+
+                public String getIdentifier()
+                {
+                    return identifier;
+                }
+
+                public void setIdentifier( String identifier )
+                {
+                    this.identifier = identifier;
+                }
+
+                public String getExecutable()
+                {
+                    return executable;
+                }
+
+                public void setExecutable( String executable )
+                {
+                    this.executable = executable;
+                }
+
+                public Vendor getVendor()
+                {
+                    return vendor;
+                }
+
+                public void setVendor( Vendor vendor )
+                {
+                    this.vendor = vendor;
+                }
+
+                public String getLanguage()
+                {
+                    return language;
+                }
+
+                public void setLanguage( String language )
+                {
+                    this.language = language;
+                }
+
+                public String getOperatingSystem()
+                {
+                    return operatingSystem;
+                }
+
+                public void setOperatingSystem( String operatingSystem )
+                {
+                    this.operatingSystem = operatingSystem;
+                }
+
+                public String getArchitecture()
+                {
+                    return architecture;
+                }
+
+                public void setArchitecture( String architecture )
+                {
+                    this.architecture = architecture;
+                }
+
+                public boolean isHasJustInTime()
+                {
+                    return hasJustInTime;
+                }
+
+                public void setHasJustInTime( boolean hasJustInTime )
+                {
+                    this.hasJustInTime = hasJustInTime;
+                }
+
+
+                public String getPluginClassName()
+                {
+                    return pluginClassName;
+                }
+
+                public void setPluginClassName( String pluginClassName )
+                {
+                    this.pluginClassName = pluginClassName;
+                }
+
+                public CommandCapability getCommandCapability()
+                {
+                    return commandCapability;
+                }
+
+
+                public void setCommandCapability( CommandCapability commandCapability )
+                {
+                    this.commandCapability = commandCapability;
+                }
+
+                public String toString()
+                {
+                    return "ID = " + identifier + ", Plugin Class: " + pluginClassName + ", OS = " + operatingSystem +
+                        ", Language = " + language + ", Vendor = " + vendor;
+                }
+            };
+        }
+    }
+
+}

Propchange: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableCapability.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableConfig.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableConfig.java?view=auto&rev=485313
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableConfig.java (added)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableConfig.java Sun Dec 10 15:43:51 2006
@@ -0,0 +1,146 @@
+/*
+ * 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.
+ */
+package org.apache.maven.dotnet.executable;
+
+import org.apache.maven.dotnet.executable.compiler.CompilerConfig;
+import org.apache.maven.dotnet.executable.compiler.ArtifactType;
+
+import java.util.List;
+import java.io.File;
+
+/**
+ * User-defined configuration information for an executable or compiler.
+ *
+ * @author Shane Isbell
+ * @see RepositoryExecutableContext
+ */
+public interface ExecutableConfig
+{
+
+    /**
+     * The commands to pass to the executable plugin.
+     *
+     * @return the commands to pass to the executable plugin
+     */
+    List<String> getCommands();
+
+    /**
+     * Sets commands to pass to the executable plugin.
+     *
+     * @param commands the user-defined commands to pass to the executable plugin
+     */
+    void setCommands( List<String> commands );
+
+    /**
+     * The execution path of the executable. This can be an absolute path to the executable or just the name of the
+     * executable as invoked from the command line.
+     *
+     * @return the execution path of the executable
+     */
+    String getExecutionPath();
+
+    /**
+     * Sets the executation path of the executable.
+     *
+     * @param executionPath
+     */
+    void setExecutionPath( String executionPath );
+
+    public static class Factory
+    {
+        /**
+         * Constructor
+         */
+        private Factory()
+        {
+        }
+
+        /**
+         * Returns a default instance of the executable config.
+         *
+         * @return a default instance of the executable config
+         */
+        public static ExecutableConfig createDefaultExecutableConfig()
+        {
+            return new CompilerConfig()
+            {
+                private List<String> commands;
+
+                private String executionPath;
+
+                private ArtifactType artifactType;
+
+                private boolean isTestCompile = false;
+
+                private File localRepository;
+
+                public List<String> getCommands()
+                {
+                    return commands;
+                }
+
+                public void setCommands( List<String> commands )
+                {
+                    this.commands = commands;
+                }
+
+                public String getExecutionPath()
+                {
+                    return executionPath;
+                }
+
+                public void setExecutionPath( String executionPath )
+                {
+                    this.executionPath = executionPath;
+                }
+
+                public ArtifactType getArtifactType()
+                {
+                    return artifactType;
+                }
+
+                public void setArtifactType( ArtifactType artifactType )
+                {
+                    this.artifactType = artifactType;
+                }
+
+                public boolean isTestCompile()
+                {
+                    return isTestCompile;
+                }
+
+                public void setTestCompile( boolean testCompile )
+                {
+                    isTestCompile = testCompile;
+                }
+
+                public File getLocalRepository()
+                {
+                    return localRepository;
+                }
+
+                public void setLocalRepository( File localRepository )
+                {
+                    this.localRepository = localRepository;
+                }
+            };
+        }
+    }
+
+}

Propchange: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableConfig.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableContext.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableContext.java?view=auto&rev=485313
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableContext.java (added)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableContext.java Sun Dec 10 15:43:51 2006
@@ -0,0 +1,87 @@
+/*
+ * 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.
+ */
+package org.apache.maven.dotnet.executable;
+
+import org.apache.maven.dotnet.NMavenContext;
+import org.apache.maven.dotnet.PlatformUnsupportedException;
+import org.apache.maven.project.MavenProject;
+
+/**
+ * Provides services for executables.
+ *
+ * @author Shane Isbell
+ */
+public interface ExecutableContext
+    extends NMavenContext
+{
+    /**
+     * Returns an instance of the NetExecutable appropriate for given vendor/profile/frameworkVersion/OS
+     *
+     * @return an instance of the NetExecutable appropriate for given vendor/profile/frameworkVersion/OS
+     * @throws org.apache.maven.dotnet.executable.ExecutionException
+     *          if there is a problem finding an appropriate executable.
+     */
+    NetExecutable getNetExecutable()
+        throws ExecutionException;
+
+    /**
+     * Creates a command filter. If the includes parameter is null, then the filter will return all commands that are
+     * not in the exlude filters. If the excludes parameter is null, then the filter will only return what is in the
+     * includes list. If both parameters are null...
+     *
+     * @return the command filter associated with this context
+     */
+    CommandFilter getCommandFilter();
+
+    /**
+     * Returns the capabilities of the executable associated with this context.
+     *
+     * @return the capabilities of the executable associated with this context
+     */
+    ExecutableCapability getExecutableCapability();
+
+    /**
+     * Returns the user-defined requirements associated with this context.
+     *
+     * @return the user-defined requirements associated with this context
+     */
+    ExecutableRequirement getExecutableRequirement();
+
+    /**
+     * Returns user-defined configuration used to initialize this context.
+     *
+     * @return user-defined configuration used to initialize this context
+     */
+    ExecutableConfig getExecutableConfig();
+
+    /**
+     * Initializes the context
+     *
+     * @param executableRequirement
+     * @param executableConfig
+     * @param project the maven project
+     * @param capabilityMatcher
+     * @throws org.apache.maven.dotnet.PlatformUnsupportedException
+     *
+     */
+    void init( ExecutableRequirement executableRequirement, ExecutableConfig executableConfig, MavenProject project,
+               CapabilityMatcher capabilityMatcher )
+        throws PlatformUnsupportedException;
+
+}

Propchange: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableMatchPolicy.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableMatchPolicy.java?view=auto&rev=485313
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableMatchPolicy.java (added)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableMatchPolicy.java Sun Dec 10 15:43:51 2006
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+package org.apache.maven.dotnet.executable;
+
+/**
+ * Provides a way for a developer to implement custom match policies for executables.
+ *
+ * @author Shane Isbell
+ */
+public interface ExecutableMatchPolicy
+{
+
+    /**
+     * Returns true if <code>ExecutableCapability</code> matches the policy implementation, otherwise returns false.
+     *
+     * @param executableCapability the executable capability to match
+     * @return true if <code>ExecutableCapability</code> matches the policy implementation, otherwise returns false.
+     */
+    boolean match( ExecutableCapability executableCapability );
+}

Propchange: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableMatchPolicy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableRequirement.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableRequirement.java?view=auto&rev=485313
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableRequirement.java (added)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableRequirement.java Sun Dec 10 15:43:51 2006
@@ -0,0 +1,151 @@
+/*
+ * 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.
+ */
+package org.apache.maven.dotnet.executable;
+
+import org.apache.maven.dotnet.vendor.Vendor;
+
+/**
+ * Requirements that the executable plugin must satisfy to be used in the build.
+ *
+ * @author Shane Isbell
+ * @see ExecutableCapability
+ * @see CapabilityMatcher
+ */
+public interface ExecutableRequirement
+{
+    /**
+     * Returns required framework version under which the executable runs.
+     *
+     * @return required framework version under which the executable runs
+     */
+    String getFrameworkVersion();
+
+    /**
+     * Sets required framework version.
+     *
+     * @param frameworkVersion
+     */
+    void setFrameworkVersion( String frameworkVersion );
+
+    /**
+     * Returns required profile of the executable.
+     *
+     * @return required profile of the executable
+     */
+    String getProfile();
+
+    /**
+     * Sets required profile of the executable
+     *
+     * @param profile
+     */
+    void setProfile( String profile );
+
+    /**
+     * Returns required vendor of executable
+     *
+     * @return required vendor of executable
+     */
+    Vendor getVendor();
+
+    /**
+     * Sets required vendor of executable
+     *
+     * @param vendor
+     */
+    void setVendor( Vendor vendor );
+
+    void setVendorVersion( String vendorVersion );
+
+    String getVendorVersion();
+
+    /**
+     * Provides factory services for creating a default instance of the executable requirement.
+     */
+    public static class Factory
+    {
+
+        /**
+         * Default constructor
+         */
+        private Factory()
+        {
+        }
+
+        /**
+         * Creates a default implementation of an executable requirements.
+         *
+         * @return a default implementation of an executable requirements
+         */
+        public static ExecutableRequirement createDefaultExecutableRequirement()
+        {
+            return new ExecutableRequirement()
+            {
+                private String frameworkVersion;
+
+                private Vendor vendor;
+
+                private String profile;
+
+                private String vendorVersion;
+
+                public String getVendorVersion()
+                {
+                    return vendorVersion;
+                }
+
+                public void setVendorVersion( String vendorVersion )
+                {
+                    this.vendorVersion = vendorVersion;
+                }
+
+                public String getFrameworkVersion()
+                {
+                    return frameworkVersion;
+                }
+
+                public void setFrameworkVersion( String frameworkVersion )
+                {
+                    this.frameworkVersion = frameworkVersion;
+                }
+
+                public Vendor getVendor()
+                {
+                    return vendor;
+                }
+
+                public void setVendor( Vendor vendor )
+                {
+                    this.vendor = vendor;
+                }
+
+                public String getProfile()
+                {
+                    return profile;
+                }
+
+                public void setProfile( String profile )
+                {
+                    this.profile = profile;
+                }
+            };
+
+        }
+    }
+}

Propchange: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableRequirement.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutionException.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutionException.java?view=auto&rev=485313
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutionException.java (added)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutionException.java Sun Dec 10 15:43:51 2006
@@ -0,0 +1,70 @@
+/*
+ * 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.
+ */
+package org.apache.maven.dotnet.executable;
+
+/**
+ * Exception thrown for compiler errors.
+ *
+ * @author Shane Isbell
+ */
+public class ExecutionException
+    extends Exception
+{
+
+    static final long serialVersionUID = -7843278034782074384L;
+
+    /**
+     * Constructs an <code>ExecutionException</code>  with no exception message.
+     */
+    public ExecutionException()
+    {
+        super();
+    }
+
+    /**
+     * Constructs an <code>ExecutionException</code> with the specified exception message.
+     *
+     * @param message the exception message
+     */
+    public ExecutionException( String message )
+    {
+        super( message );
+    }
+
+    /**
+     * Constructs an <code>ExecutionException</code> with the specified exception message and cause of the exception.
+     *
+     * @param message the exception message
+     * @param cause   the cause of the exception
+     */
+    public ExecutionException( String message, Throwable cause )
+    {
+        super( message, cause );
+    }
+
+    /**
+     * Constructs an <code>ExecutionException</code> with the cause of the exception.
+     *
+     * @param cause the cause of the exception
+     */
+    public ExecutionException( Throwable cause )
+    {
+        super( cause );
+    }
+}

Propchange: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutionException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/NetExecutable.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/NetExecutable.java?view=auto&rev=485313
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/NetExecutable.java (added)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/NetExecutable.java Sun Dec 10 15:43:51 2006
@@ -0,0 +1,77 @@
+/*
+ * 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.
+ */
+package org.apache.maven.dotnet.executable;
+
+import org.apache.maven.dotnet.NMavenContext;
+
+import java.util.List;
+import java.io.File;
+
+/**
+ * Provides services for executing programs.
+ *
+ * @author Shane Isbell
+ * @see org.apache.maven.dotnet.executable.compiler.CompilerExecutable
+ */
+public interface NetExecutable
+{
+
+    /**
+     * Returns the commands that this compiler will use to compile the application. This is not a live list and any changes
+     * in it, will not be used by the compiler.
+     *
+     * @return the commands that this compiler will use to compile the application
+     * @throws ExecutionException
+     */
+    List<String> getCommands()
+        throws ExecutionException;
+
+    /**
+     * Compiles class files.
+     *
+     * @throws org.apache.maven.dotnet.executable.ExecutionException
+     *          if the compiler writes to the standard error stream.
+     *          artifact (module, library, exe, winexe) or the target artifact is not valid for the compiler
+     */
+    void execute()
+        throws ExecutionException;
+
+    /**
+     * Returns the executable that this compiler will use to compile the application.
+     *
+     * @return the executable that this compiler will use to compile the application
+     * @throws org.apache.maven.dotnet.executable.ExecutionException
+     *
+     */
+    String getExecutable()
+        throws ExecutionException;
+
+    /**
+     * @return excution path
+     */
+    File getExecutionPath();
+
+    /**
+     * Initialize this compiler.
+     *
+     * @param nmavenContext
+     */
+    void init( NMavenContext nmavenContext );
+
+}

Propchange: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/NetExecutable.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/NetExecutableFactory.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/NetExecutableFactory.java?view=auto&rev=485313
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/NetExecutableFactory.java (added)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/NetExecutableFactory.java Sun Dec 10 15:43:51 2006
@@ -0,0 +1,93 @@
+/*
+ * 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.
+ */
+package org.apache.maven.dotnet.executable;
+
+import org.apache.maven.project.MavenProject;
+
+import java.util.List;
+import java.io.File;
+
+import org.apache.maven.dotnet.vendor.VendorInfo;
+import org.apache.maven.dotnet.executable.compiler.CompilerRequirement;
+import org.apache.maven.dotnet.executable.compiler.CompilerConfig;
+import org.apache.maven.dotnet.executable.compiler.CompilerExecutable;
+import org.apache.maven.dotnet.PlatformUnsupportedException;
+
+/**
+ * Provides services to obtain executables. This interface is intended to be used by <code>AbstractMojo</code>
+ * implementations to obtain the appropriate executable or compiler.
+ *
+ * @author Shane Isbell
+ */
+public interface NetExecutableFactory
+{
+
+    /**
+     * Role used to register component implementations with the container.
+     */
+    String ROLE = NetExecutableFactory.class.getName();
+
+    /**
+     * Returns an executable that matches the vendor, framework version and profile. These are typically framework-vendor
+     * executables.
+     *
+     * @param vendor           the vendor of the executable
+     * @param frameworkVersion the version of the .NET framework that the executable works under
+     * @param profile          the profile of the executable plugin. This is used to differentiate an executable that
+     *                         matches the same platform and framework version.
+     * @param project          the maven project
+     * @param commands         the user-defined command options to use with the executable
+     * @param netHome          the install root of the .NET framework
+     * @return the executable that matches the vendor, framework version and profile
+     * @throws org.apache.maven.dotnet.PlatformUnsupportedException if no executable is found
+     */
+    NetExecutable getNetExecutableFor( String vendor, String frameworkVersion, String profile, MavenProject project,
+                                       List<String> commands, File netHome )
+        throws PlatformUnsupportedException;
+
+    /**
+     * Returns an executable that resides within a maven repository. These are typically user-implemented executables.
+     *
+     * @param groupId         the group ID of the executable artifact (as specified within the maven repo)
+     * @param artifactId      the artifact ID of the executable artifact (as specified within the maven repo)
+     * @param vendorInfo      the additional vendor information used to decide how to execute the net executable
+     * @param localRepository the local maven repository where the executable resides.
+     * @return the executable that resides within a maven repository.
+     * @throws PlatformUnsupportedException if no executable is found
+     */
+    NetExecutable getNetExecutableFromRepository( String groupId, String artifactId, VendorInfo vendorInfo,
+                                                  MavenProject project, String localRepository, List<String> commands )
+        throws PlatformUnsupportedException;
+
+    /**
+     * Returns an executable for compiling .NET applications.
+     *
+     * @param compilerRequirement   the requirements for the compiler
+     * @param compilerConfig        the configuration for the compiler
+     * @param project               the maven project
+     * @param assemblyPath          an optional parameter for replacing the system assemblies
+     * @return the executable for compiling .NET applications
+     * @throws org.apache.maven.dotnet.PlatformUnsupportedException if no executable is found
+     *
+     */
+    CompilerExecutable getCompilerExecutableFor( CompilerRequirement compilerRequirement, CompilerConfig compilerConfig,
+                                                 MavenProject project, File assemblyPath )
+        throws PlatformUnsupportedException;
+
+}

Propchange: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/NetExecutableFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/RepositoryExecutableContext.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/RepositoryExecutableContext.java?view=auto&rev=485313
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/RepositoryExecutableContext.java (added)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/RepositoryExecutableContext.java Sun Dec 10 15:43:51 2006
@@ -0,0 +1,59 @@
+/*
+ * 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.
+ */
+package org.apache.maven.dotnet.executable;
+
+import org.apache.maven.dotnet.NMavenContext;
+import org.apache.maven.dotnet.InitializationException;
+import org.apache.maven.project.MavenProject;
+
+/**
+ * Provides services for obtaining the executable for a context.
+ *
+ * @author Shane Isbell
+ */
+public interface RepositoryExecutableContext
+    extends NMavenContext
+{
+    /**
+     * Returns an instance of NetExecutable for this context.
+     *
+     * @return an instance of the NetExecutable
+     * @throws org.apache.maven.dotnet.executable.ExecutionException
+     *          if there is a problem finding an appropriate executable.
+     */
+    NetExecutable getNetExecutable()
+        throws ExecutionException;
+
+    /**
+     * Returns user-defined configuration for this context.
+     *
+     * @return user-defined configuration for this context
+     */
+    ExecutableConfig getExecutableConfig();
+
+    /**
+     * Initializes this context.
+     *
+     * @param executableConfig the executable config for this context
+     * @param project the maven project
+     * @throws org.apache.maven.dotnet.InitializationException if the context cannot be initialized
+     */
+    void init( ExecutableConfig executableConfig, MavenProject project )
+        throws InitializationException;
+}

Propchange: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/RepositoryExecutableContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/ArtifactType.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/ArtifactType.java?view=auto&rev=485313
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/ArtifactType.java (added)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/ArtifactType.java Sun Dec 10 15:43:51 2006
@@ -0,0 +1,68 @@
+/*
+ * 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.
+ */
+package org.apache.maven.dotnet.executable.compiler;
+
+/**
+ * Enumeration of all the valid target types (module, library, winexe, exe, nar) for the .NET platform.
+ *
+ * @author Shane Isbell
+ */
+public enum ArtifactType
+{
+    MODULE( "module", "netmodule" ),
+    LIBRARY( "library", "dll" ),
+    EXE( "exe", "exe" ),
+    WINEXE( "winexe", "exe" ),
+    NAR( "nar", "nar" ),
+    EXECONFIG( "exe.config", "exe.config" ),
+    NULL( "null", "null" );
+
+    private String extension;
+
+    private String artifactTypeName;
+
+    /**
+     * Constructor
+     */
+    ArtifactType( String artifactTypeName, String extension )
+    {
+        this.artifactTypeName = artifactTypeName;
+        this.extension = extension;
+    }
+
+    /**
+     * Returns extension used for the artifact(netmodule, dll, exe).
+     *
+     * @return Extension used for the artifact(netmodule, dll, exe).
+     */
+    public String getExtension()
+    {
+        return extension;
+    }
+
+    /**
+     * Returns target types (module, library, winexe, exe) for the .NET platform.
+     *
+     * @return target types (module, library, winexe, exe) for the .NET platform.
+     */
+    public String getArtifactTypeName()
+    {
+        return artifactTypeName;
+    }
+}

Propchange: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/ArtifactType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerCapability.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerCapability.java?view=auto&rev=485313
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerCapability.java (added)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerCapability.java Sun Dec 10 15:43:51 2006
@@ -0,0 +1,98 @@
+/*
+ * 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.
+ */
+package org.apache.maven.dotnet.executable.compiler;
+
+import org.apache.maven.dotnet.executable.ExecutableCapability;
+
+import java.util.List;
+
+/**
+ * Provides information about the capabilty of a specific compiler plugin.
+ *
+ * @author Shane Isbell
+ */
+public interface CompilerCapability
+    extends ExecutableCapability
+{
+
+    /**
+     * Role used to register component implementations with the container.
+     */
+    String ROLE = CompilerCapability.class.getName();
+
+    /**
+     * Returns assembly path of the core assemblies. For windows Compact Framework this would look something like:
+     * C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\WindowsCE
+     *
+     * @return assemblyPath
+     */
+    String getAssemblyPath();
+
+    /**
+     * Returns a list of core assemblies names. These assemblies do not contain the artifact extension (.dll), but may contain
+     * a path with the artifact name.
+     *
+     * @return list of core assemblies
+     */
+    List<String> getCoreAssemblies();
+
+    /**
+     * Returns the language of the plugin.
+     *
+     * @return the language of the plugin.
+     */
+    String getLanguage();
+
+    /**
+     * Returns true if the compiler has JIT functionality, otherwise returns false.
+     *
+     * @return true if the compiler has JIT functionality, otherwise returns false.
+     */
+    boolean isHasJustInTime();
+
+    /**
+     * Sets the assembly path.
+     *
+     * @param assemblyPath
+     */
+    void setAssemblyPath( String assemblyPath );
+
+    /**
+     * Sets the core assemblies. You may specify a path with the core assembly name, but do not give the extension (.dll),
+     * as this is assumed.
+     *
+     * @param coreAssemblies
+     */
+    void setCoreAssemblies( List<String> coreAssemblies );
+
+    /**
+     * Set the language capability of the compiler.
+     *
+     * @param language
+     */
+    void setLanguage( String language );
+
+    /**
+     * Sets the JIT capability
+     *
+     * @param hasJustInTime
+     */
+    void setHasJustInTime( boolean hasJustInTime );
+
+}

Propchange: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerCapability.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerConfig.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerConfig.java?view=auto&rev=485313
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerConfig.java (added)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerConfig.java Sun Dec 10 15:43:51 2006
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ */
+package org.apache.maven.dotnet.executable.compiler;
+
+import org.apache.maven.dotnet.executable.compiler.ArtifactType;
+import org.apache.maven.dotnet.executable.ExecutableConfig;
+
+import java.io.File;
+
+/**
+ * Provides configuration Information for the .NET Compile Environment
+ *
+ * @author Shane Isbell
+ */
+public interface CompilerConfig
+    extends ExecutableConfig
+{
+
+    /**
+     * The target artifact for the compile: library, module, exe, winexe or nar.
+     *
+     * @return target artifact for the compile
+     */
+    ArtifactType getArtifactType();
+
+    /**
+     * Returns true if the compiler plugin should compile the test classes, otherwise returns false.
+     *
+     * @return true if the compiler plugin should compile the test classes, otherwise returns false.
+     */
+    boolean isTestCompile();
+
+    /**
+     * Returns local repository
+     *
+     * @return local repository
+     */
+    File getLocalRepository();
+
+    /**
+     * Sets the artifact type for the compiler plugin: library, module, exe, winexe or nar
+     *
+     * @param artifactType
+     */
+    void setArtifactType( ArtifactType artifactType );
+
+    /**
+     * If true, tells the compiler to compile the test classes, otherwise tells the compiler to compile the main classes.
+     *
+     * @param testCompile
+     */
+    void setTestCompile( boolean testCompile );
+
+    /**
+     * Sets local repository
+     *
+     * @param localRepository
+     */
+    void setLocalRepository( File localRepository );
+
+
+}

Propchange: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerConfig.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerContext.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerContext.java?view=auto&rev=485313
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerContext.java (added)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerContext.java Sun Dec 10 15:43:51 2006
@@ -0,0 +1,180 @@
+/*
+ * 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.
+ */
+package org.apache.maven.dotnet.executable.compiler;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.project.MavenProject;
+
+import java.util.List;
+import java.io.File;
+
+import org.apache.maven.dotnet.executable.compiler.CompilerCapability;
+import org.apache.maven.dotnet.executable.compiler.CompilerConfig;
+import org.apache.maven.dotnet.executable.*;
+import org.apache.maven.dotnet.NMavenContext;
+import org.apache.maven.dotnet.PlatformUnsupportedException;
+
+/**
+ * Interface defining compiler services.
+ *
+ * @author Shane Isbell
+ */
+public interface CompilerContext
+    extends NMavenContext
+{
+
+    /**
+     * Role used to register component implementations with the container.
+     */
+    String ROLE = CompilerContext.class.getName();
+
+    /**
+     * Returns the artifact that the compiler generated. Typically, this is needed by a plugin to attach to the
+     * project for installation in the local repo. Example:
+     * <p/>
+     * <code>project.getArtifact().setFile(compilerContext.getArtifact());</code>
+     *
+     * @return the artifact that the compiler generated.
+     * @throws InvalidArtifactException
+     */
+    File getArtifact()
+        throws InvalidArtifactException;
+
+    /**
+     * Return the <code>CompilerCapability</code> associated with this context.
+     *
+     * @return the <code>CompilerCapability</code> associated with this context.
+     */
+    CompilerCapability getCompilerCapability();
+
+
+    /**
+     * Returns assembly names that should be referenced by the compiler. If the List is emtpy, then all core assemblies
+     * should be includes. These are assemblies that are not standard
+     * dependencies, but are system assemblies that replace the core .NET framework assemblies (used to create profiles)
+     *
+     * @return assembly names that should be referenced by the compiler.
+     */
+    List<String> getCoreAssemblyNames();
+
+    /**
+     * Returns a list of module (netmodule) dependencies that exist directly within the invoking projects pom
+     * (no transitive module dependencies).
+     *
+     * @return a list of module (netmodule) dependencies of the class files.
+     */
+    List<Artifact> getDirectModuleDependencies();
+
+    /**
+     * Returns a list of library (dll) dependencies of the class files.
+     *
+     * @return a list of library (dll) dependencies of the class files.
+     */
+    List<Artifact> getLibraryDependencies();
+
+    /**
+     * Returns a list of module (netmodule) dependencies of the class files.
+     *
+     * @return a list of module (netmodule) dependencies of the class files.
+     */
+    List<Artifact> getModuleDependencies();
+
+    /**
+     * Returns the user provided configuration associated to this context. This is a live copy, so any changes to the
+     * config will be reflected during compilation.
+     *
+     * @return the user provided configuration associated to this context
+     */
+    CompilerConfig getNetCompilerConfig();
+
+    /**
+     * Requirements used to match the compiler plugin associated with this context.
+     *
+     * @return Requirements used to match the compiler plugin associated with this context.
+     */
+    CompilerRequirement getCompilerRequirement();
+
+    /**
+     * Returns the source directory (or test source directory) path of the class files. These are defined in the pom.xml
+     * by the properties ${build.sourceDirectory} or ${build.testSourceDirectory}.
+     *
+     * @return Returns the source directory (or test source directory) path of the class files.
+     */
+    String getSourceDirectoryName();
+
+    /**
+     * Returns an instance of the NetExecutable appropriate for given language/vendor/OS.
+     *
+     * @return an instance of the NetExecutable appropriate for given language/vendor/OS.
+     * @throws org.apache.maven.dotnet.executable.ExecutionException
+     *          if there is a problem finding an appropriate executable.
+     */
+    CompilerExecutable getCompilerExecutable()
+        throws ExecutionException;
+
+    /**
+     * Creates a command filter. If the includes parameter is null, then the filter will return all commands that are
+     * not in the exlude filters. If the excludes parameter is null, then the filter will only return what is in the
+     * includes list. If both parameters are null...
+     */
+    CommandFilter getCommandFilter();
+
+    /**
+     * Returns a list of resources that the compiler should link to the compiled assembly
+     *
+     * @return a list of resources that the compiler should link to the compiled assembly
+     */
+    List<File> getLinkedResources();
+
+    /**
+     * Returns a list of resources that the compiler should embed in the compiled assembly. These may of any mime-type
+     * or it may be a generated .resource file.
+     *
+     * @return a list of resources that the compiler should embed in the compiled assembly.
+     */
+    List<File> getEmbeddedResources();
+
+    /**
+     * Returns the icon that the assembly should display when viewed. Should not be used in conjunction with win32res.
+     *
+     * @return the icon that the assembly should display when viewed.
+     */
+    File getWin32Icon();
+
+    /**
+     * Returns a list of win32 resources. Should not be used in conjunction with win32icon.
+     *
+     * @return a list of win32 resources.
+     */
+    List<File> getWin32Resources();
+
+    /**
+     * Initializes the context
+     *
+     * @param compilerRequirement
+     * @param config
+     * @param project
+     * @param capabilityMatcher
+     * @throws PlatformUnsupportedException
+     */
+    void init( CompilerRequirement compilerRequirement, CompilerConfig config, MavenProject project,
+               CapabilityMatcher capabilityMatcher )
+        throws PlatformUnsupportedException;
+
+}

Propchange: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerExecutable.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerExecutable.java?view=auto&rev=485313
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerExecutable.java (added)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerExecutable.java Sun Dec 10 15:43:51 2006
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+package org.apache.maven.dotnet.executable.compiler;
+
+import org.apache.maven.dotnet.executable.NetExecutable;
+
+import java.io.File;
+
+/**
+ * Provides a service for obtaining the compiled artifact. This interface is needed because the plugins need to set the
+ * compiled artifact file on the maven project: <code>MavenProject.getArtifact().setFile</code>
+ *
+ * @author Shane Isbell
+ */
+public interface CompilerExecutable
+    extends NetExecutable
+{
+
+    /**
+     * Returns a file pointing to the compiled artifact for this executable.
+     *
+     * @return a file pointing to the compiled artifact for this executable
+     * @throws InvalidArtifactException if the artifact is invalid
+     */
+    File getCompiledArtifact()
+        throws InvalidArtifactException;
+
+}

Propchange: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerExecutable.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerRequirement.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerRequirement.java?view=auto&rev=485313
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerRequirement.java (added)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerRequirement.java Sun Dec 10 15:43:51 2006
@@ -0,0 +1,122 @@
+/*
+ * 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.
+ */
+package org.apache.maven.dotnet.executable.compiler;
+
+import org.apache.maven.dotnet.vendor.Vendor;
+import org.apache.maven.dotnet.executable.ExecutableRequirement;
+
+/**
+ * Requirements that the compiler plugin must satisfy to be used in the build.
+ *
+ * @author Shane Isbell
+ * @see CompilerCapability
+ */
+public interface CompilerRequirement
+    extends ExecutableRequirement
+{
+
+    /**
+     * Returns the required language for the compiler
+     *
+     * @return the required language for the compiler
+     */
+    String getLanguage();
+
+    /**
+     * Sets required language for the compiler
+     *
+     * @param language the required language for the compiler
+     */
+    void setLanguage( String language );
+
+    public static class Factory
+    {
+
+        private Factory()
+        {
+        }
+
+        public static CompilerRequirement createDefaultCompilerRequirement()
+        {
+            return new CompilerRequirement()
+            {
+                private String language;
+
+                private String frameworkVersion;
+
+                private Vendor vendor;
+
+                private String profile;
+
+                private String vendorVersion;
+
+                public String getVendorVersion()
+                {
+                    return vendorVersion;
+                }
+
+                public void setVendorVersion( String vendorVersion )
+                {
+                    this.vendorVersion = vendorVersion;
+                }
+
+                public String getLanguage()
+                {
+                    return language;
+                }
+
+                public void setLanguage( String language )
+                {
+                    this.language = language;
+                }
+
+                public String getFrameworkVersion()
+                {
+                    return frameworkVersion;
+                }
+
+                public void setFrameworkVersion( String frameworkVersion )
+                {
+                    this.frameworkVersion = frameworkVersion;
+                }
+
+                public Vendor getVendor()
+                {
+                    return vendor;
+                }
+
+                public void setVendor( Vendor vendor )
+                {
+                    this.vendor = vendor;
+                }
+
+                public String getProfile()
+                {
+                    return profile;
+                }
+
+                public void setProfile( String profile )
+                {
+                    this.profile = profile;
+                }
+            };
+
+        }
+    }
+}

Propchange: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerRequirement.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/InvalidArtifactException.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/InvalidArtifactException.java?view=auto&rev=485313
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/InvalidArtifactException.java (added)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/InvalidArtifactException.java Sun Dec 10 15:43:51 2006
@@ -0,0 +1,72 @@
+/*
+ * 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.
+ */
+package org.apache.maven.dotnet.executable.compiler;
+
+import org.apache.maven.dotnet.executable.ExecutionException;
+
+/**
+ * Exception thrown when the framework either does not recognize the target artifact (module, library, exe, winexe) or
+ * the target artifact is not valid for the compiler.
+ *
+ * @author Shane Isbell
+ */
+public class InvalidArtifactException
+    extends ExecutionException
+{
+    static final long serialVersionUID = -3214341783478731432L;
+
+    /**
+     * Constructs an <code>InvalidArtifactException</code>  with no exception message.
+     */
+    public InvalidArtifactException()
+    {
+        super();
+    }
+
+    /**
+     * Constructs an <code>InvalidArtifactException</code> with the specified exception message.
+     *
+     * @param message the exception message
+     */
+    public InvalidArtifactException( String message )
+    {
+        super( message );
+    }
+
+    /**
+     * Constructs an <code>InvalidArtifactException</code> with the specified exception message and cause of the exception.
+     *
+     * @param message the exception message
+     * @param cause   the cause of the exception
+     */
+    public InvalidArtifactException( String message, Throwable cause )
+    {
+        super( message, cause );
+    }
+
+    /**
+     * Constructs an <code>InvalidArtifactException</code> with the cause of the exception.
+     *
+     * @param cause the cause of the exception
+     */
+    public InvalidArtifactException( Throwable cause )
+    {
+        super( cause );
+    }
+}

Propchange: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/InvalidArtifactException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/CSharpCompilerForProfile.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/CSharpCompilerForProfile.java?view=auto&rev=485313
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/CSharpCompilerForProfile.java (added)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/CSharpCompilerForProfile.java Sun Dec 10 15:43:51 2006
@@ -0,0 +1,122 @@
+/*
+ * 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.
+ */
+package org.apache.maven.dotnet.executable.compiler.impl;
+
+import org.apache.maven.dotnet.executable.NetExecutable;
+import org.apache.maven.dotnet.executable.ExecutionException;
+import org.apache.maven.dotnet.NMavenContext;
+import org.apache.maven.dotnet.executable.CommandExecutor;
+import org.apache.maven.dotnet.executable.compiler.CompilerContext;
+import org.apache.maven.dotnet.executable.compiler.InvalidArtifactException;
+import org.apache.maven.dotnet.executable.compiler.CompilerExecutable;
+
+import java.util.List;
+import java.io.File;
+
+import org.codehaus.plexus.logging.Logger;
+
+/**
+ * A compiler to be used for compiling with .NET Profiles.
+ *
+ * @author Shane Isbell
+ */
+public final class CSharpCompilerForProfile
+    implements CompilerExecutable
+{
+
+    private NetExecutable netCompiler;
+
+    private CompilerContext compilerContext;
+
+    public CSharpCompilerForProfile()
+    {
+        netCompiler = new DefaultCompiler();
+    }
+
+    public File getCompiledArtifact()
+        throws InvalidArtifactException
+    {
+        File file = compilerContext.getArtifact();
+        if ( !file.exists() )
+        {
+            throw new InvalidArtifactException(
+                "NMAVEN-067-003: Artifact does not exist: Artifact = " + file.getAbsolutePath() );
+        }
+        return file;
+    }
+
+    public File getExecutionPath()
+    {
+        return ( compilerContext.getNetCompilerConfig().getExecutionPath() != null ) ? new File(
+            compilerContext.getNetCompilerConfig().getExecutionPath() ) : null;
+    }
+
+    public void execute()
+        throws ExecutionException
+    {
+        Logger logger = compilerContext.getLogger();
+        if ( !( new File( compilerContext.getSourceDirectoryName() ).exists() ) )
+        {
+            logger.info( "NMAVEN-067-000: No source files to compile." );
+            return;
+        }
+        logger.info( "NMAVEN-067-001: Compiling Artifact: Vendor = " +
+            compilerContext.getCompilerRequirement().getVendor() + ", Language = " +
+            compilerContext.getCompilerRequirement().getVendor() + ", Assembly Name = " +
+            compilerContext.getArtifact().getAbsolutePath() );
+
+        CommandExecutor commandExecutor = CommandExecutor.Factory.createDefaultCommmandExecutor();
+        commandExecutor.setLogger( logger );
+        commandExecutor.executeCommand( getExecutable(), getCommands(), getExecutionPath(), true );
+    }
+
+    public List<String> getCommands()
+        throws ExecutionException
+    {
+        String fv = compilerContext.getCompilerRequirement().getFrameworkVersion();
+        File path = new File( compilerContext.getCompilerCapability().getAssemblyPath() );
+        if ( !path.exists() )
+        {
+            throw new ExecutionException(
+                "NMAVEN-067-002: The assembly path does not exist: Path = " + path.getAbsolutePath() );
+        }
+
+        List<String> commands = netCompiler.getCommands();
+        commands.add( "/nostdlib+" );
+        commands.add( "/noconfig" );
+        for ( String coreAssembly : compilerContext.getCoreAssemblyNames() )
+        {
+            commands.add( "/reference:" + path.getAbsolutePath() + File.separator + coreAssembly + ".dll" );
+        }
+        return commands;
+    }
+
+
+    public String getExecutable()
+        throws ExecutionException
+    {
+        return netCompiler.getExecutable();
+    }
+
+    public void init( NMavenContext nmavenContext )
+    {
+        netCompiler.init( nmavenContext );
+        this.compilerContext = (CompilerContext) nmavenContext;
+    }
+}

Propchange: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/CSharpCompilerForProfile.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java?view=auto&rev=485313
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java (added)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java Sun Dec 10 15:43:51 2006
@@ -0,0 +1,186 @@
+/*
+ * 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.
+ */
+package org.apache.maven.dotnet.executable.compiler.impl;
+
+import org.apache.maven.artifact.Artifact;
+import org.codehaus.plexus.logging.Logger;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.io.File;
+
+import org.apache.maven.dotnet.executable.CommandFilter;
+import org.apache.maven.dotnet.executable.CommandExecutor;
+import org.apache.maven.dotnet.executable.ExecutionException;
+import org.apache.maven.dotnet.NMavenContext;
+import org.apache.maven.dotnet.vendor.Vendor;
+import org.apache.maven.dotnet.executable.compiler.CompilerConfig;
+import org.apache.maven.dotnet.executable.compiler.CompilerContext;
+import org.apache.maven.dotnet.executable.compiler.CompilerExecutable;
+import org.apache.maven.dotnet.executable.compiler.InvalidArtifactException;
+
+/**
+ * A default compiler that can be used in most cases.
+ *
+ * @author Shane Isbell
+ */
+public final class DefaultCompiler
+    implements CompilerExecutable
+{
+
+    private CompilerContext compilerContext;
+
+    private Logger logger;
+
+    public void init( NMavenContext nmavenContext )
+    {
+        this.compilerContext = (CompilerContext) nmavenContext;
+        this.logger = nmavenContext.getLogger();
+    }
+
+    public File getCompiledArtifact()
+        throws InvalidArtifactException
+    {
+        File file = compilerContext.getArtifact();
+        if ( !file.exists() )
+        {
+            throw new InvalidArtifactException(
+                "NMAVEN-068-004: Artifact does not exist: Artifact = " + file.getAbsolutePath() );
+        }
+        return file;
+    }
+
+    public File getExecutionPath()
+    {
+        return ( compilerContext.getNetCompilerConfig().getExecutionPath() != null ) ? new File(
+            compilerContext.getNetCompilerConfig().getExecutionPath() ) : null;
+    }
+
+    public List<String> getCommands()
+        throws ExecutionException
+    {
+        if ( compilerContext == null )
+        {
+            throw new ExecutionException( "NMAVEN-068-000: Compiler has not been initialized with a context" );
+        }
+        CompilerConfig config = compilerContext.getNetCompilerConfig();
+        List<Artifact> references = compilerContext.getLibraryDependencies();
+        List<Artifact> modules = compilerContext.getDirectModuleDependencies();
+
+        String sourceDirectory = compilerContext.getSourceDirectoryName();
+        String artifactFilePath = compilerContext.getArtifact().getAbsolutePath();
+        String targetArtifactType = config.getArtifactType().getArtifactTypeName();
+
+        compilerContext.getCompilerRequirement().getFrameworkVersion();
+
+        List<String> commands = new ArrayList<String>();
+        commands.add( "/out:" + artifactFilePath );
+        commands.add( "/target:" + targetArtifactType );
+        commands.add( "/recurse:" + sourceDirectory + File.separator + "**" );
+        if ( !modules.isEmpty() )
+        {
+            StringBuffer sb = new StringBuffer();
+            for ( Iterator i = modules.iterator(); i.hasNext(); )
+            {
+                Artifact artifact = (Artifact) i.next();
+                String path = artifact.getFile().getAbsolutePath();
+                sb.append( path );
+                if ( i.hasNext() )
+                {
+                    sb.append( ";" );
+                }
+            }
+            commands.add( "/addmodule:" + sb.toString() );
+        }
+        if ( !references.isEmpty() )
+        {
+            for ( Artifact artifact : references )
+            {
+                String path = artifact.getFile().getAbsolutePath();
+                commands.add( "/reference:" + path );
+            }
+        }
+
+        for ( File file : compilerContext.getEmbeddedResources() )
+        {
+            commands.add( "/resource:" + file.getAbsolutePath() );
+        }
+        for ( File file : compilerContext.getLinkedResources() )
+        {
+            commands.add( "/linkresource:" + file.getAbsolutePath() );
+        }
+        for ( File file : compilerContext.getWin32Resources() )
+        {
+            commands.add( "/win32res:" + file.getAbsolutePath() );
+        }
+        if ( compilerContext.getWin32Icon() != null )
+        {
+            commands.add( "/win32icon:" + compilerContext.getWin32Icon().getAbsolutePath() );
+        }
+
+        if ( compilerContext.getCompilerRequirement().getVendor().equals( Vendor.MICROSOFT ) )
+        {
+            commands.add( "/nologo" );
+        }
+
+        if ( config.getCommands() != null )
+        {
+            commands.addAll( config.getCommands() );
+        }
+        commands.add( "/warnaserror-" );
+        if ( compilerContext.getCompilerRequirement().getVendor().equals( Vendor.MONO ) )
+        {
+            commands.add( "/reference:System.Drawing" );
+            commands.add( "/reference:System.Windows.Forms" );
+        }
+        CommandFilter filter = compilerContext.getCommandFilter();
+        return filter.filter( commands );
+    }
+
+    public String getExecutable()
+        throws ExecutionException
+    {
+        if ( compilerContext == null )
+        {
+            throw new ExecutionException( "NMAVEN-068-001: Compiler has not been initialized with a context" );
+        }
+        return compilerContext.getCompilerCapability().getExecutable();
+    }
+
+    public void execute()
+        throws ExecutionException
+    {
+        if ( !( new File( compilerContext.getSourceDirectoryName() ).exists() ) )
+        {
+            logger.info( "NMAVEN-068-002: No source files to compile." );
+            return;
+        }
+        logger.info( "NMAVEN-068-003: Compiling Artifact: Vendor = " +
+            compilerContext.getCompilerRequirement().getVendor() + ", Language = " +
+            compilerContext.getCompilerRequirement().getVendor() + ", Assembly Name = " +
+            compilerContext.getArtifact().getAbsolutePath() );
+
+        CommandExecutor commandExecutor = CommandExecutor.Factory.createDefaultCommmandExecutor();
+        commandExecutor.setLogger( logger );
+        //MONO writes warnings to standard error: this turns off failing builds on warnings for MONO
+        boolean failOnErrorOutput = !compilerContext.getCompilerRequirement().getVendor().equals( Vendor.MONO );
+        commandExecutor.executeCommand( getExecutable(), getCommands(), getExecutionPath(), failOnErrorOutput );
+    }
+}

Propchange: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message