Skip to content
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

How do I configure FileAssociations in gradle #197

Closed
2 of 5 tasks
jinsihou19 opened this issue May 15, 2022 · 3 comments
Closed
2 of 5 tasks

How do I configure FileAssociations in gradle #197

jinsihou19 opened this issue May 15, 2022 · 3 comments
Labels
bug Something isn't working fixed Issue fixed and release pending

Comments

@jinsihou19
Copy link

I'm submitting a…

  • bug report
  • feature request
  • other

Short description of the issue/suggestion:

How do I configure FileAssociations in gradle?

I write this code:

def association = new FileAssociation()
association.extension = 'log'
association.description = 'log_analyzer'
association.mimeType = 'text/plain'

task packageAppForMac(type: PackageTask, dependsOn: shadowJar) {
    appName = project.name
    platform = 'mac'
    fileAssociations  = [
            association
    ]
}

after run it report that:

Unable to store input properties for task ':packageAppForMac'. Property 'fileAssociations' with value '[FileAssociation [mimeType=text/plain, extension=log, description=log]]' cannot be serialized.

Please tell us about your environment:

  • JavaPackager version:
  • OS version: macos 12.3.1
  • JDK version: 1.8.0_181
  • Build tool:
    • Maven
    • Gradle
@fvarrui fvarrui added the bug Something isn't working label May 27, 2022
@fvarrui
Copy link
Owner

fvarrui commented May 27, 2022

Hi @jinsihou19!
It seems to be a bug, since the FileAssociation class would have to be serializable.

A work around could be to specify the file association in the extension:

javapackager {
    fileAssociations = [
    	new FileAssociation(mimeType: 'text/plain', extension: 'log', description: 'log_analyzer')
    ]
}

@fvarrui
Copy link
Owner

fvarrui commented Jun 8, 2022

Hi @jinsihou19!
I've made FileAssociation class serializable. This should fix this problem. Please, could you try JavaPackager 1.6.7-SNAPSHOT (devel branch)?

It has to be installed manually in your local repo:

git clone https://github.com/fvarrui/JavaPackager --branch devel
cd JavaPackager
./gradlew publishToMavenLocal

@fvarrui fvarrui added the fixed Issue fixed and release pending label Jun 8, 2022
@fvarrui
Copy link
Owner

fvarrui commented Jul 18, 2022

JavaPackager v1.6.7 released to Maven Central. See changes here.

@fvarrui fvarrui closed this as completed Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed Issue fixed and release pending
Projects
None yet
Development

No branches or pull requests

2 participants