在TeamCity,我们一直特别关注.NET,其许多工具和测试框架。在这篇文章中,我们想谈谈对.NET支持的最新更新,并共享一个示例演示项目来说明它们。
现在,在TeamCity的.NET支持一个巨大的一套专门的“实施运动员”和“打造特色”。运行程序提供了构建与第三方软件的集成,功能充当了构建的功能附加组件。
在版本2020.1之前,TeamCity提供了以下.NET组件:
- MSBUILD -转轮用的MSBuild和单XBuild支持
- Visual Studio(sln) -使用MSBuild模拟Visual Studio IDE(devenv)的运行器
- Visual Studio 2003-与上一个运行程序相同,但考虑到Visual Studio 2003的详细信息
- Visual Studio测试-运行Visual Studio和MS测试的运行器
- .NET Process Runner-启动.NET应用程序的运行器
- .NET CLI Runner – , TeamCity .NET Core CLI
- NUnit – , NUnit-
- NuGet – nuget.exe CLI Windows
- TeamCity NuGet
- TeamCity symbol server –
- Azure DevOps ( Team Foundation Server)
- Duplicates Finder (ReSharper) –
- Inspections (ReSharper) – JetBrains Resharper
- FxCop – FxCop
- JetBrains dotTrace – dotTrace Command-Line Profiler
- JetBrains dotMemory Unit – JetBrains dotMemory Unit
- 3D- Unity
TeamCity .NET, . , , , :
- .NET-
..
, .NET Core , Microsoft , .NET SDK. .NET 5 – .NET Core, .NET Framework, Xamarin Mono. 2020.1 TeamCity , , , .NET. . , .NET . :
, .NET, . .NET 5 Visual Studio Rider.
-
, .NET – .NET CLI. , .NET-. TeamCity . TeamCity -.
- .NET .NET :
|
|
|
TeamCity |
|
|
.NET Standard 1.2 |
|
|
NuGet |
|
.NET Standard 1.2 |
IoC |
|
NuGet |
|
.NET 5.0 |
|
|
|
|
.NET 5.0 |
|
|
Docker |
|
.NET 5.0 |
Web |
|
Docker |
|
.NET 4.8 WPF |
|
|
Windows |
|
UAP |
UWP- |
|
UWP |
|
.NET Standard 1.2 |
Xamarin |
|
Android |
|
Xamarin Android |
Android |
|
Android |
CI/CD-, -. TeamCity , TeamCity Kotlin DSL. , . , . , , DSL, ( ).
2 :
- Windows 10 x64 Pro 10.0.19041
- Visual Studio 2019 Pro 16.8.1
- Docker (Windows container) 19.03.13
- .NET SDK 5.0
- Ubuntu 16.04
- Docker 18.06.3
GitHub Maven, IntelliJ IDEA 2020.2.2 : , .. , DSL- Kotlin.
DSL- .NET TeamCity. , TeamCity VCS root’, DSL-. , Versioned Settings, “Kotlin”:
, TeamCity DSL- .
.NET : «Building» «Deployment». -.
, .NET - – Build Deploy. :
– , Docker NuGet:
, , .NET- - /p:key=value
. , - system.configuration=Release
, /p:configuration=Release
. system.
, TeamCity , . , , TeamCity .NET:
TeamCity | |||
configuration | Release | MSBuild-. | |
VersionPrefix | 1.0.0 | . | |
VersionSuffix | beta%build.number% | . | |
Build console and web | InvariantGlobalization | true | , . |
Build Windows desktop | PublishDir | ../bin/Clock.Desktop/win/ | . |
AppxPackageDir | ../bin/Clock.Desktop.Uwp/win/ | UWP . | |
Pack | Copyright | Copyright 2020 JetBrains | NuGet-. |
Title | TeamCity .NET sample | ||
RepositoryType | git | ||
RepositoryUrl | https://github.com/JetBrains/teamcity-dotnet-samples.git | ||
RepositoryBranch | refs/heads/master |
«Test on Windows Test on Linux»
Windows #1 Linux Docker- mcr.microsoft.com/dotnet/core/sdk:5.0, .NET. Linux Docker, UI :
Linux Docker- .NET SDK 5.0. Windows , Docker.
Clock.Tests .NET 5.0, .NET Core CLI test
. JetBrains dotCover JetBrains.dotCover.DotNetCliTool, TeamCity. DSL, TestBase Linux Windows.
«Build console and web for win-x64» «Build console and web for linux-x64»
TeamCity Linux Windows Clock.Console Clock.Web , . BuildConsoleAndWebBase, – BuildBase. , Projects , , outputDir. .NET 5.0, , .NET Core CLI publish
.
UI Linux, Clock.Console , Output directory:
Windows, Runtime, win-x64, Output directory bin/Clock.Console/win-x64.
Clock.Web Linux , , Output directory bin/Clock.Web/linux-x64. , TeamCity .
win-x64:
- bin/Clock.Console/win-x64/Clock.Console
- bin/Clock.Console/win-x64/Clock.Web
linux-x64:
- bin/Clock.Console/linux-x64/Clock.Console
- bin/Clock.Console/linux-x64/Clock.Web
«Build Windows desktop»
Windows MSBuild Visual Studio 2019 #1 «» Restore, Rebuild Publish :
- Clock.Desktop/Clock.Desktop.csproj
- Clock.Desktop.Uwp/Clock.Desktop.csproj
, PublishDir ( Clock.Desktop) AppxPackageDir ( Clock.Desktop.Uwp). .
«Build Android app»
Android, Windows MSBuild Visual Studio 2019, #1:
, MSBuild «» Publish «» SignAndroidPackage, Android-.
«Pack»
NuGet- .NET CLI pack
, – Clock Clock.IoC:
NuGet- , .., TeamCity – . , NuGet-, .
«Build»
TeamCity . , TeamCity- - :
«Deploy»
- Push image … Linux Windows
- Push multi-arch image … - Docker.
- Publish to NuGet NuGet TeamCity NuGet.
NuGet- , NuGet-. Clock.Console Docker :
docker pull nikolayp/clock-console
docker run -it --rm nikolayp/clock-console
Clock.Web:
docker pull nikolayp/clock-web
docker run -it --rm -p 5000:5000 nikolayp/clock-web
Microsoft .NET 5, . TeamCity , .NET .NET 5 .
, . .