Skip to content

Bug: Wrong config.json created when a Beckhoff repo is configured before a Nuget repo #164

@laspir

Description

@laspir

Type: Bug
Version: TwinPack 1.4.3
Reproducible: Yes

TwinPack offers the option to create the config.json file through the IDE as follows:
Image

However if during creation of the config.json a Nuget repository is configured after the Beckhoff repository,

Image

and "all repositories" is selected

Image

the libraries belonging to the Nuget repository are erroneously added as "reference" instead of "package" and with the prefix TwinCAT.XAE.PLC, which is usually reserved for Beckhoff Repositories, as shown below:

      "plcs": [
        {
          "version": "1.0.0",
          "distributor-name": "TestCompany",
          "name": "TestPlc",
          "title": "TestLib",
          "type": "Application",
          "frameworks": {
            "zeugwerk": {
              "version": "",
              "references": [],
              "repositories": [
                "https://framework.zeugwerk.dev/Distribution"
              ],
              "hide": false,
              "qualified-only": true
            }
          },
          "packages": [],
          "references": {
            "*": [
              "TwinCAT.XAE.PLC.Lib.TestLibrary=*"
            ]
          },

On the other hand, if the Beckhoff Repository is deactivated

Image

or if the nuget repository is explicitly selected before creating the config.json

Image

then config.json is created correctly:

      "plcs": [
        {
          "version": "1.0.0",
          "distributor-name": "TestCompany",
          "name": "TestPlc",
          "title": "TestLib",
          "type": "Application",
          "frameworks": {
            "zeugwerk": {
              "version": "",
              "references": [],
              "repositories": [
                "https://framework.zeugwerk.dev/Distribution"
              ],
              "hide": false,
              "qualified-only": true
            }
          },
          "packages": [
            {
              "version": null,
              "name": "TestLibrary",
              "branch": "main",
              "target": "TC3.1",
              "configuration": "Release",
              "distributor-name": "TestCompany"
            }
          ],
          "references": {
            "*": []
          },

Attached is

  • the TpZip test project used to file the bug report
  • the TestLibrary used in the test project and .nuspec from which the package was generated
  • the correct and wrong config.json files generated

correct_config.json
wrong_config.json
TestProject.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions