Thanks to visit codestin.com
Credit goes to github.com

Skip to content

SQLDelight Gradle plugin contains a lot of dependencies, including JUnit #3644

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aSemy opened this issue Nov 5, 2022 · 2 comments · Fixed by #4079
Closed

SQLDelight Gradle plugin contains a lot of dependencies, including JUnit #3644

aSemy opened this issue Nov 5, 2022 · 2 comments · Fixed by #4079

Comments

@aSemy
Copy link
Contributor

aSemy commented Nov 5, 2022

Description

I was poking around, trying to figure out why I can't see the Gradle plugin's source code in IntelliJ #3642, when I saw that the JAR for the SQL contained a lot of dependencies that I guess have been shaded in

image

Since the Gradle plugin uses the Gradle Worker API I suspect that shading isn't necessary. Instead, the plugin can

  1. create a resolvable configuration, called slqdelightWorkerRuntime or something
  2. Add the dependencies required by SQLDelight to run its Grade tasks as default dependencies
  3. In SqlDelightWorkerTask, set the classpath for the worker to use slqdelightWorkerRuntime
    https://github.com/cashapp/sqldelight/blob/4a942a8f56761e6e7871384a3b6174f318aba75a/sqldelight-gradle-plugin/src/main/kotlin/app/cash/sqldelight/gradle/SqlDelightWorkerTask.kt#L21-L28

This has the benefit that the classpath will use idiomatic Gradle functionality, dependencies can be shared, and the dependencies can be configurable by users, if necessary. However, maybe I've missed something!

(I've created this issue as a 'feature' because none of the other options provided seemed to make sense)

@hfhbd
Copy link
Collaborator

hfhbd commented Nov 15, 2022

These are two issues, the worker executer and its classpath and the second one, unnecessary shaded dependencies. We still need to shade the intellij dependencies.

@aSemy
Copy link
Contributor Author

aSemy commented Nov 27, 2022

Perhaps version 1.0.0 of the Plugin Publish Plugin could help.

https://docs.gradle.org/current/userguide/publishing_gradle_plugins.html#shadow_dependencies

Shadow dependencies
Starting from version 1.0.0 of Plugin Publish Plugin, shadowing the dependencies of your plugin (ie. publishing it as a fat jar) has been made automatic. To enable it, all that’s needed is to apply the com.github.johnrengelman.shadow plugin in your build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants