incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r536993 - in /incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/maven/ src/main/java/org/apache/maven/dotnet/ src/main/j...
Date Thu, 10 May 2007 20:55:21 GMT
Author: sisbell
Date: Thu May 10 13:55:20 2007
New Revision: 536993

URL: http://svn.apache.org/viewvc?view=rev&rev=536993
Log:
Initial import of the visual studio installer.

Added:
    incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/
    incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/pom.xml   (with props)
    incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/
    incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/
    incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/java/
    incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/java/org/
    incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/java/org/apache/
    incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/java/org/apache/maven/
    incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/java/org/apache/maven/dotnet/
    incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/java/org/apache/maven/dotnet/plugin/
    incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/java/org/apache/maven/dotnet/plugin/vsinstaller/
    incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/java/org/apache/maven/dotnet/plugin/vsinstaller/VsInstallerMojo.java
  (with props)
    incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/resources/
    incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/resources/META-INF/
    incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/resources/META-INF/plexus/
    incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/resources/META-INF/plexus/components.xml
  (with props)
    incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/resources/template/
    incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/resources/template/NMaven.VisualStudio.AddIn

Added: incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/pom.xml?view=auto&rev=536993
==============================================================================
--- incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/pom.xml (added)
+++ incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/pom.xml Thu May 10 13:55:20
2007
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?><!--
+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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <groupId>org.apache.maven.dotnet.plugins</groupId>
+    <version>0.14-SNAPSHOT</version>
+    <artifactId>maven-dotnet-plugins</artifactId>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.dotnet.plugins</groupId>
+  <artifactId>maven-vsinstaller-plugin</artifactId>
+  <packaging>maven-plugin</packaging>
+  <version>0.14-SNAPSHOT</version>
+  <name>maven-vsinstaller-plugin</name>
+  <description>
+    Maven Plugin for .NET
+  </description>
+</project>
\ No newline at end of file

Propchange: incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/java/org/apache/maven/dotnet/plugin/vsinstaller/VsInstallerMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/java/org/apache/maven/dotnet/plugin/vsinstaller/VsInstallerMojo.java?view=auto&rev=536993
==============================================================================
--- incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/java/org/apache/maven/dotnet/plugin/vsinstaller/VsInstallerMojo.java
(added)
+++ incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/java/org/apache/maven/dotnet/plugin/vsinstaller/VsInstallerMojo.java
Thu May 10 13:55:20 2007
@@ -0,0 +1,202 @@
+package org.apache.maven.dotnet.plugin.vsinstaller;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
+import org.apache.maven.artifact.installer.ArtifactInstallationException;
+import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
+import org.apache.maven.artifact.handler.DefaultArtifactHandler;
+import org.apache.maven.artifact.handler.ArtifactHandler;
+import org.apache.maven.dotnet.artifact.ArtifactContext;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.IOUtil;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author Shane Isbell
+ * @goal install
+ * @requiresProject false
+ * @requiresDirectInvocation true
+ */
+public class VsInstallerMojo
+    extends AbstractMojo
+{
+
+    /**
+     * The maven project.
+     *
+     * @parameter expression="${project}"
+     * @required
+     */
+    private MavenProject project;
+
+    /**
+     * @parameter expression="${settings.localRepository}"
+     */
+    private String localRepository;
+
+    /**
+     * @component
+     */
+    private ArtifactContext artifactContext;
+
+    /**
+     * @component
+     */
+    private ArtifactHandlerManager artifactHandlerManager;
+
+    private ArtifactHandler createArtifactHandler(String packaging, String extension)
+    {
+        Handler handler = new Handler();
+        handler.setExtension(extension);
+        handler.setPackaging( packaging );
+        return handler;
+    }
+
+    public void execute()
+        throws MojoExecutionException, MojoFailureException
+    {
+        Map handlers = new HashMap();
+        handlers.put("library",createArtifactHandler("library", "dll"));
+        handlers.put("netplugin",createArtifactHandler("netplugin", "dll"));
+        artifactHandlerManager.addHandlers(handlers);
+
+        artifactContext.init( project, new File( localRepository ) );
+
+        try
+        {
+            artifactContext.getArtifactInstaller().resolveAndInstallNetDependenciesForProfile(
null,
+                                                                                        
      new ArrayList<Dependency>() );
+        }
+        catch ( ArtifactResolutionException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-1600-003: Unable to resolve assemblies",
e );
+        }
+        catch ( ArtifactNotFoundException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-1600-004: Unable to resolve assemblies",
e );
+        }
+        catch ( ArtifactInstallationException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-1600-005: Unable to resolve assemblies",
e );
+        }
+        String addin;
+        try
+        {
+            addin =
+                IOUtil.toString( VsInstallerMojo.class.getResourceAsStream( "/template/NMaven.VisualStudio.AddIn"
) );
+        }
+        catch ( IOException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-1600-003: Unable to resolve assemblies",
e );
+        }
+/*
+        FileOutputStream fos = null;
+        try
+        {
+            fos = new FileOutputStream("C:\\test.AddIn");
+            fos.write( addin.replaceAll( "${localRepository}", localRepository).getBytes());
+        }
+        catch ( IOException e )
+        {
+            e.printStackTrace();
+        }
+        finally {
+            try
+            {
+                if(fos != null) fos.close();
+            }
+            catch ( IOException e )
+            {
+                e.printStackTrace();
+            }
+        }
+        */
+    }
+
+    private class Handler
+        implements ArtifactHandler
+    {
+        private String extension, directory, classifier, packaging, language;
+
+        private boolean includesDependencies, addedToClasspath;
+
+        public void setExtension( String extension )
+        {
+            this.extension = extension;
+        }
+
+        public String getExtension()
+        {
+            return extension;
+        }
+
+        public void setDirectory( String directory )
+        {
+            this.directory = directory;
+        }
+
+        public String getDirectory()
+        {
+            return directory;
+        }
+
+        public void setClassifier( String classifier )
+        {
+            this.classifier = classifier;
+        }
+
+        public String getClassifier()
+        {
+            return classifier;
+        }
+
+        public void setPackaging( String packaging )
+        {
+            this.packaging = packaging;
+        }
+
+        public String getPackaging()
+        {
+            return packaging;
+        }
+
+        public void setIncludesDependencies( boolean includesDependencies )
+        {
+            this.includesDependencies = includesDependencies;
+        }
+
+        public boolean isIncludesDependencies()
+        {
+            return includesDependencies;
+        }
+
+        public void setLanguage( String language )
+        {
+            this.language = language;
+        }
+
+        public String getLanguage()
+        {
+            return language;
+        }
+
+        public void setAddedToClasspath( boolean addedToClasspath )
+        {
+            this.addedToClasspath = addedToClasspath;
+        }
+
+        public boolean isAddedToClasspath()
+        {
+            return addedToClasspath;
+        }
+    }
+}

