Skip to content

Commit

Permalink
RepoToolset update to 1.0.0-beta2-62718-01 (#83)
Browse files Browse the repository at this point in the history
* RepoToolset update to 1.0.0-beta2-62718-01

* PR feedback: use versionprefix, use a target for nuspec, update to latest repotoolset version

* Update execute permissions

* PR feedback: fix casing of preparemachine

* build commands aren't unified yet, update them both

* add preparemachine to both cibuild.cmd commands
  • Loading branch information
chcosta authored Mar 20, 2018
1 parent 55dbc18 commit ca2f92e
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 37 deletions.
6 changes: 3 additions & 3 deletions .vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ phases:
TeamName: $(__TeamName)
continueOnError: false
condition: and(succeeded(), in(variables.__SignType, 'real', 'test'))
- script: build\CIBuild.cmd -configuration $(buildConfig)
- script: eng\common\CIBuild.cmd -configuration $(buildConfig) -prepareMachine
/p:SignType=test
name: Build
condition: and(succeeded(), ne(variables['buildConfig'], 'Release'))
Expand All @@ -43,7 +43,7 @@ phases:
SecretsFilter: 'dotnetfeed-storage-access-key-1'
condition: and(succeeded(), eq(variables['buildConfig'], 'Release'))
# Build and Publish on the Release configuration
- script: build\CIBuild.cmd -configuration $(buildConfig)
- script: eng\common\CIBuild.cmd -configuration $(buildConfig) -prepareMachine
/p:PB_PublishType=$(__PublishType)
/p:PB_PublishBlobFeedUrl=$(__PublishBlobFeedUrl)
/p:PB_PublishBlobFeedKey=$(dotnetfeed-storage-access-key-1)
Expand Down Expand Up @@ -90,7 +90,7 @@ phases:
- checkout: self
clean: true
fetchDepth: 1
- script: build/cibuild.sh --configuration $(buildConfig)
- script: eng/common/cibuild.sh --configuration $(buildConfig) --preparemachine
name: Build
env:
OfficialBuildId: $(BUILD.BUILDNUMBER)
Expand Down
2 changes: 1 addition & 1 deletion Build.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
powershell -ExecutionPolicy ByPass %~dp0build\Build.ps1 -restore -build %*
powershell -ExecutionPolicy ByPass %~dp0eng\common\Build.ps1 -restore -build %*
exit /b %ErrorLevel%
9 changes: 9 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<Target Name="_InitializeNuspecProperties"
BeforeTargets="GenerateNuSpec">
<PropertyGroup>
<NuspecProperties>$(NuspecProperties);version=$(Version);licenseUrl=$(PackageLicenseUrl);repoUrl=$(RepositoryUrl);copyright=$(Copyright);ArtifactsBinDir=$(ArtifactsBinDir)</NuspecProperties>
</PropertyGroup>
</Target>
</Project>
2 changes: 1 addition & 1 deletion Restore.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
powershell -ExecutionPolicy ByPass %~dp0build\Build.ps1 -restore %*
powershell -ExecutionPolicy ByPass %~dp0eng\common\Build.ps1 -restore %*
exit /b %ErrorLevel%
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ while [[ -h $source ]]; do
done

scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
"$scriptroot/build/build.sh" --build --restore $@
"$scriptroot/eng/common/build.sh" --build --restore $@
File renamed without changes.
2 changes: 1 addition & 1 deletion build/Versions.props → eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- This repo version -->
<VersionBase>1.0.0</VersionBase>
<VersionPrefix>1.0.0</VersionPrefix>
<PreReleaseVersionLabel>prerelease</PreReleaseVersionLabel>

<!-- Opt-out repo features -->
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions build/build.ps1 → eng/common/build.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[CmdletBinding(PositionalBinding=$false)]
Param(
[string] $configuration = "Debug",
[string] $solution = "",
[string] $projects = "",
[string] $verbosity = "minimal",
[switch] $restore,
[switch] $deployDeps,
Expand Down Expand Up @@ -42,7 +42,7 @@ function Print-Usage() {
Write-Host ""

Write-Host "Advanced settings:"
Write-Host " -solution <value> Path to solution to build"
Write-Host " -projects <value> Semi-colon delimited list of sln/proj's to build. Globbing is supported (*.sln)"
Write-Host " -ci Set when running on CI server"
Write-Host " -log Enable logging (by default on CI)"
Write-Host " -prepareMachine Prepare machine for CI run"
Expand Down Expand Up @@ -112,7 +112,7 @@ function Build {
$logCmd = ""
}

& $DotNetExe msbuild $ToolsetBuildProj /m /nologo /clp:Summary /warnaserror /v:$verbosity $logCmd /p:Configuration=$configuration /p:SolutionPath=$solution /p:Restore=$restore /p:DeployDeps=$deployDeps /p:Build=$build /p:Rebuild=$rebuild /p:Deploy=$deploy /p:Test=$test /p:IntegrationTest=$integrationTest /p:Sign=$sign /p:Pack=$pack /p:CIBuild=$ci /p:RestorePackagesPath=$NuGetPackageRoot /p:NuGetPackageRoot=$NuGetPackageRoot $properties
& $DotNetExe msbuild $ToolsetBuildProj /m /nologo /clp:Summary /warnaserror /v:$verbosity $logCmd /p:Configuration=$configuration /p:RepoRoot=$RepoRoot /p:Projects=$projects /p:Restore=$restore /p:DeployDeps=$deployDeps /p:Build=$build /p:Rebuild=$rebuild /p:Deploy=$deploy /p:Test=$test /p:IntegrationTest=$integrationTest /p:Sign=$sign /p:Pack=$pack /p:CIBuild=$ci /p:RestorePackagesPath=$NuGetPackageRoot /p:NuGetPackageRoot=$NuGetPackageRoot $properties
}

function Stop-Processes() {
Expand All @@ -122,7 +122,7 @@ function Stop-Processes() {
}

try {
$RepoRoot = Join-Path $PSScriptRoot "..\"
$RepoRoot = Join-Path $PSScriptRoot "..\..\"
$DotNetRoot = Join-Path $RepoRoot ".\.dotnet"
$DotNetExe = Join-Path $DotNetRoot "dotnet.exe"
$ArtifactsDir = Join-Path $RepoRoot "artifacts"
Expand All @@ -136,8 +136,8 @@ try {
$OfficialBuild = $true
}

if ($solution -eq "") {
$solution = @(Get-ChildItem(Join-Path $RepoRoot "*.sln"))[0]
if ($projects -eq "") {
$projects = Join-Path $RepoRoot "*.sln"
}

if ($env:NUGET_PACKAGES -ne $null) {
Expand Down
28 changes: 14 additions & 14 deletions build/build.sh → eng/common/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ configuration='Debug'
help=false
log=false
pack=false
prepareMachine=false
preparemachine=false
rebuild=false
restore=false
sign=false
solution=''
projects=''
test=false
verbosity='minimal'
properties=''
reporoot="$scriptroot/.."
reporoot="$scriptroot/../.."
artifactsdir="$reporoot/artifacts"
artifactsconfigurationdir="$artifactsdir/$configuration"
logdir="$artifactsconfigurationdir/log"
Expand Down Expand Up @@ -68,10 +68,10 @@ while (($# > 0)); do
echo " --pack Package build outputs into NuGet packages and Willow components"
echo ""
echo "Advanced settings:"
echo " --solution <value> Path to solution to build"
echo " --projects <value> Semi-colon delimited list of sln/proj's to build. Globbing is supported (*.sln)"
echo " --ci Set when running on CI server"
echo " --log Enable logging (by default on CI)"
echo " --prepareMachine Prepare machine for CI run"
echo " --preparemachine Prepare machine for CI run"
echo ""
echo "Command line arguments not listed above are passed through to MSBuild."
exit 0
Expand All @@ -84,8 +84,8 @@ while (($# > 0)); do
pack=true
shift 1
;;
--prepareMachine)
prepareMachine=true
--preparemachine)
preparemachine=true
shift 1
;;
--rebuild)
Expand All @@ -100,8 +100,8 @@ while (($# > 0)); do
sign=true
shift 1
;;
--solution)
solution=$2
--projects)
projects=$2
shift 2
;;
--test)
Expand Down Expand Up @@ -237,7 +237,7 @@ function InstallToolset {
function Build {
InstallDotNetCli

if [[ "$prepareMachine" == true ]]; then
if [[ "$preparemachine" == true ]]; then
mkdir -p "$nugetpackageroot"
dotnet nuget locals all --clear
local lastexitcode=$?
Expand All @@ -260,12 +260,12 @@ function Build {
logcmd="/bl:$logdir/Build.binlog"
fi

if [[ -z $solution ]]; then
solution="$reporoot/Arcade.sln"
if [[ -z $projects ]]; then
projects="$reporoot/*.sln"
fi

dotnet msbuild $toolsetbuildproj /m /nologo /clp:Summary /warnaserror \
/v:$verbosity $logcmd /p:Configuration=$configuration /p:SolutionPath=$solution \
/v:$verbosity $logcmd /p:Configuration=$configuration /p:RepoRoot=$reporoot /p:Projects=$projects \
/p:Restore=$restore /p:Build=$build /p:Rebuild=$rebuild /p:Deploy=$deploy /p:Test=$test /p:Sign=$sign /p:Pack=$pack /p:CIBuild=$ci \
"/p:RestorePackagesPath=$nugetpackageroot/" "/p:NuGetPackageRoot=$nugetpackageroot/" \
$properties
Expand All @@ -278,7 +278,7 @@ function Build {
}

function ExitWithExitCode {
if [[ "$ci" == true && "$prepareMachine" == true ]]; then
if [[ "$ci" == true && "$preparemachine" == true ]]; then
StopProcesses
fi
exit $1
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"version": "2.1.100-preview-007366"
},
"msbuild-sdks": {
"RoslynTools.RepoToolset": "1.0.0-beta2-62705-02"
"RoslynTools.RepoToolset": "1.0.0-beta2-62719-04"
}
}
4 changes: 2 additions & 2 deletions netci.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ static addBuildSteps(def job, def projectName, def os, def configName, def isPR)
job.with {
steps {
if(os == "Windows_NT") {
batchFile(".\\build\\CIBuild.cmd -configuration ${configName} -prepareMachine")
batchFile(".\\eng\\common\\CIBuild.cmd -configuration ${configName} -prepareMachine")
}
else {
shell("./build/cibuild.sh --configuration ${configName}")
shell("./eng/common/cibuild.sh --configuration ${configName} --preparemachine")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ while [[ -h $source ]]; do
done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"

. "$scriptroot/build/build.sh" --restore $@
. "$scriptroot/eng/common/build.sh" --restore $@
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@
<PropertyGroup>
<TargetFrameworks>netstandard1.5;$(NetFxTfm)</TargetFrameworks>

<!-- Workaround for repotoolset applying uniform versioning to the entire repo https://github.com/dotnet/roslyn-tools/issues/189 -->
<VersionSubstring>$([System.Text.RegularExpressions.Regex]::Replace($(Version), $(VersionBase), ""))</VersionSubstring>
<VersionBase>2.2.0</VersionBase>
<Version>$(VersionBase)$(VersionSubstring)</Version>
<VersionPrefix>2.2.0</VersionPrefix>
<IsPackable>true</IsPackable>
<NuspecFile>$(MSBuildProjectName).nuspec</NuspecFile>
<NuspecBasePath>$(MSBuildProjectDirectory)</NuspecBasePath>
<NuspecProperties>version=$(Version);licenseUrl=$(PackageLicenseUrl);repoUrl=$(RepositoryUrl);copyright=$(Copyright);ArtifactsBinDir=$(ArtifactsBinDir)</NuspecProperties>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<PackageTargetFallback>dotnet</PackageTargetFallback>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<IsPackable>true</IsPackable>
<NuspecFile>$(MSBuildProjectName).nuspec</NuspecFile>
<NuspecBasePath>$(MSBuildProjectDirectory)</NuspecBasePath>
<NuspecProperties>version=$(Version);licenseUrl=$(PackageLicenseUrl);repoUrl=$(RepositoryUrl);copyright=$(Copyright);ArtifactsBinDir=$(ArtifactsBinDir);NetFxTfm=$(NetFxTfm)</NuspecProperties>
<NuspecProperties>NetFxTfm=$(NetFxTfm)</NuspecProperties>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
Expand Down

0 comments on commit ca2f92e

Please sign in to comment.