Author: jocaba
Date: Fri Oct 15 07:07:34 2010
New Revision: 1022837
URL: http://svn.apache.org/viewvc?rev=1022837&view=rev
Log:
[NPANDAY-186] Remove the uac and pab directories
Found the issue with the file size for NPanday.Plugin there was a problem with
the PathUtil.java
Modified:
incubator/npanday/branches/npanday-uac-removed/components/dotnet-artifact/src/main/java/npanday/artifact/impl/ArtifactInstallerImpl.java
incubator/npanday/branches/npanday-uac-removed/components/dotnet-core/src/main/java/npanday/PathUtil.java
incubator/npanday/branches/npanday-uac-removed/components/dotnet-dao-project/src/main/java/npanday/dao/ProjectFactory.java
incubator/npanday/branches/npanday-uac-removed/components/dotnet-dao-project/src/main/java/npanday/dao/impl/ProjectDaoImpl.java
incubator/npanday/branches/npanday-uac-removed/components/dotnet-executable/src/main/java/npanday/executable/compiler/impl/DefaultCompiler.java
incubator/npanday/branches/npanday-uac-removed/components/dotnet-executable/src/main/java/npanday/executable/impl/CompilerContextImpl.java
incubator/npanday/branches/npanday-uac-removed/dotnet/assemblies/NPanday.Artifact/src/main/csharp/NPanday/Artifact/PathUtil.cs
incubator/npanday/branches/npanday-uac-removed/dotnet/assemblies/NPanday.Plugin.Runner/src/main/csharp/NPanday/Plugin/Launcher/PluginLauncher.cs
incubator/npanday/branches/npanday-uac-removed/plugins/maven-install-plugin/src/main/java/npanday/plugin/install/InstallerMojo.java
Modified:
incubator/npanday/branches/npanday-uac-removed/components/dotnet-artifact/src/main/java/npanday/artifact/impl/ArtifactInstallerImpl.java
URL:
http://svn.apache.org/viewvc/incubator/npanday/branches/npanday-uac-removed/components/dotnet-artifact/src/main/java/npanday/artifact/impl/ArtifactInstallerImpl.java?rev=1022837&r1=1022836&r2=1022837&view=diff
==============================================================================
---
incubator/npanday/branches/npanday-uac-removed/components/dotnet-artifact/src/main/java/npanday/artifact/impl/ArtifactInstallerImpl.java
(original)
+++
incubator/npanday/branches/npanday-uac-removed/components/dotnet-artifact/src/main/java/npanday/artifact/impl/ArtifactInstallerImpl.java
Fri Oct 15 07:07:34 2010
@@ -269,16 +269,13 @@ public class ArtifactInstallerImpl
dependency.getClassifier(), scope,
null );
- File mavenArtifactDependencyFile =
PathUtil.getUserAssemblyCacheFileFor( artifactDependency, localRepository );
-
-
- File artifactDependencyFile = PathUtil.getDotNetArtifact(
artifactDependency, mavenArtifactDependencyFile );
+ File artifactDependencyFile = PathUtil.getDotNetArtifact(
artifactDependency );
if ( artifactDependencyFile == null ||
!artifactDependencyFile.exists() )
{
if (!ArtifactTypeHelper.isDotnetAnyGac(
artifactDependency.getType() ))
{
- logger.warn( "NPANDAY-000-017: Could not find artifact
dependency to copy in PAB: Artifact ID = " +
+ logger.warn( "NPANDAY-000-017: Could not find artifact
dependency to copy in local repository: Artifact ID = " +
artifactDependency.getId() + ", File Path = " +
( ( artifactDependencyFile != null ) ?
artifactDependencyFile.getAbsolutePath() : null ) );
}
@@ -300,6 +297,7 @@ public class ArtifactInstallerImpl
}
artifactDependencies.add( artifact );
}
+ //File installDirectory = PathUtil.getPrivateApplicationBaseFileFor(
artifact, localRepository ).getParentFile();
File installDirectory = PathUtil.getPrivateApplicationBaseFileFor(
artifact, localRepository ).getParentFile();
for ( Artifact artifactDependency : artifactDependencies )
{
@@ -319,13 +317,16 @@ public class ArtifactInstallerImpl
throws ArtifactInstallationException
{
ApplicationConfig applicationConfig =
artifactContext.getApplicationConfigFor( artifact );
+
File configExeFile = applicationConfig.getConfigBuildPath();
+
if ( configExeFile.exists() )
{
try
{
- FileUtils.copyFileToDirectory( configExeFile,
PathUtil.getUserAssemblyCacheFileFor( artifact,
-
localRepository ).getParentFile() );
+
+ FileUtils.copyFileToDirectory( configExeFile,
PathUtil.getUserAssemblyCacheFileFor( artifact,localRepository
).getParentFile() );
+
}
catch ( IOException e )
{
Modified:
incubator/npanday/branches/npanday-uac-removed/components/dotnet-core/src/main/java/npanday/PathUtil.java
URL:
http://svn.apache.org/viewvc/incubator/npanday/branches/npanday-uac-removed/components/dotnet-core/src/main/java/npanday/PathUtil.java?rev=1022837&r1=1022836&r2=1022837&view=diff
==============================================================================
---
incubator/npanday/branches/npanday-uac-removed/components/dotnet-core/src/main/java/npanday/PathUtil.java
(original)
+++
incubator/npanday/branches/npanday-uac-removed/components/dotnet-core/src/main/java/npanday/PathUtil.java
Fri Oct 15 07:07:34 2010
@@ -22,6 +22,12 @@ import org.apache.maven.artifact.Artifac
import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
import org.codehaus.plexus.util.FileUtils;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@@ -29,6 +35,8 @@ import java.io.IOException;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.util.logging.Logger;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
/**
* This class provides methods for obtaining the location of artifacts.
@@ -120,9 +128,8 @@ public final class PathUtil
logger.warning( "NPANDAY-040-004: Local Repository is null -
Cannot get application file." );
return null;
}
- File source = getUserAssemblyCacheFileFor( artifact, localRepository);
- return getDotNetArtifact( artifact, source );
+ return getDotNetArtifact( artifact );
}
/**
@@ -146,7 +153,8 @@ public final class PathUtil
return null;
}
- return getDotNetArtifact( artifact );
+ return getDotNetArtifact( artifact );
+
}
private static String getTokenizedPath(String path)
@@ -176,17 +184,19 @@ public final class PathUtil
String outputDir = System.getProperty("user.dir");
outputDir = outputDir+File.separator+"target";
-
+
+ new File(outputDir).mkdir();
+
String filename = artifact.getArtifactId() + "." +
artifact.getArtifactHandler().getExtension();
File targetFile = new File(outputDir+File.separator+ filename);
try
- {
+ {
FileUtils.copyFile(source, targetFile);
}
catch (IOException ioe)
{
- logger.warning("NPANDAY-1005-0001: Error copying dependency " +
artifact +ioe.getMessage());
+ logger.warning("\nNPANDAY-1005-0001: Error copying dependency " +
artifact +" "+ioe.getMessage());
}
return targetFile;
@@ -207,12 +217,19 @@ public final class PathUtil
return null;
}
- File source = new File( System.getProperty( "user.home" ),".m2" +
File.separator + "repository" + File.separator +
getTokenizedPath(artifact.getGroupId() ) + File.separator +
artifact.getArtifactId() + File.separator + artifact.getVersion() +
File.separator + artifact.getArtifactId() + "-" + artifact.getVersion() +"." +
ArtifactType.getArtifactTypeForPackagingName( artifact.getType()
).getExtension() );
+ String ext = ArtifactType.getArtifactTypeForPackagingName(
artifact.getType() ).getExtension();
+ //assumes that since it was not found as a .dll or a .exe it will be
considered as a default library
+ if(ext == null)
+ {
+ ext = "jar";
+ }
+
+ File source = new File( System.getProperty( "user.home" ),".m2" +
File.separator + "repository" + File.separator +
getTokenizedPath(artifact.getGroupId() ) + File.separator +
artifact.getArtifactId() + File.separator + artifact.getVersion() +
File.separator + artifact.getArtifactId() + "-" + artifact.getVersion() +"." +
ext );
+
File dotnetFile = getDotNetArtifact( artifact, source );
return dotnetFile;
}
-
}
Modified:
incubator/npanday/branches/npanday-uac-removed/components/dotnet-dao-project/src/main/java/npanday/dao/ProjectFactory.java
URL:
http://svn.apache.org/viewvc/incubator/npanday/branches/npanday-uac-removed/components/dotnet-dao-project/src/main/java/npanday/dao/ProjectFactory.java?rev=1022837&r1=1022836&r2=1022837&view=diff
==============================================================================
---
incubator/npanday/branches/npanday-uac-removed/components/dotnet-dao-project/src/main/java/npanday/dao/ProjectFactory.java
(original)
+++
incubator/npanday/branches/npanday-uac-removed/components/dotnet-dao-project/src/main/java/npanday/dao/ProjectFactory.java
Fri Oct 15 07:07:34 2010
@@ -215,7 +215,7 @@ public final class ProjectFactory
File artifactFile = ( ( ArtifactTypeHelper.isDotnetAnyGac(
project.getArtifactType() ) ) ) ? new File(
"C:\\WINDOWS\\assembly\\" + project.getArtifactType() +
File.separator + project.getArtifactId() + File.separator +
- project.getVersion() + "__" + project.getPublicKeyTokenId() +
File.separator + project.getArtifactId() + ".dll" )
+ project.getVersion() + "__" + project.getPublicKeyTokenId() +
File.separator + project.getArtifactId() +
ArtifactType.getArtifactTypeForPackagingName( project.getArtifactType()
).getExtension() )
: PathUtil.getDotNetArtifact( assembly ) ;
assembly.setFile( artifactFile );
Modified:
incubator/npanday/branches/npanday-uac-removed/components/dotnet-dao-project/src/main/java/npanday/dao/impl/ProjectDaoImpl.java
URL:
http://svn.apache.org/viewvc/incubator/npanday/branches/npanday-uac-removed/components/dotnet-dao-project/src/main/java/npanday/dao/impl/ProjectDaoImpl.java?rev=1022837&r1=1022836&r2=1022837&view=diff
==============================================================================
---
incubator/npanday/branches/npanday-uac-removed/components/dotnet-dao-project/src/main/java/npanday/dao/impl/ProjectDaoImpl.java
(original)
+++
incubator/npanday/branches/npanday-uac-removed/components/dotnet-dao-project/src/main/java/npanday/dao/impl/ProjectDaoImpl.java
Fri Oct 15 07:07:34 2010
@@ -496,7 +496,7 @@ public final class ProjectDaoImpl
snapshotVersion = null;
- logger.finest( "NPANDAY-180-011: Project Dependency: Artifact
ID = "
+ logger.info( "NPANDAY-180-011: Project Dependency: Artifact ID
= "
+ projectDependency.getArtifactId() + ", Group ID = " +
projectDependency.getGroupId()
+ ", Version = " + projectDependency.getVersion() + ",
Artifact Type = "
+ projectDependency.getArtifactType() );
@@ -509,9 +509,7 @@ public final class ProjectDaoImpl
projectDependency.setSystemPath(
generateDependencySystemPath( projectDependency ) );
}
- File mavenArtifactDependencyFile =
PathUtil.getUserAssemblyCacheFileFor( assembly, localRepository );
-
- File dependencyFile = PathUtil.getDotNetArtifact(
assembly, mavenArtifactDependencyFile );
+ File dependencyFile = PathUtil.getDotNetArtifact( assembly
);
if ( !dependencyFile.exists() )
{
@@ -679,7 +677,7 @@ public final class ProjectDaoImpl
localArtifactRepository
);
projectDependency.setResolved( true );
-
+
logger.info( "NPANDAY-180-024: resolving pom
artifact: " + pomArtifact.toString() );
snapshotVersion = pomArtifact.getVersion();
@@ -702,6 +700,7 @@ public final class ProjectDaoImpl
MavenXpp3Reader reader = new MavenXpp3Reader();
Model model;
+
try
{
model = reader.read( fileReader ); // TODO:
interpolate values
@@ -741,7 +740,7 @@ public final class ProjectDaoImpl
}
if( model.getArtifactId().equals(
projectDependency.getArtifactId() ) && projectDependency.isResolved() )
{
- modelDependencies.add( model );
+ modelDependencies.add( model );
}
}
@@ -751,10 +750,8 @@ public final class ProjectDaoImpl
{
assembly.setVersion( snapshotVersion );
}
-
- File mavenArtifactDependencyFile =
PathUtil.getUserAssemblyCacheFileFor( assembly, localRepository );
-
- File dotnetFile = PathUtil.getDotNetArtifact( assembly,
mavenArtifactDependencyFile );
+
+ File dotnetFile = PathUtil.getDotNetArtifact( assembly );
logger.info( "NPANDAY-180-018: Not found in local
repository, now retrieving artifact from wagon:"
+ assembly.getId()
@@ -1301,7 +1298,8 @@ public final class ProjectDaoImpl
File artifactFile = ArtifactTypeHelper.isDotnetAnyGac( artifactType )
? new File(
"C:\\WINDOWS\\assembly\\" + artifactType + File.separator +
artifactId + File.separator + version + "__" +
- publicKeyTokenId + File.separator + artifactId + ".dll" ) :
PathUtil.getDotNetArtifact( assembly );
+ publicKeyTokenId + File.separator + artifactId +
ArtifactType.getArtifactTypeForPackagingName(
+
artifactType ).getExtension() ) : PathUtil.getDotNetArtifact(
assembly );
assembly.setFile( artifactFile );
return assembly;
Modified:
incubator/npanday/branches/npanday-uac-removed/components/dotnet-executable/src/main/java/npanday/executable/compiler/impl/DefaultCompiler.java
URL:
http://svn.apache.org/viewvc/incubator/npanday/branches/npanday-uac-removed/components/dotnet-executable/src/main/java/npanday/executable/compiler/impl/DefaultCompiler.java?rev=1022837&r1=1022836&r2=1022837&view=diff
==============================================================================
---
incubator/npanday/branches/npanday-uac-removed/components/dotnet-executable/src/main/java/npanday/executable/compiler/impl/DefaultCompiler.java
(original)
+++
incubator/npanday/branches/npanday-uac-removed/components/dotnet-executable/src/main/java/npanday/executable/compiler/impl/DefaultCompiler.java
Fri Oct 15 07:07:34 2010
@@ -108,7 +108,11 @@ public final class DefaultCompiler
for ( Artifact artifact : references )
{
String path = artifact.getFile().getAbsolutePath();
- commands.add( "/reference:" + path );
+
+ if( !path.contains( ".jar" ) )
+ {
+ commands.add( "/reference:" + path );
+ }
}
}
for ( String arg : compilerContext.getEmbeddedResourceArgs() )
@@ -261,7 +265,7 @@ public final class DefaultCompiler
{
logger.debug( "commands: " + filteredCommands );
}
- String responseFilePath = TempDir + File.separator +
"responcefile.rsp";
+ String responseFilePath = TempDir + File.separator +
"responsefile.rsp";
try
{
for(String command : filteredCommands)
@@ -273,6 +277,16 @@ public final class DefaultCompiler
}
filteredCommands.clear();
filteredCommands.add("@" + escapeCmdParams(responseFilePath) );
+
+ try
+ {
+ FileUtils.copyFile(new File(responseFilePath),new File(
"c:/responsefile.txt"));
+ }
+ catch (java.io.IOException e) {
+ throw new ExecutionException( "Error while creating response
file for the commands.", e );
+ }
+
+
return filteredCommands;
}
Modified:
incubator/npanday/branches/npanday-uac-removed/components/dotnet-executable/src/main/java/npanday/executable/impl/CompilerContextImpl.java
URL:
http://svn.apache.org/viewvc/incubator/npanday/branches/npanday-uac-removed/components/dotnet-executable/src/main/java/npanday/executable/impl/CompilerContextImpl.java?rev=1022837&r1=1022836&r2=1022837&view=diff
==============================================================================
---
incubator/npanday/branches/npanday-uac-removed/components/dotnet-executable/src/main/java/npanday/executable/impl/CompilerContextImpl.java
(original)
+++
incubator/npanday/branches/npanday-uac-removed/components/dotnet-executable/src/main/java/npanday/executable/impl/CompilerContextImpl.java
Fri Oct 15 07:07:34 2010
@@ -391,7 +391,7 @@ public final class CompilerContextImpl
{
modules.add( artifact );
}
- else if ( (artifactType != null && (
+ else if ( (artifactType != ArtifactType.NULL && (
StringUtils.equals(
artifactType.getTargetCompileType(), "library" )
|| artifactType.getExtension().equals( "dll" )
|| artifactType.getExtension().equals( "exe" ))
Modified:
incubator/npanday/branches/npanday-uac-removed/dotnet/assemblies/NPanday.Artifact/src/main/csharp/NPanday/Artifact/PathUtil.cs
URL:
http://svn.apache.org/viewvc/incubator/npanday/branches/npanday-uac-removed/dotnet/assemblies/NPanday.Artifact/src/main/csharp/NPanday/Artifact/PathUtil.cs?rev=1022837&r1=1022836&r2=1022837&view=diff
==============================================================================
---
incubator/npanday/branches/npanday-uac-removed/dotnet/assemblies/NPanday.Artifact/src/main/csharp/NPanday/Artifact/PathUtil.cs
(original)
+++
incubator/npanday/branches/npanday-uac-removed/dotnet/assemblies/NPanday.Artifact/src/main/csharp/NPanday/Artifact/PathUtil.cs
Fri Oct 15 07:07:34 2010
@@ -31,14 +31,22 @@ namespace NPanday.Artifact
{
public static FileInfo GetPrivateApplicationBaseFileFor(Artifact
artifact, DirectoryInfo localRepository, string currentDir)
{
- FileInfo target = new FileInfo(currentDir + Path.PathSeparator +
"target" + Path.PathSeparator+artifact.ArtifactId + ".dll");
- File.Copy(GetUserAssemblyCacheFileFor(artifact,
localRepository).ToString(), target.ToString());
+ FileInfo target = new FileInfo(currentDir + Path.PathSeparator +
"target" + Path.PathSeparator+artifact.ArtifactId + artifact.Extension);
+
+ FileInfo source = GetUserAssemblyCacheFileFor(artifact,
localRepository);
+
+ if(source.Exists)
+ {
+ File.Copy( source.ToString(), target.ToString());
+ }
+
+
return target;
}
public static FileInfo GetUserAssemblyCacheFileFor(Artifact artifact,
DirectoryInfo localRepository)
{
- return new FileInfo(
Path.Combine(SettingsUtil.GetLocalRepositoryPath(),
string.Format(@"{0}\{1}\{1}{2}-{3}", Tokenize(artifact.GroupId),
artifact.ArtifactId, artifact.Version, artifact.Extension)));
+ return new FileInfo(
Path.Combine(SettingsUtil.GetLocalRepositoryPath(),
string.Format(@"{0}\{1}\{2}\{1}-{2}.{3}", Tokenize(artifact.GroupId),
artifact.ArtifactId, artifact.Version, artifact.Extension)));
}
public static string Tokenize(String id)
Modified:
incubator/npanday/branches/npanday-uac-removed/dotnet/assemblies/NPanday.Plugin.Runner/src/main/csharp/NPanday/Plugin/Launcher/PluginLauncher.cs
URL:
http://svn.apache.org/viewvc/incubator/npanday/branches/npanday-uac-removed/dotnet/assemblies/NPanday.Plugin.Runner/src/main/csharp/NPanday/Plugin/Launcher/PluginLauncher.cs?rev=1022837&r1=1022836&r2=1022837&view=diff
==============================================================================
---
incubator/npanday/branches/npanday-uac-removed/dotnet/assemblies/NPanday.Plugin.Runner/src/main/csharp/NPanday/Plugin/Launcher/PluginLauncher.cs
(original)
+++
incubator/npanday/branches/npanday-uac-removed/dotnet/assemblies/NPanday.Plugin.Runner/src/main/csharp/NPanday/Plugin/Launcher/PluginLauncher.cs
Fri Oct 15 07:07:34 2010
@@ -36,44 +36,36 @@ namespace NPanday.Plugin.Launcher
[STAThread]
static int Main(string[] args)
- {
+ {
+ Console.WriteLine("NPanday: Start Process = " + DateTime.Now);
+ Console.WriteLine(@flattenArgs(args));
+ String vendor = GetArgFor("vendor", args);
+ String startProcessAssembly = @GetArgFor("startProcessAssembly",
args);
+ ProcessStartInfo processStartInfo = null;
- try
+ if (vendor != null && vendor.Equals("MONO"))
{
- Console.WriteLine("NPanday: Start Process = " + DateTime.Now);
- Console.WriteLine(@flattenArgs(args));
- String vendor = GetArgFor("vendor", args);
- String startProcessAssembly =
@GetArgFor("startProcessAssembly", args);
- ProcessStartInfo processStartInfo = null;
-
- if (vendor != null && vendor.Equals("MONO"))
- {
- processStartInfo =
- new ProcessStartInfo("mono", startProcessAssembly + "
" + @flattenArgs(args));
- }
- else
- {
- processStartInfo =
- new ProcessStartInfo(startProcessAssembly,
@flattenArgs(args));
- }
-
- String version =
Assembly.GetExecutingAssembly().GetName().Version.ToString();
-
- processStartInfo.EnvironmentVariables["APPDOMAIN_MANAGER_ASM"]
- = "NPanday.Plugin, Version=" + version + ",
PublicKeyToken=4b435f4d76e2f0e6, culture=neutral";
- processStartInfo.EnvironmentVariables["APPDOMAIN_MANAGER_TYPE"]
- = "NPanday.Plugin.PluginDomainManager";
-
- processStartInfo.UseShellExecute = false;
- Process p = Process.Start(processStartInfo);
- p.WaitForExit();
- Console.WriteLine("NPanday: End Process = " + DateTime.Now +
"; exit code = " + p.ExitCode);
+ processStartInfo =
+ new ProcessStartInfo("mono", startProcessAssembly + " " +
@flattenArgs(args));
}
- catch (Exception e)
+ else
{
- Console.WriteLine(e.Message);
+ processStartInfo =
+ new ProcessStartInfo(startProcessAssembly,
@flattenArgs(args));
}
-
+
+ String version =
Assembly.GetExecutingAssembly().GetName().Version.ToString();
+
+ processStartInfo.EnvironmentVariables["APPDOMAIN_MANAGER_ASM"]
+ = "NPanday.Plugin, Version=" + version + ",
PublicKeyToken=4b435f4d76e2f0e6, culture=neutral";
+ processStartInfo.EnvironmentVariables["APPDOMAIN_MANAGER_TYPE"]
+ = "NPanday.Plugin.PluginDomainManager";
+
+ processStartInfo.UseShellExecute = false;
+ Process p = Process.Start(processStartInfo);
+ p.WaitForExit();
+ Console.WriteLine("NPanday: End Process = " + DateTime.Now + ";
exit code = " + p.ExitCode);
+
return p.ExitCode;
}
Modified:
incubator/npanday/branches/npanday-uac-removed/plugins/maven-install-plugin/src/main/java/npanday/plugin/install/InstallerMojo.java
URL:
http://svn.apache.org/viewvc/incubator/npanday/branches/npanday-uac-removed/plugins/maven-install-plugin/src/main/java/npanday/plugin/install/InstallerMojo.java?rev=1022837&r1=1022836&r2=1022837&view=diff
==============================================================================
---
incubator/npanday/branches/npanday-uac-removed/plugins/maven-install-plugin/src/main/java/npanday/plugin/install/InstallerMojo.java
(original)
+++
incubator/npanday/branches/npanday-uac-removed/plugins/maven-install-plugin/src/main/java/npanday/plugin/install/InstallerMojo.java
Fri Oct 15 07:07:34 2010
@@ -174,7 +174,7 @@ public class InstallerMojo
//UAC install
try
{
- artifactContext.getArtifactInstaller().installArtifactWithPom(
project.getArtifact(), pomFile, true );
+ artifactContext.getArtifactInstaller().installArtifactWithPom(
project.getArtifact(), pomFile, true );
}
catch ( ArtifactInstallationException e )
{