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

[Question] What's the recommended way to differentiate different kind of output paths. #582

Open
1 of 4 tasks
jdneo opened this issue Jul 24, 2023 · 6 comments
Open
1 of 4 tasks

Comments

@jdneo
Copy link
Contributor

jdneo commented Jul 24, 2023

Describe the use-case for this feature

In definition of OutputPathItem, the spec has kind for File and Directory. But in some cases, these two might not be enough.

For example. In Gradle, the source set can have different output paths for class files and resource files:

image

The spec has two dedicated requests for sources and resources. What's the recommended way to differentiate the output of them?

What do you propose

I'm now using query string of uris:

?kind=sources or ?kind=resources

I've checked to make sure there isn't already a way to support this in the current protocol

  • I've checked the existing protocol and there isn't a way to do this currently

Maintainer approval (This is for the maintainers)

  • Jetbrains
  • Metals
  • Scala Center
@lefou
Copy link
Contributor

lefou commented Jul 24, 2023

I think there is currently nothing missing. Although there are two dedicated requests for sources and resources, neither of them need any kind of output, as these files and directory are already known through the request. Only the compilation request needs some output location for the produced files. This is the defined output path(s). Unless we also add some compile-resources request, I don't see the need for an resource output path. Can you elaborate on your use case? What you want to achieve?

@jdneo
Copy link
Contributor Author

jdneo commented Jul 24, 2023

I'm trying to write an Eclipse project importer to import bsp project.

The Importer will ask build server to get project structures like sources, resources, dependencies, ...

And the output of the source dirs and resource dirs are also needed by the importer.

@lefou
Copy link
Contributor

lefou commented Jul 24, 2023

I wonder what the output of a resources might be, without the mention of any task that can produce additional resources. Also there is no output of a sources. Output only makes sense in combination with a task that can produce something. So, the compile task is supposed to produce something from the sources. But AFAIK there is no task to produce something from the resources.

It might be, that in gradle, configuration of outputs is coupled to the concept of sources, but this is not the case in other tools nor in BSP.

Are you looking into mapping some resource generation task into BSP?

@jdneo
Copy link
Contributor Author

jdneo commented Jul 24, 2023

what the output of a resources might be

Let's say there is a Gradle Java project, by default:

  • the task compileJava will compile the sources, and output the .class file into ./build/classes
  • the task processResources will copy the resources to the target folder: e.g. ./build/resources. In that case, the target folder can be considered as the output of the processResources task.

It might be, that in gradle, configuration of outputs is coupled to the concept of sources, but this is not the case in other tools nor in BSP.

Yes, I understand that it might not apply to other build tools. So I come here to ask for any recommendation in this case :)

@agluszak
Copy link
Collaborator

I'm now using query string of uris:
?kind=sources or ?kind=resources

What do you mean by that?

@jdneo
Copy link
Contributor Author

jdneo commented Jul 24, 2023

I added the query to the uri of each output path item to store their kinds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants