From 1a68081ce6f293cd2776f6a4240c38a522fff782 Mon Sep 17 00:00:00 2001 From: Daymon <17409137+daymxn@users.noreply.github.com> Date: Thu, 14 Dec 2023 13:38:48 -0600 Subject: [PATCH] Rename public.api to released.api (#15) Per [b/316375696](https://b.corp.google.com/issues/316375696), This renames the `public.api` to `released.api` to better articulate the intention of the file, since it wasn't immediately apparent- since folks felt that they needed to update it on each PR. --- .github/workflows/check_for_api_changes.yml | 8 ++++---- generativeai/{public.api => released.api} | 0 plugins/README.md | 4 ++-- .../src/main/java/com/google/gradle/plugins/ApiPlugin.kt | 6 +++--- .../main/java/com/google/gradle/tasks/FindChangesTask.kt | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) rename generativeai/{public.api => released.api} (100%) diff --git a/.github/workflows/check_for_api_changes.yml b/.github/workflows/check_for_api_changes.yml index 5c9b2743..85f916f4 100644 --- a/.github/workflows/check_for_api_changes.yml +++ b/.github/workflows/check_for_api_changes.yml @@ -18,12 +18,12 @@ jobs: distribution: temurin cache: gradle - - name: Update public.api + - name: Update released.api run: | ./gradlew updateApi --no-daemon - - name: Save public.api from master - run: mv generativeai/public.api ~/public.api + - name: Save released.api from master + run: mv generativeai/released.api ~/released.api - name: Checkout branch uses: actions/checkout@v3.5.3 @@ -36,7 +36,7 @@ jobs: cache: gradle - name: Copy saved api to branch - run: mv ~/public.api generativeai/public.api + run: mv ~/released.api generativeai/released.api - name: Run api warning task run: | diff --git a/generativeai/public.api b/generativeai/released.api similarity index 100% rename from generativeai/public.api rename to generativeai/released.api diff --git a/plugins/README.md b/plugins/README.md index fe6e91db..22ad15c9 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -34,14 +34,14 @@ The APIPlugin registers the two following tasks to facilitate this process: - [buildApi](./src/main/java/com/google/gradle/plugins/ApiPlugin.kt) -> Creates a `.api` file containing the public API of the project. - [updateApi](./src/main/java/com/google/gradle/plugins/ApiPlugin.kt) -> Updates (or creates) the -`public.api` file at the project directory; keeping track of the currently released/public api. +`released.api` file at the project directory; keeping track of the currently released/public api. ### Tasks The ChangelogPlugin registers the four following tasks: - [findChanges](./src/main/java/com/google/gradle/tasks/FindChangesTask.kt) -> Creates a new `.api` -file for the current project, and compares it to the existing `public.api` to create a diff of +file for the current project, and compares it to the existing `released.api` to create a diff of changes made to the public api. - [makeChange](./src/main/java/com/google/gradle/tasks/MakeChangeTask.kt) -> Creates a new `.json` file in the `.changes` directory with an optional message, including the version impact inferred diff --git a/plugins/src/main/java/com/google/gradle/plugins/ApiPlugin.kt b/plugins/src/main/java/com/google/gradle/plugins/ApiPlugin.kt index a2dc2b26..d9b4aaf4 100644 --- a/plugins/src/main/java/com/google/gradle/plugins/ApiPlugin.kt +++ b/plugins/src/main/java/com/google/gradle/plugins/ApiPlugin.kt @@ -32,12 +32,12 @@ import org.gradle.kotlin.dsl.register /** * A Gradle plugin for creating `.api` files; representing the public API of the project. * - * By default, a `public.api` file (at the root of the project) will be used as a base for the + * By default, a `released.api` file (at the root of the project) will be used as a base for the * released api. * * Registers two tasks: * - `buildApi` -> creates a `.api` file containing the *current* public API of the project. - * - `updateApi` -> updates the `public.api` file at the project root to match the one generated by + * - `updateApi` -> updates the `released.api` file at the project root to match the one generated by * `buildApi`; effectively saying that the released api is up to date with the current repo state. * * @see ApiPluginExtension @@ -73,7 +73,7 @@ abstract class ApiPlugin : Plugin { context(Project) private fun ApiPluginExtension.commonConfiguration() { - apiFile.convention(file("public.api")) + apiFile.convention(file("released.api")) } } diff --git a/plugins/src/main/java/com/google/gradle/tasks/FindChangesTask.kt b/plugins/src/main/java/com/google/gradle/tasks/FindChangesTask.kt index 54d09621..3f931638 100644 --- a/plugins/src/main/java/com/google/gradle/tasks/FindChangesTask.kt +++ b/plugins/src/main/java/com/google/gradle/tasks/FindChangesTask.kt @@ -31,7 +31,7 @@ import org.gradle.api.tasks.TaskAction * The changes are represented as [LinesChanged]; with a list of added and removed lines between the * files. These are saved in `.json` format in the [outputFile]. * - * @property old the previously released api file (typically `public.api) + * @property old the previously released api file (typically `released.api) * @property new the current API pending release (generated from the state of the repo as is) * @property outputFile where to save the diff to */