GradleUp / shadow

Gradle plugin to create fat/uber JARs, apply file transforms, and relocate packages for applications and libraries. Gradle version of Maven's Shade plugin.
https://www.gradleup.com/shadow/
Apache License 2.0
3.77k stars 395 forks source link

minimize() causing error because of implementation of sub project #1004

Closed Juli0q closed 1 month ago

Juli0q commented 1 month ago

Expected and Results

Minimize breaks when trying to use implementation with a sub project.

Cannot read field "forJava" because "parsedFileName" is null

Related environent and versions

Gradle 8.9 Shadow 8.3.3 Fedora 39

Reproduction steps

  1. Create a Gradle project with multiple sub projects
  2. Try to use implementation to implement a sub project into a sub project
  3. Try to build a shadowJar

Anything else?

No response

Goooler commented 1 month ago

I tried, this works for Ktlint after adding minimize()

https://github.com/pinterest/ktlint/blob/50e44a7d11207a96577fedd059cb95ffa225aa17/ktlint-cli/build.gradle.kts#L17-L27

Juli0q commented 1 month ago

Okay I will try to create an example repo.

I am using a different syntax for implementing the sub project, does that make a difference? implementation(project(":MySubProject"))

Goooler commented 1 month ago

Nope.

Juli0q commented 1 month ago

I can't replicate the issue in a separate project either. I will look into why my project has this issue later today.

Juli0q commented 1 month ago

I managed to fix the issue. I had the buildSrc folder generated by gradle init which caused problems with the plugins I used.