-
Notifications
You must be signed in to change notification settings - Fork 46
Generate project view based on args to installer #195
Comments
do we want to do it? we started moving things from installer to project view #77 and the the usage (for me) seems not very convenient. For example the project view for bazel plugin has only 20 lines (there are more complex) (https://github.com/bazelbuild/intellij/blob/master/ijwb/ijwb.bazelproject) and for providing 20 arguments via command line seems stupid - at the end of the day I would keep in the file anyway (so in the project view file) and paste it into the command line. Also, should we wipe out the existing file content? For me it doesn't seem useful at all |
I think it is a good direction to keep the server configuration in the project view. It will allow to freely edit the project while working on it. But what about the moment of creating the project? For this purpose I want to have command lines flags to generate such file in the right place. Now the workflow is:
I would like a workflow like this
Creting new projects that are slices of the monorepo is quite frequent activity. Similarly for debugging, we frequently create a new project and we want to debug the server. It is much easier to run command like:
instead of
and don't forget to copy the file from previous project with target specs and debugging configuration. |
In general I would like to add one parameter to the installer - path to project view which would be passed to the server also, we would like to add (somehow) support for so, in the new client there would be a mechanism to perform some actions before importing projects with known build tools (currently it is the case for set) - user doesn't run the bsp server manually - the client does it, only for a "generic" case (for not known build tools) user would have to run the server manually and run a "generic" import in IntelliJ. In intellij for bazel we would implement such thing as well, which would include the step where the user can specify a path to project view or create a new one in the popup window (with syntax support)
(more like 2000 minutes than 20)
well, we can't move
afaik, on daily basis when u work with mono repo you are just using predefined projective file for you team - you are just specifying the path to the project view during installation, and that's it
if you are creating a new project you are creating new files anyway, so why not create one more - project view |
+1 on that. From the server perspective it is nice to have an argument as project view path and use it as source of truth. Such file is easy to edit later during work with the project. I propose a wrapper that would be a part of the installer that is able to generate project view from command line and later pass this file to the server.
It is a nice idea, I was also thinking about this - to have proper support for BUILD files and some potential custom actions. But regardless of that, one of the first things we implemented for google's plugin was a command line mini-tool to generate seed projects with specified set of targets and open idea. Generally we want to support both GUI and CLI workflows.
Yes, after 20 I just started to be suspicious :p
True that. I initially didn't know the purpose of this file, as it could be handled without visible files. I though it may be there just as an example to copy and use, for convenience. This is the UX thing to think through. With 1000 developers some of them may fall in such trap as well.
I also heard that it is common approach for bazel world, but other workflows also are possible. In pants projects were created frequently ad-hoc, some people prefer more focused imports, some want the whole project. There is also IDE performance tradeoff. Projects are often big and users select their parts in different variations and it might be matter of personal preference. I know some projects have a script in repo that imports the important targets (and this could be replaced with commited projectview file), but it is not true for most of the projects. Also frequent workflow with bazel plugin is to have some root projectview and use
Creating a new project in bazel sense is rare thing. If someone wanted to have .projectview for each project, what you are saying of course makes sense. However creating project in intellij/bsp sense is more common. If something doesn't work it is common to just (paraphrasing existing commands):
It is also common to have multiple such projects that include targets in arbitrary combinations. The project in intellij/bsp sense is lightweight and self contained, easy to remove, easy to create. It is different from project in bazel world. |
if there is a use case for that then lets do it I was thinking about creating a proper tool similar to bazelisk - #179 then we could create an installer - it just create a json file and prepare the environment for the server, and the tool to create a project view and save it in a provided location - everything would be included in this tool (probably user would need to install it on the machine with coursier instead of calling the installer directly using coursier |
I like the idea of this tool. We should explore what coursier can do. I think coursier can prepare a small bootstrap script that downloads coursier and all deps and runs the actual tool. We could even commit such file to the repo, similarly to gradlew. |
this issue contains 2 subtasks:
|
The server was simplified to accept project view path as the only argument. This is fine, but it would be very useful to be able to specify flags from command line. I imagine it as command line interface for generating project view. This would give 2 possible workflows (just example syntax):
maybe it is possible to first create the file and then point to in while running install, not sure. But anyway, this is not what I am looking for in this issue. Expected scenario is:
The first command would generate the project view at
_bsp_projects/my-project
according to options and set up bsp server that uses this file.The text was updated successfully, but these errors were encountered: