You are viewing a plain text version of this content. The canonical link for it is here.
Posted to nmaven-commits@incubator.apache.org by br...@apache.org on 2008/06/30 12:54:03 UTC
svn commit: r672753 [9/9] - in /incubator/nmaven/branches/NMAVEN_0.14:
archetypes/maven-archetype-dotnet-simple/src/main/resources/archetype-resources/src/main/csharp/Sample/
archetypes/maven-archetype-dotnet-simple/src/main/resources/archetype-resourc...
Modified: incubator/nmaven/branches/NMAVEN_0.14/plugins/netplugins/NMaven.Plugin.Resx/src/main/csharp/NMaven/Plugin/Resx/ResX.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/NMAVEN_0.14/plugins/netplugins/NMaven.Plugin.Resx/src/main/csharp/NMaven/Plugin/Resx/ResX.cs?rev=672753&r1=672752&r2=672753&view=diff
==============================================================================
--- incubator/nmaven/branches/NMAVEN_0.14/plugins/netplugins/NMaven.Plugin.Resx/src/main/csharp/NMaven/Plugin/Resx/ResX.cs (original)
+++ incubator/nmaven/branches/NMAVEN_0.14/plugins/netplugins/NMaven.Plugin.Resx/src/main/csharp/NMaven/Plugin/Resx/ResX.cs Mon Jun 30 05:54:00 2008
@@ -1,177 +1,177 @@
-//
-// 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.
-//
-
-using System;
-using System.Text;
-using System.Resources;
-using System.IO;
-using System.Configuration;
-using System.Drawing;
-
-namespace NMaven.Plugin.ResX
-{
- /// <summary>
- /// Utility for generating resource files
- /// </summary>
- public class ResourceGenerator
- {
- ///<summary>
- /// Generates a resource file
- ///</summary>
- ///<param name = "sourceDirectory">directory containing resources (jpg, txt, wav)</param>
- ///<param name = "outputFile">the generated .resources file</param>
- ///<returns>void</returns>
- public void Execute(string sourceDirectory, string outputFile)
- {
- AppSettingsReader appSettingsReader = new AppSettingsReader();
- if (!hasConfig(appSettingsReader)) throw new Exception("NMAVEN-9000-003: Could not find exe.config file.");
-
- ResXResourceWriter resourceWriter = new ResXResourceWriter(@outputFile);
-
- DirectoryInfo directoryInfo =
- new DirectoryInfo(@sourceDirectory);
- foreach (FileInfo fileInfo in directoryInfo.GetFiles())
- {
- MimeType mimeType = GetMimeTypeFor(fileInfo.Name, appSettingsReader);
- string extension = mimeType.GetExtension();
- if (extension.Equals("ico"))
- resourceWriter.AddResource(fileInfo.Name, new Icon(@fileInfo.FullName));
- else if (extension.Equals("x-properties"))
- {
- StreamReader reader = new StreamReader(fileInfo.OpenRead(),Encoding.Default);
- while(reader.Peek() >= 0)
- {
- string[] values = reader.ReadLine().Split('=');
- if(values != null && values.Length == 2 && !values[0].StartsWith("#"))
- resourceWriter.AddResource(values[0], values[1]);
- }
- reader.Close();
- }
- else if (extension.Equals("db"))
- continue;//Thumbnail
- else if(extension.Equals("wav"))
- {
- MemoryStream memoryStream = FileInfoToMemoryStream(fileInfo);
- resourceWriter.AddResource(fileInfo.Name, memoryStream);
- memoryStream.Close();
- }
- else if (mimeType.GetPrimaryType().Equals("image"))
- resourceWriter.AddResource(fileInfo.Name, new Bitmap(@fileInfo.FullName));
- else if(mimeType.GetPrimaryType().Equals("text"))
- resourceWriter.AddResource(fileInfo.Name, fileInfo.OpenText().ReadToEnd());
- else
- {
- MemoryStream memoryStream = FileInfoToMemoryStream(fileInfo);
- resourceWriter.AddResource(fileInfo.Name, memoryStream.ToArray());
- memoryStream.Close();
- }
- }
- resourceWriter.Generate();
- resourceWriter.Close();
- }
-
- /// <summary>
- /// Entry method
- /// </summary>
- /// <param name="args">array of arguments: 1) source directory of resources and 2) resource output file</param>
- /// <returns>if successful, return 0, otherwise returns 1</returns>
- public static int Main(string[] args)
- {
- Console.WriteLine("NMAVEN Resource Generator Utility ");
-/*
- if (args.Length != 2)
- {
- StringBuilder stringBuilder = new StringBuilder();
- foreach (string arg in args)
- stringBuilder.Append("Arg = ").Append(arg).Append(", ");
-
- Console.Error.WriteLine("NMAVEN-9000-000: Exiting program: Incorrect number of args (should have 2): Number Found = {0}, {1} ",
- args.Length, stringBuilder.ToString());
- return 1;
- }
-*/
- string sourceDirectory = args[0];
- string outputFile = args[1];
-
- ResourceGenerator resX = new ResourceGenerator();
- try
- {
- resX.Execute(sourceDirectory, outputFile);
- }
- catch (Exception e)
- {
- Console.Error.WriteLine("NMAVEN-9000-002: Unable to generate resources: " + e.ToString());
- return 1;
- }
- return 0;
- }
-
- /// <summary>
- /// Returns mime-type information for the given file
- /// </summary>
- /// <param name="fileName">file name</param>
- /// <param name="appSettingsReader">reader for the utility config</param>
- /// <returns>mime-type information for the given file</returns>
- private MimeType GetMimeTypeFor(String fileName, AppSettingsReader appSettingsReader)
- {
- string extension = new FileInfo(fileName).Extension.Substring(1);
- string mimeType = null;
- try
- {
- mimeType = (string)appSettingsReader.GetValue(extension, typeof(string));
- }
- catch (InvalidOperationException e)
- {
- Console.WriteLine("NMAVEN-9000-001: Could not find the mime-type: Extension = {0} "
- , extension);
- return new MimeType("", "", extension);
- }
- return new MimeType(mimeType.Split('/')[0], mimeType.Split('/')[1], extension);
- }
-
- /// <summary>
- /// Converts file info to memory stream
- /// </summary>
- /// <param name="fileInfo">file info</param>
- /// <returns>memory stream for the file</returns>
- private MemoryStream FileInfoToMemoryStream(FileInfo fileInfo)
- {
- MemoryStream memoryStream = new MemoryStream();
- BinaryReader reader = new BinaryReader(fileInfo.Open(FileMode.Open), Encoding.Default);
- byte[] buffer = new byte[1024];
- int n = 0;
- while ((n = reader.Read(buffer, 0, 1024)) > 0)
- memoryStream.Write(buffer, 0, n);
- return memoryStream;
- }
-
- private bool hasConfig(AppSettingsReader appSettingsReader)
- {
- try
- {
- string s = (string)appSettingsReader.GetValue("txt", typeof(string));
- return true;
- }
- catch (InvalidOperationException e)
- {
- 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.
+//
+
+using System;
+using System.Text;
+using System.Resources;
+using System.IO;
+using System.Configuration;
+using System.Drawing;
+
+namespace NMaven.Plugin.ResX
+{
+ /// <summary>
+ /// Utility for generating resource files
+ /// </summary>
+ public class ResourceGenerator
+ {
+ ///<summary>
+ /// Generates a resource file
+ ///</summary>
+ ///<param name = "sourceDirectory">directory containing resources (jpg, txt, wav)</param>
+ ///<param name = "outputFile">the generated .resources file</param>
+ ///<returns>void</returns>
+ public void Execute(string sourceDirectory, string outputFile)
+ {
+ AppSettingsReader appSettingsReader = new AppSettingsReader();
+ if (!hasConfig(appSettingsReader)) throw new Exception("NMAVEN-9000-003: Could not find exe.config file.");
+
+ ResXResourceWriter resourceWriter = new ResXResourceWriter(@outputFile);
+
+ DirectoryInfo directoryInfo =
+ new DirectoryInfo(@sourceDirectory);
+ foreach (FileInfo fileInfo in directoryInfo.GetFiles())
+ {
+ MimeType mimeType = GetMimeTypeFor(fileInfo.Name, appSettingsReader);
+ string extension = mimeType.GetExtension();
+ if (extension.Equals("ico"))
+ resourceWriter.AddResource(fileInfo.Name, new Icon(@fileInfo.FullName));
+ else if (extension.Equals("x-properties"))
+ {
+ StreamReader reader = new StreamReader(fileInfo.OpenRead(),Encoding.Default);
+ while(reader.Peek() >= 0)
+ {
+ string[] values = reader.ReadLine().Split('=');
+ if(values != null && values.Length == 2 && !values[0].StartsWith("#"))
+ resourceWriter.AddResource(values[0], values[1]);
+ }
+ reader.Close();
+ }
+ else if (extension.Equals("db"))
+ continue;//Thumbnail
+ else if(extension.Equals("wav"))
+ {
+ MemoryStream memoryStream = FileInfoToMemoryStream(fileInfo);
+ resourceWriter.AddResource(fileInfo.Name, memoryStream);
+ memoryStream.Close();
+ }
+ else if (mimeType.GetPrimaryType().Equals("image"))
+ resourceWriter.AddResource(fileInfo.Name, new Bitmap(@fileInfo.FullName));
+ else if(mimeType.GetPrimaryType().Equals("text"))
+ resourceWriter.AddResource(fileInfo.Name, fileInfo.OpenText().ReadToEnd());
+ else
+ {
+ MemoryStream memoryStream = FileInfoToMemoryStream(fileInfo);
+ resourceWriter.AddResource(fileInfo.Name, memoryStream.ToArray());
+ memoryStream.Close();
+ }
+ }
+ resourceWriter.Generate();
+ resourceWriter.Close();
+ }
+
+ /// <summary>
+ /// Entry method
+ /// </summary>
+ /// <param name="args">array of arguments: 1) source directory of resources and 2) resource output file</param>
+ /// <returns>if successful, return 0, otherwise returns 1</returns>
+ public static int Main(string[] args)
+ {
+ Console.WriteLine("NMAVEN Resource Generator Utility ");
+/*
+ if (args.Length != 2)
+ {
+ StringBuilder stringBuilder = new StringBuilder();
+ foreach (string arg in args)
+ stringBuilder.Append("Arg = ").Append(arg).Append(", ");
+
+ Console.Error.WriteLine("NMAVEN-9000-000: Exiting program: Incorrect number of args (should have 2): Number Found = {0}, {1} ",
+ args.Length, stringBuilder.ToString());
+ return 1;
+ }
+*/
+ string sourceDirectory = args[0];
+ string outputFile = args[1];
+
+ ResourceGenerator resX = new ResourceGenerator();
+ try
+ {
+ resX.Execute(sourceDirectory, outputFile);
+ }
+ catch (Exception e)
+ {
+ Console.Error.WriteLine("NMAVEN-9000-002: Unable to generate resources: " + e.ToString());
+ return 1;
+ }
+ return 0;
+ }
+
+ /// <summary>
+ /// Returns mime-type information for the given file
+ /// </summary>
+ /// <param name="fileName">file name</param>
+ /// <param name="appSettingsReader">reader for the utility config</param>
+ /// <returns>mime-type information for the given file</returns>
+ private MimeType GetMimeTypeFor(String fileName, AppSettingsReader appSettingsReader)
+ {
+ string extension = new FileInfo(fileName).Extension.Substring(1);
+ string mimeType = null;
+ try
+ {
+ mimeType = (string)appSettingsReader.GetValue(extension, typeof(string));
+ }
+ catch (InvalidOperationException e)
+ {
+ Console.WriteLine("NMAVEN-9000-001: Could not find the mime-type: Extension = {0} "
+ , extension);
+ return new MimeType("", "", extension);
+ }
+ return new MimeType(mimeType.Split('/')[0], mimeType.Split('/')[1], extension);
+ }
+
+ /// <summary>
+ /// Converts file info to memory stream
+ /// </summary>
+ /// <param name="fileInfo">file info</param>
+ /// <returns>memory stream for the file</returns>
+ private MemoryStream FileInfoToMemoryStream(FileInfo fileInfo)
+ {
+ MemoryStream memoryStream = new MemoryStream();
+ BinaryReader reader = new BinaryReader(fileInfo.Open(FileMode.Open), Encoding.Default);
+ byte[] buffer = new byte[1024];
+ int n = 0;
+ while ((n = reader.Read(buffer, 0, 1024)) > 0)
+ memoryStream.Write(buffer, 0, n);
+ return memoryStream;
+ }
+
+ private bool hasConfig(AppSettingsReader appSettingsReader)
+ {
+ try
+ {
+ string s = (string)appSettingsReader.GetValue("txt", typeof(string));
+ return true;
+ }
+ catch (InvalidOperationException e)
+ {
+ return false;
+ }
+ }
+ }
+}
Propchange: incubator/nmaven/branches/NMAVEN_0.14/plugins/netplugins/NMaven.Plugin.Resx/src/main/csharp/NMaven/Plugin/Resx/ResX.cs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/nmaven/branches/NMAVEN_0.14/plugins/netplugins/NMaven.Plugin.Settings/src/main/csharp/NMaven/Plugin/Settings/ExecutionException.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/NMAVEN_0.14/plugins/netplugins/NMaven.Plugin.Settings/src/main/csharp/NMaven/Plugin/Settings/ExecutionException.cs?rev=672753&r1=672752&r2=672753&view=diff
==============================================================================
--- incubator/nmaven/branches/NMAVEN_0.14/plugins/netplugins/NMaven.Plugin.Settings/src/main/csharp/NMaven/Plugin/Settings/ExecutionException.cs (original)
+++ incubator/nmaven/branches/NMAVEN_0.14/plugins/netplugins/NMaven.Plugin.Settings/src/main/csharp/NMaven/Plugin/Settings/ExecutionException.cs Mon Jun 30 05:54:00 2008
@@ -1,36 +1,36 @@
-//
-// 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.
-//
-
-using System;
-using System.Runtime.Serialization;
-
-namespace NMaven.Plugin
-{
- [Serializable]
- public class ExecutionException : Exception
- {
- public ExecutionException() : base(){ }
-
- public ExecutionException(String message) : base(message) { }
-
- public ExecutionException(String message, Exception exception) : base(message, exception) { }
-
- public ExecutionException(SerializationInfo info, StreamingContext context) : base(info, context) { }
- }
-}
+//
+// 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.
+//
+
+using System;
+using System.Runtime.Serialization;
+
+namespace NMaven.Plugin
+{
+ [Serializable]
+ public class ExecutionException : Exception
+ {
+ public ExecutionException() : base(){ }
+
+ public ExecutionException(String message) : base(message) { }
+
+ public ExecutionException(String message, Exception exception) : base(message, exception) { }
+
+ public ExecutionException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
+}
Propchange: incubator/nmaven/branches/NMAVEN_0.14/plugins/netplugins/NMaven.Plugin.Settings/src/main/csharp/NMaven/Plugin/Settings/ExecutionException.cs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/nmaven/branches/NMAVEN_0.14/plugins/netplugins/NMaven.Plugin.Settings/src/main/csharp/NMaven/Plugin/Settings/SettingsGeneratorMojo.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/NMAVEN_0.14/plugins/netplugins/NMaven.Plugin.Settings/src/main/csharp/NMaven/Plugin/Settings/SettingsGeneratorMojo.cs?rev=672753&r1=672752&r2=672753&view=diff
==============================================================================
--- incubator/nmaven/branches/NMAVEN_0.14/plugins/netplugins/NMaven.Plugin.Settings/src/main/csharp/NMaven/Plugin/Settings/SettingsGeneratorMojo.cs (original)
+++ incubator/nmaven/branches/NMAVEN_0.14/plugins/netplugins/NMaven.Plugin.Settings/src/main/csharp/NMaven/Plugin/Settings/SettingsGeneratorMojo.cs Mon Jun 30 05:54:00 2008
@@ -1,293 +1,293 @@
-//
-// 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.
-//
-
-using System;
-using System.IO;
-using System.Collections;
-using System.Xml.Serialization;
-using Microsoft.Win32;
-
-using NMaven.Plugin;
-
-namespace NMaven.Plugin.Settings
-{
- [Serializable]
- [ClassAttribute(Phase = "validate", Goal = "generate-settings")]
- public sealed class SettingsGeneratorMojo : AbstractMojo
- {
- public SettingsGeneratorMojo() { }
-
- public override Type GetMojoImplementationType()
- {
- return this.GetType();
- }
-
- public override void Execute()
- {
- string outputFile = Environment.GetEnvironmentVariable("USERPROFILE") + "/.m2/nmaven-settings.xml";
- XmlSerializer serializer = new XmlSerializer(typeof(nmavenSettings));
-
- nmavenSettings settings = new nmavenSettings();
- settings.operatingSystem = Environment.OSVersion.ToString();
-
- RegistryKey monoRegistryKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Novell\Mono");
- RegistryKey microsoftRegistryKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\.NETFramework");
-
- string defaultMonoCLR = (monoRegistryKey != null) ? (string) monoRegistryKey.GetValue("DefaultCLR") : null;
-
- settings.defaultSetup = GetDefaultSetup(defaultMonoCLR,
- (string) microsoftRegistryKey.GetValue("InstallRoot"));
-
- nmavenSettingsVendorsVendor[] microsoftVendors = null;
- try
- {
- microsoftVendors = GetVendorsForMicrosoft(microsoftRegistryKey);
- }
- catch(ExecutionException e)
- {
- Console.WriteLine(e.ToString());
- }
-
- nmavenSettingsVendorsVendor[] monoVendors = null;
- try
- {
- monoVendors = GetVendorsForMono(monoRegistryKey, defaultMonoCLR);
- }
- catch(ExecutionException e)
- {
- Console.WriteLine(e.ToString());
- }
-
- nmavenSettingsVendorsVendor dotGnuVendor = null;
- try
- {
- dotGnuVendor = GetVendorForGnu(Environment.GetEnvironmentVariable("CSCC_LIB_PATH"));
- }
- catch(ExecutionException e)
- {
- Console.WriteLine(e.ToString());
- }
- int monoVendorsLength = (monoVendors == null) ? 0: monoVendors.Length;
- int dotGnuVendorLength = (dotGnuVendor == null) ? 0: 1;
- int microsoftVendorsLength = (microsoftVendors == null) ? 0: microsoftVendors.Length;
-
- nmavenSettingsVendorsVendor[] vendors =
- new nmavenSettingsVendorsVendor[microsoftVendorsLength + monoVendorsLength + dotGnuVendorLength];
-
- int copyLocation = 0;
- if(microsoftVendors != null)
- {
- microsoftVendors.CopyTo(vendors, copyLocation);
- copyLocation+=microsoftVendors.Length;
- }
- if(monoVendors != null)
- {
- monoVendors.CopyTo(vendors, copyLocation);
- copyLocation+=monoVendors.Length;
- }
- if(dotGnuVendor != null)
- vendors[copyLocation] = dotGnuVendor;
-
- settings.vendors = vendors;
-
- TextWriter writer = new StreamWriter(@outputFile);
- serializer.Serialize(writer, settings);
- writer.Close();
- }
-
- protected nmavenSettingsDefaultSetup GetDefaultSetup(string defaultMonoCLR,
- string installRoot)
- {
- nmavenSettingsDefaultSetup defaultSetup = new nmavenSettingsDefaultSetup();
- if(installRoot == null)
- {
- defaultSetup.vendorName = "MONO";
- defaultSetup.vendorVersion = defaultMonoCLR;
- return (defaultMonoCLR != null) ? defaultSetup : null;
- }
- bool dirInfo11 = new DirectoryInfo(Path.Combine(installRoot, "v1.1.4322")).Exists;
- bool dirInfo20 = new DirectoryInfo(Path.Combine(installRoot, "v2.0.50727")).Exists;
-
- if(installRoot != null)
- {
- if(!dirInfo11 && !dirInfo20)
- return null;
- defaultSetup.vendorName = "MICROSOFT";
- defaultSetup.vendorVersion = (dirInfo20) ? "2.0.50727" : "1.1.4322";
- defaultSetup.frameworkVersion = defaultSetup.vendorVersion;
- return defaultSetup;
- }
- else if(defaultMonoCLR != null)
- {
- defaultSetup.vendorName = "MONO";
- defaultSetup.vendorVersion = defaultMonoCLR;
- defaultSetup.frameworkVersion = "2.0.50727";
- return defaultSetup;
- }
- return null;
- }
-
- protected nmavenSettingsVendorsVendor GetVendorForGnu(String libPath)
- {
- if(libPath == null)
- throw new ExecutionException("NMAVEN-9011-000: No CSCC_LIB_PATH Found");
-
- if (libPath.EndsWith("lib" + Path.DirectorySeparatorChar + "cscc" + Path.DirectorySeparatorChar + "lib"))
- {
- string installR = new DirectoryInfo(libPath).Parent.Parent.Parent.FullName;
- string[] tokenizedInstallRoot = installR.Split(Path.DirectorySeparatorChar);
- string vendorVersion = tokenizedInstallRoot[tokenizedInstallRoot.Length - 1];
- if (!isValidVersion(vendorVersion))
- {
- throw new ExecutionException("NMAVEN-9011-001: Invalid version format for dotGNU: Version = " +
- vendorVersion + ", Root = " + installR);
- }
-
- nmavenSettingsVendorsVendor vendor = new nmavenSettingsVendorsVendor();
- vendor.vendorName = "DotGNU";
- vendor.vendorVersion = vendorVersion;
- nmavenSettingsVendorsVendorFrameworksFramework[] vendorFrameworks
- = new nmavenSettingsVendorsVendorFrameworksFramework[1];
- nmavenSettingsVendorsVendorFrameworksFramework vf = new nmavenSettingsVendorsVendorFrameworksFramework();
- vf.installRoot = Path.Combine(installR, "bin");
- vf.frameworkVersion = "2.0.50727";//doesn't matter
- vendorFrameworks[0] = vf; ;
- vendor.frameworks = vendorFrameworks;
- return vendor;
- }
- throw new ExecutionException("NMAVEN-9011-002: CSCC_LIB_PATH found but could not determine vendor information");
- }
-
- private nmavenSettingsVendorsVendor[] GetVendorsForMicrosoft(RegistryKey microsoftRegistryKey)
- {
- if(microsoftRegistryKey == null)
- throw new ExecutionException("NMAVEN-9011-006: Microsoft installation could not be found.");
- string installRoot = (string) microsoftRegistryKey.GetValue("InstallRoot");
- string sdkInstallRoot11 = (string) microsoftRegistryKey.GetValue("sdkInstallRootv1.1");
- string sdkInstallRoot20 = (string) microsoftRegistryKey.GetValue("sdkInstallRootv2.0");
-
- if(installRoot == null) throw new ExecutionException("NMAVEN-9011-005");
-
- nmavenSettingsVendorsVendor[] vendors = new nmavenSettingsVendorsVendor[3];
- DirectoryInfo dirInfo11 = new DirectoryInfo(Path.Combine(installRoot, "v1.1.4322"));
- DirectoryInfo dirInfo20 = new DirectoryInfo(Path.Combine(installRoot, "v2.0.50727"));
- DirectoryInfo dirInfo30 = new DirectoryInfo(Path.Combine(installRoot, "v3.0"));
- int vendorCounter = 0;
- if (dirInfo11.Exists)
- {
- nmavenSettingsVendorsVendor vendor = new nmavenSettingsVendorsVendor();
- vendor.vendorName = "MICROSOFT";
- vendor.vendorVersion = "1.1.4322";
- nmavenSettingsVendorsVendorFrameworksFramework[] vendorFrameworks
- = new nmavenSettingsVendorsVendorFrameworksFramework[1];
- nmavenSettingsVendorsVendorFrameworksFramework vf11
- = new nmavenSettingsVendorsVendorFrameworksFramework();
- vf11.installRoot = dirInfo11.FullName;
- vf11.frameworkVersion = "1.1.4322";
-
- vendorFrameworks[0] = vf11;
- vf11.sdkInstallRoot = sdkInstallRoot11;
- vendor.frameworks = vendorFrameworks;
-
- vendors[vendorCounter++] = vendor;
- }
- if (dirInfo20.Exists)
- {
- nmavenSettingsVendorsVendor vendor = new nmavenSettingsVendorsVendor();
- vendor.vendorName = "MICROSOFT";
- vendor.vendorVersion = "2.0.50727";
- nmavenSettingsVendorsVendorFrameworksFramework[] vendorFrameworks
- = new nmavenSettingsVendorsVendorFrameworksFramework[1];
- nmavenSettingsVendorsVendorFrameworksFramework vf11 = new nmavenSettingsVendorsVendorFrameworksFramework();
- vf11.installRoot = dirInfo20.FullName;
- vf11.frameworkVersion = "2.0.50727";
- vendorFrameworks[0] = vf11;
- vf11.sdkInstallRoot = sdkInstallRoot20;
- vendor.frameworks = vendorFrameworks;
- vendors[vendorCounter++] = vendor;
- }
- if (dirInfo30.Exists)
- {
- nmavenSettingsVendorsVendor vendor = new nmavenSettingsVendorsVendor();
- vendor.vendorName = "MICROSOFT";
- vendor.vendorVersion = "3.0";
- nmavenSettingsVendorsVendorFrameworksFramework[] vendorFrameworks = new nmavenSettingsVendorsVendorFrameworksFramework[1];
- nmavenSettingsVendorsVendorFrameworksFramework vf11 = new nmavenSettingsVendorsVendorFrameworksFramework();
- vf11.installRoot = dirInfo30.FullName;
- vf11.frameworkVersion = "3.0";
- vendorFrameworks[0] = vf11;
- vf11.sdkInstallRoot = sdkInstallRoot20;
- vendor.frameworks = vendorFrameworks;
- vendors[vendorCounter++] = vendor;
- }
-
- return vendors;
- }
-
- private nmavenSettingsVendorsVendor[] GetVendorsForMono(RegistryKey monoRegistryKey, string defaultMonoCLR)
- {
- if(monoRegistryKey == null)
- throw new ExecutionException("NMAVEN-9011-007: Mono installation could not be found.");
- nmavenSettingsVendorsVendor[] vendors = new nmavenSettingsVendorsVendor[monoRegistryKey.SubKeyCount];
- int i = 0;
- foreach (string keyName in monoRegistryKey.GetSubKeyNames())
- {
- string sdkInstallRoot = (string) monoRegistryKey.OpenSubKey(keyName).GetValue("SdkInstallRoot");
- if(sdkInstallRoot == null)
- throw new ExecutionException("NMAVEN-9011-004: Could not find install root key for mono");
- string installRoot = Path.Combine(sdkInstallRoot, "bin");
- nmavenSettingsVendorsVendorFrameworksFramework[] vendorFrameworks = new nmavenSettingsVendorsVendorFrameworksFramework[2];
- nmavenSettingsVendorsVendorFrameworksFramework vf11 = new nmavenSettingsVendorsVendorFrameworksFramework();
- vf11.installRoot = installRoot;
- vf11.frameworkVersion = "1.1.4322";
- vendorFrameworks[0] = vf11;
-
- nmavenSettingsVendorsVendorFrameworksFramework vf20 = new nmavenSettingsVendorsVendorFrameworksFramework();
- vf20.installRoot = installRoot;
- vf20.frameworkVersion = "2.0.50727";
- vendorFrameworks[1] = vf20;
-
- nmavenSettingsVendorsVendor vendor = new nmavenSettingsVendorsVendor();
- vendor.vendorName = "MONO";
- vendor.vendorVersion = keyName;
- vendor.frameworks = vendorFrameworks;
- if(defaultMonoCLR.Equals(keyName)) vendor.isDefault = "true";
- vendors[i++] = vendor;
- }
- return vendors;
- }
-
- private bool isValidVersion(String version)
- {
- string[] vendorVersionToken = version.Split('.');
- foreach (string token in vendorVersionToken)
- {
- try
- {
- Single.Parse(token);
- }
- catch(Exception)
- {
- return false;
- }
- }
- return true;
- }
- }
-}
+//
+// 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.
+//
+
+using System;
+using System.IO;
+using System.Collections;
+using System.Xml.Serialization;
+using Microsoft.Win32;
+
+using NMaven.Plugin;
+
+namespace NMaven.Plugin.Settings
+{
+ [Serializable]
+ [ClassAttribute(Phase = "validate", Goal = "generate-settings")]
+ public sealed class SettingsGeneratorMojo : AbstractMojo
+ {
+ public SettingsGeneratorMojo() { }
+
+ public override Type GetMojoImplementationType()
+ {
+ return this.GetType();
+ }
+
+ public override void Execute()
+ {
+ string outputFile = Environment.GetEnvironmentVariable("USERPROFILE") + "/.m2/nmaven-settings.xml";
+ XmlSerializer serializer = new XmlSerializer(typeof(nmavenSettings));
+
+ nmavenSettings settings = new nmavenSettings();
+ settings.operatingSystem = Environment.OSVersion.ToString();
+
+ RegistryKey monoRegistryKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Novell\Mono");
+ RegistryKey microsoftRegistryKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\.NETFramework");
+
+ string defaultMonoCLR = (monoRegistryKey != null) ? (string) monoRegistryKey.GetValue("DefaultCLR") : null;
+
+ settings.defaultSetup = GetDefaultSetup(defaultMonoCLR,
+ (string) microsoftRegistryKey.GetValue("InstallRoot"));
+
+ nmavenSettingsVendorsVendor[] microsoftVendors = null;
+ try
+ {
+ microsoftVendors = GetVendorsForMicrosoft(microsoftRegistryKey);
+ }
+ catch(ExecutionException e)
+ {
+ Console.WriteLine(e.ToString());
+ }
+
+ nmavenSettingsVendorsVendor[] monoVendors = null;
+ try
+ {
+ monoVendors = GetVendorsForMono(monoRegistryKey, defaultMonoCLR);
+ }
+ catch(ExecutionException e)
+ {
+ Console.WriteLine(e.ToString());
+ }
+
+ nmavenSettingsVendorsVendor dotGnuVendor = null;
+ try
+ {
+ dotGnuVendor = GetVendorForGnu(Environment.GetEnvironmentVariable("CSCC_LIB_PATH"));
+ }
+ catch(ExecutionException e)
+ {
+ Console.WriteLine(e.ToString());
+ }
+ int monoVendorsLength = (monoVendors == null) ? 0: monoVendors.Length;
+ int dotGnuVendorLength = (dotGnuVendor == null) ? 0: 1;
+ int microsoftVendorsLength = (microsoftVendors == null) ? 0: microsoftVendors.Length;
+
+ nmavenSettingsVendorsVendor[] vendors =
+ new nmavenSettingsVendorsVendor[microsoftVendorsLength + monoVendorsLength + dotGnuVendorLength];
+
+ int copyLocation = 0;
+ if(microsoftVendors != null)
+ {
+ microsoftVendors.CopyTo(vendors, copyLocation);
+ copyLocation+=microsoftVendors.Length;
+ }
+ if(monoVendors != null)
+ {
+ monoVendors.CopyTo(vendors, copyLocation);
+ copyLocation+=monoVendors.Length;
+ }
+ if(dotGnuVendor != null)
+ vendors[copyLocation] = dotGnuVendor;
+
+ settings.vendors = vendors;
+
+ TextWriter writer = new StreamWriter(@outputFile);
+ serializer.Serialize(writer, settings);
+ writer.Close();
+ }
+
+ protected nmavenSettingsDefaultSetup GetDefaultSetup(string defaultMonoCLR,
+ string installRoot)
+ {
+ nmavenSettingsDefaultSetup defaultSetup = new nmavenSettingsDefaultSetup();
+ if(installRoot == null)
+ {
+ defaultSetup.vendorName = "MONO";
+ defaultSetup.vendorVersion = defaultMonoCLR;
+ return (defaultMonoCLR != null) ? defaultSetup : null;
+ }
+ bool dirInfo11 = new DirectoryInfo(Path.Combine(installRoot, "v1.1.4322")).Exists;
+ bool dirInfo20 = new DirectoryInfo(Path.Combine(installRoot, "v2.0.50727")).Exists;
+
+ if(installRoot != null)
+ {
+ if(!dirInfo11 && !dirInfo20)
+ return null;
+ defaultSetup.vendorName = "MICROSOFT";
+ defaultSetup.vendorVersion = (dirInfo20) ? "2.0.50727" : "1.1.4322";
+ defaultSetup.frameworkVersion = defaultSetup.vendorVersion;
+ return defaultSetup;
+ }
+ else if(defaultMonoCLR != null)
+ {
+ defaultSetup.vendorName = "MONO";
+ defaultSetup.vendorVersion = defaultMonoCLR;
+ defaultSetup.frameworkVersion = "2.0.50727";
+ return defaultSetup;
+ }
+ return null;
+ }
+
+ protected nmavenSettingsVendorsVendor GetVendorForGnu(String libPath)
+ {
+ if(libPath == null)
+ throw new ExecutionException("NMAVEN-9011-000: No CSCC_LIB_PATH Found");
+
+ if (libPath.EndsWith("lib" + Path.DirectorySeparatorChar + "cscc" + Path.DirectorySeparatorChar + "lib"))
+ {
+ string installR = new DirectoryInfo(libPath).Parent.Parent.Parent.FullName;
+ string[] tokenizedInstallRoot = installR.Split(Path.DirectorySeparatorChar);
+ string vendorVersion = tokenizedInstallRoot[tokenizedInstallRoot.Length - 1];
+ if (!isValidVersion(vendorVersion))
+ {
+ throw new ExecutionException("NMAVEN-9011-001: Invalid version format for dotGNU: Version = " +
+ vendorVersion + ", Root = " + installR);
+ }
+
+ nmavenSettingsVendorsVendor vendor = new nmavenSettingsVendorsVendor();
+ vendor.vendorName = "DotGNU";
+ vendor.vendorVersion = vendorVersion;
+ nmavenSettingsVendorsVendorFrameworksFramework[] vendorFrameworks
+ = new nmavenSettingsVendorsVendorFrameworksFramework[1];
+ nmavenSettingsVendorsVendorFrameworksFramework vf = new nmavenSettingsVendorsVendorFrameworksFramework();
+ vf.installRoot = Path.Combine(installR, "bin");
+ vf.frameworkVersion = "2.0.50727";//doesn't matter
+ vendorFrameworks[0] = vf; ;
+ vendor.frameworks = vendorFrameworks;
+ return vendor;
+ }
+ throw new ExecutionException("NMAVEN-9011-002: CSCC_LIB_PATH found but could not determine vendor information");
+ }
+
+ private nmavenSettingsVendorsVendor[] GetVendorsForMicrosoft(RegistryKey microsoftRegistryKey)
+ {
+ if(microsoftRegistryKey == null)
+ throw new ExecutionException("NMAVEN-9011-006: Microsoft installation could not be found.");
+ string installRoot = (string) microsoftRegistryKey.GetValue("InstallRoot");
+ string sdkInstallRoot11 = (string) microsoftRegistryKey.GetValue("sdkInstallRootv1.1");
+ string sdkInstallRoot20 = (string) microsoftRegistryKey.GetValue("sdkInstallRootv2.0");
+
+ if(installRoot == null) throw new ExecutionException("NMAVEN-9011-005");
+
+ nmavenSettingsVendorsVendor[] vendors = new nmavenSettingsVendorsVendor[3];
+ DirectoryInfo dirInfo11 = new DirectoryInfo(Path.Combine(installRoot, "v1.1.4322"));
+ DirectoryInfo dirInfo20 = new DirectoryInfo(Path.Combine(installRoot, "v2.0.50727"));
+ DirectoryInfo dirInfo30 = new DirectoryInfo(Path.Combine(installRoot, "v3.0"));
+ int vendorCounter = 0;
+ if (dirInfo11.Exists)
+ {
+ nmavenSettingsVendorsVendor vendor = new nmavenSettingsVendorsVendor();
+ vendor.vendorName = "MICROSOFT";
+ vendor.vendorVersion = "1.1.4322";
+ nmavenSettingsVendorsVendorFrameworksFramework[] vendorFrameworks
+ = new nmavenSettingsVendorsVendorFrameworksFramework[1];
+ nmavenSettingsVendorsVendorFrameworksFramework vf11
+ = new nmavenSettingsVendorsVendorFrameworksFramework();
+ vf11.installRoot = dirInfo11.FullName;
+ vf11.frameworkVersion = "1.1.4322";
+
+ vendorFrameworks[0] = vf11;
+ vf11.sdkInstallRoot = sdkInstallRoot11;
+ vendor.frameworks = vendorFrameworks;
+
+ vendors[vendorCounter++] = vendor;
+ }
+ if (dirInfo20.Exists)
+ {
+ nmavenSettingsVendorsVendor vendor = new nmavenSettingsVendorsVendor();
+ vendor.vendorName = "MICROSOFT";
+ vendor.vendorVersion = "2.0.50727";
+ nmavenSettingsVendorsVendorFrameworksFramework[] vendorFrameworks
+ = new nmavenSettingsVendorsVendorFrameworksFramework[1];
+ nmavenSettingsVendorsVendorFrameworksFramework vf11 = new nmavenSettingsVendorsVendorFrameworksFramework();
+ vf11.installRoot = dirInfo20.FullName;
+ vf11.frameworkVersion = "2.0.50727";
+ vendorFrameworks[0] = vf11;
+ vf11.sdkInstallRoot = sdkInstallRoot20;
+ vendor.frameworks = vendorFrameworks;
+ vendors[vendorCounter++] = vendor;
+ }
+ if (dirInfo30.Exists)
+ {
+ nmavenSettingsVendorsVendor vendor = new nmavenSettingsVendorsVendor();
+ vendor.vendorName = "MICROSOFT";
+ vendor.vendorVersion = "3.0";
+ nmavenSettingsVendorsVendorFrameworksFramework[] vendorFrameworks = new nmavenSettingsVendorsVendorFrameworksFramework[1];
+ nmavenSettingsVendorsVendorFrameworksFramework vf11 = new nmavenSettingsVendorsVendorFrameworksFramework();
+ vf11.installRoot = dirInfo30.FullName;
+ vf11.frameworkVersion = "3.0";
+ vendorFrameworks[0] = vf11;
+ vf11.sdkInstallRoot = sdkInstallRoot20;
+ vendor.frameworks = vendorFrameworks;
+ vendors[vendorCounter++] = vendor;
+ }
+
+ return vendors;
+ }
+
+ private nmavenSettingsVendorsVendor[] GetVendorsForMono(RegistryKey monoRegistryKey, string defaultMonoCLR)
+ {
+ if(monoRegistryKey == null)
+ throw new ExecutionException("NMAVEN-9011-007: Mono installation could not be found.");
+ nmavenSettingsVendorsVendor[] vendors = new nmavenSettingsVendorsVendor[monoRegistryKey.SubKeyCount];
+ int i = 0;
+ foreach (string keyName in monoRegistryKey.GetSubKeyNames())
+ {
+ string sdkInstallRoot = (string) monoRegistryKey.OpenSubKey(keyName).GetValue("SdkInstallRoot");
+ if(sdkInstallRoot == null)
+ throw new ExecutionException("NMAVEN-9011-004: Could not find install root key for mono");
+ string installRoot = Path.Combine(sdkInstallRoot, "bin");
+ nmavenSettingsVendorsVendorFrameworksFramework[] vendorFrameworks = new nmavenSettingsVendorsVendorFrameworksFramework[2];
+ nmavenSettingsVendorsVendorFrameworksFramework vf11 = new nmavenSettingsVendorsVendorFrameworksFramework();
+ vf11.installRoot = installRoot;
+ vf11.frameworkVersion = "1.1.4322";
+ vendorFrameworks[0] = vf11;
+
+ nmavenSettingsVendorsVendorFrameworksFramework vf20 = new nmavenSettingsVendorsVendorFrameworksFramework();
+ vf20.installRoot = installRoot;
+ vf20.frameworkVersion = "2.0.50727";
+ vendorFrameworks[1] = vf20;
+
+ nmavenSettingsVendorsVendor vendor = new nmavenSettingsVendorsVendor();
+ vendor.vendorName = "MONO";
+ vendor.vendorVersion = keyName;
+ vendor.frameworks = vendorFrameworks;
+ if(defaultMonoCLR.Equals(keyName)) vendor.isDefault = "true";
+ vendors[i++] = vendor;
+ }
+ return vendors;
+ }
+
+ private bool isValidVersion(String version)
+ {
+ string[] vendorVersionToken = version.Split('.');
+ foreach (string token in vendorVersionToken)
+ {
+ try
+ {
+ Single.Parse(token);
+ }
+ catch(Exception)
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+}
Propchange: incubator/nmaven/branches/NMAVEN_0.14/plugins/netplugins/NMaven.Plugin.Settings/src/main/csharp/NMaven/Plugin/Settings/SettingsGeneratorMojo.cs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/nmaven/branches/NMAVEN_0.14/plugins/netplugins/NMaven.Plugin.Settings/src/main/csharp/NMaven/Plugin/Settings/nmavenSettings.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/NMAVEN_0.14/plugins/netplugins/NMaven.Plugin.Settings/src/main/csharp/NMaven/Plugin/Settings/nmavenSettings.cs?rev=672753&r1=672752&r2=672753&view=diff
==============================================================================
--- incubator/nmaven/branches/NMAVEN_0.14/plugins/netplugins/NMaven.Plugin.Settings/src/main/csharp/NMaven/Plugin/Settings/nmavenSettings.cs (original)
+++ incubator/nmaven/branches/NMAVEN_0.14/plugins/netplugins/NMaven.Plugin.Settings/src/main/csharp/NMaven/Plugin/Settings/nmavenSettings.cs Mon Jun 30 05:54:00 2008
@@ -1,89 +1,89 @@
-// ------------------------------------------------------------------------------
-// <autogenerated>
-// This code was generated by a tool.
-// Mono Runtime Version: 1.1.4322.2032
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </autogenerated>
-// ------------------------------------------------------------------------------
-
-//
-//This source code was auto-generated by MonoXSD
-//
-namespace NMaven.Plugin.Settings {
-
-
- /// <remarks/>
- public class nmavenSettings {
-
- /// <remarks/>
- public string operatingSystem;
-
- /// <remarks/>
- public string architecture;
-
- /// <remarks/>
- public nmavenSettingsDefaultSetup defaultSetup;
-
- /// <remarks/>
- [System.Xml.Serialization.XmlArrayItem(ElementName="vendor", IsNullable=false)]
- public nmavenSettingsVendorsVendor[] vendors;
- }
-
- /// <remarks/>
- public class nmavenSettingsDefaultSetup {
-
- /// <remarks/>
- public string vendorName;
-
- /// <remarks/>
- public string vendorVersion;
-
- /// <remarks/>
- public string frameworkVersion;
- }
-
- /// <remarks/>
- public class nmavenSettingsVendorsVendor {
-
- /// <remarks/>
- public string vendorName;
-
- /// <remarks/>
- public string vendorVersion;
-
- /// <remarks/>
- public string isDefault;
-
- /// <remarks/>
- [System.Xml.Serialization.XmlArrayItem(ElementName="framework", IsNullable=false)]
- public nmavenSettingsVendorsVendorFrameworksFramework[] frameworks;
- }
-
- /// <remarks/>
- public class nmavenSettingsVendorsVendorFrameworksFramework {
-
- /// <remarks/>
- public string frameworkVersion;
-
- /// <remarks/>
- public string installRoot;
-
- /// <remarks/>
- public string sdkInstallRoot;
-
- /// <remarks/>
- [System.Xml.Serialization.XmlArrayItem(ElementName="executablePath", IsNullable=false)]
- public string[] executablePaths;
- }
-
- /// <remarks/>
- [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)]
- public class NewDataSet {
-
- /// <remarks/>
- [System.Xml.Serialization.XmlElementAttribute()]
- public nmavenSettings[] nmavenSettings;
- }
-}
+// ------------------------------------------------------------------------------
+// <autogenerated>
+// This code was generated by a tool.
+// Mono Runtime Version: 1.1.4322.2032
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </autogenerated>
+// ------------------------------------------------------------------------------
+
+//
+//This source code was auto-generated by MonoXSD
+//
+namespace NMaven.Plugin.Settings {
+
+
+ /// <remarks/>
+ public class nmavenSettings {
+
+ /// <remarks/>
+ public string operatingSystem;
+
+ /// <remarks/>
+ public string architecture;
+
+ /// <remarks/>
+ public nmavenSettingsDefaultSetup defaultSetup;
+
+ /// <remarks/>
+ [System.Xml.Serialization.XmlArrayItem(ElementName="vendor", IsNullable=false)]
+ public nmavenSettingsVendorsVendor[] vendors;
+ }
+
+ /// <remarks/>
+ public class nmavenSettingsDefaultSetup {
+
+ /// <remarks/>
+ public string vendorName;
+
+ /// <remarks/>
+ public string vendorVersion;
+
+ /// <remarks/>
+ public string frameworkVersion;
+ }
+
+ /// <remarks/>
+ public class nmavenSettingsVendorsVendor {
+
+ /// <remarks/>
+ public string vendorName;
+
+ /// <remarks/>
+ public string vendorVersion;
+
+ /// <remarks/>
+ public string isDefault;
+
+ /// <remarks/>
+ [System.Xml.Serialization.XmlArrayItem(ElementName="framework", IsNullable=false)]
+ public nmavenSettingsVendorsVendorFrameworksFramework[] frameworks;
+ }
+
+ /// <remarks/>
+ public class nmavenSettingsVendorsVendorFrameworksFramework {
+
+ /// <remarks/>
+ public string frameworkVersion;
+
+ /// <remarks/>
+ public string installRoot;
+
+ /// <remarks/>
+ public string sdkInstallRoot;
+
+ /// <remarks/>
+ [System.Xml.Serialization.XmlArrayItem(ElementName="executablePath", IsNullable=false)]
+ public string[] executablePaths;
+ }
+
+ /// <remarks/>
+ [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)]
+ public class NewDataSet {
+
+ /// <remarks/>
+ [System.Xml.Serialization.XmlElementAttribute()]
+ public nmavenSettings[] nmavenSettings;
+ }
+}
Propchange: incubator/nmaven/branches/NMAVEN_0.14/plugins/netplugins/NMaven.Plugin.Settings/src/main/csharp/NMaven/Plugin/Settings/nmavenSettings.cs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/nmaven/branches/NMAVEN_0.14/plugins/netplugins/NMaven.Plugin.Solution/src/main/csharp/NMaven/Plugin/Solution/SolutionMojo.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/NMAVEN_0.14/plugins/netplugins/NMaven.Plugin.Solution/src/main/csharp/NMaven/Plugin/Solution/SolutionMojo.cs?rev=672753&r1=672752&r2=672753&view=diff
==============================================================================
--- incubator/nmaven/branches/NMAVEN_0.14/plugins/netplugins/NMaven.Plugin.Solution/src/main/csharp/NMaven/Plugin/Solution/SolutionMojo.cs (original)
+++ incubator/nmaven/branches/NMAVEN_0.14/plugins/netplugins/NMaven.Plugin.Solution/src/main/csharp/NMaven/Plugin/Solution/SolutionMojo.cs Mon Jun 30 05:54:00 2008
@@ -1,160 +1,160 @@
-//
-// 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.
-//
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Xml;
-using System.Xml.Serialization;
-
-using NMaven.Solution;
-using NMaven.Plugin;
-
-namespace NMaven.Plugin.Solution
-{
- /// <summary>
- /// Description
- /// </summary>
- [Serializable]
- [ClassAttribute(Phase = "package", Goal = "solution")]
- public sealed class SolutionMojo : AbstractMojo
- {
- public SolutionMojo()
- {
- }
-
- [FieldAttribute("localRepo", Expression = "${settings.localRepository}", Type = "java.lang.String")]
- public String localRepository;
-
- [FieldAttribute("basedir", Expression = "${basedir}", Type = "java.lang.String")]
- public String basedir;
-
- [FieldAttribute("mavenProject", Expression = "${project}", Type = "org.apache.maven.project.MavenProject")]
- public NMaven.Model.Pom.Model mavenProject;
-
- private String profile = null;
-
- public override Type GetMojoImplementationType()
- {
- return this.GetType();
- }
-
- public override void Execute()
- {
- IProjectGenerator projectGenerator = Factory.createDefaultProjectGenerator();
- FileInfo pomFileInfo = new FileInfo(basedir + @"\pom.xml");
- List<IProjectReference> projectReferences = Execute(new DirectoryInfo(pomFileInfo.DirectoryName),
- mavenProject, profile);
- String solutionFile = (profile == null) ? pomFileInfo.DirectoryName + @"\" + @mavenProject.artifactId + ".sln" :
- pomFileInfo.DirectoryName + @"\" + @mavenProject.artifactId + "." + profile + ".sln";
- projectGenerator.GenerateSolutionFor(new FileInfo(solutionFile), projectReferences);
- Console.WriteLine("Solution Plugin Working: " + basedir + ", Packaging = " + mavenProject.packaging);
-
- }
-
- public List<IProjectReference> Execute(DirectoryInfo currentDirectory, NMaven.Model.Pom.Model model, string profile)
- {
-
- if(model == null)
- {
- throw new ExecutionException("NMAVEN-000-000: Model is null");
- }
-
- if(currentDirectory == null)
- {
- throw new ExecutionException("NMAVEN-000-000: Current directory is null");
- }
- if(!currentDirectory.Exists)
- {
- throw new ExecutionException("NMAVEN-000-000: Could not find current directory: Path = "
- + currentDirectory.FullName);
- }
-
- List<IProjectReference> projectReferences = new List<IProjectReference>();
- IProjectGenerator projectGenerator = Factory.createDefaultProjectGenerator();
- if(model.packaging.Equals("pom"))
- {
- foreach(String module in GetModulesForProfile(profile, model))
- {
- DirectoryInfo newDir = new DirectoryInfo(currentDirectory.FullName + @"\" + module );
- NMaven.Model.Pom.Model m = projectGenerator.CreatePomModelFor(newDir.FullName + @"\pom.xml");
- projectReferences.AddRange(Execute(newDir, m, profile));
- }
- }
- else
- {
- IProjectReference mainProjectReference = null;
- if(new DirectoryInfo(currentDirectory.FullName + @"\src\main\csharp\").Exists)
- {
- mainProjectReference =
- projectGenerator.GenerateProjectFor(model,
- new DirectoryInfo(currentDirectory.FullName + @"\src\main\csharp\"),
- model.artifactId, null, new DirectoryInfo(localRepository));
- Console.WriteLine("NMAVEN-000-000: Generated project: File Name = "
- + mainProjectReference.CSProjectFile.FullName);
- projectReferences.Add(mainProjectReference);
- }
- if(new DirectoryInfo( currentDirectory.FullName + @"\src\test\csharp\").Exists)
- {
- List<IProjectReference> mainRef = new List<IProjectReference>();
- if(mainProjectReference != null)
- {
- mainRef.Add(mainProjectReference);
- }
- IProjectReference projectReference =
- projectGenerator.GenerateProjectFor(model,
- new DirectoryInfo(currentDirectory.FullName + @"\src\test\csharp\"),
- model.artifactId + "-Test", mainRef, new DirectoryInfo(localRepository));
- Console.WriteLine("NMAVEN-000-000: Generated test project: File Name = "
- + projectReference.CSProjectFile.FullName);
- projectReferences.Add(projectReference);
- }
- }
- return projectReferences;
- }
-
- private string GetArgFor(string name, string[] args)
- {
- char[] delim = {'='};
- foreach(string arg in args)
- {
- string[] tokens = arg.Split(delim);
- if (tokens[0].Equals(name)) return tokens[1];
- }
- return null;
- }
-
-
- private string[] GetModulesForProfile(string profile, NMaven.Model.Pom.Model model)
- {
- NMaven.Model.Pom.Profile[] profiles = model.profiles;
- if(profiles == null)
- return model.modules;
-
- foreach(NMaven.Model.Pom.Profile p in profiles)
- {
- if(p.activation.property.name.Equals(profile))
- {
- return p.modules;
- }
- }
- return model.modules;
- }
- }
-}
+//
+// 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.
+//
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Xml;
+using System.Xml.Serialization;
+
+using NMaven.Solution;
+using NMaven.Plugin;
+
+namespace NMaven.Plugin.Solution
+{
+ /// <summary>
+ /// Description
+ /// </summary>
+ [Serializable]
+ [ClassAttribute(Phase = "package", Goal = "solution")]
+ public sealed class SolutionMojo : AbstractMojo
+ {
+ public SolutionMojo()
+ {
+ }
+
+ [FieldAttribute("localRepo", Expression = "${settings.localRepository}", Type = "java.lang.String")]
+ public String localRepository;
+
+ [FieldAttribute("basedir", Expression = "${basedir}", Type = "java.lang.String")]
+ public String basedir;
+
+ [FieldAttribute("mavenProject", Expression = "${project}", Type = "org.apache.maven.project.MavenProject")]
+ public NMaven.Model.Pom.Model mavenProject;
+
+ private String profile = null;
+
+ public override Type GetMojoImplementationType()
+ {
+ return this.GetType();
+ }
+
+ public override void Execute()
+ {
+ IProjectGenerator projectGenerator = Factory.createDefaultProjectGenerator();
+ FileInfo pomFileInfo = new FileInfo(basedir + @"\pom.xml");
+ List<IProjectReference> projectReferences = Execute(new DirectoryInfo(pomFileInfo.DirectoryName),
+ mavenProject, profile);
+ String solutionFile = (profile == null) ? pomFileInfo.DirectoryName + @"\" + @mavenProject.artifactId + ".sln" :
+ pomFileInfo.DirectoryName + @"\" + @mavenProject.artifactId + "." + profile + ".sln";
+ projectGenerator.GenerateSolutionFor(new FileInfo(solutionFile), projectReferences);
+ Console.WriteLine("Solution Plugin Working: " + basedir + ", Packaging = " + mavenProject.packaging);
+
+ }
+
+ public List<IProjectReference> Execute(DirectoryInfo currentDirectory, NMaven.Model.Pom.Model model, string profile)
+ {
+
+ if(model == null)
+ {
+ throw new ExecutionException("NMAVEN-000-000: Model is null");
+ }
+
+ if(currentDirectory == null)
+ {
+ throw new ExecutionException("NMAVEN-000-000: Current directory is null");
+ }
+ if(!currentDirectory.Exists)
+ {
+ throw new ExecutionException("NMAVEN-000-000: Could not find current directory: Path = "
+ + currentDirectory.FullName);
+ }
+
+ List<IProjectReference> projectReferences = new List<IProjectReference>();
+ IProjectGenerator projectGenerator = Factory.createDefaultProjectGenerator();
+ if(model.packaging.Equals("pom"))
+ {
+ foreach(String module in GetModulesForProfile(profile, model))
+ {
+ DirectoryInfo newDir = new DirectoryInfo(currentDirectory.FullName + @"\" + module );
+ NMaven.Model.Pom.Model m = projectGenerator.CreatePomModelFor(newDir.FullName + @"\pom.xml");
+ projectReferences.AddRange(Execute(newDir, m, profile));
+ }
+ }
+ else
+ {
+ IProjectReference mainProjectReference = null;
+ if(new DirectoryInfo(currentDirectory.FullName + @"\src\main\csharp\").Exists)
+ {
+ mainProjectReference =
+ projectGenerator.GenerateProjectFor(model,
+ new DirectoryInfo(currentDirectory.FullName + @"\src\main\csharp\"),
+ model.artifactId, null, new DirectoryInfo(localRepository));
+ Console.WriteLine("NMAVEN-000-000: Generated project: File Name = "
+ + mainProjectReference.CSProjectFile.FullName);
+ projectReferences.Add(mainProjectReference);
+ }
+ if(new DirectoryInfo( currentDirectory.FullName + @"\src\test\csharp\").Exists)
+ {
+ List<IProjectReference> mainRef = new List<IProjectReference>();
+ if(mainProjectReference != null)
+ {
+ mainRef.Add(mainProjectReference);
+ }
+ IProjectReference projectReference =
+ projectGenerator.GenerateProjectFor(model,
+ new DirectoryInfo(currentDirectory.FullName + @"\src\test\csharp\"),
+ model.artifactId + "-Test", mainRef, new DirectoryInfo(localRepository));
+ Console.WriteLine("NMAVEN-000-000: Generated test project: File Name = "
+ + projectReference.CSProjectFile.FullName);
+ projectReferences.Add(projectReference);
+ }
+ }
+ return projectReferences;
+ }
+
+ private string GetArgFor(string name, string[] args)
+ {
+ char[] delim = {'='};
+ foreach(string arg in args)
+ {
+ string[] tokens = arg.Split(delim);
+ if (tokens[0].Equals(name)) return tokens[1];
+ }
+ return null;
+ }
+
+
+ private string[] GetModulesForProfile(string profile, NMaven.Model.Pom.Model model)
+ {
+ NMaven.Model.Pom.Profile[] profiles = model.profiles;
+ if(profiles == null)
+ return model.modules;
+
+ foreach(NMaven.Model.Pom.Profile p in profiles)
+ {
+ if(p.activation.property.name.Equals(profile))
+ {
+ return p.modules;
+ }
+ }
+ return model.modules;
+ }
+ }
+}
Propchange: incubator/nmaven/branches/NMAVEN_0.14/plugins/netplugins/NMaven.Plugin.Solution/src/main/csharp/NMaven/Plugin/Solution/SolutionMojo.cs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetexe/src/main/resources/archetype-resources/src/main/csharp/App.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetexe/src/main/resources/archetype-resources/src/main/csharp/App.cs?rev=672753&r1=672752&r2=672753&view=diff
==============================================================================
--- incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetexe/src/main/resources/archetype-resources/src/main/csharp/App.cs (original)
+++ incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetexe/src/main/resources/archetype-resources/src/main/csharp/App.cs Mon Jun 30 05:54:00 2008
@@ -1,19 +1,19 @@
-using System;
-
-namespace $package
-{
- /// <summary>
- /// Sample Maven Dotnet App
- /// </summary>
- class App
- {
- /// <summary>
- /// The main entry point for the application.
- /// </summary>
- [STAThread]
- static void Main(string[] args)
- {
- Console.WriteLine("Hello Bill");
- }
- }
-}
+using System;
+
+namespace $package
+{
+ /// <summary>
+ /// Sample Maven Dotnet App
+ /// </summary>
+ class App
+ {
+ /// <summary>
+ /// The main entry point for the application.
+ /// </summary>
+ [STAThread]
+ static void Main(string[] args)
+ {
+ Console.WriteLine("Hello Bill");
+ }
+ }
+}
Propchange: incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetexe/src/main/resources/archetype-resources/src/main/csharp/App.cs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetexe/src/main/resources/archetype-resources/src/main/csharp/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetexe/src/main/resources/archetype-resources/src/main/csharp/AssemblyInfo.cs?rev=672753&r1=672752&r2=672753&view=diff
==============================================================================
--- incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetexe/src/main/resources/archetype-resources/src/main/csharp/AssemblyInfo.cs (original)
+++ incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetexe/src/main/resources/archetype-resources/src/main/csharp/AssemblyInfo.cs Mon Jun 30 05:54:00 2008
@@ -1,58 +1,58 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-//
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-//
-[assembly: AssemblyTitle("")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-//
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-
-[assembly: AssemblyVersion("1.0.*")]
-
-//
-// In order to sign your assembly you must specify a key to use. Refer to the
-// Microsoft .NET Framework documentation for more information on assembly signing.
-//
-// Use the attributes below to control which key is used for signing.
-//
-// Notes:
-// (*) If no key is specified, the assembly is not signed.
-// (*) KeyName refers to a key that has been installed in the Crypto Service
-// Provider (CSP) on your machine. KeyFile refers to a file which contains
-// a key.
-// (*) If the KeyFile and the KeyName values are both specified, the
-// following processing occurs:
-// (1) If the KeyName can be found in the CSP, that key is used.
-// (2) If the KeyName does not exist and the KeyFile does exist, the key
-// in the KeyFile is installed into the CSP and used.
-// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
-// When specifying the KeyFile, the location of the KeyFile should be
-// relative to the project output directory which is
-// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
-// located in the project directory, you would specify the AssemblyKeyFile
-// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
-// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
-// documentation for more information on this.
-//
-[assembly: AssemblyDelaySign(false)]
-[assembly: AssemblyKeyFile("")]
-[assembly: AssemblyKeyName("")]
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+//
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly: AssemblyTitle("")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion("1.0.*")]
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing.
+//
+// Notes:
+// (*) If no key is specified, the assembly is not signed.
+// (*) KeyName refers to a key that has been installed in the Crypto Service
+// Provider (CSP) on your machine. KeyFile refers to a file which contains
+// a key.
+// (*) If the KeyFile and the KeyName values are both specified, the
+// following processing occurs:
+// (1) If the KeyName can be found in the CSP, that key is used.
+// (2) If the KeyName does not exist and the KeyFile does exist, the key
+// in the KeyFile is installed into the CSP and used.
+// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+// When specifying the KeyFile, the location of the KeyFile should be
+// relative to the project output directory which is
+// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
+// located in the project directory, you would specify the AssemblyKeyFile
+// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
+// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+// documentation for more information on this.
+//
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
+[assembly: AssemblyKeyName("")]
Propchange: incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetexe/src/main/resources/archetype-resources/src/main/csharp/AssemblyInfo.cs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetexe/src/main/resources/archetype-resources/src/test/csharp/AppTest.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetexe/src/main/resources/archetype-resources/src/test/csharp/AppTest.cs?rev=672753&r1=672752&r2=672753&view=diff
==============================================================================
--- incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetexe/src/main/resources/archetype-resources/src/test/csharp/AppTest.cs (original)
+++ incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetexe/src/main/resources/archetype-resources/src/test/csharp/AppTest.cs Mon Jun 30 05:54:00 2008
@@ -1,21 +1,21 @@
-using System;
-
-using NUnit.Framework;
-
-namespace $package
-{
- /// <summary>
- /// A very simple example of a dotnet test.
- /// </summary>
- [TestFixture] public class AppTest
- {
-
- [Test] public void test()
- {
- Assert.AreEqual(true, true);
- Console.WriteLine("Who said Java and dotnet don\'t mix? :-)");
- }
-
-
- }
+using System;
+
+using NUnit.Framework;
+
+namespace $package
+{
+ /// <summary>
+ /// A very simple example of a dotnet test.
+ /// </summary>
+ [TestFixture] public class AppTest
+ {
+
+ [Test] public void test()
+ {
+ Assert.AreEqual(true, true);
+ Console.WriteLine("Who said Java and dotnet don\'t mix? :-)");
+ }
+
+
+ }
}
\ No newline at end of file
Propchange: incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetexe/src/main/resources/archetype-resources/src/test/csharp/AppTest.cs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetlibrary/src/main/resources/archetype-resources/src/main/csharp/App.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetlibrary/src/main/resources/archetype-resources/src/main/csharp/App.cs?rev=672753&r1=672752&r2=672753&view=diff
==============================================================================
--- incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetlibrary/src/main/resources/archetype-resources/src/main/csharp/App.cs (original)
+++ incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetlibrary/src/main/resources/archetype-resources/src/main/csharp/App.cs Mon Jun 30 05:54:00 2008
@@ -1,18 +1,18 @@
-using System;
-
-namespace $package
-{
- /// <summary>
- /// Sample Maven Dotnet App
- /// </summary>
- public class App
- {
- /// <summary>
- /// A public call on the library...
- /// </summary>
- public void doSomething()
- {
- Console.WriteLine("Hello World");
- }
- }
-}
+using System;
+
+namespace $package
+{
+ /// <summary>
+ /// Sample Maven Dotnet App
+ /// </summary>
+ public class App
+ {
+ /// <summary>
+ /// A public call on the library...
+ /// </summary>
+ public void doSomething()
+ {
+ Console.WriteLine("Hello World");
+ }
+ }
+}
Propchange: incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetlibrary/src/main/resources/archetype-resources/src/main/csharp/App.cs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetlibrary/src/main/resources/archetype-resources/src/main/csharp/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetlibrary/src/main/resources/archetype-resources/src/main/csharp/AssemblyInfo.cs?rev=672753&r1=672752&r2=672753&view=diff
==============================================================================
--- incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetlibrary/src/main/resources/archetype-resources/src/main/csharp/AssemblyInfo.cs (original)
+++ incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetlibrary/src/main/resources/archetype-resources/src/main/csharp/AssemblyInfo.cs Mon Jun 30 05:54:00 2008
@@ -1,58 +1,58 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-//
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-//
-[assembly: AssemblyTitle("")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-//
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-
-[assembly: AssemblyVersion("1.0.*")]
-
-//
-// In order to sign your assembly you must specify a key to use. Refer to the
-// Microsoft .NET Framework documentation for more information on assembly signing.
-//
-// Use the attributes below to control which key is used for signing.
-//
-// Notes:
-// (*) If no key is specified, the assembly is not signed.
-// (*) KeyName refers to a key that has been installed in the Crypto Service
-// Provider (CSP) on your machine. KeyFile refers to a file which contains
-// a key.
-// (*) If the KeyFile and the KeyName values are both specified, the
-// following processing occurs:
-// (1) If the KeyName can be found in the CSP, that key is used.
-// (2) If the KeyName does not exist and the KeyFile does exist, the key
-// in the KeyFile is installed into the CSP and used.
-// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
-// When specifying the KeyFile, the location of the KeyFile should be
-// relative to the project output directory which is
-// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
-// located in the project directory, you would specify the AssemblyKeyFile
-// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
-// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
-// documentation for more information on this.
-//
-[assembly: AssemblyDelaySign(false)]
-[assembly: AssemblyKeyFile("")]
-[assembly: AssemblyKeyName("")]
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+//
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly: AssemblyTitle("")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion("1.0.*")]
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing.
+//
+// Notes:
+// (*) If no key is specified, the assembly is not signed.
+// (*) KeyName refers to a key that has been installed in the Crypto Service
+// Provider (CSP) on your machine. KeyFile refers to a file which contains
+// a key.
+// (*) If the KeyFile and the KeyName values are both specified, the
+// following processing occurs:
+// (1) If the KeyName can be found in the CSP, that key is used.
+// (2) If the KeyName does not exist and the KeyFile does exist, the key
+// in the KeyFile is installed into the CSP and used.
+// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+// When specifying the KeyFile, the location of the KeyFile should be
+// relative to the project output directory which is
+// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
+// located in the project directory, you would specify the AssemblyKeyFile
+// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
+// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+// documentation for more information on this.
+//
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
+[assembly: AssemblyKeyName("")]
Propchange: incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetlibrary/src/main/resources/archetype-resources/src/main/csharp/AssemblyInfo.cs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetlibrary/src/main/resources/archetype-resources/src/test/csharp/AppTest.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetlibrary/src/main/resources/archetype-resources/src/test/csharp/AppTest.cs?rev=672753&r1=672752&r2=672753&view=diff
==============================================================================
--- incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetlibrary/src/main/resources/archetype-resources/src/test/csharp/AppTest.cs (original)
+++ incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetlibrary/src/main/resources/archetype-resources/src/test/csharp/AppTest.cs Mon Jun 30 05:54:00 2008
@@ -1,21 +1,21 @@
-using System;
-
-using NUnit.Framework;
-
-namespace $package
-{
- /// <summary>
- /// A very simple example of a dotnet test.
- /// </summary>
- [TestFixture] public class AppTest
- {
-
- [Test] public void doTest()
- {
- Assert.AreEqual(true, true);
- Console.WriteLine("Who said Java and dotnet don\'t mix? :-)");
- }
-
-
- }
+using System;
+
+using NUnit.Framework;
+
+namespace $package
+{
+ /// <summary>
+ /// A very simple example of a dotnet test.
+ /// </summary>
+ [TestFixture] public class AppTest
+ {
+
+ [Test] public void doTest()
+ {
+ Assert.AreEqual(true, true);
+ Console.WriteLine("Who said Java and dotnet don\'t mix? :-)");
+ }
+
+
+ }
}
\ No newline at end of file
Propchange: incubator/nmaven/branches/NMAVEN_0.14/sandbox/maven-csharp/archetype/maven-archetype-dotnetlibrary/src/main/resources/archetype-resources/src/test/csharp/AppTest.cs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/nmaven/branches/NMAVEN_0.14/sandbox/prototype/maven-csharp-test/src/main/csharp/Test.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/NMAVEN_0.14/sandbox/prototype/maven-csharp-test/src/main/csharp/Test.cs?rev=672753&r1=672752&r2=672753&view=diff
==============================================================================
--- incubator/nmaven/branches/NMAVEN_0.14/sandbox/prototype/maven-csharp-test/src/main/csharp/Test.cs (original)
+++ incubator/nmaven/branches/NMAVEN_0.14/sandbox/prototype/maven-csharp-test/src/main/csharp/Test.cs Mon Jun 30 05:54:00 2008
@@ -1,17 +1,17 @@
-
-
-using System;
-using System.Text;
-
-namespace Com.Test {
- public class Test2 {
- public int MyProp {
- get { return 1; }
- }
-
- [STAThread]
- public static void Main(string[] args) {
- System.Console.WriteLine("HELLO WORLD");
- }
- }
-}
+
+
+using System;
+using System.Text;
+
+namespace Com.Test {
+ public class Test2 {
+ public int MyProp {
+ get { return 1; }
+ }
+
+ [STAThread]
+ public static void Main(string[] args) {
+ System.Console.WriteLine("HELLO WORLD");
+ }
+ }
+}
Propchange: incubator/nmaven/branches/NMAVEN_0.14/sandbox/prototype/maven-csharp-test/src/main/csharp/Test.cs
------------------------------------------------------------------------------
svn:eol-style = native