dotnet-build-file 0.0.3

dotnet tool install --global dotnet-build-file --version 0.0.3                
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local dotnet-build-file --version 0.0.3                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=dotnet-build-file&version=0.0.3                
nuke :add-package dotnet-build-file --version 0.0.3                

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.
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.1 is compatible.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 2.1

    • No dependencies.
Version Downloads Last updated
0.0.3 1,288 8/3/2018
0.0.1 886 8/2/2018