Skip to content

Commit 83916c3

Browse files
committed
Update README and examples
1 parent 5de5276 commit 83916c3

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

README.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,31 @@ This library [fixes][34] those issues in generated code, implements [paging][24]
2828

2929
## Setup
3030

31-
Set up environment variables and use the library from any notebook, script or project:
31+
Set up once and use the library from any notebook, script or project:
3232

3333
- [`DEVELOCITY_API_URL`][16]: the URL of your Develocity instance
34-
- [`DEVELOCITY_API_TOKEN`][17]: an [access key][31] for the Develocity instance
3534
- [`DEVELOCITY_API_CACHE_ENABLED`][12] (optional, off by default): enables caching for some
3635
requests (see [caveats][13])
36+
- An access key in one of the supported locations
37+
38+
<details>
39+
40+
<summary>Supported access key locations</summary>
41+
42+
Access key support matches that of official tooling: the Develocity [Gradle Plugin][37] and [Maven Extension][38].
43+
If you've already provisioned a key for your build to connect to Develocity, there's probably no action needed.
44+
Supported locations, in order of precedence:
45+
46+
- a provider function as [`Config.accessKey`][17] (see [optional setup](#optional-setup))
47+
- official tooling locations with value in format `host=key`, e.g. `DEVELOCITY_ACCESS_KEY='foo.com=my-key'`:
48+
- [`DEVELOCITY_ACCESS_KEY`](https://docs.gradle.com/develocity/gradle-plugin/current/#manual_access_key_configuration)
49+
- [`GRADLE_ENTERPRISE_ACCESS_KEY`](https://docs.gradle.com/develocity/gradle-plugin/current/#manual_access_key_configuration)
50+
- File `$GRADLE_USER_HOME/.gradle/develocity/keys.properties`, or `~/.gradle/develocity/keys.properties` if `GRADLE_USER_HOME` is not set
51+
- File `~/.m2/.develocity/keys.properties`
52+
53+
Refer to the Develocity [Gradle Plugin User Manual][37] or [Maven Extension User Manual][38] for details on these variables and files, including support for keys of multiple hosts.
54+
55+
</details>
3756

3857
### Setup snippets
3958

@@ -172,7 +191,7 @@ your own. For example:
172191
```kotlin
173192
val config = Config(
174193
apiUrl = "https://ge.mycompany.com/api/",
175-
apiToken = { vault.getGeApiToken() },
194+
accessKey = { vault.getDevelocityAccessKey() },
176195
clientBuilder = existingClient.newBuilder(),
177196
)
178197
val api = DevelocityApi.newInstance(config)
@@ -214,7 +233,7 @@ For general discussions or questions, feel free to reach out to maintainers on t
214233
[13]: https://gabrielfeo.github.io/develocity-api-kotlin/library/com.gabrielfeo.develocity.api/-config/-cache-config/index.html
215234
[14]: https://central.sonatype.com/artifact/com.gabrielfeo/develocity-api-kotlin/2024.3.0
216235
[16]: https://gabrielfeo.github.io/develocity-api-kotlin/library/com.gabrielfeo.develocity.api/-config/api-url.html
217-
[17]: https://gabrielfeo.github.io/develocity-api-kotlin/library/com.gabrielfeo.develocity.api/-config/api-token.html
236+
[17]: https://gabrielfeo.github.io/develocity-api-kotlin/library/com.gabrielfeo.develocity.api/-config/access-key.html
218237
[18]: https://gabrielfeo.github.io/develocity-api-kotlin/library/com.gabrielfeo.develocity.api/-builds-api/index.html
219238
[19]: https://gabrielfeo.github.io/develocity-api-kotlin/library/com.gabrielfeo.develocity.api.model/-gradle-attributes/index.html
220239
[20]: https://gabrielfeo.github.io/develocity-api-kotlin/library/com.gabrielfeo.develocity.api/-builds-api/index.html
@@ -234,3 +253,5 @@ For general discussions or questions, feel free to reach out to maintainers on t
234253
[34]: https://github.com/gabrielfeo/develocity-api-kotlin/blob/main/build-logic/src/functionalTest/kotlin/com/gabrielfeo/task/PostProcessGeneratedApiTest.kt#L21
235254
[35]: https://community.gradle.org/#community-channels
236255
[36]: ./examples/example-gradle-task/
256+
[37]: https://docs.gradle.com/develocity/gradle-plugin/current/#manual_access_key_configuration
257+
[38]: https://docs.gradle.com/develocity/maven-extension/current/#manual_access_key_configuration

examples/example-notebooks/MostFrequentBuilds.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"source": [
1010
"# Most frequent builds\n",
1111
"\n",
12-
"See what builds are most commonly invoked by developers, e.g. `clean assemble`, `test` or `check`. You can [set up the URL and a token for your Develocity instance](https://github.com/gabrielfeo/develocity-api-kotlin/blob/main/README.md#setup) and run this notebook as-is for your own project.\n",
12+
"See what builds are most commonly invoked by developers, e.g. `clean assemble`, `test` or `check`. You can [set up the URL and an access key for your Develocity instance](https://github.com/gabrielfeo/develocity-api-kotlin/blob/main/README.md#setup) and run this notebook as-is for your own project.\n",
1313
"\n",
1414
"This is a simple example of something you can do with the API. It could bring insights, for example:\n",
1515
"\n",

0 commit comments

Comments
 (0)