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
4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<ProductDependencies>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.25080.7">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.25126.4">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>bbea86c614fcf4380c58c80eacd279a0b8305a79</Sha>
<Sha>6d4b01bce3a29c172faff5abc0bfe2ae3d1fef3d</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
9 changes: 4 additions & 5 deletions eng/common/core-templates/job/publish-build-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,11 @@ jobs:
fetchDepth: 3
clean: true

- task: DownloadBuildArtifacts@0
displayName: Download artifact
- task: DownloadPipelineArtifact@2
displayName: Download Asset Manifests
inputs:
artifactName: AssetManifests
downloadPath: '$(Build.StagingDirectory)/Download'
checkDownloadedFiles: true
targetPath: '$(Build.StagingDirectory)/AssetManifests'
condition: ${{ parameters.condition }}
continueOnError: ${{ parameters.continueOnError }}

Expand All @@ -95,7 +94,7 @@ jobs:
scriptLocation: scriptPath
scriptPath: $(Build.SourcesDirectory)/eng/common/sdk-task.ps1
arguments: -task PublishBuildAssets -restore -msbuildEngine dotnet
/p:ManifestsPath='$(Build.StagingDirectory)/Download/AssetManifests'
/p:ManifestsPath='$(Build.StagingDirectory)/AssetManifests'
/p:MaestroApiEndpoint=https://maestro.dot.net
/p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }}
/p:OfficialBuildId=$(Build.BuildNumber)
Expand Down
4 changes: 2 additions & 2 deletions eng/common/core-templates/steps/generate-sbom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# IgnoreDirectories - Directories to ignore for SBOM generation. This will be passed through to the CG component detector.

parameters:
PackageVersion: 9.0.0
PackageVersion: 10.0.0
BuildDropPath: '$(Build.SourcesDirectory)/artifacts'
PackageName: '.NET'
ManifestDirPath: $(Build.ArtifactStagingDirectory)/sbom
Expand Down Expand Up @@ -38,7 +38,7 @@ steps:
PackageName: ${{ parameters.packageName }}
BuildDropPath: ${{ parameters.buildDropPath }}
PackageVersion: ${{ parameters.packageVersion }}
ManifestDirPath: ${{ parameters.manifestDirPath }}
ManifestDirPath: ${{ parameters.manifestDirPath }}/$(ARTIFACT_NAME)
${{ if ne(parameters.IgnoreDirectories, '') }}:
AdditionalComponentDetectorArgs: '--IgnoreDirectories ${{ parameters.IgnoreDirectories }}'

Expand Down
2 changes: 1 addition & 1 deletion eng/common/core-templates/steps/source-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ steps:
# in the default public locations.
internalRuntimeDownloadArgs=
if [ '$(dotnetbuilds-internal-container-read-token-base64)' != '$''(dotnetbuilds-internal-container-read-token-base64)' ]; then
internalRuntimeDownloadArgs='/p:DotNetRuntimeSourceFeed=https://dotnetbuilds.blob.core.windows.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64) --runtimesourcefeed https://dotnetbuilds.blob.core.windows.net/internal --runtimesourcefeedkey $(dotnetbuilds-internal-container-read-token-base64)'
internalRuntimeDownloadArgs='/p:DotNetRuntimeSourceFeed=https://ci.dot.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64) --runtimesourcefeed https://ci.dot.net/internal --runtimesourcefeedkey $(dotnetbuilds-internal-container-read-token-base64)'
fi

