Bug 107321 - Add MIME type for groovy and gradle
Summary: Add MIME type for groovy and gradle
Status: RESOLVED FIXED
Alias: None
Product: shared-mime-info
Classification: Unclassified
Component: freedesktop.org.xml (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Shared Mime Info group
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-21 09:19 UTC by Alberto Fanjul Alonso
Modified: 2018-07-25 11:02 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
MIME type info for Groovy (1.86 KB, patch)
2018-07-21 10:59 UTC, Alberto Fanjul Alonso
Details | Splinter Review
MIME type info for Gradle (1.90 KB, patch)
2018-07-21 10:59 UTC, Alberto Fanjul Alonso
Details | Splinter Review
MIME type info for Groovy (1.79 KB, patch)
2018-07-22 05:50 UTC, Alberto Fanjul Alonso
Details | Splinter Review
MIME type info for Gradle (1.85 KB, patch)
2018-07-22 05:51 UTC, Alberto Fanjul Alonso
Details | Splinter Review
Add MIME type info for Groovy scripting language (1.78 KB, patch)
2018-07-22 12:26 UTC, Bastien Nocera
Details | Splinter Review
Add MIME type for Gradle build tool (1.83 KB, patch)
2018-07-22 12:26 UTC, Bastien Nocera
Details | Splinter Review
MIME type info for Gradle scripts (952 bytes, patch)
2018-07-24 06:26 UTC, Alberto Fanjul Alonso
Details | Splinter Review
attachment-22008-0.html (1.79 KB, text/html)
2018-07-24 11:58 UTC, Alberto Fanjul Alonso
Details

Description Alberto Fanjul Alonso 2018-07-21 09:19:27 UTC
Definition of groovy and gradle file formats to allow IDEs to relay on MIME type to provide hightlight, autocomplete and linter
Comment 1 Alberto Fanjul Alonso 2018-07-21 10:59:03 UTC
Created attachment 140752 [details] [review]
MIME type info for Groovy
Comment 2 Alberto Fanjul Alonso 2018-07-21 10:59:54 UTC
Created attachment 140753 [details] [review]
MIME type info for Gradle

It is based on Groovy as subtype of it, so that patch should be applied first
Comment 3 Bastien Nocera 2018-07-21 11:26:43 UTC
As in bug 107322:
As for the mime-type and aliases, you need to show where you got those from. We prefer text/x-... for text based file formats, rather than application/x-, so unless application/x-... is already used somewhere else, please use text/x- instead.
Comment 4 Alberto Fanjul Alonso 2018-07-22 05:50:20 UTC
Created attachment 140758 [details] [review]
MIME type info for Groovy
Comment 5 Alberto Fanjul Alonso 2018-07-22 05:51:00 UTC
Created attachment 140759 [details] [review]
MIME type info for Gradle

suggestions applied
Comment 6 Bastien Nocera 2018-07-22 12:26:29 UTC
Created attachment 140769 [details] [review]
Add MIME type info for Groovy scripting language
Comment 7 Bastien Nocera 2018-07-22 12:26:33 UTC
Created attachment 140770 [details] [review]
Add MIME type for Gradle build tool
Comment 8 Bastien Nocera 2018-07-22 12:26:49 UTC
Attachment 140769 [details] pushed as 9f4fb11 - Add MIME type info for Groovy scripting language
Attachment 140770 [details] pushed as a60572d - Add MIME type for Gradle build tool
Comment 9 Paul Merlin 2018-07-23 15:12:44 UTC
Groovy Gradle scripts glob pattern should be `*.gradle` instead of `build.gradle`, you can name your script as you like.

Moreover, there's now also Kotlin Gradle scripts for which the glob pattern should be `*.gradle.kts`.
Comment 10 Alberto Fanjul Alonso 2018-07-24 06:26:08 UTC
Created attachment 140803 [details] [review]
MIME type info for Gradle scripts

Ouch! that's correct.

I focus on my use case (detect gradle build scripts) but for MIME it should be all the gradle scripts.
Comment 11 Paul Merlin 2018-07-24 11:22:58 UTC
How should the difference between Groovy and Kotlin Gradle scripts be approached?

Kotlin Gradle scripts will probably be a sub-class of `text/x-kotlin`.

But I'm wondering about the `mime-type`.
Shouldn't we have something like `text/x-gradle-groovy` and `text/x-gradle-kotlin`?
Comment 12 Alberto Fanjul Alonso 2018-07-24 11:58:48 UTC
Created attachment 140807 [details]
attachment-22008-0.html

I think is a kotlin MIME type (*.kts), Does the purpose of the script need
to be detected?

El mar., 24 jul. 2018 a las 13:23, <bugzilla-daemon@freedesktop.org>
escribió:

> *Comment # 11 <https://bugs.freedesktop.org/show_bug.cgi?id=107321#c11> on
> bug 107321 <https://bugs.freedesktop.org/show_bug.cgi?id=107321> from Paul
> Merlin <paul@nosphere.org> *
>
> How should the difference between Groovy and Kotlin Gradle scripts be
> approached?
>
> Kotlin Gradle scripts will probably be a sub-class of `text/x-kotlin`.
>
> But I'm wondering about the `mime-type`.
> Shouldn't we have something like `text/x-gradle-groovy` and
> `text/x-gradle-kotlin`?
>
> ------------------------------
> You are receiving this mail because:
>
>    - You reported the bug.
>
>
Comment 13 Paul Merlin 2018-07-24 19:21:16 UTC
To clarify:

`*.kt` glob pattern should match generic Kotlin _sources_
`*.kts` glob pattern should match generic Kotlin _scripts_

Gradle Kotlin scripts are named `*.gradle.kts`
Comment 14 Bastien Nocera 2018-07-25 11:02:20 UTC
Please file new bugs. Nobody is expected to look in closed bugs.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.