Skip to content

use sbt-assembly to build fat JAR #18

@SethTisue

Description

@SethTisue

A user reports:

ran the plugin against simple cases via the commands as suggested in the README file. Although, it seems that there is a difficulty to apply the same approach when utilising Sculpt with our Gradle-based projects. When providing the settings such as -Xplugin:scala-sculpt_2.11-0.1.0.jar:spray-json_2.11-1.3.2.jar, an error “Missing scalac-plugin.xml in D:\jars\scala-sculpt-0.1.0\spray-json_2.11-1.3.2.jar” occurs. That seems right, as the JAR providing spray is not a Scalac plugin itself, but only a dependency for Sculpt. According to the documentation, -Xplugin option is supposed to point at Scalac plugins only, so I am not sure why it works out of the Gradle, when calling Scalac as shown in the README file

I'm not sure either, not knowing anything about Gradle. @typesafehub/scala-team, is there any policy or history on the question of how a Scala compiler plugin's dependencies should be handled? (and does anyone have a hypothesis about why the behavior would be different in Gradle? I'm mostly just curious.)

for the moment, I'll just add sbt-assembly and ship a fat JAR. we might want to reconsider that if scala-sculpt becomes released publicly, though. as the sbt-assembly readme says, "Publishing fat JARs out to the world is discouraged because non-modular JARs cause much sadness". if compiler plugins simply don't support additional JAR dependencies, and we're forced to ship a fat JAR, we might want to consider shading. (or maybe just see if anyone actually complains...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions