Skip to content

Commit

Permalink
Rename public.api to released.api (#15)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
daymxn authored Dec 14, 2023
1 parent b5de7a3 commit 1a68081
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/check_for_api_changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
Expand All @@ -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: |
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions plugins/src/main/java/com/google/gradle/plugins/ApiPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -73,7 +73,7 @@ abstract class ApiPlugin : Plugin<Project> {

context(Project)
private fun ApiPluginExtension.commonConfiguration() {
apiFile.convention(file("public.api"))
apiFile.convention(file("released.api"))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit 1a68081

Please sign in to comment.