1- # Gradle Enterprise API Kotlin
1+ # Develocity API Kotlin
22
33[ ![ Maven Central] ( https://img.shields.io/badge/Maven%20Central-2023.4.0-blue )] [ 14 ]
44[ ![ Javadoc] ( https://img.shields.io/badge/Javadoc-2023.4.0-orange )] [ 7 ]
55
6- A Kotlin library to access the [ Gradle Enterprise API] [ 1 ] , easy to use from:
6+ A Kotlin library to access the [ Develocity API] [ 1 ] , easy to use from:
77
88- [ Jupyter notebooks with the Kotlin kernel] [ 29 ]
99- [ Kotlin scripts (` kts ` )] [ 27 ]
1010- [ Kotlin projects] [ 28 ]
1111
1212``` kotlin
13- val api = GradleEnterpriseApi .newInstance()
13+ val api = DevelocityApi .newInstance()
1414api.buildsApi.getBuildsFlow(fromInstant = 0 , query = " buildStartTime<-1d" ).forEach {
1515 println (it)
1616}
@@ -22,8 +22,8 @@ api.buildsApi.getBuildsFlow(fromInstant = 0, query = "buildStartTime<-1d").forEa
2222
2323Set up environment variables and use the library from any notebook, script or project:
2424
25- - [ ` GRADLE_ENTERPRISE_API_URL ` ] [ 16 ] : the URL of your Gradle Enterprise instance
26- - [ ` GRADLE_ENTERPRISE_API_TOKEN ` ] [ 17 ] : an [ access key] [ 31 ] for the Gradle Enterprise instance
25+ - [ ` GRADLE_ENTERPRISE_API_URL ` ] [ 16 ] : the URL of your Develocity instance
26+ - [ ` GRADLE_ENTERPRISE_API_TOKEN ` ] [ 17 ] : an [ access key] [ 31 ] for the Develocity instance
2727- [ ` GRADLE_ENTERPRISE_API_CACHE_ENABLED ` ] [ 12 ] (optional, off by default): enables caching for some
2828 requests (see [ caveats] [ 13 ] )
2929
@@ -37,7 +37,7 @@ recommended over JitPack.
3737
3838```
3939%useLatestDescriptors
40- %use gradle-enterprise -api-kotlin(version=2023.4.0)
40+ %use develocity -api-kotlin(version=2023.4.0)
4141```
4242
4343</details >
@@ -46,7 +46,7 @@ recommended over JitPack.
4646 <summary >Add to a Kotlin script</summary >
4747
4848``` kotlin
49- @file:DependsOn(" com.gabrielfeo:gradle-enterprise -api-kotlin:2023.4.0" )
49+ @file:DependsOn(" com.gabrielfeo:develocity -api-kotlin:2023.4.0" )
5050```
5151
5252</details >
@@ -56,19 +56,19 @@ recommended over JitPack.
5656
5757``` kotlin
5858dependencies {
59- implementation(" com.gabrielfeo:gradle-enterprise -api-kotlin:2023.4.0" )
59+ implementation(" com.gabrielfeo:develocity -api-kotlin:2023.4.0" )
6060}
6161```
6262
6363</details >
6464
6565## Usage
6666
67- The [ ` GradleEnterpriseApi ` ] [ 9 ] interface represents the Gradle Enterprise REST API. It contains
67+ The [ ` DevelocityApi ` ] [ 9 ] interface represents the Develocity REST API. It contains
6868all the APIs exactly as listed in the [ REST API Manual] [ 5 ] :
6969
7070``` kotlin
71- interface GradleEnterpriseApi {
71+ interface DevelocityApi {
7272 val buildsApi: BuildsApi
7373 val testsApi: TestsApi
7474 val buildCacheApi: BuildCacheApi
@@ -106,7 +106,7 @@ off by default. Enable by simply setting [`GRADLE_ENTERPRISE_API_CACHE_ENABLED`]
106106### Extensions
107107
108108Explore the library's convenience extensions:
109- [ ` com.gabrielfeo.gradle.enterprise .api.extension ` ] [ 25 ] .
109+ [ ` com.gabrielfeo.develocity .api.extension ` ] [ 25 ] .
110110
111111By default, the API's most common endpoint, ` /api/builds ` , is paginated. The library provides a
112112[ ` getBuildsFlow ` ] [ 24 ] extension to handle paging under-the-hood and yield all builds as you collect
@@ -126,7 +126,7 @@ case they're needed again. This is an optimization of [OkHttp][4]. If you're wor
126126or have a long-living program that fetches builds continuosly, no shutdown is needed.
127127
128128``` kotlin
129- val api = GradleEnterpriseApi .newInstance()
129+ val api = DevelocityApi .newInstance()
130130while (true ) {
131131 delay(2 .minutes)
132132 processNewBuilds(api.buildsApi.getBuildsFlow(query = " ..." ))
@@ -135,10 +135,10 @@ while (true) {
135135```
136136
137137In other cases (i.e. fetching some builds and exiting), you might want to call
138- [ ` GradleEnterpriseApi .shutdown()` ] [ 11 ] so that the program exits immediately:
138+ [ ` DevelocityApi .shutdown()` ] [ 11 ] so that the program exits immediately:
139139
140140``` kotlin
141- val api = GradleEnterpriseApi .newInstance()
141+ val api = DevelocityApi .newInstance()
142142printMetrics(api.buildsApi.getBuildsFlow(query = " ..." ))
143143// Call shutdown if you expect the program to exit now
144144api.shutdown()
@@ -170,7 +170,7 @@ val config = Config(
170170 apiToken = { vault.getGeApiToken() },
171171 clientBuilder = existingClient.newBuilder(),
172172)
173- val api = GradleEnterpriseApi .newInstance(config)
173+ val api = DevelocityApi .newInstance(config)
174174api.buildsApi.getBuilds(fromInstant = yesterdayMilli)
175175```
176176
@@ -184,9 +184,9 @@ See the [`Config`][8] documentation for more.
184184 no auto-complete, wildcard imports can be used (in notebooks, they're added automatically):
185185
186186``` kotlin
187- import com.gabrielfeo.gradle.enterprise .api.*
188- import com.gabrielfeo.gradle.enterprise .api.model.*
189- import com.gabrielfeo.gradle.enterprise .api.model.extension.*
187+ import com.gabrielfeo.develocity .api.*
188+ import com.gabrielfeo.develocity .api.model.*
189+ import com.gabrielfeo.develocity .api.model.extension.*
190190```
191191
192192[ 1 ] : https://docs.gradle.com/enterprise/api-manual/
@@ -195,27 +195,27 @@ import com.gabrielfeo.gradle.enterprise.api.model.extension.*
195195[ 4 ] : https://github.com/square/retrofit/issues/3144#issuecomment-508300518
196196[ 5 ] : https://docs.gradle.com/enterprise/api-manual/ref/2022.4.html
197197[ 6 ] : https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-gradle-plugin/README.adoc
198- [ 7 ] : https://gabrielfeo.github.io/gradle-enterprise -api-kotlin/
199- [ 8 ] : https://gabrielfeo.github.io/gradle-enterprise- api-kotlin/library/com.gabrielfeo.gradle.enterprise .api/-config/index.html
200- [ 9 ] : https://gabrielfeo.github.io/gradle-enterprise- api-kotlin/library/com.gabrielfeo.gradle.enterprise. api/-gradle-enterprise -api/
201- [ 11 ] : https://gabrielfeo.github.io/gradle-enterprise- api-kotlin/library/com.gabrielfeo.gradle.enterprise. api/-gradle-enterprise -api/shutdown.html
202- [ 12 ] : https://gabrielfeo.github.io/gradle-enterprise- api-kotlin/library/com.gabrielfeo.gradle.enterprise .api/-config/-cache-config/cache-enabled.html
203- [ 13 ] : https://gabrielfeo.github.io/gradle-enterprise- api-kotlin/library/com.gabrielfeo.gradle.enterprise .api/-config/-cache-config/index.html
204- [ 14 ] : https://central.sonatype.com/artifact/com.gabrielfeo/gradle-enterprise -api-kotlin/2023.4.0
205- [ 16 ] : https://gabrielfeo.github.io/gradle-enterprise- api-kotlin/library/com.gabrielfeo.gradle.enterprise .api/-config/api-url.html
206- [ 17 ] : https://gabrielfeo.github.io/gradle-enterprise- api-kotlin/library/com.gabrielfeo.gradle.enterprise .api/-config/api-token.html
207- [ 18 ] : https://gabrielfeo.github.io/gradle-enterprise- api-kotlin/library/com.gabrielfeo.gradle.enterprise .api/-builds-api/index.html
208- [ 19 ] : https://gabrielfeo.github.io/gradle-enterprise- api-kotlin/library/com.gabrielfeo.gradle.enterprise .api.model/-gradle-attributes/index.html
209- [ 20 ] : https://gabrielfeo.github.io/gradle-enterprise- api-kotlin/library/com.gabrielfeo.gradle.enterprise .api/-builds-api/index.html
210- [ 21 ] : https://gabrielfeo.github.io/gradle-enterprise- api-kotlin/library/com.gabrielfeo.gradle.enterprise .api/-builds-api/get-builds.html
211- [ 22 ] : https://gabrielfeo.github.io/gradle-enterprise- api-kotlin/library/com.gabrielfeo.gradle.enterprise .api/-builds-api/get-gradle-attributes.html
212- [ 23 ] : https://gabrielfeo.github.io/gradle-enterprise- api-kotlin/library/com.gabrielfeo.gradle.enterprise. api/-gradle-enterprise -api/-default-instance/index.html
213- [ 24 ] : https://gabrielfeo.github.io/gradle-enterprise- api-kotlin/library/com.gabrielfeo.gradle.enterprise .api.extension/get-builds-flow.html
214- [ 25 ] : https://gabrielfeo.github.io/gradle-enterprise- api-kotlin/library/com.gabrielfeo.gradle.enterprise .api.extension/index.html
198+ [ 7 ] : https://gabrielfeo.github.io/develocity -api-kotlin/
199+ [ 8 ] : https://gabrielfeo.github.io/develocity- api-kotlin/library/com.gabrielfeo.develocity .api/-config/index.html
200+ [ 9 ] : https://gabrielfeo.github.io/develocity- api-kotlin/library/com.gabrielfeo.develocity. api/-develocity -api/
201+ [ 11 ] : https://gabrielfeo.github.io/develocity- api-kotlin/library/com.gabrielfeo.develocity. api/-develocity -api/shutdown.html
202+ [ 12 ] : https://gabrielfeo.github.io/develocity- api-kotlin/library/com.gabrielfeo.develocity .api/-config/-cache-config/cache-enabled.html
203+ [ 13 ] : https://gabrielfeo.github.io/develocity- api-kotlin/library/com.gabrielfeo.develocity .api/-config/-cache-config/index.html
204+ [ 14 ] : https://central.sonatype.com/artifact/com.gabrielfeo/develocity -api-kotlin/2023.4.0
205+ [ 16 ] : https://gabrielfeo.github.io/develocity- api-kotlin/library/com.gabrielfeo.develocity .api/-config/api-url.html
206+ [ 17 ] : https://gabrielfeo.github.io/develocity- api-kotlin/library/com.gabrielfeo.develocity .api/-config/api-token.html
207+ [ 18 ] : https://gabrielfeo.github.io/develocity- api-kotlin/library/com.gabrielfeo.develocity .api/-builds-api/index.html
208+ [ 19 ] : https://gabrielfeo.github.io/develocity- api-kotlin/library/com.gabrielfeo.develocity .api.model/-gradle-attributes/index.html
209+ [ 20 ] : https://gabrielfeo.github.io/develocity- api-kotlin/library/com.gabrielfeo.develocity .api/-builds-api/index.html
210+ [ 21 ] : https://gabrielfeo.github.io/develocity- api-kotlin/library/com.gabrielfeo.develocity .api/-builds-api/get-builds.html
211+ [ 22 ] : https://gabrielfeo.github.io/develocity- api-kotlin/library/com.gabrielfeo.develocity .api/-builds-api/get-gradle-attributes.html
212+ [ 23 ] : https://gabrielfeo.github.io/develocity- api-kotlin/library/com.gabrielfeo.develocity. api/-develocity -api/-default-instance/index.html
213+ [ 24 ] : https://gabrielfeo.github.io/develocity- api-kotlin/library/com.gabrielfeo.develocity .api.extension/get-builds-flow.html
214+ [ 25 ] : https://gabrielfeo.github.io/develocity- api-kotlin/library/com.gabrielfeo.develocity .api.extension/index.html
215215[ 26 ] : https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/
216216[ 27 ] : ./examples/example-scripts/example-script.main.kts
217217[ 28 ] : ./examples/example-project
218- [ 29 ] : https://nbviewer.org/github/gabrielfeo/gradle-enterprise -api-kotlin/blob/main/examples/example-notebooks/MostFrequentBuilds.ipynb
218+ [ 29 ] : https://nbviewer.org/github/gabrielfeo/develocity -api-kotlin/blob/main/examples/example-notebooks/MostFrequentBuilds.ipynb
219219[ 30 ] : https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/run-blocking.html
220220[ 31 ] : ./docs/AccessKeys.md
221221[ 32 ] : ./examples
0 commit comments