Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » B3 » the ways to invoke b3? opinions wanted...
the ways to invoke b3? opinions wanted... [message #603392] Sun, 14 March 2010 13:24 Go to previous message
Henrik Lindberg is currently offline Henrik Lindberg
Messages: 2428
Registered: July 2009
Senior Member
Hi,
Here is a topic where I want your input - the various ways we want to be
able to invoke the b3 engine.

There are a couple of cases, and situations. Here are some ideas for how
things could work. They are all quite easy to implement, but what is the
best approach, and what would be the easiest to use?

So - braindump on ideas...

When the workspace does not contain what user wants to work on, it feels
natural to get it there via Eclipse -> Import -> "Import using b3
materialization"

A b3 materialization requires a) a definition of the repositories to
search, and b) the top unit (i.e. what is requested).

Now, there are many choices how this can be done in the user interface.
- User could point to a b3 script that contains everything required.
(i.e. something like:
repositories { "p2:..."; "git:..."; "svn: ..."; }
b3.resolveAndMaterialize("org.myorg.mytopComponent");
)
- User could point to a b3 script that only contains the repositories
declaration (and any other setup code the user is interested in), and
enter the name of the component manually.

- What if this is the first time the user is using b3? User has no
scripts, and has made no configuration of b3. What should the dialog
tell the user? By default b3 resolves from workspace and target platform
(and naturally the b3 file being executed) - the dialog could tell the
user that additional repository configuration is required (if wanted)
and then create a b3 file with a template repository config. It would
probably be possible to discover repositories by looking at the p2
repositories in p2's preferences, and by looking at repositories
configured for cvs, svn, git, etc. and then guess on a template (could
be directed by user choice - showing them). This is perhaps a separate
wizard that the user is offered a choice to run - the output would be a
b3 script with a repository configuration that can then be further
edited as required).

- An alterantive to the above is to just open the b3 editor with a
minimal template, and let the user insert repository configuration using
code/completion (i.e. look up repository info from scm's and p2
preferences).

- User would not have to use the import dialog at all, when there is a
b3 script defining repositories and having a resolveAndMaterialize call.
It is enough to simply run the b3 script.

- User preferences for b3 could contain a reference to the equivalence
of a .b3rc to run by default when running b3 scripts. User could be
allowed to have several such named scripts. User could then select one
of them in the import dialog.

- User could open the script editor. When in the script editor, the b3
code can be executed from within the editor (currently via "run" in the
outline - but could be placed in a more visible place).

- We can implement a "run as b3", that would be available from the run
menu, as well as in a context menu for a b3 file. (Some distinction is
needed between "run in IDE" (i.e. having b3 installed), and "run
selfhosted / for debugging" - but those are probably quite different as
the latter requires a launch configuration.

- Currently, invokation of b3 scripts call a function called main. There
is no notion of just executing expressions at the top level (as in many
script languages). I think that feature should be added in order to
simplify when using b3 as a command script (i.e. to do resolve and
materialize, import, build, etc).

- When running a b3 file from the command line, passing arguments is
naturally easy - should there be a dialog for this in the UI? i.e.
typing parameters in a field?

// When there is stuff in the workspace
- When there are things in the workspace that b3 has translated into
build units (i.e. plugins, features, etc.) it is possible to invoke
actions on them. (Similar to how Buckminster does this). In Buckminster
there is a clear distinction between running a query and invoking
actions, but in b3, these can be combined. So a dialog for invoking an
action on a discovered unit is very similar to the ways to invoke things
described above. The difference being that it makes sense to show the
builders (and perhaps functions) in the dialog, and let the user choose
what to invoke (as opposed to just running the expressions in a b3
script, or calling a fixed function (e.g. "main"). Do you think all of
the options should be unified into one "invoke b3" dialog?

How can all of the above be done in the simplest possible fashion?
How would you like it to work.

Regards
- henrik
 
Read Message
Read Message
Read Message
Previous Topic:the ways to invoke b3? opinions wanted...
Next Topic:Using p2 model to generate a p2 site
Goto Forum:
  


Current Time: Wed May 22 10:13:14 EDT 2013

Powered by FUDForum. Page generated in 0.01743 seconds