-
Notifications
You must be signed in to change notification settings - Fork 403
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
Excluding a jar from being unzipped #111
Comments
There is not a mechanism for this at the moment. |
Could this at all be a near future planned feature? Because I'm having the same issue with a zip file that I wish to only include as a resource not unzipped into the root. This is working just fine with my normal jar. |
Is there any update on this issue? |
this will be addressed with #196 |
If I understand correctly, #196 is now fixed for |
Or, if a PR is available to make this configurable, is it acceptable? For example,
|
@dmikuribe - you are correct. This was incorrectly closed. I would love a PR to support this. Something maybe like this though:
|
@dmikurube, here is what i use for a workaround: |
The files go into embulk-core, not embulk-cli, as a workaround against Shadow Gradle Plugin's bug. GradleUp/shadow#111 If gradle-wrapper.jar is processed directly by Shadow Plugin in embulk-cli, gradle-wrapper.jar is unzipped unexpectedly. If the jar is once contained in embulk-core's jar, gradle-wrapper.jar is not unzipped.
This is unresolved yet, right? Got a little bit confused because milestone is set to 1.2.4. |
@johnrengelman Just observed that behaviour, a jar file put as a resource (e.g., |
yes there is a workaround. read the thread. |
Omitting the visibility modifier in Groovy [1] automatically creates a private backing field and a public getter (+ setter if the field is not final). It is unlikely to be an intended design as it makes access to those fields awkward from statically typed languages `ShadowBasePlugin.getCONFIGURATION_NAME()`. This is a backward incompatible change as this removes public getters. Here is what the generated class looked liked before this commit (7.0.0): ``` $ javap -p -c -constants ShadowBasePlugin.class Compiled from "ShadowBasePlugin.groovy" public class com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin implements org.gradle.api.Plugin<org.gradle.api.Project>, groovy.lang.GroovyObject { private static final java.lang.String EXTENSION_NAME = "shadow"; private static final java.lang.String CONFIGURATION_NAME = "shadow"; [...] public static java.lang.String getEXTENSION_NAME(); Code: 0: getstatic GradleUp#86 // Field EXTENSION_NAME:Ljava/lang/String; 3: areturn public static java.lang.String getCONFIGURATION_NAME(); Code: 0: getstatic GradleUp#111 // Field CONFIGURATION_NAME:Ljava/lang/String; 3: areturn ``` [1] https://groovy-lang.org/objectorientation.html#fields
Omitting the visibility modifier creates a Groovy _property_ [1], which is composed by: * a _private_ backing field * a public getter * (+ setter if the property is not `final`) It is unlikely to be an intended design as it makes access to those fields awkward from statically typed languages `ShadowBasePlugin.getCONFIGURATION_NAME()`. This commit replaces such _properties_ with _public fields_ only. This is a backward incompatible change as this removes public getters. Here is what the generated class looked liked before this commit (7.0.0): ``` $ javap -p -c -constants ShadowBasePlugin.class Compiled from "ShadowBasePlugin.groovy" public class com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin implements org.gradle.api.Plugin<org.gradle.api.Project>, groovy.lang.GroovyObject { private static final java.lang.String EXTENSION_NAME = "shadow"; private static final java.lang.String CONFIGURATION_NAME = "shadow"; [...] public static java.lang.String getEXTENSION_NAME(); Code: 0: getstatic GradleUp#86 // Field EXTENSION_NAME:Ljava/lang/String; 3: areturn public static java.lang.String getCONFIGURATION_NAME(); Code: 0: getstatic GradleUp#111 // Field CONFIGURATION_NAME:Ljava/lang/String; 3: areturn ``` [1] https://groovy-lang.org/objectorientation.html#properties
Omitting the visibility modifier creates a Groovy _property_ [1], which is composed by: * a _private_ backing field * a public getter * (+ setter if the property is not `final`) It is unlikely to be an intended design as it makes access to those fields awkward from statically typed languages `ShadowBasePlugin.getCONFIGURATION_NAME()`. This commit replaces such _properties_ with _public fields_ only. This is a backward incompatible change as this removes public getters. Here is what the generated class looked liked before this commit (7.0.0): ``` $ javap -p -c -constants ShadowBasePlugin.class Compiled from "ShadowBasePlugin.groovy" public class com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin implements org.gradle.api.Plugin<org.gradle.api.Project>, groovy.lang.GroovyObject { private static final java.lang.String EXTENSION_NAME = "shadow"; private static final java.lang.String CONFIGURATION_NAME = "shadow"; [...] public static java.lang.String getEXTENSION_NAME(); Code: 0: getstatic GradleUp#86 // Field EXTENSION_NAME:Ljava/lang/String; 3: areturn public static java.lang.String getCONFIGURATION_NAME(); Code: 0: getstatic GradleUp#111 // Field CONFIGURATION_NAME:Ljava/lang/String; 3: areturn ``` [1] https://groovy-lang.org/objectorientation.html#properties
Caused by this stupid behavior of the shadow plugin: GradleUp/shadow#111 Fixes #976
I've got a
.jar
file in my tree that I want to get included into the shadowjar, but not unzipped into the shadowjar. Right now it's unclear to me how I might have the file included but not unpacked.Guidance is much appreciated :D
The text was updated successfully, but these errors were encountered: