.NET Framework
Prerequisites
Requirements to the host machine
|
Currently, Space Automation does not provide any special API for working with .NET Framework projects. This means, that you should run .NET Framework builds by using the build tools directly inside shell scripts.
The content of .space.kts
might look like follows:
// paths to tools
val nuget = "C:\\nuget\\nuget.exe"
val msbuild = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\MSBuild\\Current\\Bin\\MsBuild.exe"
val nunit = "C:\\Program Files (x86)\\NUnit.org\\nunit-console\\nunit3-console.exe"
job("Build and test") {
host("Run nuget, msbuild, nunit") {
shellScript {
// 1. Restore dependencies
// 2. Build the solution (MySolution.sln)
// 3. Run tests in the MainTests.csproj project
// To escape spaces in command line, we use quotes e.g. "$msbuild"
content = """
"$nuget" restore
"$msbuild" netframework-sample.sln
"$nunit" MainTests\MainTests.csproj
"""
}
// run this job only on
// a Windows worker
requirements {
os {
type = OSType.Windows
}
}
}
}
Thanks for your feedback!
Was this page helpful?