DevOpsTargets 1.1.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package DevOpsTargets --version 1.1.1
NuGet\Install-Package DevOpsTargets -Version 1.1.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DevOpsTargets" Version="1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DevOpsTargets --version 1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DevOpsTargets, 1.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DevOpsTargets as a Cake Addin #addin nuget:?package=DevOpsTargets&version=1.1.1 // Install DevOpsTargets as a Cake Tool #tool nuget:?package=DevOpsTargets&version=1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
devops-targets
This are helper deployment scripts used for building, testing deploying application with .NET script or .NET SDK app.
Use with dotnet script;
#! "net5.0"
#r "nuget:DevOpsTargets"
using System.IO;
using static Bullseye.Targets;
using static DevOpsTargets.Targets;
var pathToApp = Path.Combine(GetScriptFolder(), "MyApp");
Target("check-version", "Check .NET CLI version", () => Shell("dotnet --version"));
Target("build", "Build .NET App", DependsOn("check-version"), () => DotNet.Build(pathToApp));
RunAndExit(Args);
Methods
using static DevOpsTargets.Targets;
// Run all Bullseye Targets with the System.CommandLine library.
RunAndExit(IEnumerable<string> args, string loggerPrefix); // void
// Get current script directory
GetScriptFolder(); // string
// Create directory if not exists
EnsureDirectoryExists(string path); // void
// Remove and re-create directory.
CleanDirectory(string path); // void
// Delete all passed paths
DeleteAllFilesAndFolders(params string[] paths); // void
// Write messages to the output.
Write(string message, LogLevel logLevel = LogLevel.Message); // void
// Write messages to the output on a new line.
WriteLine(string message, LogLevel logLevel = LogLevel.Message); // void
// Start a shell command for the current OS.
ShellCommand(string command, string workingDirectory = null, LogLevel outputLogLevel = LogLevel.Verbose, bool doubleEscapeLinux = true); // Command
// Start a shell command for the current OS and wait result.
Shell(string command, string workingDirectory = null, LogLevel outputLogLevel = LogLevel.Verbose); // string
// Start a shell command for the current OS and wait result if test command fail.
ShellInstall(string testCommand, string installCommand, string workingDirectory = null, LogLevel outputLogLevel = LogLevel.Verbose); // string
// Merge transform .json into another .json
Transform.TransformSettingsJson(string pathToSettingsJson, string pathToTransformJson); // void
// Find value of a property in json.
Transform.FindPropertyValueInJson(string pathToJson, string propertyName); // string
// Find value in XML by xpath
Transform.GetXmlXPathValue(string pathToXml, string xpath); // string
// Replace ${value} in a text file
Transform.ReplaceInFile(string pathToFile, string pathToNewFile, params EnvValue[] values); // void
// Build csproj file
DotNet.Build(string pathToProject, string configuration = "Debug"); // void
// Publish csproj file
DotNet.Publish(string pathToProject, string pathToOutput, string configuration = "Release"); // void
// Test csproj file
DotNet.Test(string pathToProject, string configuration = "Debug", string pathToOutput = null); // void
// Test with coverage csproj file
DotNet.TestWithCoverage(string pathToProject, string pathToOutput, string configuration = "Debug", TestCoverageFormat formats = TestCoverageFormat.Cobertura, params TestLogInfo[] loggers); // void
// Install NodeJs version if NodeJs was never installed.
NodeJs.Install(string version); // void
// Execute `npm install` in folder.
Npm.Install(string pathToFolder); // void
// Execute `npm ci --no-optional ..` in folder.
Npm.Ci(string pathToFolder, string cacheFolder = null"); // void
// Install npm package globally is not already installed. Example InstallGlobal("@angular/cli");
Npm.InstallGlobal(string package); // void
// Run NPM command.
Npm.Run(string command, string pathToFolder); // void
Also see samples/.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net5.0
- Bullseye (>= 3.8.0)
- DevOpsTargets.Terminal (>= 1.1.1)
- System.CommandLine (>= 2.0.0-beta1.21308.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.