C# Automated Rapid Project Setup (CARPS)
CARPS is a Python script that automates the setup of new C# projects. It streamlines the project initialization process by generating a series of commands to create a .NET project and solution file.
- Interactive prompts for project name input.
- Validation of project name.
- Creation of a new directory for the project.
- Initialization of a new .NET solution.
- Creation of a new console application.
- Addition of the application to the solution.
- Building and running the application.
- Error handling for command execution.
Download the latest release
- Download CARPS v4 for Microsoft.exe
- Place into the directory you want your project to be in.
- Run.
- It will ask you for the name of your project.
- Click enter
- It will create, build and test your project in the directory. Or
- Download the python script
- Use python to run it in your favorite IDE (hopefully VsCode ;) )
Prints a welcome message to the user.
Prompts the user to input the name of the project and returns the input as a string.
Validates the project name. The project name must be non-empty and can only contain alphanumeric characters and underscores. If the project name is invalid, it raises a ValueError.
Executes a single command using the subprocess module. It prints the command being executed and the output of the command. If the command fails, it prints an error message and stops the execution of the program.
Creates the necessary directories for the project and constructs a list of .NET commands to be executed. It then calls execute_single_command
for each command in the list.
The main function of the program. It parses command line arguments, gets the project name if not provided, validates the project name, and executes the necessary commands to set up the .NET project.
Run this script in a Python environment. Follow the prompts to input the name of the new project. The script will generate a series of commands to set up the project.
- Python 3.x
- .NET SDK
John Akujobi
January 2024
4.0