Author: lcorneliussen
Date: Mon May  7 17:00:16 2012
New Revision: 1335128

URL: http://svn.apache.org/viewvc?rev=1335128&view=rev
Log:
[NPANDAY-231] Remove RDF repository and model

o removed gac-resolve from compiler context, since this is done beforehand by 
GacResolver

Modified:
    
incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/CompilerContextImpl.java

Modified: 
incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/CompilerContextImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/CompilerContextImpl.java?rev=1335128&r1=1335127&r2=1335128&view=diff
==============================================================================
--- 
incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/CompilerContextImpl.java
 (original)
+++ 
incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/CompilerContextImpl.java
 Mon May  7 17:00:16 2012
@@ -109,6 +109,8 @@ public final class CompilerContextImpl
         return linkedResources;
     }
 
+
+    @Deprecated
     public List<File> getEmbeddedResources()
     {
         return embeddedResources;
@@ -227,7 +229,6 @@ public final class CompilerContextImpl
 
     public List<Artifact> getDirectLibraryDependencies()
     {
-
         for ( Iterator i = project.getDependencyArtifacts().iterator(); 
i.hasNext(); )
         {
             Artifact artifact = (Artifact) i.next();
@@ -391,14 +392,7 @@ public final class CompilerContextImpl
                     libraries.add( artifact );
                 }
 
-                File gacRoot = 
capability.getVendorInfo().getGlobalAssemblyCacheDirectoryFor( type );
-
-                if ( gacRoot != null )
-                {
-                    setArtifactGacFile( gacRoot.getAbsolutePath(), artifact );
-                    libraries.add( artifact );
-                }
-                else if ( type.equals( 
ArtifactType.COM_REFERENCE.getPackagingType() ) )
+                if ( type.equals( 
ArtifactType.COM_REFERENCE.getPackagingType() ) )
                 {
                     moveInteropDllToBuildDirectory( artifact );
                     libraries.add( artifact );
@@ -506,115 +500,5 @@ public final class CompilerContextImpl
         {
             throw new PlatformUnsupportedException( e );
         }
-
-    }
-
-    /*
-    * Installs the artifact to the gac so that it can be used in aspnet
-    */
-    private void installArtifactGacFile( Artifact artifact )
-    {
-        try
-        {
-            CommandExecutor commandExecutor = 
CommandExecutor.Factory.createDefaultCommmandExecutor(null);
-            commandExecutor.setLogger( getLogger() );
-
-            String executable = "gacutil";
-            List<String> commands = new ArrayList<String>();
-
-            //searching for the .dll to be installed.
-            String sourceDir = config.getIncludeSources().get( 0 );
-            String[] sourceDirTokens = sourceDir.split( "\\\\" );
-            String sDir = "";
-
-            //constructing the directory for the.dll 
-            for ( int i = 0; i < sourceDirTokens.length - 3; i++ )
-            {
-                if ( sDir.equalsIgnoreCase( "" ) )
-                {
-                    sDir = sourceDirTokens[i];
-                }
-                else
-                {
-                    sDir = sDir + "\\" + sourceDirTokens[i];
-                }
-
-            }
-
-            String dll = artifact.getArtifactId() + ".dll";
-            String dllSysPath = "";
-            List<File> potentialDlls = FileUtils.getFiles( new File( sDir ), 
"**", null );
-
-            for ( File cFile : potentialDlls )
-            {
-                String pSysPath = cFile.getAbsolutePath();
-                String[] pathTokens = pSysPath.split( "\\\\" );
-                if ( pathTokens[pathTokens.length - 1].equalsIgnoreCase( dll ) 
)
-                {
-                    dllSysPath = cFile.getAbsolutePath();
-                    //break;
-                }
-            }
-
-            commands.add( "/i " + dllSysPath );
-            commandExecutor.executeCommand( executable, commands );
-        }
-        catch ( Exception e )
-        {
-            System.out.println(
-                "NPANDAY-000-000: Could not install artifact to GAC artifact:" 
+ artifact.getArtifactId() );
-        }
-
-    }
-
-    private void setArtifactGacFile( String gacRoot, Artifact artifact )
-        throws PlatformUnsupportedException
-    {
-        checkArgument( gacRoot != null, "gacRoot must not be null!" );
-        checkArgument( artifact != null, "artifact must not be null!" );
-
-        // TODO: Tripplicated code: check 
PathUtil.getGlobalAssemblyCacheFileFor and 
VendorInfo#getGlobalAssemblyCacheFileFor
-        String type = artifact.getType();
-        logger.debug( "NPANDAY-061-001: Gac Root:" + gacRoot );
-        logger.debug( "NPANDAY-061-003: Artifact Type:" + type );
-        File gacFile;
-        if ( "gac_msil4".equalsIgnoreCase( type ) || 
"gac_32_4".equalsIgnoreCase( type ) || "gac_64_4".equalsIgnoreCase(
-            type ) )
-        {
-            gacFile = new File( gacRoot, artifact.getArtifactId() + 
File.separator + "v"
-                + compilerCapability.getVendorInfo().getFrameworkVersion() + 
"_" + artifact.getVersion() + "__"
-                + artifact.getClassifier() + File.separator + 
artifact.getArtifactId() + ".dll" );
-        }
-        else
-        {
-            gacFile = new File( gacRoot, artifact.getArtifactId() + 
File.separator + artifact.getVersion() + "__"
-                + artifact.getClassifier() + File.separator + 
artifact.getArtifactId() + ".dll" );
-        }
-
-        logger.debug( "NPANDAY-061-001: gacFile to:" + 
gacFile.getAbsolutePath() );
-        // first check if the artifact is not yet installed
-        if ( !gacFile.exists() )
-        {
-            installArtifactGacFile( artifact );
-        }
-        // after installing the gac check if it is installed in the system.
-        if ( !gacFile.exists() )
-        {
-            // TODO: this will only work on Windows
-            //check for gac_msil
-
-            gacRoot = System.getenv( "SystemRoot" ) + "\\assembly\\GAC_MSIL\\";
-            gacFile = new File( gacRoot, artifact.getArtifactId() + 
File.separator + artifact.getVersion() + "__"
-                + artifact.getClassifier() + File.separator + 
artifact.getArtifactId() + ".dll" );
-            if ( !gacFile.exists() )
-            {
-
-                throw new PlatformUnsupportedException(
-                    "NPANDAY-000-000: Could not find GAC dependency: File = " 
+ gacFile.getAbsolutePath() );
-            }
-
-
-        }
-        artifact.setFile( gacFile );
     }
 }


Reply via email to