From d2e04a4ccd590d569a326a048ef39716c514e027 Mon Sep 17 00:00:00 2001 From: Gabriel Feo Date: Fri, 26 May 2023 21:58:34 +0100 Subject: [PATCH 1/4] Update README to point to nbviewer --- README.md | 17 ++++++++++------- .../example-notebooks/MostFrequentBuilds.ipynb | 5 ++++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e13199f50..e5228dd03 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,11 @@ [![Maven Central](https://img.shields.io/badge/Maven%20Central-0.16.2-blue)][14] [![Javadoc](https://img.shields.io/badge/Javadoc-0.16.2-orange)][7] -A Kotlin library to access the [Gradle Enterprise API][1], easy to use from Kotlin -scripts, projects or Jupyter notebooks: +A Kotlin library to access the [Gradle Enterprise API][1], easy to use from + +- [Kotlin scripts (`kts`)][27] +- [Kotlin projects][28] +- [Jupyter notebooks with the Kotlin kernel][29] ```kotlin GradleEnterpriseApi.buildsApi.getBuilds(since = yesterdayMilli).forEach { @@ -21,11 +24,8 @@ Set up once and use the library from anywhere in your machine: Enterprise instance. - Or a macOS keychain entry labeled `gradle-enterprise-api-token` (recommended). -That's it! You can now use the library without any code configuration from: - -- [Kotlin scripts (`kts`)](./examples/example-script.main.kts) -- [Kotlin projects](./examples/example-project) -- [Jupyter notebooks with the Kotlin kernel](./examples/example-notebooks) +That's it! You can now use the library without any code configuration from scripts, projects or +notebooks. ### Setup snippets @@ -185,3 +185,6 @@ import com.gabrielfeo.gradle.enterprise.api.model.extension.* [24]: https://gabrielfeo.github.io/gradle-enterprise-api-kotlin/library/com.gabrielfeo.gradle.enterprise.api.extension/get-gradle-attributes-flow.html [25]: https://gabrielfeo.github.io/gradle-enterprise-api-kotlin/library/com.gabrielfeo.gradle.enterprise.api.extension/index.html [26]: https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/ +[27]: ./examples/example-script.main.kts +[28]: ./examples/example-project +[29]: https://nbviewer.org/github/gabrielfeo/gradle-enterprise-api-kotlin/blob/main/examples/example-notebooks/MostFrequentBuilds.ipynb diff --git a/examples/example-notebooks/MostFrequentBuilds.ipynb b/examples/example-notebooks/MostFrequentBuilds.ipynb index 7c9cc4c40..b7c0b8e66 100644 --- a/examples/example-notebooks/MostFrequentBuilds.ipynb +++ b/examples/example-notebooks/MostFrequentBuilds.ipynb @@ -17,8 +17,11 @@ "- \"Some are doing `check` builds locally, which we set up to trigger our notably slow legacy tests. We should suggest they run `test` instead, leaving `check` for CI to run.\"\n", "\n", "This notebook will take you through using gradle-enterprise-api-kotlin in Jupyter, but it won't get into what a notebook is and how to run it. If you're not familiar with Jupyter:\n", + "\n", "- [Kotlin for data science overview](https://kotlinlang.org/docs/data-science-overview.html)\n", - "- [Kotlin for Jupyter notebooks](https://github.com/cheptsov/kotlin-jupyter-demo/blob/master/index.ipynb)" + "- [Kotlin for Jupyter notebooks](https://github.com/cheptsov/kotlin-jupyter-demo/blob/master/index.ipynb)\n", + "\n", + "Note: GitHub preview won't render tables or graphs. I recommend previewing this in the [online Jupyter nbviewer](https://nbviewer.org/github/gabrielfeo/gradle-enterprise-api-kotlin/blob/main/examples/example-notebooks/MostFrequentBuilds.ipynb)." ] }, { From 2e5b0e1c90628f2e4f3d372e422fa8f6e813dad5 Mon Sep 17 00:00:00 2001 From: Gabriel Feo Date: Fri, 26 May 2023 21:58:44 +0100 Subject: [PATCH 2/4] Fix script example --- examples/example-script.main.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/example-script.main.kts b/examples/example-script.main.kts index b0b2a935b..836b776ac 100644 --- a/examples/example-script.main.kts +++ b/examples/example-script.main.kts @@ -90,4 +90,4 @@ println( ) // Shutdown to end OkHttp's thread pool earlier -shutdown() +GradleEnterpriseApi.shutdown() From 8911b8336ec1f38a8012b3a00d2f925ac08b4ea4 Mon Sep 17 00:00:00 2001 From: Gabriel Feo Date: Fri, 26 May 2023 22:15:35 +0100 Subject: [PATCH 3/4] Emphasize notebooks --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index e5228dd03..46226dcd6 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ A Kotlin library to access the [Gradle Enterprise API][1], easy to use from +- [Jupyter notebooks with the Kotlin kernel][29] - [Kotlin scripts (`kts`)][27] - [Kotlin projects][28] -- [Jupyter notebooks with the Kotlin kernel][29] ```kotlin GradleEnterpriseApi.buildsApi.getBuilds(since = yesterdayMilli).forEach { @@ -24,14 +24,24 @@ Set up once and use the library from anywhere in your machine: Enterprise instance. - Or a macOS keychain entry labeled `gradle-enterprise-api-token` (recommended). -That's it! You can now use the library without any code configuration from scripts, projects or -notebooks. +That's it! You can now use the library without any code configuration from notebooks, scripts or +projects. ### Setup snippets ℹ️ The library is now published to Maven Central under `com.gabrielfeo`. Maven Central is recommended over JitPack. +
+ Add to a Jupyter notebook + +``` +%useLatestDescriptors +%use gradle-enterprise-api-kotlin(version=0.16.2) +``` + +
+
Add to a Kotlin script @@ -52,16 +62,6 @@ dependencies {
-
- Add to a Jupyter notebook - -``` -%useLatestDescriptors -%use gradle-enterprise-api-kotlin(version=0.16.2) -``` - -
- ## Usage The [`GradleEnterpriseApi`][9] interface represents the Gradle Enterprise REST API. It contains From 974fb331cfd991ca706c4cb5481dff01efbc7421 Mon Sep 17 00:00:00 2001 From: Gabriel Feo Date: Fri, 26 May 2023 22:16:54 +0100 Subject: [PATCH 4/4] Colon --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 46226dcd6..b3203c72d 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Maven Central](https://img.shields.io/badge/Maven%20Central-0.16.2-blue)][14] [![Javadoc](https://img.shields.io/badge/Javadoc-0.16.2-orange)][7] -A Kotlin library to access the [Gradle Enterprise API][1], easy to use from +A Kotlin library to access the [Gradle Enterprise API][1], easy to use from: - [Jupyter notebooks with the Kotlin kernel][29] - [Kotlin scripts (`kts`)][27]