javafx-gradle-plugin icon indicating copy to clipboard operation
javafx-gradle-plugin copied to clipboard

Support platform-specific image generation

Open swpalmer opened this issue 8 years ago • 9 comments

I'm migrating from Danno's javafx plugin and one of the features I miss is that .ico and .icns files for Windows and Mac would be generated from supplied images (e.g. PNGs)

swpalmer avatar Aug 02 '16 19:08 swpalmer

@swpalmer Hi there, could you descibe that feature how it worked and where the files are gonna expected to be? As this was some special addendum by Danno, and my plugin only providing existing out-of-the-box features, this issue is more a feature-request than a bug.

I personally would feel better to not generate any file, because they might look bad (fileconversion is mostly bundled with quality-loss), but I can understand this request.

FibreFoX avatar Aug 03 '16 06:08 FibreFoX

You could set the icons like this

javafx {
    icons {
        shortcut = [ 'logo32x32.png', 'logo64x64.png', logo128x128.png' ]
        volume = 'macVolumeIcon.png'
        setup = 'windowsARPIcon.png'
    }
}

The icons would be converted to the correct format for the platform. I think scaled versions would be generated for missing resolutions, but I'm not certain about that. Linux would typically reference the original png files, I believe.

Take a look at https://bitbucket.org/shemnon/javafx-gradle/src/4695a6d1ed9e4b9248c93a877ee8374c16b9105b/samples/FullyExpressed/build.gradle?at=master&fileviewer=file-view-default#build.gradle-143

There was supposed to be a way to just place files at a standard path: src/deploy/package/ but that seems to be broken -In fact you commented on my Issue 21 report over there to try this plugin instead :-)

I believe it's all open and you can borrow some of the code from Danno's plugin if needed.

I don't think there will be any quality loss. I'm not certain if Mac's .icns format allows for lossless encoding, expect so. I believe .ico is lossless and of course the starting format PNG is.

swpalmer avatar Aug 04 '16 14:08 swpalmer

Hi @swpalmer , I'm going to take a look into this, but this will take some time.

FibreFoX avatar Aug 04 '16 15:08 FibreFoX

After checking the features from the plugin Danno made, I don't think this plugin is the right place for your request. This should be a small wrapper around the existing features, and not adding such ones.

As the files might change, as they are depending on the used toolsets of the underlaying javapackager, this will be implemented into separated plugin-helper (one plugin for one task, keeping it more simple).

After I worked around that windows-file-lock jdk-bug, this will be the first on my list.

FibreFoX avatar Aug 04 '16 20:08 FibreFoX

any news here?

tobium avatar Sep 07 '16 09:09 tobium

@tobium that requested feature won't be part of the javafx-gradle-plugin, but instead another gradle-plugin. This issue is open to inform others about it, but as this is a spare-time project, and other things have a higher priority, I'm not having the time I want to tinker that additional plugin.

But I think I should be able to finish the addition this month 😅

FibreFoX avatar Sep 07 '16 09:09 FibreFoX

Not yet finished, nor published, but currently under development: https://github.com/FibreFoX/imagetransform-gradle-plugin

FibreFoX avatar Nov 01 '16 23:11 FibreFoX

Is already working, just put the .ico on the $deployDir/package/windows

EDIT: Ah I see, this is for PNG, not for ICO. But come on, do you really need gradle to make icons for you?

Pesegato avatar Jun 07 '17 13:06 Pesegato

@Pesegato You miss the point. I want to supply standard cross-platform image files (e.g. PNG) and have the appropriate platform-specific form created as need based on the specific bundle type being created. So .ico for Windows, .icns for macOS, and keep PNG for Linux. With the appropriate scaled versions of the images being auto-generated if they aren't explicitly supplied. (The original plugin by Danno did the image conversions.) The idea being that the project source remains platform neutral. Packaging for a platform is where the platform-specific details are handled.

swpalmer avatar Jun 07 '17 13:06 swpalmer