Publish, System.Configuration property, Linux.
Hi.
I need to publish into single executable on Linux, Ubuntu. Here is relevant piece of config from DSL:
params {
param("MajorVersion", "1")
param("MinorVersion", "1")
param("system.Platform", "Any CPU")
param("teamcity.dotnet.vstest.17.0", "%MajorVersion%.%MinorVersion%.%build.number%.%build.counter%")
param("system.NugetPackAnyCPU", "AnyCPU")
param("system.Configuration", "single_exe")
}
dotnetPublish {
name = "publish"
conditions {
contains("teamcity.agent.jvm.os.name", "Linux")
}
projects = "src/proj/proj.csproj"
framework = "netcoreapp3.1"
configuration = "single_exe"
runtime = "linux-x64"
outputDir = "single_exe"
args = """
-p:PublishReadyToRun=true
-p:PublishSingleFile=true
""".trimIndent()
logging = DotnetPublishStep.Verbosity.Minimal
param("dotNetCoverage.dotCover.home.path", "%teamcity.tool.JetBrains.dotCover.CommandLineTools.DEFAULT%")
}
publish step is the last and looks like:
dotnet publish proj.csproj --framework netcoreapp3.1 --configuration single_exe --runtime linux-x64 --output single_exe @/home/asharov/BuildAgent/temp/agentTmp/3.rsp -p:PublishReadyToRun=true -p:PublishSingleFile=true
Everything is fine, works as expected no problems...unless I change param("system.Configuration", "single_exe") to
param("system.Configuration", "Release"). I want to publish project only with single_exe configuration because in csproj file I have smth like this:
<Choose>
<When Condition=" '$(Configuration)' != 'single_exe' ">
<ItemGroup>
Basically, I want Release build with publishing single_exe configuraion on the last step because otherwise it won't work (will give publish error,smh like multiply Bundle entrance specification and so on). So I basically introduce single_exe configuration to prevent this error.
Put it simply, if I setup param("system.Configuration", "single_exe") everything is great, no problem. But I want
Release except last publish step, hence in config for publish step have (see above):
configuration = "single_exe"
But it seems that it won't override overall Release configuration... I've introduces single_exe configuration only for publishing, otherwise I want to use Debug\Release.
What I'm doing wrong? Can you advice something?
Thanks in advance.
Please sign in to leave a comment.
Anyone to the rescue?
Anyone?
Anyone?