Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

qx.core.Environment.get("qx.libraryInfoMap") not working in "build" target #781

Open
sgaillard opened this issue Dec 15, 2020 · 4 comments

Comments

@sgaillard
Copy link

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 (or qx deploy --clean -o compiled/new_app)

Result:

  • Navigate to new_app/compiled/source result in the display in js console of the qx.libraryInfoMap with all libraries info available.
  • Navigate to new_app/compiled/build result in the display in js console of an undefined 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"));
    }
  }
});
@cboulanger
Copy link
Contributor

@sgaillard Thanks for reporting. @johnspackman , can you have a look?

@sgaillard
Copy link
Author

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

@johnspackman
Copy link
Member

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?

@sgaillard
Copy link
Author

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?

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

No branches or pull requests

3 participants