On Sat, Mar 24, 2018 at 12:27 PM, Thomas Broyer <t.bro...@gmail.com> wrote:

>
>
> On Saturday, March 24, 2018 at 10:30:10 AM UTC+1, Mincong Huang wrote:
>>
>> Hi,
>>
>> I'd like to have a clarification about the naming convention for ported
>> GWT modules. Because I'm porting the module `gwt-safecss` and
>> `gwt-animation`. When I go to Vertispan repository [1], the available
>> modules do not use the same rule for the group ID and artifact ID. This is
>> a pain when you reference them as dependencies. Here're 5 rules that I
>> found.
>>
>
> This is a subject we briefly discussed last week in our steering committee
> meeting, acknowledging the issue.
>
>
>> *Rule 1:*
>> Use "org.gwtproject" + module name as group id; module name with "gwt-"
>> prefix as artifact id. This rule is used by `gwt-http`:
>>
>>     GROUP_ID:    org.gwtproject.$MODULE
>>     ARTIFACT_ID: gwt-$MODULE
>>
>> *Rule 2:*
>> Use "org.gwtproject" + module name as group id; module name without
>> "gwt-" prefix as artifact id. This rule is used by `gwt-event`,
>> `gwt-place`, `gwt-safehtml`, `gwt-storage`, `gwt-timer`:
>>
>>     GROUP_ID:    org.gwtproject.$MODULE
>>     ARTIFACT_ID: $MODULE
>>
>
> gwt-events actually falls in rule 1.
>

Yes, indeed. You're right.


>
>
>> *Rule 3:*
>> Use "org.gwtproject" as group id; module name with "gwt-" prefix as
>> artifact id. This rule is used by `gwt-xhr`:
>>
>>     GROUP_ID:    org.gwtproject
>>     ARTIFACT_ID: gwt-$MODULE
>>
>> *Rule 4:*
>> Use "org.gwtproject" as group id; module name without "gwt-" prefix as
>> artifact id. This rule is used by `gwt-json`, `gwt-typedarrays`, `gwt-xml`,
>> `gwt-xhr`:
>>
>>     GROUP_ID:    org.gwtproject
>>     ARTIFACT_ID: $MODULE
>>
>> *Rule 5:*
>> Other rules: `gwt-window`, `gwt-history`.
>>
>
> Those fall (almost) in rule 1, with an additional "user" in groupId:
> org.gwtproject.user.$MODULE:gwt-$MODULE
>
>
>> I suggest we apply rule 4 to all the modules. It means always using
>> "org.gwtproject` as group id, and use `gwt-` + module name as artifact id.
>> There're several benefits. It helps people to find all the artifacts via
>> the same group id. It also keeps consistency for the generated JAR files:
>> each of them contains a "gwt-" prefix, thus they are GWT artifacts.
>>
>
> My rule of thumb was to use a "subgroup" of "org.gwtproject" when there
> was several artifacts, as can be seen in gwt-events and gwt-places. For
> other cases, I'm always hesitating between bare "org.gwtproject" and a
> subgroup.
>
> Fwiw, we settled on always using a subgroup (IIRC; Colin, please correct
> me if I misremember). This means rule 1 or 2 rather than 3 or 4. And I
> would tend to agree with using a "gwt-" prefix for artifact IDs, though if
> you read the artifact name as being groupId+artifactId, then that prefix
> would be redundant with the "org.gwtproject" prefix of the groupId.
>

Using the same group ID for every artifact is easier for searching. For
instance, you can use query `g:"com.google.gwt"`
<https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.google.gwt%22> to
search all the GWT artifacts in Maven central repository. You must do a
wildcard search if group ID contain a subgroup. However, I understand that
a sub group contains multiple modules, so rule 1 and 2 have their interest.
Another way could be:

*Rule 6:*
Using "org.gwtproject" as group id; "gwt-" prefix with optional subgroup
and module name as artifact ID:

    GROUP_ID:     org.gwtproject
    ARTIFACT_ID:  gwt-$SUBGP-$MODULE

Therefore, subgroup becomes the first order in artifact listing. And the
"gwt-" prefix is useful for identifying GWT jar—an counter-example is
`json-1.0-20180116.161204-1.jar`, without the group ID, I can't tell it
belong to GWT.


> Compare, for example
>
>    - org.gwtproject:http vs org.gwtproject:gwt-http vs
>    org.gwtproject.http:http vs org.gwtproject.http:gwt-http
>    - org.gwtproject:logical-event vs org.gwtproject:gwt-logical-event vs
>    org.gwtproject.event:logical vs org.gwtproject.event:logical-event vs
>    org.gwtproject.event.gwt-logical-event (this goes with "event" and
>    "compat" artifacts)
>
>
Thanks for these examples. I formatted it for those who want a vertical
comparison.

org.gwtproject:http
org.gwtproject:gwt-http
org.gwtproject.http:http
org.gwtproject.http:gwt-http

org.gwtproject:logical-event
org.gwtproject:gwt-logical-event
org.gwtproject.event:logical
org.gwtproject.event:logical-event
org.gwtproject.event.gwt-logical-event
---
org.gwtproject:gwt-event-logical (rule 6)

There're two other questions:

- Why not using `org.gwt` instead of `org.gwtproject`?
- We're discussing sub groups here. But all the sub groups are under
gwt-user. What about gwt-dev and other parts? Is `user` and `dev` are
considered as subgroup? (Thus Rule 5 makes sens)

Mincong


> --
> You received this message because you are subscribed to the Google Groups
> "GWT Contributors" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-web-toolkit-contributors/ac6913ab-7240-
> 4fcb-8d5b-4a48085089b6%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/ac6913ab-7240-4fcb-8d5b-4a48085089b6%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CACWxqgD8RS8i646xN26_m4uHx9XHT8vRLrPqQnj2_R-sEH%3DeRg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to