buildConfig=Release
Expand Down
20 changes: 14 additions & 6 deletions eng/common/generate-sbom-prep.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,26 @@ Param(

. $PSScriptRoot\pipeline-logging-functions.ps1

# Normally - we'd listen to the manifest path given, but 1ES templates will overwrite if this level gets uploaded directly
# with their own overwriting ours. So we create it as a sub directory of the requested manifest path.
$ArtifactName = "${env:SYSTEM_STAGENAME}_${env:AGENT_JOBNAME}_SBOM"
$SafeArtifactName = $ArtifactName -replace '["/:<>\\|?@*"() ]', '_'
$SbomGenerationDir = Join-Path $ManifestDirPath $SafeArtifactName

Write-Host "Artifact name before : $ArtifactName"
Write-Host "Artifact name after : $SafeArtifactName"

Write-Host "Creating dir $ManifestDirPath"

# create directory for sbom manifest to be placed
if (!(Test-Path -path $ManifestDirPath))
if (!(Test-Path -path $SbomGenerationDir))
{
New-Item -ItemType Directory -path $ManifestDirPath
Write-Host "Successfully created directory $ManifestDirPath"
New-Item -ItemType Directory -path $SbomGenerationDir
Write-Host "Successfully created directory $SbomGenerationDir"
}
else{
Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder."
}

Write-Host "Updating artifact name"
$artifact_name = "${env:SYSTEM_STAGENAME}_${env:AGENT_JOBNAME}_SBOM" -replace '["/:<>\\|?@*"() ]', '_'
Write-Host "Artifact name $artifact_name"
Write-Host "##vso[task.setvariable variable=ARTIFACT_NAME]$artifact_name"
Write-Host "##vso[task.setvariable variable=ARTIFACT_NAME]$SafeArtifactName"
17 changes: 11 additions & 6 deletions eng/common/generate-sbom-prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,24 @@ done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
. $scriptroot/pipeline-logging-functions.sh


# replace all special characters with _, some builds use special characters like : in Agent.Jobname, that is not a permissible name while uploading artifacts.
artifact_name=$SYSTEM_STAGENAME"_"$AGENT_JOBNAME"_SBOM"
safe_artifact_name="${artifact_name//["/:<>\\|?@*$" ]/_}"
manifest_dir=$1

if [ ! -d "$manifest_dir" ] ; then
mkdir -p "$manifest_dir"
echo "Sbom directory created." $manifest_dir
# Normally - we'd listen to the manifest path given, but 1ES templates will overwrite if this level gets uploaded directly
# with their own overwriting ours. So we create it as a sub directory of the requested manifest path.
sbom_generation_dir="$manifest_dir/$safe_artifact_name"

if [ ! -d "$sbom_generation_dir" ] ; then
mkdir -p "$sbom_generation_dir"
echo "Sbom directory created." $sbom_generation_dir
else
Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder."
fi

artifact_name=$SYSTEM_STAGENAME"_"$AGENT_JOBNAME"_SBOM"
echo "Artifact name before : "$artifact_name
# replace all special characters with _, some builds use special characters like : in Agent.Jobname, that is not a permissible name while uploading artifacts.
safe_artifact_name="${artifact_name//["/:<>\\|?@*$" ]/_}"
echo "Artifact name after : "$safe_artifact_name
export ARTIFACT_NAME=$safe_artifact_name
echo "##vso[task.setvariable variable=ARTIFACT_NAME]$safe_artifact_name"
Expand Down
2 changes: 1 addition & 1 deletion eng/common/sdk-task.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ try {
$GlobalJson.tools | Add-Member -Name "vs" -Value (ConvertFrom-Json "{ `"version`": `"16.5`" }") -MemberType NoteProperty
}
if( -not ($GlobalJson.tools.PSObject.Properties.Name -match "xcopy-msbuild" )) {
$GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "17.12.0" -MemberType NoteProperty
$GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "17.13.0" -MemberType NoteProperty
}
if ($GlobalJson.tools."xcopy-msbuild".Trim() -ine "none") {
$xcopyMSBuildToolsFolder = InitializeXCopyMSBuild $GlobalJson.tools."xcopy-msbuild" -install $true
Expand Down
104 changes: 104 additions & 0 deletions eng/common/sdk-task.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#!/usr/bin/env bash

show_usage() {
echo "Common settings:"
echo " --task <value> Name of Arcade task (name of a project in SdkTasks directory of the Arcade SDK package)"
echo " --restore Restore dependencies"
echo " --verbosity <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]"
echo " --help Print help and exit"
echo ""
echo "Command line arguments not listed above are passed thru to msbuild."
}

source="${BASH_SOURCE[0]}"

# resolve $source until the file is no longer a symlink
while [[ -h "$source" ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"
# if $source was a relative symlink, we need to resolve it relative to the path where the
# symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source"
done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"

Build() {
local target=$1
local log_suffix=""
[[ "$target" != "Execute" ]] && log_suffix=".$target"
local log="$log_dir/$task$log_suffix.binlog"
local output_path="$toolset_dir/$task/"

MSBuild "$taskProject" \
/bl:"$log" \
/t:"$target" \
/p:Configuration="$configuration" \
/p:RepoRoot="$repo_root" \
/p:BaseIntermediateOutputPath="$output_path" \
/v:"$verbosity" \
$properties
}

configuration="Debug"
verbosity="minimal"
restore=false
help=false
properties=''

while (($# > 0)); do
lowerI="$(echo $1 | tr "[:upper:]" "[:lower:]")"
case $lowerI in
--task)
task=$2
shift 2
;;
--restore)
restore=true
shift 1
;;
--verbosity)
verbosity=$2
shift 2
;;
--help)
help=true
shift 1
;;
*)
properties="$properties $1"
shift 1
;;
esac
done

ci=true
binaryLog=true
warnAsError=true

if $help; then
show_usage
exit 0
fi

. "$scriptroot/tools.sh"
InitializeToolset

if [[ -z "$task" ]]; then
Write-PipelineTelemetryError -Category 'Task' -Name 'MissingTask' -Message "Missing required parameter '-task <value>'"
ExitWithExitCode 1
fi

taskProject=$(GetSdkTaskProject "$task")
if [[ ! -e "$taskProject" ]]; then
Write-PipelineTelemetryError -Category 'Task' -Name 'UnknownTask' -Message "Unknown task: $task"
ExitWithExitCode 1
fi

if $restore; then
Build "Restore"
fi

Build "Execute"


ExitWithExitCode 0
1 change: 1 addition & 0 deletions eng/common/templates-official/job/job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
parameters:
PackageVersion: ${{ parameters.packageVersion }}
BuildDropPath: ${{ parameters.buildDropPath }}
ManifestDirPath: $(Build.ArtifactStagingDirectory)/sbom
publishArtifacts: false

# publish artifacts
Expand Down
4 changes: 2 additions & 2 deletions eng/common/tools.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements =

# If the version of msbuild is going to be xcopied,
# use this version. Version matches a package here:
# https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/Microsoft.DotNet.Arcade.MSBuild.Xcopy/versions/17.12.0
$defaultXCopyMSBuildVersion = '17.12.0'
# https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/Microsoft.DotNet.Arcade.MSBuild.Xcopy/versions/17.13.0
$defaultXCopyMSBuildVersion = '17.13.0'

if (!$vsRequirements) {
if (Get-Member -InputObject $GlobalJson.tools -Name 'vs') {
Expand Down
6 changes: 6 additions & 0 deletions eng/common/tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,12 @@ function GetDarc {
"$eng_root/common/darc-init.sh" --toolpath "$darc_path" $version
}

# Returns a full path to an Arcade SDK task project file.
function GetSdkTaskProject {
taskName=$1
echo "$(dirname $_InitializeToolset)/SdkTasks/$taskName.proj"
}

ResolvePath "${BASH_SOURCE[0]}"
_script_dir=`dirname "$_ResolvePath"`

Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"tools": {
"dotnet": "10.0.100-alpha.1.25077.2",
"dotnet": "10.0.100-preview.3.25125.5",
"runtimes": {
"dotnet": [
"8.0.0"
]
}
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25080.7"
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25126.4"
}
}
Loading