ceylon / ceylon-module-resolver

DEPRECATED
Apache License 2.0
23 stars 9 forks source link

ModuleVersionDetails should have nativeBackends #129

Open gavinking opened 9 years ago

gavinking commented 9 years ago

The ModuleVersionDetails class should have an attribute that tells me what are the supported Backends.

@quintesse would you please take a look at this. Thanks.

quintesse commented 9 years ago

I don't think I can do this before the deadline you set for a wednesday release. What's the specific reason you need this feature? I'd think that knowing there is an implementation (native or not) would be sufficient?

quintesse commented 9 years ago

Ah wait you linked another issue.

gavinking commented 9 years ago

I want to automatically add native annotations on the import statements. I already have a branch of the IDE which implements this, but I can't get the information I need from a module query.

quintesse commented 9 years ago

But couldn't you , for now, use the fact that a query for JVM + JS only returns one or the other for native modules?

gavinking commented 9 years ago

Well sure I guess in principle I could do it with two queries, but that would make something that is already too slow now twice as slow.

quintesse commented 9 years ago

Well I mean that if somebody is putting in an import statement we have to retrieve the artifacts anyway, right? So the moment you retrieve them you can check which ones you got. That shouldn't involve any queries AFAICT.

gavinking commented 9 years ago

No, because as-per the resolution to https://github.com/ceylon/ceylon-module-resolver/issues/128, it only sends me the artifacts I asked for. It doesn't tell me that the module also has other artifacts available.

quintesse commented 9 years ago

But that's what I mean, you'd normally ask for both artifacts, right? Because I see two situations:

THat should be enough information, right?

(*) well, it also depends on which backends you have enabled in the IDE I guess.

gavinking commented 9 years ago

But that's what I mean, you'd normally ask for both artifacts, right?

No, I don't, because I want to get a filtered list of modules. Instead I ask for only the modules that are compatible with at least one of the enabled backends.

gavinking commented 9 years ago

@quintesse Note that I can have a native import in a cross-platform module, and I might not have both backends enabled.

gavinking commented 9 years ago

Reassigning to 1.3 because I think I can live without this for now.

quintesse commented 9 years ago

Note that I can have a native import in a cross-platform module.

Yes, that was the second bullet point I mentioned above.

No, I don't, because I want to get a filtered list of modules. Instead I ask for only the modules that are compatible with at least one of the enabled backends.

I'm not sure I understand. If you ask for the list of modules that are compatible with either JVM or JS then you have your answer right there, don't you? Some of the modules will have JVM artifacts, some JS and some both. It would seem to me that's enough information?