public static string Create(string projectFilePath, string nuspec, string outputDirectory)
 {
     using (var creator = new InlineNuGetPackageCreator(projectFilePath, nuspec, outputDirectory))
     {
         return(creator.Create());
     }
 }
Esempio n. 2
0
        static void Main(string[] args)
        {
            try
            {
                Console.WriteLine("Creating inline NuGet package...");

                using (var nuspecFinder = new NuspecFinder(args.Length > 0 ? args[0] : null))
                {
                    var nuspec = nuspecFinder.NuspecPath;
                    Console.WriteLine($"Using nuspec {nuspec}");

                    var projectFile = Directory.GetFiles(Path.GetDirectoryName(nuspec), "*.*proj").Single();
                    Console.WriteLine($"Using project file {projectFile}");

                    var packed = InlineNuGetPackageCreator.Create(projectFilePath: projectFile, nuspec: nuspec, outputDirectory: Environment.CurrentDirectory);
                    Console.WriteLine($"Created {packed}");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("==== AN ERROR OCCURRED ====");
                Console.WriteLine(ex);
                Console.WriteLine("===========================");
            }
            finally
            {
                Console.Out.Flush();
                Console.Error.Flush();
            }
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            try
            {
                Console.WriteLine("Creating inline NuGet package...");

                var nuspec = args.Length == 0
                    ? Directory.GetFiles(Environment.CurrentDirectory, "*.nuspec").FirstOrDefault()
                    : args[0];

                if (nuspec == null)
                {
                    throw new FileNotFoundException("No nuspec file found");
                }
                Console.WriteLine($"Using nuspec {nuspec}");

                var projectFile = Directory.GetFiles(Path.GetDirectoryName(nuspec), "*.*proj").Single();
                Console.WriteLine($"Using project file {projectFile}");

                var packed = InlineNuGetPackageCreator.Create(projectFilePath: projectFile, nuspec: nuspec, outputDirectory: Environment.CurrentDirectory);
                Console.WriteLine($"Created {packed}");
            }
            catch (Exception ex)
            {
                Console.WriteLine("==== AN ERROR OCCURRED ====");
                Console.WriteLine(ex);
                Console.WriteLine("===========================");
            }
            finally
            {
                Console.Out.Flush();
                Console.Error.Flush();
            }
        }