I am using the distribution plugin, it works file and generate the archive with the right content. My only problem is that I want to generate only a tar when I run the install or assemble tasks instead of the 2 distributions. Is there a way to configure the plugin in that way ?
I have the same problem, disabling the task suppresses the generation of the zip, however artifactoryPublish still wants to upload the missing archive and fails.
How does one properly disable the tar/zip archive?
I canāt seem to get this to work. I tried both of the following in my build.gradle; one at a time. But I always end up with both zip and tar archives. I only want the zip archive but canāt seem to get the distTar task to stop running.
Each of those distributions are assigned a task to produce a tar file and a zip file. So, in order to skip tar file OR zip file creation, they have to be specifically disabled. A good way of doing that would be to use the task graph. For example:
It seems a slightly odd default to generate BOTH the tar and the zip, I too ended up adding the opimization to only generate the one we actually used.
I canāt think itās very often that both files are needed, itās a pity the default isnāt either one or the other, with the option to switch to output both.
Unless you have an inconsistent need for tar files in some places, but just not distributions, it would be more conventional to just disable the Tar tasks:
The plugin was designed to easily create distributions of an application for end users. Application downloads of this type often offer ZIP for Windows and a TAR for the Linux/Unix-like platforms, even if they have the same contents.
If this plugin was designed for distributing āan applicationā, then I think it makes sense but I havenāt actually seen any example that demonstrate this. All the example/usage of this plugin I have seen so far simply shows creating an archive with some files that are automatically picked up from a path as part of the pluginās convention (i.e. src/$distribution.name/dist) or add files from custom path. The User Guide of this plugin doesnāt really have a lot of examples.
Do you happen to have an example on how this plugin is supposed to be used? For example, build and application and bundle it using this plugin for distribution.
I wonder if this (disabling tar and zip) is worth documenting in the application plugin. We use the application plugin in our project solely to create a command-line tool usable by developers of our project, not to actually create a distribution, so the default of adding the slow distZip and distTar tasks to ābuild -> assembleā isnāt great (and neither is the default of not having installDist be a dependency of ābuildā). It might be nice to have a section in the docs that says something like: if youāre using the application plugin just to create a tool to use in dev, not to distribution, youāll want to add
I absolutely agree. Iāve had some use for this in multiple projects in the last 6 months and this is the first time Iāve found a nice gradley solution. Before Iāve used solutions where I scripted unpacking of the tar as part of the build because I couldnāt find these documented anywhere.