dotnet-build-file 0.0.3

Package Description

dotnet tool install --global dotnet-build-file --version 0.0.3
This package contains a .NET Core Global Tool you can call from the shell/command line.

Usage

Usage: dotnet-build-file [arguments] [options]

Arguments:
  file          The file to build.

Options:
  -?|-h|--help  Show help information
  -d|--debug    Show debug info.
  -o|--output   Specify an output path.

Given a simple HelloWorld.cs:

using System;

namespace HelloWorld
{
    public static class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            foreach (var arg in args)
            {
                Console.WriteLine(arg);
            }
        }
    }   
}

You can build the file with:

dotnet build-file HelloWorld.cs

This will produce an obj and bin in the same directory as the HelloWorld.cs
file. The assembly name is assumed to be the same as the cs file. In the bin
directory is a cmd launcher as well.

bin\HelloWorld a b c

This produces the output:

Hello World!
a
b
c

If there is a HelloWorld.csproj in the same directory, this will be included.
Use this if you need to make PackageReference(s) or include a common cs file.
Directory.Build.props and Directory.Build.targets files are also searched for
and included.

Use Cases

  • Scratch Project: I tend to have a Scratch.csproj lying around so that I always
    have a project I can open an immediately try out something. This tool should
    replace that need.
  • Multiple Small Programs: I have a folder containing lots of small utility
    programs that I compile on all my machines. I use this tool to compile them.

Planned Features

  • Comiple and Run: The ability to execute the program directly after compiling.

Usage

Usage: dotnet-build-file [arguments] [options]

Arguments:
  file          The file to build.

Options:
  -?|-h|--help  Show help information
  -d|--debug    Show debug info.
  -o|--output   Specify an output path.

Given a simple HelloWorld.cs:

using System;

namespace HelloWorld
{
    public static class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            foreach (var arg in args)
            {
                Console.WriteLine(arg);
            }
        }
    }   
}

You can build the file with:

dotnet build-file HelloWorld.cs

This will produce an obj and bin in the same directory as the HelloWorld.cs
file. The assembly name is assumed to be the same as the cs file. In the bin
directory is a cmd launcher as well.

bin\HelloWorld a b c

This produces the output:

Hello World!
a
b
c

If there is a HelloWorld.csproj in the same directory, this will be included.
Use this if you need to make PackageReference(s) or include a common cs file.
Directory.Build.props and Directory.Build.targets files are also searched for
and included.

Use Cases

  • Scratch Project: I tend to have a Scratch.csproj lying around so that I always
    have a project I can open an immediately try out something. This tool should
    replace that need.
  • Multiple Small Programs: I have a folder containing lots of small utility
    programs that I compile on all my machines. I use this tool to compile them.

Planned Features

  • Comiple and Run: The ability to execute the program directly after compiling.

  • .NETCoreApp 2.1

    • No dependencies.

Version History

Version Downloads Last updated
0.0.3 268 8/3/2018
0.0.1 173 8/2/2018