Package npanday

Examples of npanday.ArtifactType


        }

        compilerConfig.setCommands( getParameters() );

        String artifactTypeName = project.getArtifact().getType();
        ArtifactType artifactType = ArtifactType.getArtifactTypeForPackagingName( artifactTypeName );
        if ( artifactType.equals( ArtifactType.NULL ) )
        {
            throw new MojoExecutionException( "NPANDAY-900-002: Unrecognized artifact type: Language = " + language +
                ", Vendor = " + vendor + ", ArtifactType = " + artifactTypeName );
        }
        compilerConfig.setArtifactType( artifactType );
View Full Code Here


     * @throws InvalidArtifactException
     */
    public File getArtifact()
        throws InvalidArtifactException
    {
        ArtifactType artifactType = config.getArtifactType();
        if ( artifactType == null || artifactType.equals( ArtifactType.NULL ) )
        {
            throw new InvalidArtifactException( "NPANDAY-061-001: Artifact Type cannot be null" );
        }

        //TODO: The test-plugin has a dependency on this fileName/dir. If we change it here, it will break the plugin. Fix this encapsulation issue.
        String fileName = ( config.isTestCompile() ) ? project.getBuild().getDirectory() + File.separator +
            project.getArtifactId() + "-test.dll" : project.getBuild().getDirectory() + File.separator +
            project.getArtifactId() + "." + artifactType.getExtension();
        return new File( fileName );
    }
View Full Code Here

            for ( Artifact artifact : artifacts )
            {
                String type = artifact.getType();
                logger.debug( "NPANDAY-061-006: Artifact Type:" + type);
                logger.debug( "NPANDAY-061-007: Artifact Type:" + ArtifactTypeHelper.isDotnetGenericGac( type ));
                ArtifactType artifactType = ArtifactType.getArtifactTypeForPackagingName( type );
                if ( ArtifactTypeHelper.isDotnetModule( type ))
                {
                    modules.add( artifact );
                }
                else if ( (artifactType != ArtifactType.NULL && (
                            StringUtils.equals( artifactType.getTargetCompileType(), "library" )
                            || artifactType.getExtension().equals( "dll" )
                            || artifactType.getExtension().equals( "exe" ))
                          )
                          || type.equals( "jar" ) )
                {
                    libraries.add( artifact );
                }
                //Resolving here since the GAC path is vendor and framework aware
                if ( ArtifactTypeHelper.isDotnetGenericGac( type ) )               
                {
                    // TODO: Duplicate code with VendorInfoRepositoryImpl.getGlobalAssemblyCacheDirectoryFor
                    String gacRoot = null;
                    if ( compilerRequirement.getVendor().equals( Vendor.MICROSOFT ) &&
                        compilerRequirement.getFrameworkVersion().equals( "1.1.4322" ) )
                    {
                        gacRoot = System.getenv( "SystemRoot" ) + "\\assembly\\GAC\\";
                    }
                    else if ( compilerRequirement.getVendor().equals( Vendor.MICROSOFT ) )
                    {
                        // Layout changed since 2.0
                        // http://discuss.joelonsoftware.com/default.asp?dotnet.12.383883.5
                        gacRoot = System.getenv( "SystemRoot" ) + "\\assembly\\GAC_MSIL\\";
                    }
                    else if ( compilerRequirement.getVendor().equals( Vendor.MONO ) )
                    {
                        gacRoot = getGacRootForMono();
                    }
                    if ( gacRoot != null )
                    {
                        setArtifactGacFile( gacRoot, artifact );
                        libraries.add( artifact );
                    }
                }               
                else if (type.equals(ArtifactType.GAC_MSIL4.getPackagingType())) {
                    String gacRoot = System.getenv( "SystemRoot" ) + "\\Microsoft.NET\\assembly\\GAC_MSIL\\";
                    setArtifactGacFile( gacRoot, artifact );
                    libraries.add( artifact );
                }
                else if ( type.equals( ArtifactType.GAC.getPackagingType() ) )
                {
                    String gacRoot = ( compilerRequirement.getVendor().equals( Vendor.MONO ) ) ? getGacRootForMono()
                        : System.getenv( "SystemRoot" ) + "\\assembly\\GAC\\";
                    setArtifactGacFile( gacRoot, artifact );
                    libraries.add( artifact );
                }
                else if ( type.equals( ArtifactType.GAC_32.getPackagingType() ) )
                {
                    String gacRoot = ( compilerRequirement.getVendor().equals( Vendor.MONO ) ) ? getGacRootForMono()
                        : System.getenv( "SystemRoot" ) + "\\assembly\\GAC_32\\";
                    setArtifactGacFile( gacRoot, artifact );
                    libraries.add( artifact );
                }
                else if ( type.equals( ArtifactType.GAC_32_4.getPackagingType() ) )
                {
                    String gacRoot = System.getenv( "SystemRoot" ) + "\\Microsoft.NET\\assembly\\GAC_32\\";
                    setArtifactGacFile( gacRoot, artifact );
                    libraries.add( artifact );
                }
                else if ( type.equals( ArtifactType.GAC_64.getPackagingType() ) )
                {
                    String gacRoot = ( compilerRequirement.getVendor().equals( Vendor.MONO ) ) ? getGacRootForMono()
                        : System.getenv( "SystemRoot" ) + "\\assembly\\GAC_64\\";
                    setArtifactGacFile( gacRoot, artifact );
                    libraries.add( artifact );
                }
                else if ( type.equals( ArtifactType.GAC_64_4.getPackagingType() ) )
                {
                    String gacRoot = System.getenv( "SystemRoot" ) + "\\Microsoft.NET\\assembly\\GAC_64\\";
                    setArtifactGacFile( gacRoot, artifact );
                    libraries.add( artifact );
                }
                else if ( type.equals( ArtifactType.GAC_MSIL.getPackagingType() ) )
                {
                    String gacRoot = ( compilerRequirement.getVendor().equals( Vendor.MONO ) ) ? getGacRootForMono()
                        : System.getenv( "SystemRoot" ) + "\\assembly\\GAC_MSIL\\";
                    setArtifactGacFile( gacRoot, artifact );
                    libraries.add( artifact );
                }
                else if ( type.equals( ArtifactType.COM_REFERENCE.getPackagingType() ) )
                {
                    moveInteropDllToBuildDirectory( artifact );
                    libraries.add( artifact );
                }
                else if ( (artifactType != null && (
                            "library".equals(artifactType.getTargetCompileType()  )
                            || "dll".equals(artifactType.getExtension()  )
                            || "exe".equals(artifactType.getExtension()  ))
                          )
                          || "jar".equals(type  ) )
                {
                   libraries.add( artifact );
                }
View Full Code Here

                        logger.info( "Detected jar dependency - skipping: Artifact Dependency ID = "
                            + assembly.getArtifactId() );
                        continue;
                    }

                    ArtifactType type = ArtifactType.getArtifactTypeForPackagingName( assembly.getType() );

                    logger.finer( "NPANDAY-180-012: Resolving artifact for unresolved dependency: "
                                + assembly.getId());

                    ArtifactRepository localArtifactRepository =
