1- // Copyright © 2026 CCP ehf.
2-
31package Windows
42
53import jetbrains.buildServer.configs.kotlin.DslContext
@@ -42,14 +40,15 @@ class CarbonBuildWindows(buildName: String, configType: String, preset: String)
4240 id(buildName.toId())
4341 this.name = buildName
4442
45- artifactRules = " %env.CMAKE_INSTALL_PREFIX%"
43+ artifactRules = " %env.CMAKE_INSTALL_PREFIX% => artifact.zip "
4644
4745 params {
4846 param("env.GIT_TAG_HASH_OVERRIDE ", "")
4947 param("github_checkout_folder", "github")
5048 param("env.CTEST_JUNIT_OUTPUT_FILE ", "ctest_results.xml")
5149 select("env.VISUAL_STUDIO_PLATFORM_TOOLSET ", "v141", label = "Visual Studio Platform Toolset ", description = "Specify the toolset for the build. e.g. v141 or v143.",
5250 options = listOf("v141 (2017)" to "v141", "v143 (2022)" to "v143"))
51+ param("VS_DEV_BAT_SWITCHES ", "-arch=x64")
5352 param("env.CMAKE_BUILD_TARGETS ", "all")
5453 param("env.CMAKE_INSTALL_PREFIX ", ".build-artifact")
5554 param("env.CMAKE_CONFIG_TYPE ", configType)
@@ -91,7 +90,7 @@ class CarbonBuildWindows(buildName: String, configType: String, preset: String)
9190 scriptContent = """
9291 REM unfortunately ninja does not find the VS environment otherwise
9392 REM NB: the exported PATH also contains the location where we installed sentry-cli, e.g. teamcity.agent.work.dir
94- call "%env.VSDEV_BAT_PATH%" -arch=x64
93+ call "%env.VSDEV_BAT_PATH%" %VS_DEV_BAT_SWITCHES%
9594 echo ##teamcity[setParameter name='env.INCLUDE' value='%%INCLUDE%%']
9695 echo ##teamcity[setParameter name='env.LIB' value='%%LIB%%']
9796 echo ##teamcity[setParameter name='env.LIBPATH' value='%%LIBPATH%%']
@@ -140,7 +139,7 @@ class CarbonBuildWindows(buildName: String, configType: String, preset: String)
140139 echo ${' $' } Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList ${' $' } User, ${' $' } Password
141140 echo New-PSDrive -Name "symbols" -PSProvider FileSystem -Root ${' $' } Env:TC_SYMBOL_STORE_PATH -Credential ${' $' } Credential
142141 echo Write-Host "##teamcity[progressMessage 'Storing symbols']"
143- echo ${' $' } symstoreFlags = ^@^("add","/compress","/t", "CCP Games", "/c", "TeamCity %build.number%", "/s", "${' $' } Env:TC_SYMBOL_STORE_PATH", "/o", "/r", "/f", "%env.CMAKE_BUILD_FOLDER%"^)
142+ echo ${' $' } symstoreFlags = ^@^("add","/compress","/t", "CCP Games", "/c", "TeamCity %build.number%", "/s", "${' $' } Env:TC_SYMBOL_STORE_PATH", "/o", "/r", "/f", "%env.CMAKE_BUILD_FOLDER%"^)
144143 echo ^& ${' $' } Env:TC_SYMSTORE_PATH ${' $' } symstoreFlags ^| Tee-Object -file symstore.txt
145144 echo ${' $' } stored = get-content symstore.txt ^| Select-String "^SYMSTORE: Number of files stored = (.*)${' $' } "
146145 echo ${' $' } stored = ${' $' } stored.Matches.Groups[1].Value
@@ -166,7 +165,7 @@ class CarbonBuildWindows(buildName: String, configType: String, preset: String)
166165 ${' $' } Password = ConvertTo-SecureString -String "%DOMAIN_USER_PASSWORD%" -AsPlainText -Force
167166 ${' $' } Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList ${' $' } User, ${' $' } Password
168167 New-PSDrive -Name "symbols" -PSProvider FileSystem -Root ${' $' } Env:TC_SYMBOL_STORE_PATH -Credential ${' $' } Credential
169-
168+
170169 Write-Host "##teamcity[progressMessage 'Storing symbols']"
171170 ${' $' } symstoreFlags = @("add",
172171 "/compress",
@@ -177,16 +176,16 @@ class CarbonBuildWindows(buildName: String, configType: String, preset: String)
177176 "/r", # Recursive
178177 "/f", "%env.CMAKE_BUILD_FOLDER%") # source folder
179178 & ${' $' } Env:TC_SYMSTORE_PATH ${' $' } symstoreFlags | Tee-Object -file symstore.txt
180-
179+
181180 ${' $' } stored = get-content symstore.txt | Select-String "^SYMSTORE: Number of files stored = (.*)${' $' } "
182181 ${' $' } stored = ${' $' } stored.Matches.Groups[1].Value
183-
182+
184183 ${' $' } errors = get-content symstore.txt | Select-String "^SYMSTORE: Number of errors = (.*)${' $' } "
185184 ${' $' } errors = ${' $' } errors.Matches.Groups[1].Value
186-
185+
187186 ${' $' } ignored = get-content symstore.txt | Select-String "^SYMSTORE: Number of files ignored = (.*)${' $' } "
188187 ${' $' } ignored = ${' $' } ignored.Matches.Groups[1].Value
189-
188+
190189 Write-Host "##teamcity[buildStatus text='Stored: ${' $' } stored, Errors: ${' $' } errors, Ignored: ${' $' } ignored']"
191190 """ .trimIndent()
192191 }
@@ -210,13 +209,7 @@ class CarbonBuildWindows(buildName: String, configType: String, preset: String)
210209 authType = token {
211210 token = " %GITHUB_CARBON_PAT%"
212211 }
213- // Constrain PR triggers to compatible refs so as to avoid erroneous triggers
214- filterTargetBranch = """
215- +:refs/heads/main
216- +:refs/heads/release/*.x
217- -:refs/heads/release/1.x
218- """ .trimIndent()
219- filterAuthorRole = PullRequests .GitHubRoleFilter .MEMBER
212+ filterAuthorRole = PullRequests .GitHubRoleFilter .EVERYBODY
220213 }
221214 }
222215 commitStatusPublisher {
@@ -249,4 +242,4 @@ class CarbonBuildWindows(buildName: String, configType: String, preset: String)
249242 requirements {
250243 startsWith("teamcity.agent.jvm.os.name", "Windows Server ")
251244 }
252- })
245+ })
0 commit comments