From nmaven-commits-return-329-apmail-incubator-nmaven-commits-archive=incubator.apache.org@incubator.apache.org Sat May 19 07:48:29 2007 Return-Path: Delivered-To: apmail-incubator-nmaven-commits-archive@locus.apache.org Received: (qmail 50851 invoked from network); 19 May 2007 07:48:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 May 2007 07:48:25 -0000 Received: (qmail 65408 invoked by uid 500); 19 May 2007 07:48:31 -0000 Delivered-To: apmail-incubator-nmaven-commits-archive@incubator.apache.org Received: (qmail 65382 invoked by uid 500); 19 May 2007 07:48:31 -0000 Mailing-List: contact nmaven-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: nmaven-dev@incubator.apache.org Delivered-To: mailing list nmaven-commits@incubator.apache.org Received: (qmail 65358 invoked by uid 99); 19 May 2007 07:48:31 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 May 2007 00:48:31 -0700 X-ASF-Spam-Status: No, hits=-98.6 required=10.0 tests=ALL_TRUSTED,INFO_TLD,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 May 2007 00:48:18 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 6BFD81A9823; Sat, 19 May 2007 00:47:58 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r539709 [4/7] - in /incubator/nmaven/trunk: ./ archetypes/ archetypes/maven-archetype-netexecutable/ archetypes/maven-archetype-netexecutable/src/ archetypes/maven-archetype-netexecutable/src/main/ archetypes/maven-archetype-netexecutable/s... Date: Sat, 19 May 2007 07:47:53 -0000 To: nmaven-commits@incubator.apache.org From: sisbell@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070519074758.6BFD81A9823@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: 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=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/NetExecutable.java (original) +++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/NetExecutable.java Sat May 19 00:47:30 2007 @@ -19,6 +19,7 @@ package org.apache.maven.dotnet.executable; import org.apache.maven.dotnet.NMavenContext; +import org.apache.maven.dotnet.vendor.Vendor; import java.util.List; import java.io.File; @@ -53,9 +54,9 @@ throws ExecutionException; /** - * Returns the executable that this compiler will use to compile the application. + * Returns the executable file name that this compiler will use to compile the application. * - * @return the executable that this compiler will use to compile the application + * @return the executable file name that this compiler will use to compile the application * @throws org.apache.maven.dotnet.executable.ExecutionException * */ @@ -63,7 +64,9 @@ throws ExecutionException; /** - * @return excution path + * Returns the parent directory of the executable. + * + * @return the parent directory of the executable */ File getExecutionPath(); @@ -73,5 +76,12 @@ * @param nmavenContext */ void init( NMavenContext nmavenContext ); + + /** + * Returns vendor framework used to run executable. + * + * @return vendor vendor framework used to run executable + */ + Vendor getVendor(); } Modified: 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=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/NetExecutableFactory.java (original) +++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/NetExecutableFactory.java Sat May 19 00:47:30 2007 @@ -28,6 +28,7 @@ import org.apache.maven.dotnet.executable.compiler.CompilerConfig; import org.apache.maven.dotnet.executable.compiler.CompilerExecutable; import org.apache.maven.dotnet.PlatformUnsupportedException; +import org.apache.maven.artifact.Artifact; /** * Provides services to obtain executables. This interface is intended to be used by AbstractMojo @@ -51,43 +52,68 @@ * @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 + * @throws org.apache.maven.dotnet.PlatformUnsupportedException + * if no executable is found */ - NetExecutable getNetExecutableFor( String vendor, String frameworkVersion, String profile, MavenProject project, - List commands, File netHome ) + NetExecutable getNetExecutableFor( String vendor, String frameworkVersion, String profile, List 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. + * @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. + * @param isIsolatedAppDomain the executable can load up assemblies into an isolated application domain. This should + * be set to true if the application needs to load up assemblies into another app domain + * and to remotly invoke methods on classes in the other app domain, otherwise it should be + * set to false. * @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 commands ) + File localRepository, List commands, + boolean isIsolatedAppDomain ) + throws PlatformUnsupportedException; + + NetExecutable getJavaExecutableFromRepository( VendorInfo vendorInfo, List 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 + * @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 - * + * @throws org.apache.maven.dotnet.PlatformUnsupportedException + * if no executable is found */ CompilerExecutable getCompilerExecutableFor( CompilerRequirement compilerRequirement, CompilerConfig compilerConfig, MavenProject project, File assemblyPath ) + throws PlatformUnsupportedException; + + + /** + * Returns a plugin loader for loading and executing a .NET plugin. + * + * @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. + * @param parameterFile the file containing parameter information to inject into the .NET plugin + * @param mojoName the name of the .NET Mojo implementation + * @return the plugin loader for executing a .NET plugin + * @throws PlatformUnsupportedException if no executable is found + */ + NetExecutable getPluginLoaderFor( String groupId, String artifactId, VendorInfo vendorInfo, String localRepository, + File parameterFile, String mojoName ) throws PlatformUnsupportedException; } Modified: 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=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/RepositoryExecutableContext.java (original) +++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/RepositoryExecutableContext.java Sat May 19 00:47:30 2007 @@ -51,9 +51,8 @@ * 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 ) + void init( ExecutableConfig executableConfig ) throws InitializationException; } Modified: 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=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerConfig.java (original) +++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerConfig.java Sat May 19 00:47:30 2007 @@ -45,7 +45,12 @@ * @return true if the compiler plugin should compile the test classes, otherwise returns false. */ boolean isTestCompile(); - + + /** + * Returns key info used for signing assemblies. + * + * @return key info used for signing assemblies + */ KeyInfo getKeyInfo(); /** @@ -76,6 +81,11 @@ */ void setLocalRepository( File localRepository ); + /** + * Sets key info used for signing assemblies. + * + * @param keyInfo key info used for signing assemblies + */ void setKeyInfo(KeyInfo keyInfo); } Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/KeyInfo.java URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/KeyInfo.java?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/KeyInfo.java (original) +++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/KeyInfo.java Sat May 19 00:47:30 2007 @@ -1,9 +1,42 @@ +/* + * 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; +/** + * Provides services for obtaining information about the key file. + * + * @author Shane Isbell + */ public interface KeyInfo { + /** + * Returns the path of the key + * + * @return the path of the key + */ String getKeyFileUri(); + /** + * Sets the path of the key + * + * @param keyFileUri the path of the key + */ void setKeyFileUri(String keyFileUri); String getKeyContainerName(); @@ -28,7 +61,6 @@ { return new KeyInfo() { - private String keyFileUri; private String keyContainerName; Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/BaseCompiler.java URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/BaseCompiler.java?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/BaseCompiler.java (original) +++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/BaseCompiler.java Sat May 19 00:47:30 2007 @@ -1,3 +1,21 @@ +/* + * 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.compiler.CompilerContext; @@ -6,18 +24,28 @@ import org.apache.maven.dotnet.executable.ExecutionException; import org.apache.maven.dotnet.executable.CommandExecutor; import org.apache.maven.dotnet.NMavenContext; +import org.apache.maven.dotnet.vendor.Vendor; import org.codehaus.plexus.logging.Logger; import java.io.File; import java.util.List; /** + * Provides an implementation of the compiler executable. * + * @author Shane Isbell */ +//TODO: Describe how this class should be extended abstract class BaseCompiler implements CompilerExecutable { + /** + * The context that the compiler implementation can use to obtain information to customize the compile. + */ protected CompilerContext compilerContext; + /** + * A logger for writing log messages + */ protected Logger logger; /** @@ -29,18 +57,24 @@ this.logger = nmavenContext.getLogger(); } + /** + * @see org.apache.maven.dotnet.executable.compiler.CompilerExecutable#getCompiledArtifact() + */ 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() ); - } + // if ( !file.exists() ) + // { + // throw new InvalidArtifactException( + // "NMAVEN-068-004: Artifact does not exist: Artifact = " + file.getAbsolutePath() ); + // } return file; } + /** + * @see org.apache.maven.dotnet.executable.compiler.CompilerExecutable#getExecutable() + */ public String getExecutable() throws ExecutionException { @@ -51,6 +85,9 @@ return compilerContext.getCompilerCapability().getExecutable(); } + /** + * @see org.apache.maven.dotnet.executable.compiler.CompilerExecutable#getExecutionPath() + */ public File getExecutionPath() { String executable; @@ -77,6 +114,9 @@ return null; } + /** + * @see org.apache.maven.dotnet.executable.compiler.CompilerExecutable#execute() + */ public void execute() throws ExecutionException { @@ -93,5 +133,10 @@ CommandExecutor commandExecutor = CommandExecutor.Factory.createDefaultCommmandExecutor(); commandExecutor.setLogger( logger ); commandExecutor.executeCommand( getExecutable(), getCommands(), getExecutionPath(), failOnErrorOutput() ); + } + + public Vendor getVendor() + { + return compilerContext.getCompilerCapability().getVendor(); } } Modified: 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=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/CSharpCompilerForProfile.java (original) +++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/CSharpCompilerForProfile.java Sat May 19 00:47:30 2007 @@ -34,7 +34,6 @@ public final class CSharpCompilerForProfile extends BaseCompiler { - private NetExecutable netCompiler; private CompilerContext compilerContext; Modified: 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=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java (original) +++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java Sat May 19 00:47:30 2007 @@ -57,7 +57,7 @@ String sourceDirectory = compilerContext.getSourceDirectoryName(); String artifactFilePath = compilerContext.getArtifact().getAbsolutePath(); - String targetArtifactType = config.getArtifactType().getArtifactTypeName(); + String targetArtifactType = config.getArtifactType().getTargetCompileType(); compilerContext.getCompilerRequirement().getFrameworkVersion(); @@ -144,6 +144,7 @@ { commands.add( "/reference:System.Drawing" ); commands.add( "/reference:System.Windows.Forms" ); + commands.add( "/reference:System.Web.Services" ); } CommandFilter filter = compilerContext.getCommandFilter(); return filter.filter( commands ); Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DotGNUCompiler.java URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DotGNUCompiler.java?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DotGNUCompiler.java (original) +++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DotGNUCompiler.java Sat May 19 00:47:30 2007 @@ -36,7 +36,6 @@ public final class DotGNUCompiler extends BaseCompiler { - public boolean failOnErrorOutput() { return true; @@ -55,7 +54,7 @@ String sourceDirectory = compilerContext.getSourceDirectoryName(); String artifactFilePath = compilerContext.getArtifact().getAbsolutePath(); - String targetArtifactType = config.getArtifactType().getArtifactTypeName(); + String targetArtifactType = config.getArtifactType().getTargetCompileType(); List commands = new ArrayList(); commands.add( "/out:" + artifactFilePath ); Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/NemerleCompiler.java URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/NemerleCompiler.java?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/NemerleCompiler.java (original) +++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/NemerleCompiler.java Sat May 19 00:47:30 2007 @@ -51,7 +51,7 @@ String sourceDirectory = compilerContext.getSourceDirectoryName(); String artifactFilePath = compilerContext.getArtifact().getAbsolutePath(); - String targetArtifactType = config.getArtifactType().getArtifactTypeName(); + String targetArtifactType = config.getArtifactType().getTargetCompileType(); List commands = new ArrayList(); commands.add( "/out:" + artifactFilePath ); Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/PhpCompiler.java URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/PhpCompiler.java?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/PhpCompiler.java (original) +++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/PhpCompiler.java Sat May 19 00:47:30 2007 @@ -48,7 +48,7 @@ String sourceDirectory = compilerContext.getSourceDirectoryName(); String artifactFilePath = compilerContext.getArtifact().getAbsolutePath(); - String targetArtifactType = config.getArtifactType().getArtifactTypeName(); + String targetArtifactType = config.getArtifactType().getTargetCompileType(); List commands = new ArrayList(); commands.add( "/out:" + artifactFilePath ); Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/RubyCompiler.java URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/RubyCompiler.java?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/RubyCompiler.java (original) +++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/RubyCompiler.java Sat May 19 00:47:30 2007 @@ -1,3 +1,21 @@ +/* + * 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.ExecutionException; @@ -8,6 +26,12 @@ import java.util.ArrayList; import java.io.File; +/** + * Compiles ruby classes. + * + * @author Shane Isbell + */ +//TODO: Partial implementation public final class RubyCompiler extends BaseCompiler { Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/package.html URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/package.html?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/package.html (original) +++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/package.html Sat May 19 00:47:30 2007 @@ -4,20 +4,23 @@ Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CapabilityMatcherImpl.java URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CapabilityMatcherImpl.java?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CapabilityMatcherImpl.java (original) +++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CapabilityMatcherImpl.java Sat May 19 00:47:30 2007 @@ -37,6 +37,9 @@ public class CapabilityMatcherImpl implements CapabilityMatcher, LogEnabled { + /** + * A logger for writing log messages + */ private Logger logger; private RepositoryRegistry repositoryRegistry; Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java (original) +++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java Sat May 19 00:47:30 2007 @@ -41,12 +41,16 @@ import java.io.File; /** + * Provides an implementation of the Compiler Context. + * * @author Shane Isbell */ public final class CompilerContextImpl implements CompilerContext, LogEnabled { - + /** + * The maven project + */ private MavenProject project; private CompilerConfig config; @@ -67,6 +71,9 @@ private RepositoryRegistry repositoryRegistry; + /** + * A logger for writing log messages + */ private Logger logger; private List linkedResources; @@ -136,7 +143,7 @@ } if ( config.isTestCompile() && - project.getArtifact().getType().equals( ArtifactType.MODULE.getArtifactTypeName() ) && + project.getArtifact().getType().equals( ArtifactType.MODULE.getPackagingType() ) && project.getArtifact().getFile() != null && project.getArtifact().getFile().exists() ) { artifacts.add( project.getArtifact() ); @@ -159,9 +166,10 @@ public List getLibraryDependencies() { - if ( config.isTestCompile() && config.getArtifactType().equals( ArtifactType.LIBRARY ) && - project.getArtifact().getFile() != null && project.getArtifact().getFile().exists() && - !libraries.contains( project.getArtifact() ) && !project.getArtifact().getType().equals( "module" ) ) + if ( config.isTestCompile() && ( config.getArtifactType().equals( ArtifactType.LIBRARY ) || + config.getArtifactType().equals( ArtifactType.NETPLUGIN )) && project.getArtifact().getFile() != null && + project.getArtifact().getFile().exists() && !libraries.contains( project.getArtifact() ) && + !project.getArtifact().getType().equals( "module" ) ) { libraries.add( project.getArtifact() ); } @@ -224,11 +232,6 @@ } - public MavenProject getMavenProject() - { - return project; - } - public Repository find( String repositoryName ) throws RepositoryNotFoundException { @@ -241,6 +244,45 @@ return repository; } + private String getGacRootForMono() + throws PlatformUnsupportedException { + String path = System.getenv( "PATH"); + if(path != null) + { + String[] tokens = path.split( System.getProperty( "path.separator") ); + for(String token : tokens) + { + File gacRoot = new File(new File(token).getParentFile(), "lib/mono/gac/"); + if(gacRoot.exists()) + { + return gacRoot.getAbsolutePath(); + } + } + } + //check settings file + + + String monoRoot = System.getenv( "MONO_ROOT"); + if(monoRoot != null && !new File(monoRoot).exists()) + { + logger.warn( "MONO_ROOT has been incorrectly set. Trying /usr : MONO_ROOT = " + monoRoot); + } + else if(monoRoot != null) + { + return (!monoRoot.endsWith( File.separator)) ? monoRoot + File.separator : monoRoot; + } + + if(new File("/usr/lib/mono/gac/").exists()) + { + return new File("/usr/lib/mono/gac/").getAbsolutePath(); + } + else + { + throw new PlatformUnsupportedException( + "NMAVEN-061-008: Could not locate Global Assembly Cache for Mono. Try setting the MONO_ROOT environmental variable."); + } + } + public void init( CompilerRequirement compilerRequirement, CompilerConfig config, MavenProject project, CapabilityMatcher capabilityMatcher ) throws PlatformUnsupportedException @@ -251,7 +293,7 @@ this.compilerRequirement = compilerRequirement; libraries = new ArrayList(); modules = new ArrayList(); - artifactContext.init( project, config.getLocalRepository() ); + artifactContext.init( project, project.getRemoteArtifactRepositories(), config.getLocalRepository() ); Set artifacts = project.getDependencyArtifacts();//Can add WFC deps prior for ( Artifact artifact : artifacts ) @@ -261,13 +303,12 @@ { modules.add( artifact ); } - else if ( type.equals( "library" ) ) + else if ( type.equals( "library" ) || type.equals( "exe" ) ) { libraries.add( artifact ); } //Resolving here since the GAC path is vendor and framework aware - //TODO: Add support for 32/64 bit GACs - else if ( type.equals( "gac" ) ) + else if ( type.equals( "gac_generic" ) ) { String gacRoot = null; if ( compilerRequirement.getVendor().equals( Vendor.MICROSOFT ) && ( @@ -283,21 +324,35 @@ } else if ( compilerRequirement.getVendor().equals( Vendor.MONO ) ) { - //TODO: MONO Support + gacRoot = getGacRootForMono(); } if ( gacRoot != null ) { - File gacFile = new File( gacRoot + artifact.getArtifactId() + File.separator + - artifact.getVersion() + File.separator + artifact.getArtifactId() + ".dll" ); - if ( !gacFile.exists() ) - { - throw new PlatformUnsupportedException( - "NMAVEN-000-000: Could not find GAC dependency: File = " + gacFile.getAbsolutePath() ); - } - artifact.setFile( gacFile ); + setArtifactGacFile( gacRoot, artifact ); libraries.add( artifact ); } } + else if ( type.equals( "gac" ) ) + { + String gacRoot = (compilerRequirement.getVendor().equals( Vendor.MONO )) ? + getGacRootForMono() : "C:\\WINDOWS\\assembly\\GAC\\"; + setArtifactGacFile( gacRoot, artifact ); + libraries.add( artifact ); + } + else if ( type.equals( "gac_32" ) ) + { + String gacRoot = (compilerRequirement.getVendor().equals( Vendor.MONO )) ? + getGacRootForMono() : "C:\\WINDOWS\\assembly\\GAC_32\\"; + setArtifactGacFile( gacRoot, artifact ); + libraries.add( artifact ); + } + else if ( type.equals( "gac_msil" ) ) + { + String gacRoot = (compilerRequirement.getVendor().equals( Vendor.MONO )) ? + getGacRootForMono() : "C:\\WINDOWS\\assembly\\GAC_MSIL\\"; + setArtifactGacFile( gacRoot, artifact ); + libraries.add( artifact ); + } } compilerCapability = capabilityMatcher.matchCompilerCapabilityFor( compilerRequirement ); @@ -349,5 +404,18 @@ win32icon = icons[0]; } } + } + + private void setArtifactGacFile( String gacRoot, Artifact artifact ) + throws PlatformUnsupportedException + { + File gacFile = new File( gacRoot, artifact.getArtifactId() + File.separator + artifact.getVersion() + File + .separator + artifact.getArtifactId() + ".dll" ); + if ( !gacFile.exists() ) + { + throw new PlatformUnsupportedException( + "NMAVEN-000-000: Could not find GAC dependency: File = " + gacFile.getAbsolutePath() ); + } + artifact.setFile( gacFile ); } } Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerPluginsRepository.java URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerPluginsRepository.java?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerPluginsRepository.java (original) +++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerPluginsRepository.java Sat May 19 00:47:30 2007 @@ -38,7 +38,6 @@ import org.apache.maven.dotnet.model.compiler.plugins.Platform; import org.apache.maven.dotnet.model.compiler.plugins.CommandFilter; - /** * Repository for reading and providing access to the compiler-plugins.xml config file. * @@ -47,9 +46,15 @@ public final class CompilerPluginsRepository implements Repository { - + /** + * List of compiler plugins pulled from the + * compiler-plugins.xml file. + */ private List compilerPlugins; + /** + * @see Repository#load(java.io.InputStream, java.util.Hashtable) + */ public void load( InputStream inputStream, Hashtable properties ) throws IOException { @@ -68,6 +73,9 @@ compilerPlugins = plugins.getCompilerPlugins(); } + /** + * @see Repository#setRepositoryRegistry(org.apache.maven.dotnet.registry.RepositoryRegistry) + */ public void setRepositoryRegistry( RepositoryRegistry repositoryRegistry ) { } Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/DefaultNetExecutable.java URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/DefaultNetExecutable.java?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/DefaultNetExecutable.java (original) +++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/DefaultNetExecutable.java Sat May 19 00:47:30 2007 @@ -21,23 +21,26 @@ import org.apache.maven.dotnet.executable.ExecutionException; import org.apache.maven.dotnet.executable.*; import org.apache.maven.dotnet.NMavenContext; -import org.apache.maven.project.MavenProject; +import org.apache.maven.dotnet.vendor.Vendor; import org.codehaus.plexus.logging.Logger; import java.util.List; import java.io.File; /** + * Provides the default implementation of the net executable. + * * @author Shane Isbell */ public class DefaultNetExecutable implements NetExecutable { - private ExecutableContext executableContext; - - private MavenProject project; + protected ExecutableContext executableContext; + /** + * A logger for writing log messages + */ private Logger logger; public List getCommands() @@ -63,10 +66,10 @@ { for ( String executablePath : executablePaths ) { - File exe = new File( executablePath + File.separator + executable); + File exe = new File( executablePath + File.separator + executable ); if ( exe.exists() ) { - return new File(executablePath); + return new File( executablePath ); } } } @@ -86,11 +89,13 @@ } catch ( ExecutionException e ) { - throw new ExecutionException( "NMAVEN-063-000: Command = " + commands, e ); + throw new ExecutionException( "NMAVEN-070-000: Execution Path = " + + ( ( getExecutionPath() != null ) ? getExecutionPath().getAbsolutePath() : "unknown" ) + ", Command = " + + commands, e ); } if ( commandExecutor.getStandardOut().contains( "error" ) ) { - throw new ExecutionException( "NMAVEN-063-001: Command = " + commands ); + throw new ExecutionException( "NMAVEN-070-001: Command = " + commands ); } } @@ -99,15 +104,19 @@ { if ( executableContext == null ) { - throw new ExecutionException( "NMAVEN-063-002: Executable has not been initialized with a context" ); + throw new ExecutionException( "NMAVEN-070-002: Executable has not been initialized with a context" ); } return executableContext.getExecutableCapability().getExecutable(); } + public Vendor getVendor() + { + return executableContext.getExecutableCapability().getVendor(); + } + public void init( NMavenContext nmavenContext ) { this.executableContext = (ExecutableContext) nmavenContext; - this.project = executableContext.getMavenProject(); this.logger = executableContext.getLogger(); } } Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/DefaultRepositoryNetExecutable.java URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/DefaultRepositoryNetExecutable.java?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/DefaultRepositoryNetExecutable.java (original) +++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/DefaultRepositoryNetExecutable.java Sat May 19 00:47:30 2007 @@ -22,7 +22,7 @@ import org.apache.maven.dotnet.executable.CommandExecutor; import org.apache.maven.dotnet.executable.*; import org.apache.maven.dotnet.NMavenContext; -import org.apache.maven.project.MavenProject; +import org.apache.maven.dotnet.vendor.Vendor; import org.codehaus.plexus.logging.Logger; import java.util.List; @@ -37,8 +37,9 @@ private RepositoryExecutableContext executableContext; - private MavenProject project; - + /** + * A logger for writing log messages + */ private Logger logger; public List getCommands() @@ -82,8 +83,9 @@ } catch ( ExecutionException e ) { - throw new ExecutionException( "NMAVEN-063-000: Executable = " + getExecutable() + ", Command = " + commands, - e ); + throw new ExecutionException( "NMAVEN-063-000: Execution Path = " + + ( ( getExecutionPath() != null ) ? getExecutionPath().getAbsolutePath() : "unknown" ) + ", Command = " + + commands, e ); } if ( commandExecutor.getStandardOut().contains( "error" ) ) { @@ -107,24 +109,35 @@ for ( String executablePath : executablePaths ) { File exe = new File( executablePath ); + logger.debug("NMAVEN-063-004: Checking executable path = " + exe.getAbsolutePath()); if ( exe.exists() ) { return new File( executablePath ).getName(); } - else if(executablePath.equals( "mono")) + else if ( executablePath.equals( "mono" ) ) { - return executablePath; + return executablePath; } } } - throw new ExecutionException( "NMAVEN-063-003: Executable path has not been set" ); + throw new ExecutionException( "NMAVEN-063-003: Executable path has not been set or is invalid" ); } + public Vendor getVendor() + { + try + { + return executableContext.getNetExecutable().getVendor(); + } + catch ( ExecutionException e ) + { + return Vendor.NULL; + } + } public void init( NMavenContext nmavenContext ) { this.executableContext = (RepositoryExecutableContext) nmavenContext; - this.project = executableContext.getMavenProject(); this.logger = executableContext.getLogger(); } } Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/ExecutableContextImpl.java URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/ExecutableContextImpl.java?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/ExecutableContextImpl.java (original) +++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/ExecutableContextImpl.java Sat May 19 00:47:30 2007 @@ -19,7 +19,6 @@ package org.apache.maven.dotnet.executable.impl; import org.apache.maven.dotnet.executable.*; -import org.apache.maven.project.MavenProject; import org.apache.maven.dotnet.registry.Repository; import org.apache.maven.dotnet.registry.RepositoryRegistry; import org.apache.maven.dotnet.PlatformUnsupportedException; @@ -28,6 +27,7 @@ import org.codehaus.plexus.logging.LogEnabled; /** + * Provides an implementation of the executable context. * * @author Shane Isbell */ @@ -35,8 +35,6 @@ implements ExecutableContext, LogEnabled { - private MavenProject project; - private ExecutableRequirement executableRequirement; private RepositoryRegistry repositoryRegistry; @@ -49,6 +47,9 @@ private ExecutableConfig executableConfig; + /** + * A logger for writing log messages + */ private Logger logger; public void enableLogging( Logger logger ) @@ -82,11 +83,6 @@ return netExecutable; } - public MavenProject getMavenProject() - { - return project; - } - public CommandFilter getCommandFilter() { return commandFilter; @@ -105,11 +101,9 @@ } public void init( ExecutableRequirement executableRequirement, ExecutableConfig executableConfig, - MavenProject project, CapabilityMatcher capabilityMatcher ) + CapabilityMatcher capabilityMatcher ) throws PlatformUnsupportedException { - - this.project = project; this.executableRequirement = executableRequirement; this.executableConfig = executableConfig; Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/ExecutablePluginsRepository.java URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/ExecutablePluginsRepository.java?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/ExecutablePluginsRepository.java (original) +++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/ExecutablePluginsRepository.java Sat May 19 00:47:30 2007 @@ -38,12 +38,17 @@ import org.apache.maven.dotnet.vendor.Vendor; /** + * Provides services for accessing the executable information within the executable-plugins.xml file. + * * @author Shane Isbell */ public final class ExecutablePluginsRepository implements Repository { + /** + * A list of executable capabilities as specified within the executable-plugins.xml file + */ private List executablePlugins; /** @@ -75,6 +80,11 @@ { } + /** + * Returns a list of executable capabilities as specified within the executable-plugins.xml file. + * + * @return a list of executable capabilities as specified within the executable-plugins.xml file + */ List getCapabilities() { List platformCapabilities = new ArrayList(); Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/NetExecutableFactoryImpl.java URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/NetExecutableFactoryImpl.java?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/NetExecutableFactoryImpl.java (original) +++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/NetExecutableFactoryImpl.java Sat May 19 00:47:30 2007 @@ -49,6 +49,9 @@ implements NetExecutableFactory, LogEnabled { + /** + * The capability matcher + */ private CapabilityMatcher capabilityMatcher; private ArtifactContext artifactContext; @@ -65,15 +68,22 @@ private StateMachineProcessor processor; + /** + * A logger for writing log messages + */ private Logger logger; + /** + * @see LogEnabled#enableLogging(org.codehaus.plexus.logging.Logger) + */ public void enableLogging( Logger logger ) { this.logger = logger; } /** - * @see + * @see NetExecutableFactory#getCompilerExecutableFor(org.apache.maven.dotnet.executable.compiler.CompilerRequirement, + * org.apache.maven.dotnet.executable.compiler.CompilerConfig, org.apache.maven.project.MavenProject, java.io.File) */ public CompilerExecutable getCompilerExecutableFor( CompilerRequirement compilerRequirement, CompilerConfig compilerConfig, MavenProject project, @@ -94,9 +104,9 @@ throw new PlatformUnsupportedException( "NMAVEN-066-011: Illegal State: Vendor Info = " + vendorInfo, e ); } - if ( vendorInfo.getVendor() == null ) + if ( vendorInfo.getVendor() == null || vendorInfo.getFrameworkVersion() == null ) { - throw new PlatformUnsupportedException( "NMAVEN-066-012: Vendor could not be found: " + vendorInfo ); + throw new PlatformUnsupportedException( "NMAVEN-066-012: Missing Vendor Information: " + vendorInfo ); } logger.info( "NMAVEN-066-013: Found Vendor = " + vendorInfo ); @@ -141,8 +151,7 @@ if ( artifact != null ) { AssemblyRepositoryLayout layout = new AssemblyRepositoryLayout(); - File artifactPath = new File( compilerConfig.getLocalRepository().getAbsolutePath() + File.separator + - layout.pathOf( artifact ) ); + File artifactPath = new File( compilerConfig.getLocalRepository(), layout.pathOf( artifact ) ); executionPaths.add( artifactPath.getParentFile().getAbsolutePath() ); } } @@ -157,11 +166,82 @@ } } + /** + * @see NetExecutableFactory#getPluginLoaderFor(String,String,org.apache.maven.dotnet.vendor.VendorInfo,String,java.io.File,String) + */ + public NetExecutable getPluginLoaderFor( String groupId, String artifactId, VendorInfo vendorInfo, + String localRepository, File parameterFile, String mojoName ) + throws PlatformUnsupportedException + { + List artifacts = artifactContext.getArtifactsFor( groupId, artifactId, null, null ); + if ( artifacts.size() == 0 ) + { + throw new PlatformUnsupportedException( + "NMAVEN-066-023: Could not locate the plugin - missing entry in the net-dependencies.xml file: GroupId = " + + groupId + ", ArtifactId = " + artifactId ); + } + + Artifact artifact = artifacts.get( 0 ); + if ( artifact == null ) + { + throw new PlatformUnsupportedException( + "NMAVEN-066-021: Could not locate the plugin: GroupId = " + groupId + ", ArtifactId = " + artifactId ); + } + + AssemblyRepositoryLayout layout = new AssemblyRepositoryLayout(); + File artifactPath = new File( localRepository + File.separator + layout.pathOf( artifact ) ); + List commands = new ArrayList(); + commands.add( "parameterFile=" + parameterFile.getAbsolutePath() ); + commands.add( "assemblyFile=" + artifactPath.getAbsolutePath() ); + commands.add( "mojoName=" + mojoName );//ArtifactId = namespace + + Artifact pluginLoaderArtifact = + artifactContext.getArtifactsFor( "NMaven.Plugin", "NMaven.Plugin.Loader", null, null ).get( 0 ); + artifactPath = new File( localRepository + File.separator + layout.pathOf( pluginLoaderArtifact ) ); + commands.add( "startProcessAssembly=" + artifactPath.getAbsolutePath() ); + + return getNetExecutableFromRepository( "NMaven.Plugin", "NMaven.Plugin.Runner", vendorInfo, + new File( localRepository ), commands, false ); + } + + /** + * @see NetExecutableFactory#getNetExecutableFromRepository(String, String, org.apache.maven.dotnet.vendor.VendorInfo, String, java.util.List, boolean) + */ public NetExecutable getNetExecutableFromRepository( String groupId, String artifactId, VendorInfo vendorInfo, - MavenProject project, String localRepository, - List commands ) + File localRepository, List commands, + boolean isIsolatedAppDomain ) throws PlatformUnsupportedException { + if ( isIsolatedAppDomain ) + { + List artifacts = artifactContext.getArtifactsFor( groupId, artifactId, null, null ); + if ( artifacts.size() == 0 ) + { + throw new PlatformUnsupportedException( + "NMAVEN-066-024: Could not locate the executable - missing entry in the net-dependencies.xml file: GroupId = " + + groupId + ", ArtifactId = " + artifactId ); + } + + Artifact artifact = artifacts.get( 0 ); + if ( artifact == null ) + { + throw new PlatformUnsupportedException( "NMAVEN-066-025: Could not locate the executable: GroupId = " + + groupId + ", ArtifactId = " + artifactId ); + } + + AssemblyRepositoryLayout layout = new AssemblyRepositoryLayout(); + File artifactPath = new File( localRepository + File.separator + layout.pathOf( artifact ) ); + commands.add( "startProcessAssembly=" + artifactPath.getAbsolutePath() ); + + String pluginArtifactPath = new File( localRepository + File.separator + layout.pathOf( + artifactContext.getArtifactsFor( "NMaven.Plugin", "NMaven.Plugin", null, null ).get( + 0 ) ) ).getAbsolutePath(); + + commands.add( "pluginArtifactPath=" + pluginArtifactPath ); + return getNetExecutableFromRepository( "NMaven.Plugin", "NMaven.Plugin.Runner", vendorInfo, localRepository, + commands, false ); + } + if ( commands == null ) { commands = new ArrayList(); @@ -175,7 +255,20 @@ { throw new PlatformUnsupportedException( "NMAVEN-066-010: Illegal State: Vendor Info = " + vendorInfo, e ); } - Artifact artifact = artifactContext.getArtifactsFor( groupId, artifactId, null, null ).get( 0 ); + + if ( vendorInfo.getVendor() == null || vendorInfo.getFrameworkVersion() == null ) + { + throw new PlatformUnsupportedException( "NMAVEN-066-020: Missing Vendor Information: " + vendorInfo ); + } + List artifacts = artifactContext.getArtifactsFor( groupId, artifactId, null, null ); + if ( artifacts.size() == 0 ) + { + throw new PlatformUnsupportedException( + "NMAVEN-066-022: Could not locate the executable- missing entry in the net-dependencies.xml: GroupId = " + + groupId + ", ArtifactId = " + artifactId ); + } + Artifact artifact = artifacts.get( 0 ); + logger.debug( "NMAVEN-066-003: Found Vendor: " + vendorInfo ); AssemblyRepositoryLayout layout = new AssemblyRepositoryLayout(); @@ -189,9 +282,10 @@ { for ( File executablePath : executablePaths ) { - if ( new File( executablePath.getAbsolutePath() + File.separator + "mono.exe" ).exists() ) + if ( new File( executablePath.getAbsolutePath(), "mono.exe" ).exists() ) { - exe = new File( executablePath.getAbsolutePath() + File.separator + "mono" ).getAbsolutePath(); + exe = new File( executablePath.getAbsolutePath(), "mono.exe" ).getAbsolutePath(); + commands.add( "vendor=MONO");//if forked process, it needs to know. break; } } @@ -203,6 +297,7 @@ "NMAVEN-066-005: Executable path for mono does not exist. Will attempt to execute MONO using" + " the main PATH variable." ); exe = "mono"; + commands.add( "vendor=MONO");//if forked process, it needs to know. } modifiedCommands.add( artifactPath.getAbsolutePath() ); for ( String command : commands ) @@ -222,7 +317,7 @@ try { - repositoryExecutableContext.init( executableConfig, project ); + repositoryExecutableContext.init( executableConfig ); } catch ( InitializationException e ) { @@ -238,11 +333,60 @@ { throw new PlatformUnsupportedException( "NMAVEN-066-004: Unable to find net executable", e ); } + } + + public NetExecutable getJavaExecutableFromRepository( VendorInfo vendorInfo, List commands ) + throws PlatformUnsupportedException + { + + if ( commands == null ) + { + commands = new ArrayList(); + } + + try + { + processor.process( vendorInfo ); + } + catch ( IllegalStateException e ) + { + throw new PlatformUnsupportedException( "NMAVEN-066-010: Illegal State: Vendor Info = " + vendorInfo, e ); + } + + if ( vendorInfo.getVendor() == null || vendorInfo.getFrameworkVersion() == null || + vendorInfo.getVendorVersion() == null ) + { + throw new PlatformUnsupportedException( "NMAVEN-066-018: Missing Vendor Information: " + vendorInfo ); + } + + ExecutableRequirement executableRequirement = + ExecutableRequirement.Factory.createDefaultExecutableRequirement(); + executableRequirement.setVendor( vendorInfo.getVendor() ); + executableRequirement.setFrameworkVersion( vendorInfo.getFrameworkVersion() ); + executableRequirement.setVendorVersion( vendorInfo.getVendorVersion() ); + executableRequirement.setProfile( "dotnet-jetty:start" );//TODO: Remove hard-coded value + ExecutableConfig executableConfig = ExecutableConfig.Factory.createDefaultExecutableConfig(); + executableConfig.setCommands( commands ); + + executableConfig.setExecutionPaths( new ArrayList() ); + executableContext.init( executableRequirement, executableConfig, capabilityMatcher ); + + try + { + return executableContext.getNetExecutable(); + } + catch ( ExecutionException e ) + { + throw new PlatformUnsupportedException( "NMAVEN-066-001: Unable to find net executable", e ); + } } + /** + * @see NetExecutableFactory + */ public NetExecutable getNetExecutableFor( String vendor, String frameworkVersion, String profile, - MavenProject project, List commands, File netHome ) + List commands, File netHome ) throws PlatformUnsupportedException { @@ -262,6 +406,12 @@ { throw new PlatformUnsupportedException( "NMAVEN-066-010: Illegal State: Vendor Info = " + vendorInfo, e ); } + + if ( vendorInfo.getVendor() == null || vendorInfo.getFrameworkVersion() == null ) + { + throw new PlatformUnsupportedException( "NMAVEN-066-019: Missing Vendor Information: " + vendorInfo ); + } + logger.debug( "NMAVEN-066-003: Found Vendor: " + vendorInfo ); ExecutableRequirement executableRequirement = ExecutableRequirement.Factory.createDefaultExecutableRequirement(); @@ -277,7 +427,7 @@ : executableConfig.getExecutionPaths(); if ( netHome != null && netHome.exists() ) { - logger.info( "NMAVEN-066-014: Found executable path: Path = " + netHome.getAbsolutePath() ); + logger.info( "NMAVEN-066-014: Found executable path from pom: Path = " + netHome.getAbsolutePath() ); executablePaths.add( netHome.getAbsolutePath() ); } else if ( vendorInfo.getExecutablePaths() != null ) @@ -286,7 +436,7 @@ { if ( path.exists() ) { - logger.info( "NMAVEN-066-015: Found executable path: Path = " + path.getAbsolutePath() ); + logger.debug( "NMAVEN-066-015: Found executable path: Path = " + path.getAbsolutePath() ); executablePaths.add( path.getAbsolutePath() ); } } @@ -296,7 +446,7 @@ logger.info( "NMAVEN-066-016: Did not find executable path, will try system path" ); } executableConfig.setExecutionPaths( executablePaths ); - executableContext.init( executableRequirement, executableConfig, project, capabilityMatcher ); + executableContext.init( executableRequirement, executableConfig, capabilityMatcher ); try { Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/RepositoryExecutableContextImpl.java URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/RepositoryExecutableContextImpl.java?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/RepositoryExecutableContextImpl.java (original) +++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/RepositoryExecutableContextImpl.java Sat May 19 00:47:30 2007 @@ -24,11 +24,11 @@ import org.apache.maven.dotnet.InitializationException; import org.codehaus.plexus.logging.LogEnabled; import org.codehaus.plexus.logging.Logger; -import org.apache.maven.project.MavenProject; import org.apache.maven.dotnet.registry.RepositoryRegistry; import org.apache.maven.dotnet.registry.Repository; /** + * Provides an implementation of the repository executable context. * * @author Shane Isbell */ @@ -36,16 +36,20 @@ implements RepositoryExecutableContext, LogEnabled { - private MavenProject project; - private RepositoryRegistry repositoryRegistry; private NetExecutable netExecutable; private ExecutableConfig executableConfig; + /** + * A logger for writing log messages + */ private Logger logger; + /** + * @see LogEnabled#enableLogging(org.codehaus.plexus.logging.Logger) + */ public void enableLogging( Logger logger ) { this.logger = logger; @@ -67,11 +71,6 @@ return netExecutable; } - public MavenProject getMavenProject() - { - return project; - } - public Repository find( String repositoryName ) throws RepositoryNotFoundException { @@ -84,11 +83,10 @@ return repository; } - public void init( ExecutableConfig executableConfig, MavenProject project ) + public void init( ExecutableConfig executableConfig ) throws InitializationException { this.executableConfig = executableConfig; - this.project = project; netExecutable = new DefaultRepositoryNetExecutable(); netExecutable.init( this ); } Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/ThreadedNetExecutable.java URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/ThreadedNetExecutable.java?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/ThreadedNetExecutable.java (original) +++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/ThreadedNetExecutable.java Sat May 19 00:47:30 2007 @@ -1,3 +1,21 @@ +/* + * 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.impl; import org.apache.maven.dotnet.executable.NetExecutable; @@ -6,20 +24,26 @@ import org.apache.maven.dotnet.executable.CommandFilter; import org.apache.maven.dotnet.executable.CommandExecutor; import org.apache.maven.dotnet.NMavenContext; -import org.apache.maven.project.MavenProject; +import org.apache.maven.dotnet.vendor.Vendor; import org.codehaus.plexus.logging.Logger; import java.util.List; import java.io.File; - +/** + * Provides a service for executing a command within a separate thread. This will be used for executing long-running + * processes. + * + * @author Shane Isbell + */ public class ThreadedNetExecutable implements NetExecutable, Runnable { private ExecutableContext executableContext; - private MavenProject project; - + /** + * A logger for writing log messages + */ private Logger logger; public void run() @@ -89,11 +113,14 @@ return executableContext.getExecutableCapability().getExecutable(); } - + public Vendor getVendor() + { + return executableContext.getExecutableCapability().getVendor(); + } + public void init( NMavenContext nmavenContext ) { this.executableContext = (ExecutableContext) nmavenContext; - this.project = executableContext.getMavenProject(); this.logger = executableContext.getLogger(); } } Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/package.html URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/package.html?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/package.html (original) +++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/package.html Sat May 19 00:47:30 2007 @@ -4,20 +4,23 @@ Modified: incubator/nmaven/trunk/components/dotnet-model/assembly-plugins/pom.xml URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-model/assembly-plugins/pom.xml?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-model/assembly-plugins/pom.xml (original) +++ incubator/nmaven/trunk/components/dotnet-model/assembly-plugins/pom.xml Sat May 19 00:47:30 2007 @@ -1,3 +1,21 @@ + Modified: incubator/nmaven/trunk/components/dotnet-model/compiler-plugins/pom.xml URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-model/compiler-plugins/pom.xml?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-model/compiler-plugins/pom.xml (original) +++ incubator/nmaven/trunk/components/dotnet-model/compiler-plugins/pom.xml Sat May 19 00:47:30 2007 @@ -1,3 +1,21 @@ + Modified: incubator/nmaven/trunk/components/dotnet-model/entries/pom.xml URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-model/entries/pom.xml?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-model/entries/pom.xml (original) +++ incubator/nmaven/trunk/components/dotnet-model/entries/pom.xml Sat May 19 00:47:30 2007 @@ -1,3 +1,21 @@ + Modified: incubator/nmaven/trunk/components/dotnet-model/executable-plugins/pom.xml URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-model/executable-plugins/pom.xml?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-model/executable-plugins/pom.xml (original) +++ incubator/nmaven/trunk/components/dotnet-model/executable-plugins/pom.xml Sat May 19 00:47:30 2007 @@ -1,3 +1,21 @@ + Modified: incubator/nmaven/trunk/components/dotnet-model/netdependency/netdependency.mdo URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-model/netdependency/netdependency.mdo?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-model/netdependency/netdependency.mdo (original) +++ incubator/nmaven/trunk/components/dotnet-model/netdependency/netdependency.mdo Sat May 19 00:47:30 2007 @@ -62,6 +62,18 @@ String + + publicKeyToken + 1.0.0 + String + The public key of the assembly. + + + isGacInstall + 1.0.0 + boolean + True if the framework should install the net dependency in the GAC, otherwise false. + Modified: incubator/nmaven/trunk/components/dotnet-model/netdependency/pom.xml URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-model/netdependency/pom.xml?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-model/netdependency/pom.xml (original) +++ incubator/nmaven/trunk/components/dotnet-model/netdependency/pom.xml Sat May 19 00:47:30 2007 @@ -1,3 +1,21 @@ + Modified: incubator/nmaven/trunk/components/dotnet-model/pom.xml URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-model/pom.xml?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-model/pom.xml (original) +++ incubator/nmaven/trunk/components/dotnet-model/pom.xml Sat May 19 00:47:30 2007 @@ -1,22 +1,42 @@ - - - org.apache.maven.dotnet - 0.14-SNAPSHOT - dotnet-components - - 4.0.0 + + + org.apache.maven.dotnet - dotnet-model - pom 0.14-SNAPSHOT - dotnet-model + dotnet-components + + 4.0.0 + org.apache.maven.dotnet + dotnet-model + pom + 0.14-SNAPSHOT + dotnet-model - - assembly-plugins - compiler-plugins - executable-plugins - netdependency - settings - entries - + + assembly-plugins + compiler-plugins + executable-plugins + netdependency + configuration-appenders + settings + entries + Modified: incubator/nmaven/trunk/components/dotnet-model/settings/pom.xml URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-model/settings/pom.xml?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-model/settings/pom.xml (original) +++ incubator/nmaven/trunk/components/dotnet-model/settings/pom.xml Sat May 19 00:47:30 2007 @@ -1,3 +1,21 @@ + Modified: incubator/nmaven/trunk/components/dotnet-registry/pom.xml URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-registry/pom.xml?view=diff&rev=539709&r1=539708&r2=539709 ============================================================================== --- incubator/nmaven/trunk/components/dotnet-registry/pom.xml (original) +++ incubator/nmaven/trunk/components/dotnet-registry/pom.xml Sat May 19 00:47:30 2007 @@ -1,3 +1,21 @@ + @@ -11,15 +29,14 @@ jar 0.14-SNAPSHOT dotnet-registry - org.apache.maven maven-project - 2.0.4 + 2.1-SNAPSHOT - kxml2 + net.sf.kxml kxml2 2.1.8