Propchange: incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/java/org/apache/maven/dotnet/plugin/vsinstaller/VsInstallerMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/resources/META-INF/plexus/components.xml?view=auto&rev=536993
==============================================================================
--- incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/resources/META-INF/plexus/components.xml
(added)
+++ incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/resources/META-INF/plexus/components.xml
Thu May 10 13:55:20 2007
@@ -0,0 +1,102 @@
+<component-set>
+  <components>
+    <component>
+      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
+      <role-hint>module</role-hint>
+      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
+      <configuration>
+        <extension>netmodule</extension>
+        <type>module</type>
+      </configuration>
+    </component>
+    <component>
+      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
+      <role-hint>exe.config</role-hint>
+      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
+      <configuration>
+        <extension>exe.config</extension>
+        <type>exe.config</type>
+      </configuration>
+    </component>
+    <component>
+      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
+      <role-hint>library</role-hint>
+      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
+      <configuration>
+        <extension>dll</extension>
+        <type>library</type>
+      </configuration>
+    </component>
+    <component>
+      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
+      <role-hint>winexe</role-hint>
+      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
+      <configuration>
+        <extension>exe</extension>
+        <type>winexe</type>
+      </configuration>
+    </component>
+    <component>
+      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
+      <role-hint>gac</role-hint>
+      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
+      <configuration>
+        <extension>dll</extension>
+        <type>gac</type>
+      </configuration>
+    </component>
+    <component>
+      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
+      <role-hint>gac_generic</role-hint>
+      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
+      <configuration>
+        <extension>dll</extension>
+        <type>gac_generic</type>
+      </configuration>
+    </component>
+    <component>
+      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
+      <role-hint>gac_msil</role-hint>
+      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
+      <configuration>
+        <extension>dll</extension>
+        <type>gac_msil</type>
+      </configuration>
+    </component>
+    <component>
+      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
+      <role-hint>gac_32</role-hint>
+      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
+      <configuration>
+        <extension>dll</extension>
+        <type>gac_32</type>
+      </configuration>
+    </component>
+    <component>
+      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
+      <role-hint>nar</role-hint>
+      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
+      <configuration>
+        <type>nar</type>
+      </configuration>
+    </component>
+    <component>
+      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
+      <role-hint>netplugin</role-hint>
+      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
+      <configuration>
+        <extension>dll</extension>
+        <type>netplugin</type>
+      </configuration>
+    </component>
+    <component>
+      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
+      <role-hint>visual-studio-addin</role-hint>
+      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
+      <configuration>
+        <extension>dll</extension>
+        <type>visual-studio-addin</type>
+      </configuration>
+    </component>
+  </components>
+</component-set>
\ No newline at end of file

Propchange: incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/resources/META-INF/plexus/components.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/resources/template/NMaven.VisualStudio.AddIn
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/resources/template/NMaven.VisualStudio.AddIn?view=auto&rev=536993
==============================================================================
--- incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/resources/template/NMaven.VisualStudio.AddIn
(added)
+++ incubator/nmaven/branches/SI_XPT/plugins/maven-vsinstaller-plugin/src/main/resources/template/NMaven.VisualStudio.AddIn
Thu May 10 13:55:20 2007
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-16"?>
+<Extensibility xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/AutomationExtensibility">
+  <HostApplication>
+    <Name>Microsoft Visual Studio</Name>
+    <Version>8.0</Version>
+  </HostApplication>
+  <Addin>
+    <Assembly>${localRepository}\NMaven\VisualStudio\NMaven.VisualStudio.Addin\0.14\NMaven.VisualStudio.Addin.dll</Assembly>
+    <FullClassName>NMaven.VisualStudio.Addin.Connect</FullClassName>
+    <FriendlyName>NMaven.VisualStudio.Addin</FriendlyName>
+    <Description>NMaven provides Maven 2.x plugins to support building of .NET applications</Description>
+  </Addin>
+</Extensibility>
\ No newline at end of file



Mime
View raw message