View Full Code Here

            return;
        }

        String outputDirectory = project.getBuild().getDirectory();
        String finalName = project.getBuild().getFinalName();
        ArtifactType type = ArtifactType.getArtifactTypeForPackagingName(project.getPackaging());

        if (type == ArtifactType.NULL) {
            throw new MojoFailureException("NPANDAY-105-000: Packaging " + project.getPackaging() + " is not supported by this Mojo!");
        }

        File artifact = new File(outputDirectory, finalName + "." + type.getExtension());
        if (!artifact.exists()) {
            getLog().warn("NPANDAY-105-001: Could not set expected artifact to '" + artifact.getAbsolutePath() + "', because it does not exist");
            return;
        }
View Full Code Here

        CompilerConfig compilerConfig = (CompilerConfig) CompilerConfig.Factory.createDefaultExecutableConfig();
        compilerConfig.setLocalRepository( localRepository );
        compilerConfig.setCommands( getCommands( source, destination ) );

        String artifactTypeName = project.getArtifact().getType();
        ArtifactType artifactType = ArtifactType.getArtifactTypeForPackagingName( artifactTypeName );
        if ( artifactType.equals( ArtifactType.NULL ) )
        {
            throw new MojoExecutionException( "NPANDAY-900-002: Unrecognized artifact type: Language = " + language +
                ", Vendor = " + vendor + ", ArtifactType = " + artifactTypeName );
        }
        compilerConfig.setArtifactType( artifactType );
View Full Code Here

TOP

Related Classes of npanday.ArtifactType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.