-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
28 changed files
with
501 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...agent/src/main/kotlin/jetbrains/buildServer/dotnet/dotnet/NugetDeleteArgumentsProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright 2000-2017 JetBrains s.r.o. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* See LICENSE in the project root for license information. | ||
*/ | ||
|
||
package jetbrains.buildServer.dotnet.dotnet | ||
|
||
import jetbrains.buildServer.dotnet.ArgumentsProvider | ||
import jetbrains.buildServer.dotnet.DotnetConstants | ||
import jetbrains.buildServer.util.StringUtil | ||
|
||
import java.util.ArrayList | ||
|
||
/** | ||
* Provides arguments to dotnet nuget delete command. | ||
*/ | ||
class NugetDeleteArgumentsProvider : ArgumentsProvider { | ||
|
||
override fun getArguments(parameters: Map<String, String>): List<String> { | ||
val arguments = ArrayList<String>() | ||
arguments.addAll(StringUtil.split(DotnetConstants.COMMAND_NUGET_DELETE)) | ||
|
||
parameters[DotnetConstants.PARAM_NUGET_DELETE_ID]?.trim()?.let { | ||
if (it.isNotBlank()) { | ||
arguments.addAll(StringUtil.split(it)) | ||
} | ||
} | ||
|
||
parameters[DotnetConstants.PARAM_NUGET_API_KEY]?.trim()?.let { | ||
if (it.isNotBlank()) { | ||
arguments.addAll(listOf("--api-key", it)) | ||
} | ||
} | ||
|
||
parameters[DotnetConstants.PARAM_NUGET_SOURCE]?.trim()?.let { | ||
if (it.isNotBlank()) { | ||
arguments.addAll(listOf("--source", it)) | ||
} | ||
} | ||
|
||
arguments.addAll(listOf("--non-interactive")) | ||
|
||
parameters[DotnetConstants.PARAM_ARGUMENTS]?.trim()?.let { | ||
arguments.addAll(StringUtil.splitCommandArgumentsAndUnquote(it)) | ||
} | ||
|
||
return arguments | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
...t-agent/src/main/kotlin/jetbrains/buildServer/dotnet/dotnet/NugetPushArgumentsProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright 2000-2017 JetBrains s.r.o. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* See LICENSE in the project root for license information. | ||
*/ | ||
|
||
package jetbrains.buildServer.dotnet.dotnet | ||
|
||
import jetbrains.buildServer.dotnet.ArgumentsProvider | ||
import jetbrains.buildServer.dotnet.DotnetConstants | ||
import jetbrains.buildServer.util.StringUtil | ||
|
||
import java.util.ArrayList | ||
|
||
/** | ||
* Provides arguments to dotnet nuget push command. | ||
*/ | ||
class NugetPushArgumentsProvider : ArgumentsProvider { | ||
|
||
override fun getArguments(parameters: Map<String, String>): List<String> { | ||
val arguments = ArrayList<String>() | ||
arguments.addAll(StringUtil.split(DotnetConstants.COMMAND_NUGET_PUSH)) | ||
|
||
parameters[DotnetConstants.PARAM_PATHS]?.trim()?.let { | ||
if (it.isNotBlank()) { | ||
arguments.add(it) | ||
} | ||
} | ||
|
||
parameters[DotnetConstants.PARAM_NUGET_API_KEY]?.trim()?.let { | ||
if (it.isNotBlank()) { | ||
arguments.addAll(listOf("--api-key", it)) | ||
} | ||
} | ||
|
||
parameters[DotnetConstants.PARAM_NUGET_SOURCE]?.trim()?.let { | ||
if (it.isNotBlank()) { | ||
arguments.addAll(listOf("--source", it)) | ||
} | ||
} | ||
|
||
if (parameters.getOrElse(DotnetConstants.PARAM_NUGET_PUSH_NO_SYMBOLS, { "" }).trim().toBoolean()) { | ||
arguments.addAll(listOf("--no-symbols", "true")) | ||
} | ||
|
||
if (parameters.getOrElse(DotnetConstants.PARAM_NUGET_PUSH_NO_BUFFER, { "" }).trim().toBoolean()) { | ||
arguments.addAll(listOf("--disable-buffering", "true")) | ||
} | ||
|
||
parameters[DotnetConstants.PARAM_ARGUMENTS]?.trim()?.let { | ||
arguments.addAll(StringUtil.splitCommandArgumentsAndUnquote(it)) | ||
} | ||
|
||
return arguments | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.