Skip to content

Commit ddd51e6

Browse files
committed
Update README and examples
1 parent 2d824e2 commit ddd51e6

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
@@ -27,12 +27,31 @@ This library [fixes][34] those issues in generated code, implements [paging][24]
2727

2828
## Setup
2929

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

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

3756
### Setup snippets
3857

@@ -171,7 +190,7 @@ your own. For example:
171190
```kotlin
172191
val config = Config(
173192
apiUrl = "https://ge.mycompany.com/api/",
174-
apiToken = { vault.getGeApiToken() },
193+
accessKey = { vault.getDevelocityAccessKey() },
175194
clientBuilder = existingClient.newBuilder(),
176195
)
177196
val api = DevelocityApi.newInstance(config)
@@ -213,7 +232,7 @@ For general discussions or questions, feel free to reach out to maintainers on t
213232
[13]: https://gabrielfeo.github.io/develocity-api-kotlin/library/com.gabrielfeo.develocity.api/-config/-cache-config/index.html
214233
[14]: https://central.sonatype.com/artifact/com.gabrielfeo/develocity-api-kotlin/2024.3.0
215234
[16]: https://gabrielfeo.github.io/develocity-api-kotlin/library/com.gabrielfeo.develocity.api/-config/api-url.html
216-
[17]: https://gabrielfeo.github.io/develocity-api-kotlin/library/com.gabrielfeo.develocity.api/-config/api-token.html
235+
[17]: https://gabrielfeo.github.io/develocity-api-kotlin/library/com.gabrielfeo.develocity.api/-config/access-key.html
217236
[18]: https://gabrielfeo.github.io/develocity-api-kotlin/library/com.gabrielfeo.develocity.api/-builds-api/index.html
218237
[19]: https://gabrielfeo.github.io/develocity-api-kotlin/library/com.gabrielfeo.develocity.api.model/-gradle-attributes/index.html
219238
[20]: https://gabrielfeo.github.io/develocity-api-kotlin/library/com.gabrielfeo.develocity.api/-builds-api/index.html
@@ -232,3 +251,5 @@ For general discussions or questions, feel free to reach out to maintainers on t
232251
[33]: https://github.com/gradle/develocity-api-samples
233252
[34]: https://github.com/gabrielfeo/develocity-api-kotlin/blob/main/build-logic/src/functionalTest/kotlin/com/gabrielfeo/task/PostProcessGeneratedApiTest.kt#L21
234253
[35]: https://community.gradle.org/#community-channels
254+
[36]: https://docs.gradle.com/develocity/gradle-plugin/current/#manual_access_key_configuration
255+
[37]: 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)