Option for ui Library #53

saschakiefer opened this Issue Feb 20, 2014 · 4 comments


None yet

2 participants


The generated views load by default: sap.ui.commons as UI Library.
When generating a fiori app, the ui library that is needed is sap.m.
The consequence is, that a view does not work out of the box. Should we ask the user for the library to use, or should we try to extract that from the bootstrap.


I would opt for trying to detect the kind of app (e.g. by is sap.m referenced) and maybe let the user confirm it (or not). I think we have to pay attention, that we don't ask for too much from the user, especially, if we can derive the information. Agree to the page stuff.

I already have the detectin for the namespace added to to base script and could easily add a global property detecting the sap.m library in the bootstrap.

@saschakiefer saschakiefer removed the question label Feb 25, 2014
@saschakiefer saschakiefer added this to the 0.2.2 milestone Feb 25, 2014
@js1972 js1972 self-assigned this Feb 26, 2014
@js1972 js1972 added a commit to js1972/generator-openui5 that referenced this issue Feb 26, 2014
@js1972 js1972 feat(gen:view): Scaffold views with correct UI5 library.
- When the view generator is run it will scaffold out a view that uses the same UI5 library
 as used in the projects index.html (sap.m or sap.ui.commons).

- The view generator now includes a function to determine which library type is used by your
 app: whichUI5Library().

- Minor refactor to the classic app template - the Application.js had spurious whitespace and
 the _index.html created a variable (app) that was never used.

Fixes #53

This is done in the pull-request for the globals branch. However the view test is a bit ugly as it issues an error that it can't find index.html to the terminal - even though its a success test run.
I quickly looked at on-the-fly creating a dummy index.html for the view test using this.write() (part of generator) part it seems that function does not exist in the context of the beforeEach()...

Its not a problem but would be nice to refactor to handle this..


This should be closed. The fact that the test is not pretty is a different matter... It works. Closing...

@js1972 js1972 closed this Mar 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment