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 );
}