Author: brett Date: Fri Aug 22 05:17:20 2014 New Revision: 1619666 URL: http://svn.apache.org/r1619666 Log: fix line endings
Modified: incubator/npanday/trunk/components/dotnet-core/src/main/java/npanday/LocalRepositoryUtil.java (props changed) incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/ExecutionResult.java (props changed) incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/DefaultNetExecutable.java incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/VersionComparer.java (props changed) incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/resolver/NPandayResolutionCache.java incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/resolver/resolvers/PdbAssemblyResolver.java incubator/npanday/trunk/components/dotnet-nuget/src/main/java/npanday/nuget/DotnetVersion.java (props changed) incubator/npanday/trunk/components/dotnet-nuget/src/main/java/npanday/nuget/NugetException.java (contents, props changed) incubator/npanday/trunk/components/dotnet-nuget/src/main/java/npanday/nuget/NugetInstallParameters.java (contents, props changed) incubator/npanday/trunk/components/dotnet-nuget/src/main/java/npanday/nuget/NugetInvoker.java (contents, props changed) incubator/npanday/trunk/components/dotnet-nuget/src/main/java/npanday/nuget/NugetSemanticVersion.java (props changed) incubator/npanday/trunk/components/dotnet-nuget/src/main/java/npanday/nuget/NugetVersionSpec.java (props changed) incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/LibImporterPathUtils.java (props changed) incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/deploy/AbstractDeployMojo.java (props changed) incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/deploy/DeployLibraries.java (contents, props changed) incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/generate/GeneratePackageArtifactsMojo.java (contents, props changed) incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/install/AbstractInstallMojo.java (props changed) incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/install/InstallLibraries.java (contents, props changed) incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/model/NugetPackage.java (props changed) incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/model/NugetPackageLibrary.java (props changed) incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/AbstractManifestInfoMojo.java (contents, props changed) incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/AbstractNugetMojo.java (contents, props changed) incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/ExtractNuspecFromPackagesMojo.java (contents, props changed) incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/GeneratePackageManifestInfosMojo.java (contents, props changed) incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/ResolvePackagesMojo.java (contents, props changed) incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/skeletons/AbstractHandleEachImportMojo.java (props changed) incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/skeletons/AbstractHandleEachLibraryMojo.java (props changed) incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/skeletons/AbstractLibraryImportsProvidingMojo.java (props changed) incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/skeletons/AbstractNPandayMojo.java (contents, props changed) incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/skeletons/AbstractNPandaySettingsAwareMojo.java (contents, props changed) incubator/npanday/trunk/plugins/maven-resolver-plugin/src/main/java/npanday/plugin/resolver/CopyDependenciesMojo.java (contents, props changed) incubator/npanday/trunk/plugins/maven-resolver-plugin/src/main/java/npanday/plugin/resolver/ListDependenciesMojo.java (contents, props changed) incubator/npanday/trunk/plugins/maven-test-plugin/src/main/java/npanday/plugin/test/AbstractTestrelatedMojo.java (props changed) incubator/npanday/trunk/plugins/msdeploy-maven-plugin/src/main/java/npanday/plugin/msdeploy/create/AbstractCreatePackageMojo.java (props changed) incubator/npanday/trunk/plugins/msdeploy-maven-plugin/src/main/java/npanday/plugin/msdeploy/create/CreateIisAppPackageMojo.java (contents, props changed) incubator/npanday/trunk/plugins/msdeploy-maven-plugin/src/main/java/npanday/plugin/msdeploy/sync/Destination.java (props changed) incubator/npanday/trunk/plugins/msdeploy-maven-plugin/src/main/java/npanday/plugin/msdeploy/sync/SyncEvent.java (props changed) Propchange: incubator/npanday/trunk/components/dotnet-core/src/main/java/npanday/LocalRepositoryUtil.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/ExecutionResult.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/DefaultNetExecutable.java URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/DefaultNetExecutable.java?rev=1619666&r1=1619665&r2=1619666&view=diff ============================================================================== --- incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/DefaultNetExecutable.java (original) +++ incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/DefaultNetExecutable.java Fri Aug 22 05:17:20 2014 @@ -1,104 +1,104 @@ -package npanday.executable.impl; - -/* - * 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. - */ - -import npanday.NPandayContext; -import npanday.PathUtil; -import npanday.PlatformUnsupportedException; -import npanday.executable.CommandExecutor; -import npanday.executable.CommandFilter; -import npanday.executable.ExecutableContext; -import npanday.executable.ExecutionException; -import npanday.executable.ExecutionResult; -import npanday.executable.NetExecutable; -import npanday.vendor.Vendor; -import org.codehaus.plexus.logging.Logger; - -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Properties; - -/** - * Provides the default implementation of the net executable. - * - * @author Shane Isbell - */ -public class DefaultNetExecutable - implements NetExecutable -{ - - protected ExecutableContext executableContext; - - /** - * A logger for writing log messages - */ - protected Logger logger; - - private Collection<String> commands; - - private Properties configuration; - - public List<String> getCommands() throws ExecutionException, PlatformUnsupportedException - { - // TODO: should it fail on unsupported commands? - CommandFilter filter = executableContext.getCommandFilter(); - return Collections.unmodifiableList( filter.filter( commands ) ); - } - - public ExecutionResult execute() throws ExecutionException, PlatformUnsupportedException - { - return innerExecute(); - } - - public ExecutionResult innerExecute() throws ExecutionException, PlatformUnsupportedException - { - List<String> commands = getCommands(); - - CommandExecutor commandExecutor = CommandExecutor.Factory.createDefaultCommmandExecutor( - configuration); - commandExecutor.setLogger( logger ); - commandExecutor.executeCommand( - PathUtil.getExecutable( - executableContext.getExecutableName(), executableContext.getProbingPaths(), logger - ), commands, null, true - ); - - return new ExecutionResult( - commandExecutor.getResult(), - commandExecutor.getStandardOut(), - commandExecutor.getStandardError() - ); - - } - - public Vendor getVendor() - { - return executableContext.getVendor(); - } - - public void init( NPandayContext npandayContext, Properties properties ) - { - configuration = properties; - this.executableContext = (ExecutableContext) npandayContext; - this.logger = executableContext.getLogger(); - commands = executableContext.getCommands(); - } +package npanday.executable.impl; + +/* + * 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. + */ + +import npanday.NPandayContext; +import npanday.PathUtil; +import npanday.PlatformUnsupportedException; +import npanday.executable.CommandExecutor; +import npanday.executable.CommandFilter; +import npanday.executable.ExecutableContext; +import npanday.executable.ExecutionException; +import npanday.executable.ExecutionResult; +import npanday.executable.NetExecutable; +import npanday.vendor.Vendor; +import org.codehaus.plexus.logging.Logger; + +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Properties; + +/** + * Provides the default implementation of the net executable. + * + * @author Shane Isbell + */ +public class DefaultNetExecutable + implements NetExecutable +{ + + protected ExecutableContext executableContext; + + /** + * A logger for writing log messages + */ + protected Logger logger; + + private Collection<String> commands; + + private Properties configuration; + + public List<String> getCommands() throws ExecutionException, PlatformUnsupportedException + { + // TODO: should it fail on unsupported commands? + CommandFilter filter = executableContext.getCommandFilter(); + return Collections.unmodifiableList( filter.filter( commands ) ); + } + + public ExecutionResult execute() throws ExecutionException, PlatformUnsupportedException + { + return innerExecute(); + } + + public ExecutionResult innerExecute() throws ExecutionException, PlatformUnsupportedException + { + List<String> commands = getCommands(); + + CommandExecutor commandExecutor = CommandExecutor.Factory.createDefaultCommmandExecutor( + configuration); + commandExecutor.setLogger( logger ); + commandExecutor.executeCommand( + PathUtil.getExecutable( + executableContext.getExecutableName(), executableContext.getProbingPaths(), logger + ), commands, null, true + ); + + return new ExecutionResult( + commandExecutor.getResult(), + commandExecutor.getStandardOut(), + commandExecutor.getStandardError() + ); + + } + + public Vendor getVendor() + { + return executableContext.getVendor(); + } + + public void init( NPandayContext npandayContext, Properties properties ) + { + configuration = properties; + this.executableContext = (ExecutableContext) npandayContext; + this.logger = executableContext.getLogger(); + commands = executableContext.getCommands(); + } } \ No newline at end of file Propchange: incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/VersionComparer.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/resolver/NPandayResolutionCache.java URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/resolver/NPandayResolutionCache.java?rev=1619666&r1=1619665&r2=1619666&view=diff ============================================================================== --- incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/resolver/NPandayResolutionCache.java (original) +++ incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/resolver/NPandayResolutionCache.java Fri Aug 22 05:17:20 2014 @@ -1,58 +1,58 @@ -/* - * 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 npanday.resolver; - -import com.google.common.collect.Sets; -import org.apache.maven.artifact.Artifact; -import org.codehaus.plexus.logging.AbstractLogEnabled; - -import java.io.File; -import java.util.HashSet; -import java.util.Hashtable; - -/** - * The instance of this cache should span the full maven reactor build. - * Resolving the artifact file once pr. artifact id is enough. - * - * @author <a href="mailto:m...@lcorneliussen.de>Lars Corneliussen, Faktum Software</a> - * @plexus.component role="npanday.resolver.NPandayResolutionCache" - */ -public class NPandayResolutionCache - extends AbstractLogEnabled -{ - private Hashtable<String, File> cache = new Hashtable<String, File>(); - - public void put(Artifact artifact){ - cache.put(artifact.getId(), artifact.getFile()); - } - - public Boolean applyTo(Artifact artifact){ - String key = artifact.getId(); - if (cache.containsKey(key)){ - File resolvedFile = cache.get(key); - if (resolvedFile != null){ - artifact.setFile(resolvedFile); - artifact.setResolved(true); - } - return true; - } - return false; - } -} +/* + * 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 npanday.resolver; + +import com.google.common.collect.Sets; +import org.apache.maven.artifact.Artifact; +import org.codehaus.plexus.logging.AbstractLogEnabled; + +import java.io.File; +import java.util.HashSet; +import java.util.Hashtable; + +/** + * The instance of this cache should span the full maven reactor build. + * Resolving the artifact file once pr. artifact id is enough. + * + * @author <a href="mailto:m...@lcorneliussen.de>Lars Corneliussen, Faktum Software</a> + * @plexus.component role="npanday.resolver.NPandayResolutionCache" + */ +public class NPandayResolutionCache + extends AbstractLogEnabled +{ + private Hashtable<String, File> cache = new Hashtable<String, File>(); + + public void put(Artifact artifact){ + cache.put(artifact.getId(), artifact.getFile()); + } + + public Boolean applyTo(Artifact artifact){ + String key = artifact.getId(); + if (cache.containsKey(key)){ + File resolvedFile = cache.get(key); + if (resolvedFile != null){ + artifact.setFile(resolvedFile); + artifact.setResolved(true); + } + return true; + } + return false; + } +} Modified: incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/resolver/resolvers/PdbAssemblyResolver.java URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/resolver/resolvers/PdbAssemblyResolver.java?rev=1619666&r1=1619665&r2=1619666&view=diff ============================================================================== --- incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/resolver/resolvers/PdbAssemblyResolver.java (original) +++ incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/resolver/resolvers/PdbAssemblyResolver.java Fri Aug 22 05:17:20 2014 @@ -1,105 +1,105 @@ -package npanday.resolver.resolvers; - -import java.util.List; -import java.util.Set; - -import npanday.resolver.NPandayResolutionCache; -import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.factory.ArtifactFactory; -import org.apache.maven.artifact.repository.ArtifactRepository; -import org.apache.maven.artifact.resolver.ArtifactNotFoundException; -import org.apache.maven.artifact.resolver.ArtifactResolutionException; -import org.apache.maven.artifact.resolver.ArtifactResolver; -import org.apache.maven.artifact.resolver.filter.ArtifactFilter; -import org.codehaus.plexus.logging.AbstractLogEnabled; - -import npanday.ArtifactType; -import npanday.ArtifactTypeHelper; -import npanday.resolver.ArtifactResolvingContributor; - -/** - * PDB assemblies contributor class. - * @plexus.component role="npanday.resolver.ArtifactResolvingContributor" role-hint="pdb" - */ -public class PdbAssemblyResolver extends AbstractLogEnabled implements ArtifactResolvingContributor -{ - /** @plexus.requirement */ - ArtifactResolver mavenResolver; - - /** @plexus.requirement */ - ArtifactFactory artifactFactory; - - /** @plexus.requirement */ - NPandayResolutionCache cache; - - /** - * {@inheritDoc} - */ - public void tryResolve(Artifact artifact, Set<Artifact> additionalDependenciesCollector, ArtifactFilter filter) - throws ArtifactNotFoundException - { - // NO-OP - } - - - /** - * {@inheritDoc} - */ - public void contribute(Artifact artifact, ArtifactRepository localRepository, - @SuppressWarnings("rawtypes") List remoteRepositories, - Set<Artifact> additionalDependenciesCollector, ArtifactFilter filter) throws ArtifactNotFoundException - { - final ArtifactType artifactType = ArtifactType.getArtifactTypeForPackagingName(artifact.getType()); - if ( !ArtifactTypeHelper.isDotnetAnyGac(artifactType) && - !ArtifactTypeHelper.isComReference(artifactType) && - ArtifactTypeHelper.isDotnetLibraryOrExecutable(artifactType)) - { - tryResolveArtifactPdbAssembly(artifact, localRepository, remoteRepositories, - additionalDependenciesCollector, filter); - } - } - - /** - * Try to resolve PDB artifact for given artifact. - * - * @param artifact - * @param localRepository - * @param remoteRepositories - * @param additionalDependenciesCollector - * @param filter - * @throws ArtifactNotFoundException - */ - private void tryResolveArtifactPdbAssembly(Artifact artifact, ArtifactRepository localRepository, - List remoteRepositories, Set<Artifact> additionalDependenciesCollector, ArtifactFilter filter) throws ArtifactNotFoundException - { - Artifact pdbArtifact = artifactFactory.createArtifactWithClassifier(artifact.getGroupId(), artifact.getArtifactId(), - artifact.getVersion(), ArtifactType.DOTNET_SYMBOLS.getPackagingType(), artifact.getClassifier()); - pdbArtifact.setScope(artifact.getScope()); - pdbArtifact.setRelease(artifact.isRelease()); - pdbArtifact.setDependencyTrail(artifact.getDependencyTrail()); - - if(filter != null && !filter.include(pdbArtifact)){ - getLogger().debug("NPANDAY-157-003: resolving pdb for " + artifact.getId() + " was excluded by a filter"); - return; - } - - Boolean wasCached = cache.applyTo(pdbArtifact); - if (!wasCached) { - try { - mavenResolver.resolve(pdbArtifact, remoteRepositories, localRepository); - // the complimentary artifact should have the same scope as the leading one - getLogger().debug("NPANDAY-157-001: found a pdb for " + artifact.getId()); - - } catch (ArtifactNotFoundException e) { - getLogger().debug("NPANDAY-157-002: no pdb found for " + artifact.getId()); - } catch (ArtifactResolutionException e) { - throw new ArtifactNotFoundException(e.getMessage(), artifact); - } - - cache.put(pdbArtifact); - } - if (pdbArtifact.isResolved()){ - additionalDependenciesCollector.add(pdbArtifact); - } - } -} +package npanday.resolver.resolvers; + +import java.util.List; +import java.util.Set; + +import npanday.resolver.NPandayResolutionCache; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.factory.ArtifactFactory; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.resolver.ArtifactNotFoundException; +import org.apache.maven.artifact.resolver.ArtifactResolutionException; +import org.apache.maven.artifact.resolver.ArtifactResolver; +import org.apache.maven.artifact.resolver.filter.ArtifactFilter; +import org.codehaus.plexus.logging.AbstractLogEnabled; + +import npanday.ArtifactType; +import npanday.ArtifactTypeHelper; +import npanday.resolver.ArtifactResolvingContributor; + +/** + * PDB assemblies contributor class. + * @plexus.component role="npanday.resolver.ArtifactResolvingContributor" role-hint="pdb" + */ +public class PdbAssemblyResolver extends AbstractLogEnabled implements ArtifactResolvingContributor +{ + /** @plexus.requirement */ + ArtifactResolver mavenResolver; + + /** @plexus.requirement */ + ArtifactFactory artifactFactory; + + /** @plexus.requirement */ + NPandayResolutionCache cache; + + /** + * {@inheritDoc} + */ + public void tryResolve(Artifact artifact, Set<Artifact> additionalDependenciesCollector, ArtifactFilter filter) + throws ArtifactNotFoundException + { + // NO-OP + } + + + /** + * {@inheritDoc} + */ + public void contribute(Artifact artifact, ArtifactRepository localRepository, + @SuppressWarnings("rawtypes") List remoteRepositories, + Set<Artifact> additionalDependenciesCollector, ArtifactFilter filter) throws ArtifactNotFoundException + { + final ArtifactType artifactType = ArtifactType.getArtifactTypeForPackagingName(artifact.getType()); + if ( !ArtifactTypeHelper.isDotnetAnyGac(artifactType) && + !ArtifactTypeHelper.isComReference(artifactType) && + ArtifactTypeHelper.isDotnetLibraryOrExecutable(artifactType)) + { + tryResolveArtifactPdbAssembly(artifact, localRepository, remoteRepositories, + additionalDependenciesCollector, filter); + } + } + + /** + * Try to resolve PDB artifact for given artifact. + * + * @param artifact + * @param localRepository + * @param remoteRepositories + * @param additionalDependenciesCollector + * @param filter + * @throws ArtifactNotFoundException + */ + private void tryResolveArtifactPdbAssembly(Artifact artifact, ArtifactRepository localRepository, + List remoteRepositories, Set<Artifact> additionalDependenciesCollector, ArtifactFilter filter) throws ArtifactNotFoundException + { + Artifact pdbArtifact = artifactFactory.createArtifactWithClassifier(artifact.getGroupId(), artifact.getArtifactId(), + artifact.getVersion(), ArtifactType.DOTNET_SYMBOLS.getPackagingType(), artifact.getClassifier()); + pdbArtifact.setScope(artifact.getScope()); + pdbArtifact.setRelease(artifact.isRelease()); + pdbArtifact.setDependencyTrail(artifact.getDependencyTrail()); + + if(filter != null && !filter.include(pdbArtifact)){ + getLogger().debug("NPANDAY-157-003: resolving pdb for " + artifact.getId() + " was excluded by a filter"); + return; + } + + Boolean wasCached = cache.applyTo(pdbArtifact); + if (!wasCached) { + try { + mavenResolver.resolve(pdbArtifact, remoteRepositories, localRepository); + // the complimentary artifact should have the same scope as the leading one + getLogger().debug("NPANDAY-157-001: found a pdb for " + artifact.getId()); + + } catch (ArtifactNotFoundException e) { + getLogger().debug("NPANDAY-157-002: no pdb found for " + artifact.getId()); + } catch (ArtifactResolutionException e) { + throw new ArtifactNotFoundException(e.getMessage(), artifact); + } + + cache.put(pdbArtifact); + } + if (pdbArtifact.isResolved()){ + additionalDependenciesCollector.add(pdbArtifact); + } + } +} Propchange: incubator/npanday/trunk/components/dotnet-nuget/src/main/java/npanday/nuget/DotnetVersion.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/npanday/trunk/components/dotnet-nuget/src/main/java/npanday/nuget/NugetException.java URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-nuget/src/main/java/npanday/nuget/NugetException.java?rev=1619666&r1=1619665&r2=1619666&view=diff ============================================================================== --- incubator/npanday/trunk/components/dotnet-nuget/src/main/java/npanday/nuget/NugetException.java (original) +++ incubator/npanday/trunk/components/dotnet-nuget/src/main/java/npanday/nuget/NugetException.java Fri Aug 22 05:17:20 2014 @@ -1,48 +1,48 @@ -/* - * 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 npanday.nuget; - -/** - * Something went wrong while instrumenting or executing Nuget. - * - * @author <a href="mailto:lcornelius...@apache.org">Lars Corneliussen</a> - */ -public class NugetException - extends Exception -{ - public NugetException() - { - } - - public NugetException(String message) - { - super( message ); - } - - public NugetException(String message, Throwable cause) - { - super( message, cause ); - } - - public NugetException(Throwable cause) - { - super( cause ); - } -} +/* + * 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 npanday.nuget; + +/** + * Something went wrong while instrumenting or executing Nuget. + * + * @author <a href="mailto:lcornelius...@apache.org">Lars Corneliussen</a> + */ +public class NugetException + extends Exception +{ + public NugetException() + { + } + + public NugetException(String message) + { + super( message ); + } + + public NugetException(String message, Throwable cause) + { + super( message, cause ); + } + + public NugetException(Throwable cause) + { + super( cause ); + } +} Propchange: incubator/npanday/trunk/components/dotnet-nuget/src/main/java/npanday/nuget/NugetException.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/npanday/trunk/components/dotnet-nuget/src/main/java/npanday/nuget/NugetInstallParameters.java URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-nuget/src/main/java/npanday/nuget/NugetInstallParameters.java?rev=1619666&r1=1619665&r2=1619666&view=diff ============================================================================== --- incubator/npanday/trunk/components/dotnet-nuget/src/main/java/npanday/nuget/NugetInstallParameters.java (original) +++ incubator/npanday/trunk/components/dotnet-nuget/src/main/java/npanday/nuget/NugetInstallParameters.java Fri Aug 22 05:17:20 2014 @@ -1,120 +1,120 @@ -/* - * 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 npanday.nuget; - -import com.google.common.base.Preconditions; -import com.google.common.base.Strings; -import com.google.common.collect.Lists; - -import java.io.File; -import java.util.Collection; -import java.util.List; - -/** - * @author <a href="mailto:lcornelius...@apache.org">Lars Corneliussen</a> - */ -public class NugetInstallParameters -{ - private String packageName; - - private String version; - - private File outputDirectory; - - private boolean prerelease; - - private boolean excludeVersion; - - private List<String> sources; - - public NugetInstallParameters( String packageName ) - { - Preconditions.checkArgument( packageName != null, "packageName was null!" ); - - this.packageName = packageName; - } - - public Collection<String> buildCommands() - { - List<String> commands = Lists.newArrayList(); - - commands.add( "install" ); - - commands.add( packageName ); - - if ( !Strings.isNullOrEmpty( version ) ) - { - commands.add( "-Version" ); - commands.add( version ); - } - - if ( outputDirectory != null ) - { - commands.add( "-OutputDirectory" ); - commands.add( outputDirectory.getAbsolutePath() ); - } - - if ( prerelease ) - { - commands.add( "-Prerelease" ); - } - - if ( excludeVersion ) - { - commands.add( "-ExcludeVersion" ); - } - - if ( sources != null && sources.size() > 0 ) - { - for ( String source : sources ) - { - commands.add( "-Source" ); - commands.add( source ); - } - } - - return commands; - } - - public void setSources( List<String> sources ) - { - this.sources = sources; - } - - public void setVersion( String version ) - { - this.version = version; - } - - public void setOutputDirectory( File outputDirectory ) - { - this.outputDirectory = outputDirectory; - } - - public void setPrerelease( boolean prerelease ) - { - this.prerelease = prerelease; - } - - public void setExcludeVersion( boolean excludeVersion ) - { - this.excludeVersion = excludeVersion; - } -} +/* + * 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 npanday.nuget; + +import com.google.common.base.Preconditions; +import com.google.common.base.Strings; +import com.google.common.collect.Lists; + +import java.io.File; +import java.util.Collection; +import java.util.List; + +/** + * @author <a href="mailto:lcornelius...@apache.org">Lars Corneliussen</a> + */ +public class NugetInstallParameters +{ + private String packageName; + + private String version; + + private File outputDirectory; + + private boolean prerelease; + + private boolean excludeVersion; + + private List<String> sources; + + public NugetInstallParameters( String packageName ) + { + Preconditions.checkArgument( packageName != null, "packageName was null!" ); + + this.packageName = packageName; + } + + public Collection<String> buildCommands() + { + List<String> commands = Lists.newArrayList(); + + commands.add( "install" ); + + commands.add( packageName ); + + if ( !Strings.isNullOrEmpty( version ) ) + { + commands.add( "-Version" ); + commands.add( version ); + } + + if ( outputDirectory != null ) + { + commands.add( "-OutputDirectory" ); + commands.add( outputDirectory.getAbsolutePath() ); + } + + if ( prerelease ) + { + commands.add( "-Prerelease" ); + } + + if ( excludeVersion ) + { + commands.add( "-ExcludeVersion" ); + } + + if ( sources != null && sources.size() > 0 ) + { + for ( String source : sources ) + { + commands.add( "-Source" ); + commands.add( source ); + } + } + + return commands; + } + + public void setSources( List<String> sources ) + { + this.sources = sources; + } + + public void setVersion( String version ) + { + this.version = version; + } + + public void setOutputDirectory( File outputDirectory ) + { + this.outputDirectory = outputDirectory; + } + + public void setPrerelease( boolean prerelease ) + { + this.prerelease = prerelease; + } + + public void setExcludeVersion( boolean excludeVersion ) + { + this.excludeVersion = excludeVersion; + } +} Propchange: incubator/npanday/trunk/components/dotnet-nuget/src/main/java/npanday/nuget/NugetInstallParameters.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/npanday/trunk/components/dotnet-nuget/src/main/java/npanday/nuget/NugetInvoker.java URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-nuget/src/main/java/npanday/nuget/NugetInvoker.java?rev=1619666&r1=1619665&r2=1619666&view=diff ============================================================================== --- incubator/npanday/trunk/components/dotnet-nuget/src/main/java/npanday/nuget/NugetInvoker.java (original) +++ incubator/npanday/trunk/components/dotnet-nuget/src/main/java/npanday/nuget/NugetInvoker.java Fri Aug 22 05:17:20 2014 @@ -1,71 +1,71 @@ -/* - * 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 npanday.nuget; - -import com.google.common.collect.Lists; -import npanday.PlatformUnsupportedException; -import npanday.executable.ExecutableRequirement; -import npanday.executable.ExecutionException; -import npanday.executable.NetExecutable; -import npanday.executable.NetExecutableFactory; -import org.codehaus.plexus.logging.AbstractLogEnabled; - -import java.util.List; - -/** - * @author <a href="mailto:lcornelius...@apache.org">Lars Corneliussen</a> - * @plexus.component role="npanday.nuget.NugetInvoker" - */ -public class NugetInvoker - extends AbstractLogEnabled -{ - /** - * @plexus.requirement - */ - protected NetExecutableFactory netExecutableFactory; - - public void install( - ExecutableRequirement executableRequirement, NugetInstallParameters parameters ) throws - PlatformUnsupportedException, - NugetException - { - final NetExecutable executable = netExecutableFactory.getExecutable( - executableRequirement, buildCommands( parameters ), null - ); - - try - { - executable.execute(); - } - catch ( ExecutionException e ) - { - throw new NugetException( "NPANDAY-143-000: Exception on executing Nuget with " + parameters, e ); - } - } - - private List<String> buildCommands( NugetInstallParameters parameters ) - { - List<String> commands = Lists.newArrayList(); - - commands.addAll( parameters.buildCommands() ); - - return commands; - } -} +/* + * 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 npanday.nuget; + +import com.google.common.collect.Lists; +import npanday.PlatformUnsupportedException; +import npanday.executable.ExecutableRequirement; +import npanday.executable.ExecutionException; +import npanday.executable.NetExecutable; +import npanday.executable.NetExecutableFactory; +import org.codehaus.plexus.logging.AbstractLogEnabled; + +import java.util.List; + +/** + * @author <a href="mailto:lcornelius...@apache.org">Lars Corneliussen</a> + * @plexus.component role="npanday.nuget.NugetInvoker" + */ +public class NugetInvoker + extends AbstractLogEnabled +{ + /** + * @plexus.requirement + */ + protected NetExecutableFactory netExecutableFactory; + + public void install( + ExecutableRequirement executableRequirement, NugetInstallParameters parameters ) throws + PlatformUnsupportedException, + NugetException + { + final NetExecutable executable = netExecutableFactory.getExecutable( + executableRequirement, buildCommands( parameters ), null + ); + + try + { + executable.execute(); + } + catch ( ExecutionException e ) + { + throw new NugetException( "NPANDAY-143-000: Exception on executing Nuget with " + parameters, e ); + } + } + + private List<String> buildCommands( NugetInstallParameters parameters ) + { + List<String> commands = Lists.newArrayList(); + + commands.addAll( parameters.buildCommands() ); + + return commands; + } +} Propchange: incubator/npanday/trunk/components/dotnet-nuget/src/main/java/npanday/nuget/NugetInvoker.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/npanday/trunk/components/dotnet-nuget/src/main/java/npanday/nuget/NugetSemanticVersion.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/npanday/trunk/components/dotnet-nuget/src/main/java/npanday/nuget/NugetVersionSpec.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/LibImporterPathUtils.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/deploy/AbstractDeployMojo.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/deploy/DeployLibraries.java URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/deploy/DeployLibraries.java?rev=1619666&r1=1619665&r2=1619666&view=diff ============================================================================== --- incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/deploy/DeployLibraries.java (original) +++ incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/deploy/DeployLibraries.java Fri Aug 22 05:17:20 2014 @@ -1,64 +1,64 @@ -/* - * 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 npanday.plugin.libraryimporter.deploy; - -import npanday.plugin.libraryimporter.model.NugetPackageLibrary; -import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.repository.ArtifactRepository; -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugin.MojoFailureException; - -/** - * Mojo for deploying the resolved libraries to the local repository. - * - * @author <a href="mailto:lcornelius...@apache.org">Lars Corneliussen</a> - * @goal deploy-libraries - */ -public class DeployLibraries - extends AbstractDeployMojo -{ - @Override - protected void handleGeneratedArtifacts( NugetPackageLibrary lib, Artifact artifact ) throws MojoExecutionException, MojoFailureException - { - ArtifactRepository repo = getDeploymentRepository(); - if (lib.getMarkerFileFor( artifact, repo ).exists()){ - if ( getLog().isDebugEnabled() ) - { - getLog().debug( - "NPANDAY-152-002: artifact " + artifact.getId() + " has yet been deployed to " + repo.getUrl() - ); - } - return; - } - - if ( getLog().isDebugEnabled() ) - { - getLog().debug( - "NPANDAY-152-001: deploying artifact " + artifact.getId() + " to " + repo.getUrl() - ); - } - - - deploy( artifact.getFile(), artifact, repo ); - - markDeployed( lib, artifact, repo ); - } - -} +/* + * 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 npanday.plugin.libraryimporter.deploy; + +import npanday.plugin.libraryimporter.model.NugetPackageLibrary; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; + +/** + * Mojo for deploying the resolved libraries to the local repository. + * + * @author <a href="mailto:lcornelius...@apache.org">Lars Corneliussen</a> + * @goal deploy-libraries + */ +public class DeployLibraries + extends AbstractDeployMojo +{ + @Override + protected void handleGeneratedArtifacts( NugetPackageLibrary lib, Artifact artifact ) throws MojoExecutionException, MojoFailureException + { + ArtifactRepository repo = getDeploymentRepository(); + if (lib.getMarkerFileFor( artifact, repo ).exists()){ + if ( getLog().isDebugEnabled() ) + { + getLog().debug( + "NPANDAY-152-002: artifact " + artifact.getId() + " has yet been deployed to " + repo.getUrl() + ); + } + return; + } + + if ( getLog().isDebugEnabled() ) + { + getLog().debug( + "NPANDAY-152-001: deploying artifact " + artifact.getId() + " to " + repo.getUrl() + ); + } + + + deploy( artifact.getFile(), artifact, repo ); + + markDeployed( lib, artifact, repo ); + } + +} Propchange: incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/deploy/DeployLibraries.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/generate/GeneratePackageArtifactsMojo.java URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/generate/GeneratePackageArtifactsMojo.java?rev=1619666&r1=1619665&r2=1619666&view=diff ============================================================================== --- incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/generate/GeneratePackageArtifactsMojo.java (original) +++ incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/generate/GeneratePackageArtifactsMojo.java Fri Aug 22 05:17:20 2014 @@ -1,212 +1,212 @@ -/* - * 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 npanday.plugin.libraryimporter.generate; - -import com.google.common.base.Splitter; -import com.google.common.base.Strings; -import com.google.common.collect.Lists; -import npanday.plugin.libraryimporter.NuspecMetadata; -import npanday.plugin.libraryimporter.model.NugetPackage; -import npanday.plugin.libraryimporter.model.NugetPackageLibrary; -import npanday.plugin.libraryimporter.skeletons.AbstractLibraryImportsProvidingMojo; -import org.apache.maven.model.Build; -import org.apache.maven.model.Dependency; -import org.apache.maven.model.Developer; -import org.apache.maven.model.License; -import org.apache.maven.model.Model; -import org.apache.maven.model.Plugin; -import org.apache.maven.model.io.xpp3.MavenXpp3Writer; -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugin.MojoFailureException; -import org.codehaus.plexus.util.FileUtils; -import org.codehaus.plexus.util.IOUtil; -import org.codehaus.plexus.util.WriterFactory; - -import java.io.File; -import java.io.IOException; -import java.io.Writer; -import java.util.List; - -/** - * Generates the poms and copies the libs to corresponding temp folders. - * - * @author <a href="mailto:lcornelius...@apache.org">Lars Corneliussen</a> - * @goal generate-package-artifacts - */ -public class GeneratePackageArtifactsMojo - extends AbstractLibraryImportsProvidingMojo -{ - /** - * @parameter default-value="${project.build.directory}/generated-projects" - */ - protected File generatedProjectsDirectory; - - @Override - protected void innerExecute() throws MojoExecutionException, MojoFailureException - { - super.innerExecute(); - - List<NugetPackageLibrary> imports = Lists.newArrayList(); - - List<NugetPackage> nugetImports = Lists.newArrayList( getNugetImports() ); - - for ( NugetPackage nuget : nugetImports ) - { - try - { - nuget.resolveDependencies( nugetImports ); - } - catch (MojoExecutionException e) - { - throw new MojoExecutionException( - "NPANDAY-141-004: Could not satisfy dependency for " + nuget + ".", e - ); - } - } - - for ( NugetPackage nuget : nugetImports ) - { - for ( NugetPackageLibrary lib : nuget.getLibraries(getLog(), mavenProjectsCacheDirectory) ) - { - imports.add( lib ); - } - } - - for( NugetPackageLibrary lib : imports){ - - lib.resolveDependenciesFrom(imports); - - Model model = generateModel(lib.getNugetPackage().getNuspec(), lib); - - storePomFile( model, lib.getMavenPomFile() ); - - File target = lib.getMavenProjectFolder(); - - try - { - FileUtils.copyFileToDirectory( lib.getFile(), target ); - } - catch ( IOException e ) - { - throw new MojoExecutionException( - "NPANDAY-141-002: Error on copy file " + lib.getFile() + " to " + target, e - ); - } - } - - } - - Splitter AUTHORS_SPLITTER = Splitter.on( "," ).omitEmptyStrings().trimResults(); - - private Model generateModel( NuspecMetadata nugetPackage, NugetPackageLibrary lib ) throws - MojoExecutionException - { - Model model = new Model(); - - model.setModelVersion( "4.0.0" ); - - model.setGroupId( lib.getMavenGroupId() ); - model.setArtifactId( lib.getMavenArtifactId() ); - model.setVersion( lib.getMavenVersion() ); - - model.setBuild( new Build() ); - model.getBuild().setFinalName( model.getArtifactId() ); - - if ( !Strings.isNullOrEmpty( nugetPackage.getTitle() ) ) - { - model.setName( nugetPackage.getTitle()); - } - else - { - model.setName( nugetPackage.getId() ); - } - - model.setName( model.getName() + " :: " + model.getArtifactId() ); - - if ( !Strings.isNullOrEmpty( nugetPackage.getProjectUrl() ) ) - { - model.setUrl( nugetPackage.getProjectUrl() ); - } - - - if ( !Strings.isNullOrEmpty( nugetPackage.getSummary() ) ) - { - model.setDescription( nugetPackage.getSummary() ); - } - else if ( !Strings.isNullOrEmpty( nugetPackage.getDescription() ) ) - { - model.setDescription( nugetPackage.getDescription() ); - } - - if ( !Strings.isNullOrEmpty( nugetPackage.getLicenseUrl() ) ) - { - License lic = new License(); - lic.setUrl( nugetPackage.getLicenseUrl() ); - model.getLicenses().add( lic ); - } - - if ( !Strings.isNullOrEmpty( nugetPackage.getAuthors() ) ) - { - for ( String author : AUTHORS_SPLITTER.split( nugetPackage.getAuthors() ) ) - { - Developer dev = new Developer(); - dev.setName( author ); - model.addDeveloper( dev ); - } - } - - model.setPackaging( lib.getMavenPackaging() ); - - for( NugetPackageLibrary libDep : lib.getDependencies()){ - - Dependency dep = new Dependency(); - dep.setGroupId( libDep.getMavenGroupId() ); - dep.setArtifactId( libDep.getMavenArtifactId() ); - dep.setType( libDep.getMavenPackaging() ); - - // TODO: should this actually be a range? - dep.setVersion( libDep.getMavenVersion() ); - - model.getDependencies().add( dep ); - } - - return model; - } - - private void storePomFile( Model model, File pomFile ) throws MojoExecutionException - { - pomFile.getParentFile().mkdirs(); - - Writer writer = null; - try - { - writer = WriterFactory.newXmlWriter( pomFile ); - new MavenXpp3Writer().write( writer, model ); - } - catch ( IOException e ) - { - throw new MojoExecutionException( "NPANDAY-141-003: Error writing POM file: " + e.getMessage(), e ); - } - finally - { - IOUtil.close( writer ); - } - } -} +/* + * 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 npanday.plugin.libraryimporter.generate; + +import com.google.common.base.Splitter; +import com.google.common.base.Strings; +import com.google.common.collect.Lists; +import npanday.plugin.libraryimporter.NuspecMetadata; +import npanday.plugin.libraryimporter.model.NugetPackage; +import npanday.plugin.libraryimporter.model.NugetPackageLibrary; +import npanday.plugin.libraryimporter.skeletons.AbstractLibraryImportsProvidingMojo; +import org.apache.maven.model.Build; +import org.apache.maven.model.Dependency; +import org.apache.maven.model.Developer; +import org.apache.maven.model.License; +import org.apache.maven.model.Model; +import org.apache.maven.model.Plugin; +import org.apache.maven.model.io.xpp3.MavenXpp3Writer; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.codehaus.plexus.util.FileUtils; +import org.codehaus.plexus.util.IOUtil; +import org.codehaus.plexus.util.WriterFactory; + +import java.io.File; +import java.io.IOException; +import java.io.Writer; +import java.util.List; + +/** + * Generates the poms and copies the libs to corresponding temp folders. + * + * @author <a href="mailto:lcornelius...@apache.org">Lars Corneliussen</a> + * @goal generate-package-artifacts + */ +public class GeneratePackageArtifactsMojo + extends AbstractLibraryImportsProvidingMojo +{ + /** + * @parameter default-value="${project.build.directory}/generated-projects" + */ + protected File generatedProjectsDirectory; + + @Override + protected void innerExecute() throws MojoExecutionException, MojoFailureException + { + super.innerExecute(); + + List<NugetPackageLibrary> imports = Lists.newArrayList(); + + List<NugetPackage> nugetImports = Lists.newArrayList( getNugetImports() ); + + for ( NugetPackage nuget : nugetImports ) + { + try + { + nuget.resolveDependencies( nugetImports ); + } + catch (MojoExecutionException e) + { + throw new MojoExecutionException( + "NPANDAY-141-004: Could not satisfy dependency for " + nuget + ".", e + ); + } + } + + for ( NugetPackage nuget : nugetImports ) + { + for ( NugetPackageLibrary lib : nuget.getLibraries(getLog(), mavenProjectsCacheDirectory) ) + { + imports.add( lib ); + } + } + + for( NugetPackageLibrary lib : imports){ + + lib.resolveDependenciesFrom(imports); + + Model model = generateModel(lib.getNugetPackage().getNuspec(), lib); + + storePomFile( model, lib.getMavenPomFile() ); + + File target = lib.getMavenProjectFolder(); + + try + { + FileUtils.copyFileToDirectory( lib.getFile(), target ); + } + catch ( IOException e ) + { + throw new MojoExecutionException( + "NPANDAY-141-002: Error on copy file " + lib.getFile() + " to " + target, e + ); + } + } + + } + + Splitter AUTHORS_SPLITTER = Splitter.on( "," ).omitEmptyStrings().trimResults(); + + private Model generateModel( NuspecMetadata nugetPackage, NugetPackageLibrary lib ) throws + MojoExecutionException + { + Model model = new Model(); + + model.setModelVersion( "4.0.0" ); + + model.setGroupId( lib.getMavenGroupId() ); + model.setArtifactId( lib.getMavenArtifactId() ); + model.setVersion( lib.getMavenVersion() ); + + model.setBuild( new Build() ); + model.getBuild().setFinalName( model.getArtifactId() ); + + if ( !Strings.isNullOrEmpty( nugetPackage.getTitle() ) ) + { + model.setName( nugetPackage.getTitle()); + } + else + { + model.setName( nugetPackage.getId() ); + } + + model.setName( model.getName() + " :: " + model.getArtifactId() ); + + if ( !Strings.isNullOrEmpty( nugetPackage.getProjectUrl() ) ) + { + model.setUrl( nugetPackage.getProjectUrl() ); + } + + + if ( !Strings.isNullOrEmpty( nugetPackage.getSummary() ) ) + { + model.setDescription( nugetPackage.getSummary() ); + } + else if ( !Strings.isNullOrEmpty( nugetPackage.getDescription() ) ) + { + model.setDescription( nugetPackage.getDescription() ); + } + + if ( !Strings.isNullOrEmpty( nugetPackage.getLicenseUrl() ) ) + { + License lic = new License(); + lic.setUrl( nugetPackage.getLicenseUrl() ); + model.getLicenses().add( lic ); + } + + if ( !Strings.isNullOrEmpty( nugetPackage.getAuthors() ) ) + { + for ( String author : AUTHORS_SPLITTER.split( nugetPackage.getAuthors() ) ) + { + Developer dev = new Developer(); + dev.setName( author ); + model.addDeveloper( dev ); + } + } + + model.setPackaging( lib.getMavenPackaging() ); + + for( NugetPackageLibrary libDep : lib.getDependencies()){ + + Dependency dep = new Dependency(); + dep.setGroupId( libDep.getMavenGroupId() ); + dep.setArtifactId( libDep.getMavenArtifactId() ); + dep.setType( libDep.getMavenPackaging() ); + + // TODO: should this actually be a range? + dep.setVersion( libDep.getMavenVersion() ); + + model.getDependencies().add( dep ); + } + + return model; + } + + private void storePomFile( Model model, File pomFile ) throws MojoExecutionException + { + pomFile.getParentFile().mkdirs(); + + Writer writer = null; + try + { + writer = WriterFactory.newXmlWriter( pomFile ); + new MavenXpp3Writer().write( writer, model ); + } + catch ( IOException e ) + { + throw new MojoExecutionException( "NPANDAY-141-003: Error writing POM file: " + e.getMessage(), e ); + } + finally + { + IOUtil.close( writer ); + } + } +} Propchange: incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/generate/GeneratePackageArtifactsMojo.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/install/AbstractInstallMojo.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/install/InstallLibraries.java URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/install/InstallLibraries.java?rev=1619666&r1=1619665&r2=1619666&view=diff ============================================================================== --- incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/install/InstallLibraries.java (original) +++ incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/install/InstallLibraries.java Fri Aug 22 05:17:20 2014 @@ -1,73 +1,73 @@ -/* - * 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 npanday.plugin.libraryimporter.install; - -import npanday.plugin.libraryimporter.model.NugetPackageLibrary; -import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.installer.ArtifactInstallationException; -import org.apache.maven.artifact.repository.ArtifactRepository; -import org.apache.maven.plugin.MojoExecutionException; - -/** - * Mojo for installing the resolved libraries to the local repository. - * - * @author <a href="mailto:lcornelius...@apache.org">Lars Corneliussen</a> - * @goal install-libraries - */ -public class InstallLibraries - extends AbstractInstallMojo -{ - @Override - protected void handleGeneratedArtifacts( NugetPackageLibrary lib, Artifact artifact ) throws MojoExecutionException - { - ArtifactRepository repo = getLocalArtifactRepository(); - - if (lib.getMarkerFileFor( artifact, repo ).exists()){ - if ( getLog().isDebugEnabled() ) - { - getLog().debug( - "NPANDAY-146-002: artifact has yet been installed to local repository: " + artifact.getId() - ); - } - return; - } - - if ( getLog().isDebugEnabled() ) - { - getLog().debug( - "NPANDAY-146-001: installing artifact to local repository: " + artifact.getId() - ); - } - - try - { - install( lib, artifact, repo ); - - markDeployed( lib, artifact, repo); - } - catch ( ArtifactInstallationException e ) - { - throw new MojoExecutionException( "NPANDAY-146-000: Error on installing artifact: " + artifact.getId(), e ); - } - if ( createChecksums ) { - installChecksums( artifact ); - } - } -} +/* + * 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 npanday.plugin.libraryimporter.install; + +import npanday.plugin.libraryimporter.model.NugetPackageLibrary; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.installer.ArtifactInstallationException; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.plugin.MojoExecutionException; + +/** + * Mojo for installing the resolved libraries to the local repository. + * + * @author <a href="mailto:lcornelius...@apache.org">Lars Corneliussen</a> + * @goal install-libraries + */ +public class InstallLibraries + extends AbstractInstallMojo +{ + @Override + protected void handleGeneratedArtifacts( NugetPackageLibrary lib, Artifact artifact ) throws MojoExecutionException + { + ArtifactRepository repo = getLocalArtifactRepository(); + + if (lib.getMarkerFileFor( artifact, repo ).exists()){ + if ( getLog().isDebugEnabled() ) + { + getLog().debug( + "NPANDAY-146-002: artifact has yet been installed to local repository: " + artifact.getId() + ); + } + return; + } + + if ( getLog().isDebugEnabled() ) + { + getLog().debug( + "NPANDAY-146-001: installing artifact to local repository: " + artifact.getId() + ); + } + + try + { + install( lib, artifact, repo ); + + markDeployed( lib, artifact, repo); + } + catch ( ArtifactInstallationException e ) + { + throw new MojoExecutionException( "NPANDAY-146-000: Error on installing artifact: " + artifact.getId(), e ); + } + if ( createChecksums ) { + installChecksums( artifact ); + } + } +} Propchange: incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/install/InstallLibraries.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/model/NugetPackage.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/model/NugetPackageLibrary.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/AbstractManifestInfoMojo.java URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/AbstractManifestInfoMojo.java?rev=1619666&r1=1619665&r2=1619666&view=diff ============================================================================== --- incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/AbstractManifestInfoMojo.java (original) +++ incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/AbstractManifestInfoMojo.java Fri Aug 22 05:17:20 2014 @@ -1,41 +1,41 @@ -/* - * 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 npanday.plugin.libraryimporter.resolve; - -import npanday.executable.ExecutableRequirement; -import npanday.nuget.NugetInvoker; -import npanday.plugin.libraryimporter.skeletons.AbstractLibraryImportsProvidingMojo; - - -/** - * Abstract Mojo for interaction with CSPack - * - * @author <a href="mailto:lcornelius...@apache.org">Lars Corneliussen</a> - */ -public abstract class AbstractManifestInfoMojo - extends AbstractLibraryImportsProvidingMojo -{ - /** - * @component - */ - protected NugetInvoker nugetInvoker; - - -} +/* + * 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 npanday.plugin.libraryimporter.resolve; + +import npanday.executable.ExecutableRequirement; +import npanday.nuget.NugetInvoker; +import npanday.plugin.libraryimporter.skeletons.AbstractLibraryImportsProvidingMojo; + + +/** + * Abstract Mojo for interaction with CSPack + * + * @author <a href="mailto:lcornelius...@apache.org">Lars Corneliussen</a> + */ +public abstract class AbstractManifestInfoMojo + extends AbstractLibraryImportsProvidingMojo +{ + /** + * @component + */ + protected NugetInvoker nugetInvoker; + + +} Propchange: incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/AbstractManifestInfoMojo.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/AbstractNugetMojo.java URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/AbstractNugetMojo.java?rev=1619666&r1=1619665&r2=1619666&view=diff ============================================================================== --- incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/AbstractNugetMojo.java (original) +++ incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/AbstractNugetMojo.java Fri Aug 22 05:17:20 2014 @@ -1,64 +1,64 @@ -/* - * 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 npanday.plugin.libraryimporter.resolve; - -import npanday.executable.ExecutableRequirement; -import npanday.nuget.NugetInvoker; -import npanday.plugin.libraryimporter.skeletons.AbstractLibraryImportsProvidingMojo; - - -/** - * Abstract Mojo for interaction with CSPack - * - * @author <a href="mailto:lcornelius...@apache.org">Lars Corneliussen</a> - */ -public abstract class AbstractNugetMojo - extends AbstractLibraryImportsProvidingMojo -{ - /** - * @component - */ - protected NugetInvoker nugetInvoker; - - /** - * The executable identifier used to locate the right configurations from executable-plugins.xml. Can't be changed. - */ - private String executableIdentifier = "NUGET"; - - /** - * The nuget version to be used. - * - * @parameter expression="${nuget.version}" default-value="1.7" - */ - private String executableVersion; - - /** - * The profile to be used for retrieving the nuget exectuable. - * - * @parameter expression="${nuget.profile}" - */ - private String executableProfile; - - protected ExecutableRequirement getExecutableRequirement() - { - // TODO: profile is actually an identifier; the real profile has yet to be supported - return new ExecutableRequirement( getVendorRequirement(), executableIdentifier, executableVersion ); - } -} +/* + * 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 npanday.plugin.libraryimporter.resolve; + +import npanday.executable.ExecutableRequirement; +import npanday.nuget.NugetInvoker; +import npanday.plugin.libraryimporter.skeletons.AbstractLibraryImportsProvidingMojo; + + +/** + * Abstract Mojo for interaction with CSPack + * + * @author <a href="mailto:lcornelius...@apache.org">Lars Corneliussen</a> + */ +public abstract class AbstractNugetMojo + extends AbstractLibraryImportsProvidingMojo +{ + /** + * @component + */ + protected NugetInvoker nugetInvoker; + + /** + * The executable identifier used to locate the right configurations from executable-plugins.xml. Can't be changed. + */ + private String executableIdentifier = "NUGET"; + + /** + * The nuget version to be used. + * + * @parameter expression="${nuget.version}" default-value="1.7" + */ + private String executableVersion; + + /** + * The profile to be used for retrieving the nuget exectuable. + * + * @parameter expression="${nuget.profile}" + */ + private String executableProfile; + + protected ExecutableRequirement getExecutableRequirement() + { + // TODO: profile is actually an identifier; the real profile has yet to be supported + return new ExecutableRequirement( getVendorRequirement(), executableIdentifier, executableVersion ); + } +} Propchange: incubator/npanday/trunk/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/AbstractNugetMojo.java ------------------------------------------------------------------------------ svn:eol-style = native