From nmaven-commits-return-129-apmail-incubator-nmaven-commits-archive=incubator.apache.org@incubator.apache.org Sun Feb 18 23:39:45 2007 Return-Path: Delivered-To: apmail-incubator-nmaven-commits-archive@locus.apache.org Received: (qmail 31756 invoked from network); 18 Feb 2007 23:39:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Feb 2007 23:39:44 -0000 Received: (qmail 97581 invoked by uid 500); 18 Feb 2007 23:39:52 -0000 Delivered-To: apmail-incubator-nmaven-commits-archive@incubator.apache.org Received: (qmail 97564 invoked by uid 500); 18 Feb 2007 23:39:52 -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 97554 invoked by uid 99); 18 Feb 2007 23:39:52 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Feb 2007 15:39:52 -0800 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,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; Sun, 18 Feb 2007 15:39:43 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 0AB931A981A; Sun, 18 Feb 2007 15:39:23 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r509030 - in /incubator/nmaven/branches/SI_IDE: 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-executable/src/main... Date: Sun, 18 Feb 2007 23:39:22 -0000 To: nmaven-commits@incubator.apache.org From: sisbell@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070218233923.0AB931A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sisbell Date: Sun Feb 18 15:39:21 2007 New Revision: 509030 URL: http://svn.apache.org/viewvc?view=rev&rev=509030 Log: JIRA NMAVEN-5: This fix allows the adding of a GAC dependency within a build file. The only tricky part is that artifact resolution comes prior to NMaven becoming platform-aware. For GAC dependencies, NMaven waits until the construction of the CompilerContext to add the GAC file location to GAC artifacts. This fix only supports MS framework. For Mono/Linux may need to mandate use of nmaven-settings.xml file so we know the location of the GAC. Modified: incubator/nmaven/branches/SI_IDE/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/AssemblyRepositoryLayout.java incubator/nmaven/branches/SI_IDE/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactContextImpl.java incubator/nmaven/branches/SI_IDE/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/AssemblyResolverImpl.java incubator/nmaven/branches/SI_IDE/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/src/main/resources/META-INF/plexus/components.xml incubator/nmaven/branches/SI_IDE/plugins/pom-java-bootstrap.xml incubator/nmaven/branches/SI_IDE/plugins/pom.xml Modified: incubator/nmaven/branches/SI_IDE/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/AssemblyRepositoryLayout.java URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/AssemblyRepositoryLayout.java?view=diff&rev=509030&r1=509029&r2=509030 ============================================================================== --- incubator/nmaven/branches/SI_IDE/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/AssemblyRepositoryLayout.java (original) +++ incubator/nmaven/branches/SI_IDE/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/AssemblyRepositoryLayout.java Sun Feb 18 15:39:21 2007 @@ -104,7 +104,4 @@ */ public String pathOfRemoteRepositoryMetadata( ArtifactMetadata metadata ) { - System.out.println( "CALLING REMOTE : " + metadata.getRemoteFilename() ); - return ""; - } -} + C \ No newline at end of file Modified: incubator/nmaven/branches/SI_IDE/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactContextImpl.java URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactContextImpl.java?view=diff&rev=509030&r1=509029&r2=509030 ============================================================================== --- incubator/nmaven/branches/SI_IDE/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactContextImpl.java (original) +++ incubator/nmaven/branches/SI_IDE/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactContextImpl.java Sun Feb 18 15:39:21 2007 @@ -177,7 +177,7 @@ dependency.getVersion() ), dependency.getType(), dependency.getClassifier(), scope, null ); - depSet.add( art ); + if(!art.getType().equals( "gac")) depSet.add( art ); } try Modified: incubator/nmaven/branches/SI_IDE/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/AssemblyResolverImpl.java URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/AssemblyResolverImpl.java?view=diff&rev=509030&r1=509029&r2=509030 ============================================================================== --- incubator/nmaven/branches/SI_IDE/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/AssemblyResolverImpl.java (original) +++ incubator/nmaven/branches/SI_IDE/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/AssemblyResolverImpl.java Sun Feb 18 15:39:21 2007 @@ -103,6 +103,7 @@ sourceArtifact.addMetadata( meta ); Set artifactDependencies = new HashSet(); + Set gacDependencies = new HashSet(); for ( Dependency dependency : dependencies ) { String scope = ( dependency.getScope() == null ) ? Artifact.SCOPE_COMPILE : dependency.getScope(); @@ -112,7 +113,14 @@ dependency.getVersion() ), dependency.getType(), dependency.getClassifier(), scope, null ); - artifactDependencies.add( artifact ); + if ( artifact.getType().equals( "gac" ) ) + { + gacDependencies.add( artifact ); + } + else + { + artifactDependencies.add( artifact ); + } } ArtifactRepository localArtifactRepository = @@ -134,7 +142,9 @@ localArtifactRepository, metadata ); if ( addResolvedDependenciesToProject ) { - project.setDependencyArtifacts( result.getArtifacts() ); + Set resolvedDependencies = result.getArtifacts(); + resolvedDependencies.addAll( gacDependencies ); + project.setDependencyArtifacts( resolvedDependencies ); } } Modified: incubator/nmaven/branches/SI_IDE/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java?view=diff&rev=509030&r1=509029&r2=509030 ============================================================================== --- incubator/nmaven/branches/SI_IDE/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java (original) +++ incubator/nmaven/branches/SI_IDE/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java Sun Feb 18 15:39:21 2007 @@ -136,11 +136,15 @@ return artifacts; } - public KeyInfo getKeyInfo() { - if((compilerRequirement.getVendor().equals( Vendor.MICROSOFT ) - && compilerRequirement.getFrameworkVersion().equals("1.1.4322")) || config.getKeyInfo() == null) { + public KeyInfo getKeyInfo() + { + if ( ( compilerRequirement.getVendor().equals( Vendor.MICROSOFT ) && + compilerRequirement.getFrameworkVersion().equals( "1.1.4322" ) ) || config.getKeyInfo() == null ) + { return KeyInfo.Factory.createDefaultKeyInfo(); - } else { + } + else + { return config.getKeyInfo(); } } @@ -254,6 +258,41 @@ { 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" ) ) + { + String gacRoot = null; + if ( compilerRequirement.getVendor().equals( Vendor.MICROSOFT ) && ( + compilerRequirement.getFrameworkVersion().equals( "2.0.50727" ) || + compilerRequirement.getFrameworkVersion().equals( "3.0" ) ) ) + { + gacRoot = "C:\\WINDOWS\\assembly\\GAC_MSIL\\"; + } + else if ( compilerRequirement.getVendor().equals( Vendor.MICROSOFT ) && + compilerRequirement.getFrameworkVersion().equals( "1.1.4322" ) ) + { + gacRoot = "C:\\WINDOWS\\assembly\\GAC\\"; + } + else if ( compilerRequirement.getVendor().equals( Vendor.MONO ) ) + { + //TODO: MONO Support + } + 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 ); + libraries.add( artifact ); + } + } + + } compilerCapability = capabilityMatcher.matchCompilerCapabilityFor( compilerRequirement ); Modified: incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/src/main/resources/META-INF/plexus/components.xml URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/src/main/resources/META-INF/plexus/components.xml?view=diff&rev=509030&r1=509029&r2=509030 ============================================================================== --- incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/src/main/resources/META-INF/plexus/components.xml (original) +++ incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/src/main/resources/META-INF/plexus/components.xml Sun Feb 18 15:39:21 2007 @@ -196,6 +196,15 @@ org.apache.maven.artifact.handler.ArtifactHandler + gac + org.apache.maven.artifact.handler.DefaultArtifactHandler + + dll + gac + + + + org.apache.maven.artifact.handler.ArtifactHandler nar org.apache.maven.artifact.handler.DefaultArtifactHandler Modified: incubator/nmaven/branches/SI_IDE/plugins/pom-java-bootstrap.xml URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/pom-java-bootstrap.xml?view=diff&rev=509030&r1=509029&r2=509030 ============================================================================== --- incubator/nmaven/branches/SI_IDE/plugins/pom-java-bootstrap.xml (original) +++ incubator/nmaven/branches/SI_IDE/plugins/pom-java-bootstrap.xml Sun Feb 18 15:39:21 2007 @@ -1,50 +1,51 @@ - 4.0.0 - org.apache.maven.dotnet.plugins - maven-dotnet-plugins - pom - 0.14-SNAPSHOT - maven-dotnet-plugins - - maven-compile-plugin - maven-test-plugin - maven-webapp-plugin - maven-xsd-plugin - maven-wsdl-plugin - maven-install-plugin - maven-resgen-plugin - maven-resolver-plugin - maven-settings-plugin - + 4.0.0 + org.apache.maven.dotnet.plugins + maven-dotnet-plugins + pom + 0.14-SNAPSHOT + maven-dotnet-plugins + + maven-compile-plugin + maven-test-plugin + maven-webapp-plugin + maven-xsd-plugin + maven-wsdl-plugin + maven-install-plugin + maven-resgen-plugin + maven-resolver-plugin + maven-settings-plugin + maven-vstudio-plugin + - - - org.apache.maven.dotnet - dotnet-assembler - 0.14-SNAPSHOT - - - org.apache.maven.dotnet - dotnet-executable - 0.14-SNAPSHOT - - - org.apache.maven.dotnet - dotnet-artifact - 0.14-SNAPSHOT - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - - - - + + + org.apache.maven.dotnet + dotnet-assembler + 0.14-SNAPSHOT + + + org.apache.maven.dotnet + dotnet-executable + 0.14-SNAPSHOT + + + org.apache.maven.dotnet + dotnet-artifact + 0.14-SNAPSHOT + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.5 + 1.5 + + + + Modified: incubator/nmaven/branches/SI_IDE/plugins/pom.xml URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/pom.xml?view=diff&rev=509030&r1=509029&r2=509030 ============================================================================== --- incubator/nmaven/branches/SI_IDE/plugins/pom.xml (original) +++ incubator/nmaven/branches/SI_IDE/plugins/pom.xml Sun Feb 18 15:39:21 2007 @@ -18,6 +18,7 @@ maven-resgen-plugin maven-resolver-plugin maven-settings-plugin + maven-vstudio-plugin nmaven-utility-resx nmaven-utility-settings