oblador / react-native-vector-icons

Customizable Icons for React Native with support for image source and full styling.
https://oblador.github.io/react-native-vector-icons/
MIT License
17.31k stars 2.12k forks source link

fix: make `lintVitalAnalyze*` depend on copy #1515

Closed msbit closed 11 months ago

msbit commented 1 year ago

Since Gradle 8 (the default as of React Native 0.72), the task dependency resolution appears to be a lot tighter, and so attempting to run:

npx react-native build-android --tasks assembleRelease

errors out with the following:

- Gradle detected a problem with the following location: '<project>/android/app/build/intermediates/ReactNativeVectorIcons'.

  Reason: Task ':app:lintVitalAnalyzeRelease' uses this output of task ':app:copyReactNativeVectorIconFonts' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.

  Possible solutions:
    1. Declare task ':app:copyReactNativeVectorIconFonts' as an input of ':app:lintVitalAnalyzeRelease'.
    2. Declare an explicit dependency on ':app:copyReactNativeVectorIconFonts' from ':app:lintVitalAnalyzeRelease' using Task#dependsOn. 3. Declare an explicit dependency on ':app:copyReactNativeVectorIconFonts' from ':app:lintVitalAnalyzeRelease' using Task#mustRunAfter.

  Please refer to https://docs.gradle.org/8.0.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.

This ensures that any of the lintVitalAnalyze* tasks (likely only lintVitalAnalyzeRelease) depend on the copy task.

msbit commented 1 year ago

I've only seen this error with lintVitalAnalyzeRelease and lintVitalReportRelease, and my guess based on the description of these tasks:

lintVitalAnalyzeRelease - Run lint analysis with only the fatal issues enabled on the release variant
lintVitalRelease - Print text output from the corresponding lint report task
lintVitalReportRelease - Run lint with only the fatal issues enabled on the release variant

is that lintVitalRelease depends on lintVitalReportRelease depends on lintVitalAnalyzeRelease, so making the latter depend on the copy task should sort out both.

msbit commented 1 year ago

This probably fixes https://github.com/oblador/react-native-vector-icons/issues/1508

msbit commented 11 months ago

@oblador is there anything else you'd like to see before considering this PR?

oblador commented 11 months ago

Thanks for the fix!