File tree Expand file tree Collapse file tree 2 files changed +23
-5
lines changed
build-tools-internal/src/main
java/org/elasticsearch/gradle/internal/util Expand file tree Collapse file tree 2 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,14 @@ import java.time.LocalDateTime;
1212
1313import org.elasticsearch.gradle.Architecture
1414import org.elasticsearch.gradle.OS
15+ import static org.elasticsearch.gradle.internal.util.CiUtils.safeName
1516
1617import java.lang.management.ManagementFactory
1718import java.time.LocalDateTime
1819
20+ // Resolving this early to avoid issues with the build scan plugin in combination with the configuration cache usage
21+ def taskNames = gradle. startParameter. taskNames. join(' ' )
22+
1923develocity {
2024
2125 buildScan {
@@ -112,7 +116,7 @@ develocity {
112116
113117 // Add a build annotation
114118 // See: https://buildkite.com/docs/agent/v3/cli-annotate
115- def body = """ <div class="mb3"><span class="p1 border rounded">${ System.getenv('BUILDKITE_LABEL')} </span> :gradle: ${ result.failures ? 'failed' : 'successful'} build: <a href="${ scan.buildScanUri} "><code>gradle ${ gradle.startParameter. taskNames.join(' ') } </code></a></div>"""
119+ def body = """ <div class="mb3"><span class="p1 border rounded">${ System.getenv('BUILDKITE_LABEL')} </span> :gradle: ${ result.failures ? 'failed' : 'successful'} build: <a href="${ scan.buildScanUri} "><code>gradle ${ taskNames} </code></a></div>"""
116120 def process = [
117121 ' buildkite-agent' ,
118122 ' annotate' ,
@@ -133,7 +137,3 @@ develocity {
133137 }
134138 }
135139}
136-
137- static def safeName (String string ) {
138- return string. replaceAll(/ [^a-zA-Z0-9_\-\. ]+/ , ' ' ). trim(). replaceAll(' ' , ' _' ). toLowerCase()
139- }
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+ * or more contributor license agreements. Licensed under the "Elastic License
4+ * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+ * Public License v 1"; you may not use this file except in compliance with, at
6+ * your election, the "Elastic License 2.0", the "GNU Affero General Public
7+ * License v3.0 only", or the "Server Side Public License, v 1".
8+ */
9+
10+ package org .elasticsearch .gradle .internal .util ;
11+
12+ public class CiUtils {
13+
14+ static String safeName (String input ) {
15+ return input .replaceAll ("[^a-zA-Z0-9_\\ -\\ .]+" , " " ).trim ().replaceAll (" " , "_" ).toLowerCase ();
16+ }
17+
18+ }
You can’t perform that action at this time.
0 commit comments