@@ -21,19 +21,19 @@ data class Config(
2121 * To use different SLF4J bindings, simply exclude the logback dependency.
2222 */
2323 val logLevel : String? =
24- env[" GRADLE_ENTERPRISE_API_LOG_LEVEL " ],
24+ env[" DEVELOCITY_API_LOG_LEVEL " ],
2525
2626 /* *
2727 * Provides the URL of a Develocity API instance REST API. By default, uses
28- * environment variable `GRADLE_ENTERPRISE_API_URL `. Must end with `/api/`.
28+ * environment variable `DEVELOCITY_API_URL `. Must end with `/api/`.
2929 */
3030 val apiUrl : String =
31- env[" GRADLE_ENTERPRISE_API_URL " ]
32- ? : error("GRADLE_ENTERPRISE_API_URL is required"),
31+ env[" DEVELOCITY_API_URL " ]
32+ ? : error("DEVELOCITY_API_URL is required"),
3333
3434 /* *
3535 * Provides the access token for a Develocity API instance. By default, uses keychain entry
36- * `gradle-enterprise-api-token` or environment variable `GRADLE_ENTERPRISE_API_TOKEN `.
36+ * `gradle-enterprise-api-token` or environment variable `DEVELOCITY_API_TOKEN `.
3737 */
3838 val apiToken : () -> String = {
3939 requireEnvOrKeychainToken()
@@ -53,24 +53,24 @@ data class Config(
5353
5454 /* *
5555 * Maximum amount of concurrent requests allowed. Further requests will be queued. By default,
56- * uses environment variable `GRADLE_ENTERPRISE_API_MAX_CONCURRENT_REQUESTS ` or 5 (OkHttp's
56+ * uses environment variable `DEVELOCITY_API_MAX_CONCURRENT_REQUESTS ` or 5 (OkHttp's
5757 * default value of [Dispatcher.maxRequestsPerHost]).
5858 *
5959 * If set, will set [Dispatcher.maxRequests] and [Dispatcher.maxRequestsPerHost] of the
6060 * internal client, overwriting what's inherited from the base client of [clientBuilder],
6161 * if any.
6262 */
6363 val maxConcurrentRequests : Int? =
64- env[" GRADLE_ENTERPRISE_API_MAX_CONCURRENT_REQUESTS " ]?.toInt(),
64+ env[" DEVELOCITY_API_MAX_CONCURRENT_REQUESTS " ]?.toInt(),
6565
6666 /* *
6767 * Timeout for reading an API response, used for [OkHttpClient.readTimeoutMillis].
68- * By default, uses environment variable `GRADLE_ENTERPRISE_API_READ_TIMEOUT_MILLIS `
68+ * By default, uses environment variable `DEVELOCITY_API_READ_TIMEOUT_MILLIS `
6969 * or 60_000. Keep in mind that Develocity API responses can be big and slow to send depending on
7070 * the endpoint.
7171 */
7272 val readTimeoutMillis : Long =
73- env[" GRADLE_ENTERPRISE_API_READ_TIMEOUT_MILLIS " ]?.toLong()
73+ env[" DEVELOCITY_API_READ_TIMEOUT_MILLIS " ]?.toLong()
7474 ? : 60_000L ,
7575
7676 /* *
@@ -126,30 +126,30 @@ data class Config(
126126
127127 /* *
128128 * Whether caching is enabled. By default, uses environment variable
129- * `GRADLE_ENTERPRISE_API_CACHE_ENABLED ` or `false`.
129+ * `DEVELOCITY_API_CACHE_ENABLED ` or `false`.
130130 */
131131 val cacheEnabled : Boolean =
132- env[" GRADLE_ENTERPRISE_API_CACHE_ENABLED " ].toBoolean(),
132+ env[" DEVELOCITY_API_CACHE_ENABLED " ].toBoolean(),
133133
134134 /* *
135- * HTTP cache location. By default, uses environment variable `GRADLE_ENTERPRISE_API_CACHE_DIR `
135+ * HTTP cache location. By default, uses environment variable `DEVELOCITY_API_CACHE_DIR `
136136 * or the system temporary folder (`java.io.tmpdir` / develocity-api-kotlin-cache).
137137 */
138138 val cacheDir : File =
139- env[" GRADLE_ENTERPRISE_API_CACHE_DIR " ]?.let(::File )
139+ env[" DEVELOCITY_API_CACHE_DIR " ]?.let(::File )
140140 ? : File (systemProperties["user.home"], ".develocity-api-kotlin-cache"),
141141
142142 /* *
143143 * Max size of the HTTP cache. By default, uses environment variable
144- * `GRADLE_ENTERPRISE_API_MAX_CACHE_SIZE ` or ~1 GB.
144+ * `DEVELOCITY_API_MAX_CACHE_SIZE ` or ~1 GB.
145145 */
146- val maxCacheSize : Long = env[" GRADLE_ENTERPRISE_API_MAX_CACHE_SIZE " ]?.toLong()
146+ val maxCacheSize : Long = env[" DEVELOCITY_API_MAX_CACHE_SIZE " ]?.toLong()
147147 ? : 1_000_000_000L ,
148148
149149 /* *
150150 * Regex pattern to match API URLs that are OK to store long-term in the HTTP cache, up to
151151 * [longTermCacheMaxAge] (1y by default, max value). By default, uses environment variable
152- * `GRADLE_ENTERPRISE_API_LONG_TERM_CACHE_URL_PATTERN ` or a pattern matching:
152+ * `DEVELOCITY_API_LONG_TERM_CACHE_URL_PATTERN ` or a pattern matching:
153153 * - {host}/api/builds/{id}/gradle-attributes
154154 * - {host}/api/builds/{id}/maven-attributes
155155 * - {host}/api/builds/{id}/gradle-build-cache-performance
@@ -158,7 +158,7 @@ data class Config(
158158 * Use `|` to define multiple patterns in one, e.g. `.*gradle-attributes|.*test-distribution`.
159159 */
160160 val longTermCacheUrlPattern : Regex =
161- env[" GRADLE_ENTERPRISE_API_LONG_TERM_CACHE_URL_PATTERN " ]?.toRegex()
161+ env[" DEVELOCITY_API_LONG_TERM_CACHE_URL_PATTERN " ]?.toRegex()
162162 ? : Regex (
163163 """
164164 .*/api/builds/[\d\w]+/(? :gradle|maven)-(? :attributes|build-cache-performance)
@@ -167,30 +167,30 @@ data class Config(
167167
168168 /* *
169169 * Max age in seconds for URLs to be cached long-term (matched by [longTermCacheUrlPattern]).
170- * By default, uses environment variable `GRADLE_ENTERPRISE_API_LONG_TERM_CACHE_MAX_AGE ` or 1 year.
170+ * By default, uses environment variable `DEVELOCITY_API_LONG_TERM_CACHE_MAX_AGE ` or 1 year.
171171 */
172172 val longTermCacheMaxAge : Long =
173- env[" GRADLE_ENTERPRISE_API_SHORT_TERM_CACHE_MAX_AGE " ]?.toLong()
173+ env[" DEVELOCITY_API_SHORT_TERM_CACHE_MAX_AGE " ]?.toLong()
174174 ? : 365 .days.inWholeSeconds,
175175
176176 /* *
177177 * Regex pattern to match API URLs that are OK to store short-term in the HTTP cache, up to
178178 * [shortTermCacheMaxAge] (1d by default). By default, uses environment variable
179- * `GRADLE_ENTERPRISE_API_SHORT_TERM_CACHE_URL_PATTERN ` or a pattern matching:
179+ * `DEVELOCITY_API_SHORT_TERM_CACHE_URL_PATTERN ` or a pattern matching:
180180 * - {host}/api/builds
181181 *
182182 * Use `|` to define multiple patterns in one, e.g. `.*gradle-attributes|.*test-distribution`.
183183 */
184184 val shortTermCacheUrlPattern : Regex =
185- env[" GRADLE_ENTERPRISE_API_SHORT_TERM_CACHE_URL_PATTERN " ]?.toRegex()
185+ env[" DEVELOCITY_API_SHORT_TERM_CACHE_URL_PATTERN " ]?.toRegex()
186186 ? : """ .*/builds(?:\?.*|\Z)""" .toRegex(),
187187
188188 /* *
189189 * Max age in seconds for URLs to be cached short-term (matched by [shortTermCacheUrlPattern]).
190- * By default, uses environment variable `GRADLE_ENTERPRISE_API_SHORT_TERM_CACHE_MAX_AGE ` or 1 day.
190+ * By default, uses environment variable `DEVELOCITY_API_SHORT_TERM_CACHE_MAX_AGE ` or 1 day.
191191 */
192192 val shortTermCacheMaxAge : Long =
193- env[" GRADLE_ENTERPRISE_API_SHORT_TERM_CACHE_MAX_AGE " ]?.toLong()
193+ env[" DEVELOCITY_API_SHORT_TERM_CACHE_MAX_AGE " ]?.toLong()
194194 ? : 1 .days.inWholeSeconds,
195195 )
196196}
@@ -202,6 +202,6 @@ internal fun requireEnvOrKeychainToken(): String {
202202 is KeychainResult .Error -> {}
203203 }
204204 }
205- return env[" GRADLE_ENTERPRISE_API_TOKEN " ]
206- ? : error(" GRADLE_ENTERPRISE_API_TOKEN is required" )
205+ return env[" DEVELOCITY_API_TOKEN " ]
206+ ? : error(" DEVELOCITY_API_TOKEN is required" )
207207}
0 commit comments