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 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:
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.
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.