Oswald
Oswald

Reputation: 1272

TFS 2017 Build Templates Property needs attention

I'm currently trying to create default build templates on Microsoft Team Foundation Server 2017.

I created a template via the REST API and it's going well overall.

But... One Question.

If anybody creates a build with my template, I wanna show him which settings he have to set up to run the build well. Until now I've done this:

Choose Project for Packing The JSON looks like this:

...,
    {
        "enabled": true,
        "continueOnError": false,
        "alwaysRun": false,
        "displayName": "NuGet Packager ",
        "timeoutInMinutes": 0,
        "task": {
            "id": "333b11bd-d341-40d9-afcf-b32d5ce6f24b",
            "versionSpec": "0.*",
            "definitionType": "task"
        },
        "inputs": {
            "searchPattern": "<chooseProject>",
            "outputdir": "",
            "includeReferencedProjects": "false",
            "versionByBuild": "false",
            "versionEnvVar": "",
            "requestedMajorVersion": "1",
            "requestedMinorVersion": "0",
            "requestedPatchVersion": "0",
            "configurationToPack": "$(BuildConfiguration)",
            "buildProperties": "",
            "nuGetAdditionalArgs": "",
            "nuGetPath": ""
        }
    }...

How can I change the json to make it look like this? Needs attention

Upvotes: 1

Views: 98

Answers (1)

PatrickLu-MSFT
PatrickLu-MSFT

Reputation: 51183

Just need to add a "required": true, in the inputs.

You could also refer the source code of this task in github--PublishBuildArtifacts

Upvotes: 1

Related Questions