You are viewing a plain text version of this content. The canonical link for it is here.
Posted to nmaven-commits@incubator.apache.org by si...@apache.org on 2007/03/23 16:08:22 UTC
svn commit: r521786 - in /incubator/nmaven/branches/SI_RUBY: ./
components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/
components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/
components/dotnet-core/src/main/r...
Author: sisbell
Date: Fri Mar 23 09:08:20 2007
New Revision: 521786
URL: http://svn.apache.org/viewvc?view=rev&rev=521786
Log:
1) A cleanup of the compilers. I added a base class for the compilers since the pattern is clear and a fair amount of duplication exists. 2) I also added a way to link the compilers to the netdependencies, allowing executables to be download and installed from a remote repo. 3) I am commenting out the ruby compiler, since it does not work with the CommandExecutor (some issues with the use of
Modified:
incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ArtifactContext.java
incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ArtifactInstaller.java
incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/AssemblyRepositoryLayout.java
incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactContextImpl.java
incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java
incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/NetDependenciesRepositoryImpl.java
incubator/nmaven/branches/SI_RUBY/components/dotnet-core/src/main/resources/META-INF/nmaven/assembly-plugins.xml
incubator/nmaven/branches/SI_RUBY/components/dotnet-core/src/main/resources/META-INF/nmaven/compiler-plugins.xml
incubator/nmaven/branches/SI_RUBY/components/dotnet-core/src/main/resources/META-INF/nmaven/net-dependencies.xml
incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableCapability.java
incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerExecutable.java
incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/CSharpCompilerForProfile.java
incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java
incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DotGNUCompiler.java
incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/NemerleCompiler.java
incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/PhpCompiler.java
incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java
incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerPluginsRepository.java
incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/NetExecutableFactoryImpl.java
incubator/nmaven/branches/SI_RUBY/components/dotnet-model/compiler-plugins/compiler-plugins.mdo
incubator/nmaven/branches/SI_RUBY/components/dotnet-model/netdependency/netdependency.mdo
incubator/nmaven/branches/SI_RUBY/maven-dotnet.iml
incubator/nmaven/branches/SI_RUBY/plugins/maven-install-plugin/src/main/java/org/apache/maven/dotnet/plugin/install/FileInstallerMojo.java
incubator/nmaven/branches/SI_RUBY/plugins/maven-install-plugin/src/main/java/org/apache/maven/dotnet/plugin/install/InstallerMojo.java
Modified: incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ArtifactContext.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ArtifactContext.java?view=diff&rev=521786&r1=521785&r2=521786
==============================================================================
--- incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ArtifactContext.java (original)
+++ incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ArtifactContext.java Fri Mar 23 09:08:20 2007
@@ -79,6 +79,8 @@
* but not null.
*/
List<Artifact> getArtifactsFor( String groupId, String artifactId, String version, String type );
+
+ Artifact getArtifactByID( String id );
/**
* Returns an artifact installer used for installing NMaven artifacts into the local Maven repository.
@@ -97,6 +99,8 @@
* @throws NullPointerException if the artifact is null
*/
ApplicationConfig getApplicationConfigFor( Artifact artifact );
+
+ File getLocalRepository();
/**
* Initializes this artifact context. Neither parameter value should be null.
Modified: incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ArtifactInstaller.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ArtifactInstaller.java?view=diff&rev=521786&r1=521785&r2=521786
==============================================================================
--- incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ArtifactInstaller.java (original)
+++ incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ArtifactInstaller.java Fri Mar 23 09:08:20 2007
@@ -64,10 +64,10 @@
* @param artifactId the artifact id of the artifact to install
* @param version the version of the artifact to install
* @param packaging the packaging type of the artifact to install
- * @param pomFile the pom file of the artifact to install
+ * @param artifactFile the artifact to install
* @throws ArtifactInstallationException if there is a problem installing the artifact
*/
- void installFile( String groupId, String artifactId, String version, String packaging, File pomFile )
+ void installFile( String groupId, String artifactId, String version, String packaging, File artifactFile )
throws ArtifactInstallationException;
/**
Modified: incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/AssemblyRepositoryLayout.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/AssemblyRepositoryLayout.java?view=diff&rev=521786&r1=521785&r2=521786
==============================================================================
--- incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/AssemblyRepositoryLayout.java (original)
+++ incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/AssemblyRepositoryLayout.java Fri Mar 23 09:08:20 2007
@@ -52,7 +52,7 @@
*/
public String pathOf( Artifact artifact )
{
- if ( artifact.getType().equals( "pom" ) )//Use standard format for pom packaging
+ if ( artifact.getType() != null && artifact.getType().equals( "pom" ) )//Use standard format for pom packaging
{
ArtifactRepositoryLayout defaultLayout = new DefaultRepositoryLayout();
return defaultLayout.pathOf( artifact );
Modified: incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactContextImpl.java?view=diff&rev=521786&r1=521785&r2=521786
==============================================================================
--- incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactContextImpl.java (original)
+++ incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactContextImpl.java Fri Mar 23 09:08:20 2007
@@ -106,6 +106,11 @@
this.logger = logger;
}
+ public File getLocalRepository()
+ {
+ return new File(localRepository);
+ }
+
/**
* @see ArtifactContext#getArtifactsFor(String, String, String, String)
*/
@@ -122,6 +127,14 @@
}
repository.init( artifactFactory );
return repository.getArtifactsFor( groupId, artifactId, version, type );
+ }
+
+ public Artifact getArtifactByID( String id )
+ {
+ NetDependenciesRepositoryImpl repository =
+ (NetDependenciesRepositoryImpl) repositoryRegistry.find( "net-dependencies" );
+ repository.init( artifactFactory );
+ return repository.getArtifactByID( id );
}
/**
Modified: incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java?view=diff&rev=521786&r1=521785&r2=521786
==============================================================================
--- incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java (original)
+++ incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java Fri Mar 23 09:08:20 2007
@@ -198,12 +198,12 @@
/**
* @see org.apache.maven.dotnet.artifact.ArtifactInstaller#installFile(String, String, String, String, java.io.File)
*/
- public void installFile( String groupId, String artifactId, String version, String packaging, File pomFile )
+ public void installFile( String groupId, String artifactId, String version, String packaging, File artifactFile )
throws ArtifactInstallationException
{
Artifact artifact =
mavenArtifactFactory.createArtifactWithClassifier( groupId, artifactId, version, packaging, null );
- artifact.setFile( pomFile );
+ artifact.setFile( artifactFile );
FileWriter fileWriter = null;
try
Modified: incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/NetDependenciesRepositoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/NetDependenciesRepositoryImpl.java?view=diff&rev=521786&r1=521785&r2=521786
==============================================================================
--- incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/NetDependenciesRepositoryImpl.java (original)
+++ incubator/nmaven/branches/SI_RUBY/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/NetDependenciesRepositoryImpl.java Fri Mar 23 09:08:20 2007
@@ -107,7 +107,7 @@
*/
public List<Dependency> getDependencies()
{
- return getDependenciesFor(null);
+ return getDependenciesFor( null );
}
/**
@@ -115,12 +115,18 @@
*/
public List<Dependency> getDependenciesFor( List<NetDependencyMatchPolicy> matchPolicies )
{
- if(matchPolicies == null) matchPolicies = new ArrayList<NetDependencyMatchPolicy>();
+ if ( matchPolicies == null )
+ {
+ matchPolicies = new ArrayList<NetDependencyMatchPolicy>();
+ }
List<Dependency> dependencies = new ArrayList<Dependency>();
for ( NetDependency netDependency : netDependencies )
{
- if(isMatch(netDependency, matchPolicies)) dependencies.add( netDependencyToDependency( netDependency ) );
+ if ( isMatch( netDependency, matchPolicies ) )
+ {
+ dependencies.add( netDependencyToDependency( netDependency ) );
+ }
}
return dependencies;
}
@@ -141,16 +147,20 @@
*
* @param netDependency the net dependency to match
* @param matchPolicies the match policies to use in matching the net dependency
- * @return true is the specified net dependency matches ALL of the specified match policies, otherwise returns false
+ * @return true is the specified net dependency matches ALL of the specified match policies, otherwise returns false
*/
- private boolean isMatch(NetDependency netDependency, List<NetDependencyMatchPolicy> matchPolicies)
+ private boolean isMatch( NetDependency netDependency, List<NetDependencyMatchPolicy> matchPolicies )
{
- for(NetDependencyMatchPolicy matchPolicy : matchPolicies)
+ for ( NetDependencyMatchPolicy matchPolicy : matchPolicies )
{
- if(!matchPolicy.match( netDependency)) return false;
+ if ( !matchPolicy.match( netDependency ) )
+ {
+ return false;
+ }
}
return true;
}
+
/**
* Returns a list of artifacts that match the specified parameters. If the version or type parameters are null,
* then the returned list will include all versions and types.
@@ -175,6 +185,18 @@
}
return artifacts;
+ }
+
+ Artifact getArtifactByID( String id )
+ {
+ for ( NetDependency netDependency : netDependencies )
+ {
+ if ( netDependency.getId() != null && netDependency.getId().equals( id ) )
+ {
+ return netDependencyToArtifact( netDependency );
+ }
+ }
+ return null;
}
/**
Modified: incubator/nmaven/branches/SI_RUBY/components/dotnet-core/src/main/resources/META-INF/nmaven/assembly-plugins.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_RUBY/components/dotnet-core/src/main/resources/META-INF/nmaven/assembly-plugins.xml?view=diff&rev=521786&r1=521785&r2=521786
==============================================================================
--- incubator/nmaven/branches/SI_RUBY/components/dotnet-core/src/main/resources/META-INF/nmaven/assembly-plugins.xml (original)
+++ incubator/nmaven/branches/SI_RUBY/components/dotnet-core/src/main/resources/META-INF/nmaven/assembly-plugins.xml Fri Mar 23 09:08:20 2007
@@ -5,6 +5,14 @@
<language>C_SHARP</language>
<extension>cs</extension>
</assemblyPlugin>
+ <!--
+ <assemblyPlugin>
+ <identifier>RUBY</identifier>
+ <pluginClass>org.apache.maven.dotnet.assembler.impl.DefaultAssemblyInfoMarshaller</pluginClass>
+ <language>RUBY</language>
+ <extension>rb</extension>
+ </assemblyPlugin>
+ -->
<assemblyPlugin>
<identifier>VB</identifier>
<pluginClass>org.apache.maven.dotnet.assembler.impl.VBAssemblyInfoMarshaller</pluginClass>
Modified: incubator/nmaven/branches/SI_RUBY/components/dotnet-core/src/main/resources/META-INF/nmaven/compiler-plugins.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_RUBY/components/dotnet-core/src/main/resources/META-INF/nmaven/compiler-plugins.xml?view=diff&rev=521786&r1=521785&r2=521786
==============================================================================
--- incubator/nmaven/branches/SI_RUBY/components/dotnet-core/src/main/resources/META-INF/nmaven/compiler-plugins.xml (original)
+++ incubator/nmaven/branches/SI_RUBY/components/dotnet-core/src/main/resources/META-INF/nmaven/compiler-plugins.xml Fri Mar 23 09:08:20 2007
@@ -50,7 +50,6 @@
</includes>
</commandFilter>
</compilerPlugin>
-
<compilerPlugin>
<identifier>MS-CS-2.0</identifier>
<pluginClass>org.apache.maven.dotnet.executable.compiler.impl.DefaultCompiler</pluginClass>
@@ -181,7 +180,6 @@
</includes>
</commandFilter>
</compilerPlugin>
-
<compilerPlugin>
<identifier>MS-VB</identifier>
<pluginClass>org.apache.maven.dotnet.executable.compiler.impl.DefaultCompiler</pluginClass>
@@ -224,7 +222,6 @@
</includes>
</commandFilter>
</compilerPlugin>
-
<compilerPlugin>
<identifier>MONO-CS</identifier>
<pluginClass>org.apache.maven.dotnet.executable.compiler.impl.DefaultCompiler</pluginClass>
@@ -281,8 +278,6 @@
</includes>
</commandFilter>
</compilerPlugin>
-
-
<compilerPlugin>
<identifier>MONO-CS-2</identifier>
<pluginClass>org.apache.maven.dotnet.executable.compiler.impl.DefaultCompiler</pluginClass>
@@ -339,7 +334,6 @@
</includes>
</commandFilter>
</compilerPlugin>
-
<compilerPlugin>
<identifier>NEM</identifier>
<pluginClass>org.apache.maven.dotnet.executable.compiler.impl.NemerleCompiler</pluginClass>
@@ -415,4 +409,24 @@
</platform>
</platforms>
</compilerPlugin>
+ <!--
+ <compilerPlugin>
+ <identifier>Ruby</identifier>
+ <pluginClass>org.apache.maven.dotnet.executable.compiler.impl.RubyCompiler</pluginClass>
+ <vendor>MICROSOFT</vendor>
+ <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/nmaven/branches/SI_RUBY/components/dotnet-core/src/main/resources/META-INF/nmaven/net-dependencies.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_RUBY/components/dotnet-core/src/main/resources/META-INF/nmaven/net-dependencies.xml?view=diff&rev=521786&r1=521785&r2=521786
==============================================================================
--- incubator/nmaven/branches/SI_RUBY/components/dotnet-core/src/main/resources/META-INF/nmaven/net-dependencies.xml (original)
+++ incubator/nmaven/branches/SI_RUBY/components/dotnet-core/src/main/resources/META-INF/nmaven/net-dependencies.xml Fri Mar 23 09:08:20 2007
@@ -11,6 +11,15 @@
<version>0.14</version>
<type>exe</type>
</netDependency>
+<!--
+ <netDependency>
+ <id>RubyCompiler</id>
+ <groupId>QUT.RubyCompiler</groupId>
+ <artifactId>RubyCompiler</artifactId>
+ <version>1.0.0</version>
+ <type>exe</type>
+ </netDependency>
+ -->
<netDependency>
<groupId>NMaven.Plugin</groupId>
<artifactId>NMaven.Plugin.Solution</artifactId>
Modified: incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableCapability.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableCapability.java?view=diff&rev=521786&r1=521785&r2=521786
==============================================================================
--- incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableCapability.java (original)
+++ incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableCapability.java Fri Mar 23 09:08:20 2007
@@ -169,6 +169,20 @@
void setPluginClassName( String pluginClassName );
/**
+ * Returns the net dependency id (within the net-dependencies.xml file).
+ *
+ * @return the net dependency id
+ */
+ String getNetDependencyId();
+
+ /**
+ * Sets the net dependency id.
+ *
+ * @param netDependencyId
+ */
+ void setNetDependencyId(String netDependencyId);
+
+ /**
* Provides factory services for creating a default instance of the executable capability.
*/
public static class Factory
@@ -216,6 +230,8 @@
private String assemblyPath;
+ private String netDependencyId;
+
public String getAssemblyPath()
{
return assemblyPath;
@@ -346,6 +362,16 @@
public void setCommandCapability( CommandCapability commandCapability )
{
this.commandCapability = commandCapability;
+ }
+
+ public String getNetDependencyId()
+ {
+ return netDependencyId;
+ }
+
+ public void setNetDependencyId( String executableLocation )
+ {
+ this.netDependencyId = executableLocation;
}
public String toString()
Modified: incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerExecutable.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerExecutable.java?view=diff&rev=521786&r1=521785&r2=521786
==============================================================================
--- incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerExecutable.java (original)
+++ incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerExecutable.java Fri Mar 23 09:08:20 2007
@@ -41,4 +41,11 @@
File getCompiledArtifact()
throws InvalidArtifactException;
+ /**
+ * Returns true to fail the build if the compiler writes anything to the error stream, otherwise return false.
+ *
+ * @return true to fail the build if the compiler writes anything to the error stream, otherwise return false
+ */
+ boolean failOnErrorOutput();
+
}
Modified: incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/CSharpCompilerForProfile.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/CSharpCompilerForProfile.java?view=diff&rev=521786&r1=521785&r2=521786
==============================================================================
--- incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/CSharpCompilerForProfile.java (original)
+++ incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/CSharpCompilerForProfile.java Fri Mar 23 09:08:20 2007
@@ -21,89 +21,32 @@
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
+ extends BaseCompiler
{
private NetExecutable netCompiler;
private CompilerContext compilerContext;
- public CSharpCompilerForProfile()
+ public boolean failOnErrorOutput()
{
- 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;
+ return true;
}
- public File getExecutionPath()
- {
- String executable;
- try
- {
- executable = getExecutable();
- }
- catch ( ExecutionException e )
- {
- return null;
- }
- List<String> executablePaths = compilerContext.getNetCompilerConfig().getExecutionPaths();
- if ( executablePaths != null )
- {
- for ( String executablePath : executablePaths )
- {
- File exe = new File( executablePath + File.separator + executable);
- if ( exe.exists() )
- {
- return new File(executablePath);
- }
- }
- }
- return null;
- }
-
- public void execute()
- throws ExecutionException
+ public CSharpCompilerForProfile()
{
- 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 );
+ netCompiler = new DefaultCompiler();
}
public List<String> getCommands()
@@ -124,13 +67,6 @@
commands.add( "/reference:" + path.getAbsolutePath() + File.separator + coreAssembly + ".dll" );
}
return commands;
- }
-
-
- public String getExecutable()
- throws ExecutionException
- {
- return netCompiler.getExecutable();
}
public void init( NMavenContext nmavenContext )
Modified: incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java?view=diff&rev=521786&r1=521785&r2=521786
==============================================================================
--- incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java (original)
+++ incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java Fri Mar 23 09:08:20 2007
@@ -19,7 +19,6 @@
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;
@@ -27,14 +26,9 @@
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.
@@ -42,55 +36,12 @@
* @author Shane Isbell
*/
public final class DefaultCompiler
- implements CompilerExecutable
+ extends BaseCompiler
{
-
- private CompilerContext compilerContext;
-
- private Logger logger;
-
- public void init( NMavenContext nmavenContext )
- {
- this.compilerContext = (CompilerContext) nmavenContext;
- this.logger = nmavenContext.getLogger();
- }
-
- public File getCompiledArtifact()
- throws InvalidArtifactException
+ public boolean failOnErrorOutput()
{
- 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()
- {
- String executable;
- try
- {
- executable = getExecutable();
- }
- catch ( ExecutionException e )
- {
- return null;
- }
- List<String> executablePaths = compilerContext.getNetCompilerConfig().getExecutionPaths();
- if ( executablePaths != null )
- {
- for ( String executablePath : executablePaths )
- {
- File exe = new File( executablePath + File.separator + executable);
- if ( exe.exists() )
- {
- return new File(executablePath);
- }
- }
- }
- return null;
+ //MONO writes warnings to standard error: this turns off failing builds on warnings for MONO
+ return !compilerContext.getCompilerRequirement().getVendor().equals( Vendor.MONO );
}
public List<String> getCommands()
@@ -196,35 +147,5 @@
}
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 );
}
}
Modified: incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DotGNUCompiler.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DotGNUCompiler.java?view=diff&rev=521786&r1=521785&r2=521786
==============================================================================
--- incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DotGNUCompiler.java (original)
+++ incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DotGNUCompiler.java Fri Mar 23 09:08:20 2007
@@ -19,12 +19,7 @@
package org.apache.maven.dotnet.executable.compiler.impl;
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.CompilerConfig;
-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.util.ArrayList;
@@ -32,7 +27,6 @@
import java.io.File;
import org.apache.maven.artifact.Artifact;
-import org.codehaus.plexus.logging.Logger;
/**
* Compiler for DotGNU.
@@ -40,55 +34,12 @@
* @author Shane Isbell
*/
public final class DotGNUCompiler
- implements CompilerExecutable
+ extends BaseCompiler
{
- private CompilerContext compilerContext;
-
- private Logger logger;
-
- public void init( NMavenContext nmavenContext )
- {
- this.compilerContext = (CompilerContext) nmavenContext;
- this.logger = nmavenContext.getLogger();
- }
-
- public File getCompiledArtifact()
- throws InvalidArtifactException
+ public boolean failOnErrorOutput()
{
- File file = compilerContext.getArtifact();
- if ( !file.exists() )
- {
- throw new InvalidArtifactException(
- "NMAVEN-069-005: Artifact does not exist: Artifact = " + file.getAbsolutePath() );
- }
- return file;
- }
-
- public File getExecutionPath()
- {
- String executable;
- try
- {
- executable = getExecutable();
- }
- catch ( ExecutionException e )
- {
- return null;
- }
- List<String> executablePaths = compilerContext.getNetCompilerConfig().getExecutionPaths();
- if ( executablePaths != null )
- {
- for ( String executablePath : executablePaths )
- {
- File exe = new File( executablePath + File.separator + executable);
- if ( exe.exists() )
- {
- return new File(executablePath);
- }
- }
- }
- return null;
+ return true;
}
public List<String> getCommands()
@@ -144,33 +95,4 @@
//TODO: Apply command filter
return commands;
}
-
- public String getExecutable()
- throws ExecutionException
- {
- if ( compilerContext == null )
- {
- throw new ExecutionException( "NMAVEN-069-001: Compiler has not been initialized with a context" );
- }
- return compilerContext.getCompilerCapability().getExecutable();
- }
-
- public void execute()
- throws ExecutionException
- {
- logger.info( "NMAVEN-069-002: Compiling" );
- if ( !( new File( compilerContext.getSourceDirectoryName() ).exists() ) )
- {
- logger.info( "NMAVEN-069-003: No source files to compile." );
- return;
- }
- CommandExecutor commandExecutor = CommandExecutor.Factory.createDefaultCommmandExecutor();
- commandExecutor.setLogger( logger );
- commandExecutor.executeCommand( getExecutable(), getCommands(), getExecutionPath(), true );
- logger.info( "NMAVEN-069-004: Compiling Artifact: Vendor = " +
- compilerContext.getCompilerRequirement().getVendor() + ", Language = " +
- compilerContext.getCompilerRequirement().getVendor() + ", Assembly Name = " +
- compilerContext.getArtifact().getAbsolutePath() );
- }
-
}
Modified: incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/NemerleCompiler.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/NemerleCompiler.java?view=diff&rev=521786&r1=521785&r2=521786
==============================================================================
--- incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/NemerleCompiler.java (original)
+++ incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/NemerleCompiler.java Fri Mar 23 09:08:20 2007
@@ -19,19 +19,13 @@
package org.apache.maven.dotnet.executable.compiler.impl;
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.CompilerConfig;
-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 org.apache.maven.artifact.Artifact;
import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.logging.Logger;
import java.util.List;
import java.util.ArrayList;
-import java.io.File;
+
/**
* Compiler for the Nemerle language (see http://nemerle.org/). Cannot use the DefaultCompiler for Nemerle
@@ -40,55 +34,12 @@
* @author Shane Isbell
*/
public final class NemerleCompiler
- implements CompilerExecutable
+ extends BaseCompiler
{
- private CompilerContext compilerContext;
-
- private Logger logger;
-
- public void init( NMavenContext nmavenContext )
- {
- this.compilerContext = (CompilerContext) nmavenContext;
- this.logger = nmavenContext.getLogger();
- }
-
- public File getExecutionPath()
- {
- String executable;
- try
- {
- executable = getExecutable();
- }
- catch ( ExecutionException e )
- {
- return null;
- }
- List<String> executablePaths = compilerContext.getNetCompilerConfig().getExecutionPaths();
- if ( executablePaths != null )
- {
- for ( String executablePath : executablePaths )
- {
- File exe = new File( executablePath + File.separator + executable);
- if ( exe.exists() )
- {
- return new File(executablePath);
- }
- }
- }
- return null;
- }
-
- public File getCompiledArtifact()
- throws InvalidArtifactException
+ public boolean failOnErrorOutput()
{
- File file = compilerContext.getArtifact();
- if ( !file.exists() )
- {
- throw new InvalidArtifactException(
- "NMAVEN-070-004: Artifact does not exist: Artifact = " + file.getAbsolutePath() );
- }
- return file;
+ return true;
}
public List<String> getCommands()
@@ -132,33 +83,4 @@
commands.addAll( config.getCommands() );
return commands;
}
-
- public String getExecutable()
- throws ExecutionException
- {
- if ( compilerContext == null )
- {
- throw new ExecutionException( "NMAVEN-070-000: Compiler has not been initialized with a context" );
- }
- return compilerContext.getCompilerCapability().getExecutable();
- }
-
- public void execute()
- throws ExecutionException
- {
- logger.info( "NMAVEN-070-001: Compiling" );
- if ( !( new File( compilerContext.getSourceDirectoryName() ).exists() ) )
- {
- logger.info( "NMAVEN-070-002: No source files to compile." );
- return;
- }
- CommandExecutor commandExecutor = CommandExecutor.Factory.createDefaultCommmandExecutor();
- commandExecutor.setLogger( logger );
- commandExecutor.executeCommand( getExecutable(), getCommands(), getExecutionPath(), true );
- logger.info( "NMAVEN-070-003: Compiling Artifact: Vendor = " +
- compilerContext.getCompilerRequirement().getVendor() + ", Language = " +
- compilerContext.getCompilerRequirement().getVendor() + ", Assembly Name = " +
- compilerContext.getArtifact().getAbsolutePath() );
- }
-
}
Modified: incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/PhpCompiler.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/PhpCompiler.java?view=diff&rev=521786&r1=521785&r2=521786
==============================================================================
--- incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/PhpCompiler.java (original)
+++ incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/PhpCompiler.java Fri Mar 23 09:08:20 2007
@@ -19,19 +19,12 @@
package org.apache.maven.dotnet.executable.compiler.impl;
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.CompilerConfig;
-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 org.apache.maven.artifact.Artifact;
import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.logging.Logger;
import java.util.List;
import java.util.ArrayList;
-import java.io.File;
/**
* Compiler for PHP (http://php4mono.sourceforge.net/)
@@ -39,70 +32,17 @@
* @author Shane Isbell
*/
public final class PhpCompiler
- implements CompilerExecutable
+ extends BaseCompiler
{
- private CompilerContext compilerContext;
-
- public void init( NMavenContext nmavenContext )
+ public boolean failOnErrorOutput()
{
- this.compilerContext = (CompilerContext) nmavenContext;
- }
-
- public File getExecutionPath()
- {
- String executable;
- try
- {
- executable = getExecutable();
- }
- catch ( ExecutionException e )
- {
- return null;
- }
- List<String> executablePaths = compilerContext.getNetCompilerConfig().getExecutionPaths();
- if ( executablePaths != null )
- {
- for ( String executablePath : executablePaths )
- {
- File exe = new File( executablePath + File.separator + executable);
- if ( exe.exists() )
- {
- return new File(executablePath);
- }
- }
- }
- return null;
+ return true;
}
public List<String> getCommands()
throws ExecutionException
{
- return null;
- }
-
- public String getExecutable()
- throws ExecutionException
- {
- return null;
- }
-
- 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 void execute()
- throws ExecutionException
- {
- Logger logger = compilerContext.getLogger();
CompilerConfig config = compilerContext.getNetCompilerConfig();
List<Artifact> resources = compilerContext.getLibraryDependencies();
@@ -110,12 +50,6 @@
String artifactFilePath = compilerContext.getArtifact().getAbsolutePath();
String targetArtifactType = config.getArtifactType().getArtifactTypeName();
- if ( !( new File( sourceDirectory ).exists() ) )
- {
- logger.info( "NMAVEN-080-000: No source files to compile." );
- return;
- }
-
List<String> commands = new ArrayList<String>();
commands.add( "/out:" + artifactFilePath );
commands.add( "/target:" + targetArtifactType );
@@ -133,10 +67,6 @@
{
commands.add( file );
}
-
- logger.info( commands.toString() );
- CommandExecutor commandExecutor = CommandExecutor.Factory.createDefaultCommmandExecutor();
- commandExecutor.setLogger( logger );
- commandExecutor.executeCommand( compilerContext.getCompilerCapability().getExecutable(), commands );
+ return commands;
}
}
Modified: incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java?view=diff&rev=521786&r1=521785&r2=521786
==============================================================================
--- incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java (original)
+++ incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java Fri Mar 23 09:08:20 2007
@@ -165,7 +165,6 @@
{
libraries.add( project.getArtifact() );
}
-
return libraries;
}
@@ -299,8 +298,6 @@
libraries.add( artifact );
}
}
-
-
}
compilerCapability = capabilityMatcher.matchCompilerCapabilityFor( compilerRequirement );
Modified: incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerPluginsRepository.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerPluginsRepository.java?view=diff&rev=521786&r1=521785&r2=521786
==============================================================================
--- incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerPluginsRepository.java (original)
+++ incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerPluginsRepository.java Fri Mar 23 09:08:20 2007
@@ -113,6 +113,8 @@
CommandFilter filter = plugin.getCommandFilter();
platformCapability.setCoreAssemblies( coreAssemblies );
+ platformCapability.setNetDependencyId( plugin.getExecutableLocation() );
+
List<String> includes = ( filter != null ) ? filter.getIncludes() : new ArrayList<String>();
List<String> excludes = ( filter != null ) ? filter.getExcludes() : new ArrayList<String>();
platformCapability.setCommandCapability(
Modified: incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/NetExecutableFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/NetExecutableFactoryImpl.java?view=diff&rev=521786&r1=521785&r2=521786
==============================================================================
--- incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/NetExecutableFactoryImpl.java (original)
+++ incubator/nmaven/branches/SI_RUBY/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/NetExecutableFactoryImpl.java Fri Mar 23 09:08:20 2007
@@ -103,7 +103,8 @@
compilerRequirement.setVendor( vendorInfo.getVendor() );
compilerRequirement.setVendorVersion( vendorInfo.getVendorVersion() );
compilerRequirement.setFrameworkVersion( vendorInfo.getFrameworkVersion() );
-
+ List<String> executionPaths = ( compilerConfig.getExecutionPaths() == null ) ? new ArrayList<String>()
+ : compilerConfig.getExecutionPaths();
if ( vendorInfoRepository != null && vendorInfoRepository.exists() )
{
File sdkInstallRoot = null;
@@ -113,10 +114,10 @@
}
catch ( PlatformUnsupportedException e )
{
- logger.debug( "NMAVEN-066-017: Did not find an SDK install root: " + vendorInfo, e);
+ logger.debug( "NMAVEN-066-017: Did not find an SDK install root: " + vendorInfo, e );
}
File installRoot = vendorInfoRepository.getInstallRootFor( vendorInfo );
- List<String> executionPaths = new ArrayList<String>();
+
if ( installRoot != null )
{
executionPaths.add( installRoot.getAbsolutePath() );
@@ -125,7 +126,6 @@
{
executionPaths.add( sdkInstallRoot.getAbsolutePath() );
}
- compilerConfig.setExecutionPaths( executionPaths );
}
compilerContext.init( compilerRequirement, compilerConfig, project, capabilityMatcher );
@@ -133,6 +133,20 @@
{
compilerContext.getCompilerCapability().setAssemblyPath( assemblyPath.getAbsolutePath() );
}
+
+ String netDependencyId = compilerContext.getCompilerCapability().getNetDependencyId();
+ if ( netDependencyId != null )
+ {
+ Artifact artifact = artifactContext.getArtifactByID( netDependencyId );
+ if ( artifact != null )
+ {
+ AssemblyRepositoryLayout layout = new AssemblyRepositoryLayout();
+ File artifactPath = new File( compilerConfig.getLocalRepository().getAbsolutePath() + File.separator +
+ layout.pathOf( artifact ) );
+ executionPaths.add( artifactPath.getParentFile().getAbsolutePath() );
+ }
+ }
+ compilerConfig.setExecutionPaths( executionPaths );
try
{
return compilerContext.getCompilerExecutable();
@@ -202,9 +216,8 @@
modifiedCommands = commands;
}
//TODO: DotGNU on Linux?
-
ExecutableConfig executableConfig = ExecutableConfig.Factory.createDefaultExecutableConfig();
- executableConfig.setExecutionPaths( Arrays.asList( exe) );
+ executableConfig.setExecutionPaths( Arrays.asList( exe ) );
executableConfig.setCommands( modifiedCommands );
try
@@ -260,7 +273,8 @@
ExecutableConfig executableConfig = ExecutableConfig.Factory.createDefaultExecutableConfig();
executableConfig.setCommands( commands );
- List<String> executablePaths = new ArrayList<String>();
+ List<String> executablePaths = ( executableConfig.getExecutionPaths() == null ) ? new ArrayList<String>()
+ : executableConfig.getExecutionPaths();
if ( netHome != null && netHome.exists() )
{
logger.info( "NMAVEN-066-014: Found executable path: Path = " + netHome.getAbsolutePath() );
Modified: incubator/nmaven/branches/SI_RUBY/components/dotnet-model/compiler-plugins/compiler-plugins.mdo
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_RUBY/components/dotnet-model/compiler-plugins/compiler-plugins.mdo?view=diff&rev=521786&r1=521785&r2=521786
==============================================================================
--- incubator/nmaven/branches/SI_RUBY/components/dotnet-model/compiler-plugins/compiler-plugins.mdo (original)
+++ incubator/nmaven/branches/SI_RUBY/components/dotnet-model/compiler-plugins/compiler-plugins.mdo Fri Mar 23 09:08:20 2007
@@ -22,7 +22,6 @@
</field>
</fields>
</class>
-
<class xml.tagName="compilerPlugin">
<name>CompilerPlugin</name>
<fields>
@@ -66,6 +65,11 @@
<description>Executable, as run from the command line.</description>
</field>
<field>
+ <name>netDependencyId</name>
+ <version>1.0.0</version>
+ <type>String</type>
+ </field>
+ <field>
<name>frameworkVersions</name>
<description>Supported framework version(s) of the compiler: 1.1.4322, 2.0.50727, 3.0</description>
<association>
@@ -112,7 +116,6 @@
</field>
</fields>
</class>
-
<class>
<name>CommandFilter</name>
<fields>
@@ -140,7 +143,6 @@
</field>
</fields>
</class>
-
<class>
<name>Platform</name>
<fields>
Modified: incubator/nmaven/branches/SI_RUBY/components/dotnet-model/netdependency/netdependency.mdo
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_RUBY/components/dotnet-model/netdependency/netdependency.mdo?view=diff&rev=521786&r1=521785&r2=521786
==============================================================================
--- incubator/nmaven/branches/SI_RUBY/components/dotnet-model/netdependency/netdependency.mdo (original)
+++ incubator/nmaven/branches/SI_RUBY/components/dotnet-model/netdependency/netdependency.mdo Fri Mar 23 09:08:20 2007
@@ -26,6 +26,12 @@
<name>NetDependency</name>
<fields>
<field>
+ <name>id</name>
+ <version>1.0.0</version>
+ <type>String</type>
+ <description></description>
+ </field>
+ <field>
<name>groupId</name>
<version>1.0.0</version>
<type>String</type>
Modified: incubator/nmaven/branches/SI_RUBY/maven-dotnet.iml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_RUBY/maven-dotnet.iml?view=diff&rev=521786&r1=521785&r2=521786
==============================================================================
--- incubator/nmaven/branches/SI_RUBY/maven-dotnet.iml (original)
+++ incubator/nmaven/branches/SI_RUBY/maven-dotnet.iml Fri Mar 23 09:08:20 2007
@@ -10,8 +10,6 @@
<sourceFolder url="file://$MODULE_DIR$/assemblies/NMaven.Plugin.Resx/src/main/csharp" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/assemblies/NMaven.Plugin.Settings/src/main/csharp" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/assemblies/NMaven.Plugin.Solution/src/main/csharp" isTestSource="false" />
- <sourceFolder url="file://$MODULE_DIR$/assemblies/NMaven.Service/Embedder/src/main/csharp" isTestSource="false" />
- <sourceFolder url="file://$MODULE_DIR$/assemblies/NMaven.Service/Embedder/src/main/resources" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/components/dotnet-artifact/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/components/dotnet-artifact/src/main/resources" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/components/dotnet-assembler/src/main/java" isTestSource="false" />
@@ -27,11 +25,14 @@
<sourceFolder url="file://$MODULE_DIR$/components/dotnet-executable/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/components/dotnet-executable/src/main/resources" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/components/dotnet-model/assembly-plugins/src/site" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/components/dotnet-model/assembly-plugins/target/generated-sources/modello" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/components/dotnet-model/compiler-plugins/target/generated-sources/modello" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/components/dotnet-model/netdependency/target/generated-sources/modello" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/components/dotnet-model/settings/target/generated-sources/modello" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/components/dotnet-registry/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/components/dotnet-registry/src/main/resources" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/components/dotnet-vendor/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/components/dotnet-vendor/src/main/resources" isTestSource="false" />
- <sourceFolder url="file://$MODULE_DIR$/components/src/main/resources" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/integration-tests/tests/it0001/src/main/csharp" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/integration-tests/tests/it0002/src/main/csharp" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/integration-tests/tests/it0003/src/main/csharp" isTestSource="false" />
@@ -53,9 +54,6 @@
<sourceFolder url="file://$MODULE_DIR$/integration-tests/tests/it0021/src/main/vb" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/integration-tests/tests/it0022/src/main/csharp" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/integration-tests/tests/it0025/it/test1/src/main/csharp" isTestSource="false" />
- <sourceFolder url="file://$MODULE_DIR$/integration-tests/tests/it0026/src/main/csharp" isTestSource="false" />
- <sourceFolder url="file://$MODULE_DIR$/integration-tests/tests/it0027" isTestSource="false" />
- <sourceFolder url="file://$MODULE_DIR$/junk/maven-axis2-plugin/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/plugins/maven-compile-plugin/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/plugins/maven-compile-plugin/src/main/resources" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/plugins/maven-install-plugin/src/main/java" isTestSource="false" />
@@ -81,7 +79,6 @@
<sourceFolder url="file://$MODULE_DIR$/sandbox/maven-csharp/plugins/maven-nunit-plugin/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/sandbox/maven-csharp/plugins/maven-vstudio-plugin/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/sandbox/prototype/maven-csharp-test/src/main/csharp" isTestSource="false" />
- <excludeFolder url="file://$MODULE_DIR$/junk" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
Modified: incubator/nmaven/branches/SI_RUBY/plugins/maven-install-plugin/src/main/java/org/apache/maven/dotnet/plugin/install/FileInstallerMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_RUBY/plugins/maven-install-plugin/src/main/java/org/apache/maven/dotnet/plugin/install/FileInstallerMojo.java?view=diff&rev=521786&r1=521785&r2=521786
==============================================================================
--- incubator/nmaven/branches/SI_RUBY/plugins/maven-install-plugin/src/main/java/org/apache/maven/dotnet/plugin/install/FileInstallerMojo.java (original)
+++ incubator/nmaven/branches/SI_RUBY/plugins/maven-install-plugin/src/main/java/org/apache/maven/dotnet/plugin/install/FileInstallerMojo.java Fri Mar 23 09:08:20 2007
@@ -55,7 +55,7 @@
* @parameter expression = "${file}
* @required
*/
- private File pomFile;
+ private File artifactFile;
/**
* @parameter expression = "${groupId}
@@ -82,6 +82,11 @@
private String packaging;
/**
+ * @parameter expression = "${generatePom} default-value = "true"
+ */
+ private boolean generatePom;
+
+ /**
* @component
*/
private ArtifactContext artifactContext;
@@ -95,13 +100,29 @@
throws MojoExecutionException
{
artifactContext.init( project, localRepository );
- try
+ if ( generatePom )
{
- artifactContext.getArtifactInstaller().installFile( groupId, artifactId, version, packaging, pomFile );
+ try
+ {
+ artifactContext.getArtifactInstaller().installFile( groupId, artifactId, version, packaging,
+ artifactFile );
+ }
+ catch ( org.apache.maven.artifact.installer.ArtifactInstallationException e )
+ {
+ throw new MojoExecutionException( "NMAVEN-1000-000: Failed to install artifact file", e );
+ }
}
- catch ( org.apache.maven.artifact.installer.ArtifactInstallationException e )
+ else
{
- throw new MojoExecutionException( "NMAVEN-1000-000: Failed to install artifact file", e );
+ try
+ {
+ artifactContext.getArtifactInstaller().installFileWithNoPom( groupId, artifactId, version,
+ artifactFile );
+ }
+ catch ( org.apache.maven.artifact.installer.ArtifactInstallationException e )
+ {
+ throw new MojoExecutionException( "NMAVEN-1000-001: Failed to install artifact file", e );
+ }
}
}
}
Modified: incubator/nmaven/branches/SI_RUBY/plugins/maven-install-plugin/src/main/java/org/apache/maven/dotnet/plugin/install/InstallerMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_RUBY/plugins/maven-install-plugin/src/main/java/org/apache/maven/dotnet/plugin/install/InstallerMojo.java?view=diff&rev=521786&r1=521785&r2=521786
==============================================================================
--- incubator/nmaven/branches/SI_RUBY/plugins/maven-install-plugin/src/main/java/org/apache/maven/dotnet/plugin/install/InstallerMojo.java (original)
+++ incubator/nmaven/branches/SI_RUBY/plugins/maven-install-plugin/src/main/java/org/apache/maven/dotnet/plugin/install/InstallerMojo.java Fri Mar 23 09:08:20 2007
@@ -98,6 +98,7 @@
}
//For the IDE: If we see a dll with same name as netmodule, copy dll to the local repo.
+ /*
File linkedFile =
new File( artifact.getFile().getParent() + File.separatorChar + artifact.getArtifactId() + ".dll" );
if ( linkedFile.exists() && artifact.getType().equals( ArtifactType.MODULE.getArtifactTypeName() ) )
@@ -113,6 +114,7 @@
throw new MojoExecutionException( "NMAVEN-1001-001: Failed to install artifact file", e );
}
}
+ */
}
}