Skip to content

Computed value with reference to other symbols #9875

@MiguelGuedelha

Description

@MiguelGuedelha

Is your feature request related to a problem? Please describe.

Consider a template that sets Product and PackageId parameters in its csproj file as follows

For example:

<Product>Umbraco.Community.PackageName</Product>
<PackageId>Umbraco.Community.PackageName</PackageId>

PackageName is the source name (so it will get replaced with whatever the -n parameter value is set to)

Umbraco.Community is simply an allowed prefix in the Umbraco community commonly used to prefix packages related to it.

However, some companies/individuals might want to have their own fully qualified ID that doesn't include Umbraco.Community for varied reasons (want it to be tied to their own company's name, etc)

I though the template could be adapted to support this in some way but the attempts I tried don't seem to work.

Describe the solution you'd like.

Something of the sorts:

csproj:

...rest of config
<Product>PACKAGE_PREFIXPackageName</Product>
<PackageId>PACKAGE_PREFIXPackageName</PackageId>
...rest of config

template.config snippet:

...rest of config
"useDefaultPrefix": {
  "description": "Whether to use the default 'Umbraco.Community' prefix for the package id or if just the name should be used, as it is already a fully qualified",
  "type": "parameter",
  "datatype": "bool",
  "defaultValue": "true"
},
 "packagePrefix": {
 "type": "computed",
 "value": "(useDefaultPrefix ? (\"Umbraco.Community\" + \".\") : (\"\"))",
 "replaces": "PACKAGE_PREFIX"
},
...rest of config

Is this or similar already possible in some way?

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions