Comments (6)
@michaelhahn-doka in version 1.5.9 you can now use Else
in the task inputs ✨
from sharpliner.
Hey,
Yes, this is possible. I believe it's also somewhere in the docs as an example. Let me dig that up.
from sharpliner.
Alright, this one is a bit verbose but you can do this:
DotNet.Pack("ProjectFile") with
{
Inputs = new()
{
{
If.Equal(parameters["IncludeSymbols"], "true"), new TaskInputs()
{
["arguments"] = "--configuration $(BuildConfiguration) --no-restore --no-build -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg"
}
},
{
If.NotEqual(parameters["IncludeSymbols"], "true"), new TaskInputs()
{
["arguments"] = "--configuration $(BuildConfiguration) --no-restore --no-build"
}
}
},
},
which produces this:
- task: DotNetCoreCLI@2
inputs:
command: pack
packagesToPack: ProjectFile
${{ if eq(parameters.IncludeSymbols, true) }}:
arguments: --configuration $(BuildConfiguration) --no-restore --no-build -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
${{ if ne(parameters.IncludeSymbols, true) }}:
arguments: --configuration $(BuildConfiguration) --no-restore --no-build
from sharpliner.
Thank you for the reply, that was the missing piece, to use two if statements instead of an if - else condition which wouldn't be possible at the moment, right?
from sharpliner.
I can check later (next week unfortunately), if I can make the Else
work but at the moment it unfortunately does not work
from sharpliner.
Well, no worries, for now I'm fine with the "Double If", thx for the fast answer.
from sharpliner.
Related Issues (20)
- The "PublishDefinitions" task failed unexpectedly in 1.5.0 HOT 6
- RepositoryResource doesn't serialize RepositoryType.Git HOT 10
- Missing a top level `pool` property on pipeline definition HOT 1
- Add support for each-expressions HOT 8
- Extends definition HOT 3
- Nested conditioned blocks (`if`, `each`...) not working
- Parameterize ExtendsPipelineDefinition to allow easier inheritance of PipelineWithExtends
- Make FlattenDefinition method on Conditioned public HOT 1
- Referencing a Sharpliner library project directly does not build
- Allow registration of custom validations via `SharplinerConfiguration`
- Allow overriding PipelineBase.Validation in subclasses outside of the Sharpliner project HOT 1
- Add models for PublishTestResults@2 and PublishCodeCoverageResults@1 ADO tasks
- DotNetInstallBuilder.FromGlobalJson() fails to set the useGlobalJson input HOT 1
- Add models for file operation tasks
- Make it easier to export new API
- Workspace = JobWorkspace.All result in error on DevOps Pipeline HOT 2
- How do I use runtime expressions? HOT 3
- Pwsh.Inline() Command HOT 2
- extension methods HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sharpliner.