qooxdoo-compiler
qooxdoo-compiler copied to clipboard
qx.core.Environment.get("qx.libraryInfoMap") not working in "build" target
Hi, Here is my issue as suggested by Henner Kollmann @hkollmann on gitter.
I use to rely on qx.core.Environment.get("qx.libraryInfoMap")
to get information about version and packages used in my apps and display them to the end user or as a log hint when debugging deployed apps.
But today (qx --version: 1.0.0-beta-20201203-1458), as with version 1.0.0-beta-20201003-1033 when I first ask on gitter, this call returns un undefined value in target "build" and with qx deploy. With qx compile --target source (default compile target) everything goes as expected.
Step to reproduce:
-
qx create new_app
- insert
console.log(qx.core.Environment.get("qx.libraryInfoMap"));
in the body of the app -
qx compile --target source
-
qx compile --target build
(orqx deploy --clean -o compiled/new_app
)
Result:
- Navigate to
new_app/compiled/source
result in the display in js console of theqx.libraryInfoMap
with all libraries info available. - Navigate to
new_app/compiled/build
result in the display in js console of anundefined
content.
Expected: Same result in both source and build targets
Environment:
- platform: Debian/Linux
- web server: nginx
- code editor: vscode
- web browser: chromium based
Minimum demo Application.js file:
/**
* @asset(new_app/*)
*/
qx.Class.define("new_app.Application",
{
extend : qx.application.Standalone,
members :
{
main : function()
{
this.base(arguments);
if (qx.core.Environment.get("qx.debug"))
{
qx.log.appender.Native;
qx.log.appender.Console;
}
// Should output library info map whatever target is build
console.log(qx.core.Environment.get("qx.libraryInfoMap"));
}
}
});
@sgaillard Thanks for reporting. @johnspackman , can you have a look?
Hi everybody,
Does anyone had a look. The problem is still here with qx --version: 1.0.2
.
Or maybe, is there an other way to get version number of the project and its dependencies and display them in the deployed app?
Best
This should work if you use the --write-library-info
command line option; although I can see that the qx deploy
command turns it off regardless. Ideally this should be in the compile.json
anyway, so that it can be relied on by the application. @sgaillard please can you have a quick re-test for with qx compile --target build --write-library-info
?
Just tryed qx compile --target build --write-library-info --clean
and it seems to work as expected. Great!
And as you mentioned it, qx deploy
do not recognize command line option--write-library-info
. Is it yet possible to put this parameter in the compile.json
file?