question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there a way to define custom properties in task.json and consume those in the build task?

See original GitHub issue

Is there a way to define a static custom property in task.json and consume that in the associated (PowerShell) build task? This would not be a user editable input.

We have multiple TFS environments and the property of the task only needs to vary between environments. My thought is that at the point the task is uploaded, our deployment process could set the property in task.json to the value specific to the environment. Or would you recommend an alternative approach?

Hope this makes sense. Thanks

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ppejoviccommented, Oct 12, 2018

@damccorm I ended up writing a separate config.json file which is read by the build step, The values in the config.json are modified by our deployment process that packages up the build step and pushes it to our TFS instances.

0reactions
ppejoviccommented, Oct 12, 2018

Well I think having it defined in the task.json would be nicer, either in its own config/options section or as an input with a default value that isn’t editable / hidden

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tasks in Visual Studio Code
Select tsc: build or tsc: watch and VS Code will generate a tasks.json file. ... Sometimes it is necessary to define your own...
Read more >
Customize build debug tasks with JSON files - Visual Studio ...
Learn how to customize tasks to provide some configuration details to run and debug a codebase that Visual Studio doesn't recognize.
Read more >
Adding a property to tasks.json (without warning) · Issue #17566
Expected: Allows custom properties to be set in the file. Custom properties are just ignored by VSC when it consumes/configures the tasks.
Read more >
VScode: Defining own variables in tasks.json - Stack Overflow
Adam Parkin's answer won't work because, at least on windows, the shell will not substitute environment variables given as arguments.
Read more >
Task definition parameters - Amazon ECS - AWS Documentation
The family and container definitions are required in a task definition. ... You can use these parameters in a JSON file to configure...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found