$actionPassedIn = @(Compare-Object -ReferenceObject $properties -DifferenceObject $actions.ForEach({ "-" + $_ }) -ExcludeDifferent -IncludeEqual).Length -ne 0
}
-if (!$actionPassedIn -or $subsetCategory -ne "libraries") {
+if (!$actionPassedIn) {
$arguments = "-restore -build"
}
+$possibleDirToBuild = if($properties.Length -gt 0) { $properties[0]; } else { $null }
+
+if ($null -ne $possibleDirToBuild -and $subsetCategory -eq "libraries") {
+ $dtb = $possibleDirToBuild.TrimEnd('\')
+ if (Test-Path $dtb) {
+ $properties[0] = "/p:DirectoryToBuild=$(Resolve-Path $dtb)"
+ }
+ else {
+ $dtb = Join-Path "$PSSCriptRoot\..\src\libraries" $dtb
+ if (Test-Path $dtb) {
+ $properties[0] = "/p:DirectoryToBuild=$(Resolve-Path $dtb)"
+ }
+ }
+}
+
foreach ($argument in $PSBoundParameters.Keys)
{
switch($argument)
build=false
buildtests=false
subsetCategory=''
+checkedPossibleDirectoryToBuild=false
# Check if an action is passed in
-declare -a actions=("r" "restore" "b" "build" "rebuild" "t" "test" "buildtests")
+declare -a actions=("r" "restore" "b" "build" "buildtests" "rebuild" "t" "test" "pack" "sign" "publish" "clean")
actInt=($(comm -12 <(printf '%s\n' "${actions[@]/#/-}" | sort) <(printf '%s\n' "${@/#--/-}" | sort)))
while [[ $# > 0 ]]; do
;;
*)
ea=$1
+
+ if [[ $checkedPossibleDirectoryToBuild == false ]] && [[ $subsetCategory == "libraries" ]]; then
+ checkedPossibleDirectoryToBuild=true
+
+ if [[ -d "$1" ]]; then
+ ea="/p:DirectoryToBuild=$1"
+ elif [[ -d "$scriptroot/../src/libraries/$1" ]]; then
+ ea="/p:DirectoryToBuild=$scriptroot/../src/libraries/$1"
+ fi
+ fi
+
extraargs="$extraargs $ea"
shift 1
;;
fi
fi
-if [ ${#actInt[@]} -eq 0 ] || [ "$subsetCategory" != "libraries" ]; then
+if [ ${#actInt[@]} -eq 0 ]; then
arguments="-restore -build $arguments"
fi
# parameter is empty, AzDO replaces it with empty space without chomping the extra newline.
# This causes a newline in the arg string that causes failure.
BuildArguments: >-
- --ci --test
+ --restore --build --ci --test
/p:CrossBuild=${{ parameters.crossBuild }}
/p:DisableCrossgen=${{ parameters.disableCrossgen }}
/p:PortableBuild=${{ parameters.portableBuild }}
- task: NuGetAuthenticate@0
- script: >-
- $(Build.SourcesDirectory)/$(buildScriptFileName).sh --ci --test
+ $(Build.SourcesDirectory)/$(buildScriptFileName).sh --restore --build --ci --test
/p:OfficialBuildId=$(OfficialBuildId)
/p:StripSymbols=true
$(CommonMSBuildArgs)
displayName: Clear NuGet http cache (if exists)
- script: >-
- $(buildScriptFileName).cmd -ci -test
+ $(buildScriptFileName).cmd -restore -build -ci -test
$(CommonMSBuildArgs)
$(MsbuildSigningArguments)
displayName: Build