Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,25 @@ if ($null -ne $properties -and $actionPassedIn -ne $true) {
$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)
Expand Down
16 changes: 14 additions & 2 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ extraargs=''
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")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

actInt=($(comm -12 <(printf '%s\n' "${actions[@]/#/-}" | sort) <(printf '%s\n' "${@/#--/-}" | sort)))

while [[ $# > 0 ]]; do
Expand Down Expand Up @@ -118,6 +119,17 @@ 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
;;
Expand All @@ -132,7 +144,7 @@ if [[ "$buildtests" == true ]]; then
fi
fi

if [ ${#actInt[@]} -eq 0 ] || [ "$subsetCategory" != "libraries" ]; then
if [ ${#actInt[@]} -eq 0 ]; then
arguments="-restore -build $arguments"
fi

Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/installer/jobs/bash-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
# 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 }}
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/installer/jobs/osx-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- 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)
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/installer/jobs/windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
displayName: Clear NuGet http cache (if exists)

- script: >-
$(buildScriptFileName).cmd -ci -test
$(buildScriptFileName).cmd -restore -build -ci -test
$(CommonMSBuildArgs)
$(MsbuildSigningArguments)
displayName: Build
Expand Down