Skip to content

Conversation

Goooler
Copy link

@Goooler Goooler commented Apr 24, 2025

Fixes

> Task :test-projects:build-class:apiCheck FAILED
Execution failed for task ':test-projects:build-class:apiCheck'.
> Expected file with API declarations 'paparazzi-gradle-plugin/src/test/projects/build-class/api/build-class.api' does not exist.
  Please ensure that ':apiDump' was executed in order to get an API dump to compare the build against

Fixes

```
> Task :test-projects:build-class:apiCheck FAILED
Execution failed for task ':test-projects:build-class:apiCheck'.
> Expected file with API declarations 'paparazzi-gradle-plugin/src/test/projects/build-class/api/build-class.api' does not exist.
  Please ensure that ':apiDump' was executed in order to get an API dump to compare the build against
```
@colinmarsch
Copy link
Collaborator

When does this error happen? Just trying to figure out why this fix might be needed

@Goooler
Copy link
Author

Goooler commented May 27, 2025

This happends due to running ./gradlew apiDump in IDEA, as the test projects are enabled in IDEA env

def isIdea = !(System.getProperty("idea.version") ?: "").isEmpty()
if (isIdea) {
includeTestProjectsIntoIDE()
}

The test projects are disabled on CI, so apiCheck tasks never fail.

apiValidation {
ignoredProjects += ['sample']
ignoredProjects += ['sample'] + testProjectNames
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about using

ignoredPackages += ["app.cash.paparazzi.plugin.test"]

instead? Helps us avoid another use of allprojects/subprojects to be tackled whenever isolated projects hits stable.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to dump empty API files for these projects first.

@jrodbx jrodbx added this to the 2.0.0-alpha03 milestone Jun 24, 2025
@SimonMarquis
Copy link
Contributor

ℹ️ BCV will be phased out in favor of a built-in setting in the KGP and is already available since Kotlin 2.2.0.
It might be a good idea to also migrate this (the update is trivial) if we also proceed to update the Kotlin version.
More details on https://kotlinlang.org/docs/whatsnew22.html#binary-compatibility-validation-included-in-kotlin-gradle-plugin

@geoff-powell
Copy link
Collaborator

@SimonMarquis made the same change here #2088 and its merged

@Goooler Goooler deleted the ignore-api-check-for-test-projects branch September 10, 2025 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants