This commit is contained in:
Matthew John Cheetham 2019-10-23 10:20:16 +01:00
Родитель 25cf471843
Коммит 31d4dabefa
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: C64BA810D2B517ED
40 изменённых файлов: 423 добавлений и 1004 удалений

Просмотреть файл

@ -58,6 +58,8 @@ jobs:
steps:
- checkout: none # Use the drop from macOS_Build_and_UnitTests job
- template: templates/macos-functional-test.yml
parameters:
useWatchman: false
- job: macOS_FunctionalTests_watchman
variables:
@ -70,7 +72,9 @@ jobs:
condition: succeeded()
steps:
- checkout: none # Use the drop from macOS_Build_and_UnitTests job
- template: templates/macos-functional-test-watchman.yml
- template: templates/macos-functional-test.yml
parameters:
useWatchman: true
- job: Windows_FunctionalTests
timeoutInMinutes: 30

Просмотреть файл

@ -1,10 +1,14 @@
steps:
- task: DotNetCoreInstaller@0
displayName: Use .NET Core SDK 2.1.301
- task: UseDotNet@2
displayName: Use .NET Core SDK 3.0.100
inputs:
packageType: sdk
version: '2.1.301'
version: 3.0.100
- script: $(Build.Repository.LocalPath)/Scripts/Mac/NukeBuildOutputs.sh
displayName: Delete previous build outputs
continueOnError: true
- task: InstallAppleCertificate@2
displayName: 'Install Apple certificate'
@ -15,21 +19,24 @@ steps:
- script: Scripts/Mac/BuildScalarForMac.sh $(configuration) $(majorAndMinorVersion).$(revision)
displayName: Build Scalar ($(configuration))
- script: Scripts/Mac/RunUnitTests.sh $(configuration) $(Common.TestResultsDirectory)
displayName: Run unit tests ($(configuration))
- task: PublishTestResults@2
displayName: Publish test results
inputs:
testRunner: NUnit
testResultsFiles: '**/TestResult.xml'
searchFolder: $(System.DefaultWorkingDirectory)
testRunner: VSTest
testResultsFiles: '**/*.trx'
searchFolder: $(Common.TestResultsDirectory)
testRunTitle: Mac $(configuration) Unit Tests
publishRunAttachments: true
condition: succeededOrFailed()
- script: Scripts/Mac/CI/CreateBuildDrop.sh $(configuration) $(Build.ArtifactStagingDirectory)/Tests
displayName: Create functional test drop
- script: Scripts/Mac/CI/CreateFTDrop.sh $(configuration) $(Build.ArtifactStagingDirectory)/Tests
displayName: Create functional tests drop
- task: PublishBuildArtifacts@1
displayName: Publish functional test drop artifact.
displayName: Publish functional tests drop
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/Tests
artifactName: "FunctionalTests_$(platformFriendlyName)_$(configuration)"
@ -38,10 +45,10 @@ steps:
condition: and(succeeded(), eq(variables['configuration'], 'Release'))
- script: Scripts/Mac/CI/CreateInstallerDrop.sh $(configuration) $(Build.ArtifactStagingDirectory)/Installers
displayName: Create installer drop
displayName: Create installers drop
- task: PublishBuildArtifacts@1
displayName: Publish installers
displayName: Publish installers drop
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)/Installers
artifactName: "Installers_$(platformFriendlyName)_$(configuration)"

Просмотреть файл

@ -1,60 +0,0 @@
steps:
- task: DotNetCoreInstaller@0
displayName: Use .NET Core SDK 2.1.301
inputs:
packageType: sdk
version: '2.1.301'
- bash: rm -rf $(Build.BinariesDirectory)/FunctionalTests_$(platformFriendlyName)_$(configuration)/BuildOutput/Git/*
displayName: Clean previous Git installations
- bash: brew install watchman
displayName: Install watchman
- task: DownloadBuildArtifacts@0
displayName: Download functional test drop
inputs:
buildType: current
downloadType: specific
artifactName: FunctionalTests_$(platformFriendlyName)_$(configuration)
downloadPath: $(Build.BinariesDirectory)
- bash: |
chmod +x $(Build.BinariesDirectory)/FunctionalTests_$(platformFriendlyName)_$(configuration)/src/Scripts/Mac/*.sh
chmod +x $(Build.BinariesDirectory)/FunctionalTests_$(platformFriendlyName)_$(configuration)/Publish/*
displayName: Ensure tests assets are executable
- bash: $(Build.BinariesDirectory)/FunctionalTests_$(platformFriendlyName)_$(configuration)/src/Scripts/Mac/CleanupFunctionalTests.sh
displayName: Clean environment
- bash: $(Build.BinariesDirectory)/FunctionalTests_$(platformFriendlyName)_$(configuration)/src/Scripts/Mac/PrepFunctionalTests.sh
displayName: Prep functional tests
- bash: $(Build.BinariesDirectory)/FunctionalTests_$(platformFriendlyName)_$(configuration)/src/Scripts/Mac/RunFunctionalTests.sh $(configuration) --trace2-output=$(Build.ArtifactStagingDirectory)/trace2-event-mac.txt
displayName: Run functional tests
- task: PublishTestResults@2
displayName: Publish functional test results
inputs:
testRunner: NUnit
testResultsFiles: "**\\TestResult*.xml"
searchFolder: $(System.DefaultWorkingDirectory)
testRunTitle: macOS $(configuration) Functional Tests
publishRunAttachments: true
condition: succeededOrFailed()
- task: PublishBuildArtifacts@1
displayName: Publish Git trace2 log
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: trace2-event-mac.txt
- bash: $(Build.BinariesDirectory)/FunctionalTests_$(platformFriendlyName)_$(configuration)/src/Scripts/Mac/CleanupFunctionalTests.sh
displayName: Cleanup
condition: always()
- bash: sudo rm -rf $(Build.BinariesDirectory)/FunctionalTests_$(platformFriendlyName)_$(configuration)
displayName: Cleanup phase 2
condition: always()

Просмотреть файл

@ -1,45 +1,67 @@
parameters:
useWatchman: true
steps:
- task: DotNetCoreInstaller@0
displayName: Use .NET Core SDK 2.1.301
- task: UseDotNet@2
displayName: Use .NET Core SDK 3.0.100
inputs:
packageType: sdk
version: '2.1.301'
- bash: rm -rf $(Build.BinariesDirectory)/FunctionalTests_$(platformFriendlyName)_$(configuration)/BuildOutput/Git/*
displayName: Clean previous Git installations
version: 3.0.100
- task: DownloadBuildArtifacts@0
displayName: Download functional test drop
displayName: Download functional tests drop
inputs:
buildType: current
downloadType: specific
artifactName: FunctionalTests_$(platformFriendlyName)_$(configuration)
downloadPath: $(Build.BinariesDirectory)
- task: DownloadBuildArtifacts@0
displayName: Download installers drop
inputs:
buildType: current
downloadType: specific
artifactName: Installers_$(platformFriendlyName)_$(configuration)
downloadPath: $(Build.BinariesDirectory)
- bash: |
chmod +x $(Build.BinariesDirectory)/FunctionalTests_$(platformFriendlyName)_$(configuration)/src/Scripts/Mac/*.sh
chmod +x $(Build.BinariesDirectory)/FunctionalTests_$(platformFriendlyName)_$(configuration)/Publish/*
displayName: Ensure tests assets are executable
chmod +x $(Build.BinariesDirectory)/Installers_$(platformFriendlyName)_$(configuration)/*.sh
displayName: Ensure all scripts are executable
- bash: $(Build.BinariesDirectory)/FunctionalTests_$(platformFriendlyName)_$(configuration)/src/Scripts/Mac/CleanupFunctionalTests.sh
displayName: Clean environment
- ${{ if eq(parameters.useWatchman, 'true') }}:
- bash: $(Build.BinariesDirectory)/Installers_$(platformFriendlyName)_$(configuration)/InstallScalar.sh
displayName: Install product (with watchman)
- bash: $(Build.BinariesDirectory)/FunctionalTests_$(platformFriendlyName)_$(configuration)/src/Scripts/Mac/PrepFunctionalTests.sh
displayName: Prep functional tests
- ${{ if ne(parameters.useWatchman, 'true') }}:
- bash: $(Build.BinariesDirectory)/Installers_$(platformFriendlyName)_$(configuration)/InstallScalar.sh --no-watchman
displayName: Install product (without watchman)
- bash: $(Build.BinariesDirectory)/FunctionalTests_$(platformFriendlyName)_$(configuration)/src/Scripts/Mac/RunFunctionalTests.sh $(configuration) --trace2-output=$(Build.ArtifactStagingDirectory)/trace2-event-mac.txt
- bash: $(Build.BinariesDirectory)/FunctionalTests_$(platformFriendlyName)_$(configuration)/src/Scripts/Mac/RunFunctionalTests.sh $(configuration) --test-scalar-on-path --trace2-output=$(Build.ArtifactStagingDirectory)/trace2-event-mac.txt
displayName: Run functional tests
- task: PublishTestResults@2
displayName: Publish functional test results
inputs:
testRunner: NUnit
testResultsFiles: "**\\TestResult*.xml"
searchFolder: $(System.DefaultWorkingDirectory)
testRunTitle: macOS $(configuration) Functional Tests
publishRunAttachments: true
condition: succeededOrFailed()
- ${{ if eq(parameters.useWatchman, 'true') }}:
- task: PublishTestResults@2
displayName: Publish functional tests results
inputs:
testRunner: NUnit
testResultsFiles: "**\\TestResult*.xml"
searchFolder: $(System.DefaultWorkingDirectory)
testRunTitle: macOS $(configuration) Functional Tests (with watchman)
publishRunAttachments: true
condition: succeededOrFailed()
- ${{ if ne(parameters.useWatchman, 'true') }}:
- task: PublishTestResults@2
displayName: Publish functional tests results
inputs:
testRunner: NUnit
testResultsFiles: "**\\TestResult*.xml"
searchFolder: $(System.DefaultWorkingDirectory)
testRunTitle: macOS $(configuration) Functional Tests (without watchman)
publishRunAttachments: true
condition: succeededOrFailed()
- task: PublishBuildArtifacts@1
displayName: Publish Git trace2 log

Просмотреть файл

@ -1,5 +1,11 @@
steps:
- task: UseDotNet@2
displayName: Use .NET Core SDK 3.0.100
inputs:
packageType: sdk
version: 3.0.100
- script: $(Build.Repository.LocalPath)\\Scripts\\NukeBuildOutputs.bat
displayName: Delete previous build outputs
continueOnError: true
@ -10,25 +16,25 @@ steps:
displayName: Disable strong name validation for MS delay-signed assemblies
- script: $(Build.Repository.LocalPath)\Scripts\BuildScalarForWindows.bat $(configuration) $(majorAndMinorVersion).$(revision)
displayName: Run Scalar build script ($(configuration))
displayName: Build Scalar ($(configuration))
- script: $(Build.Repository.LocalPath)\Scripts\RunUnitTests.bat $(configuration)
displayName: Run unit tests
- script: $(Build.Repository.LocalPath)\Scripts\RunUnitTests.bat $(configuration) $(Common.TestResultsDirectory)
displayName: Run unit tests ($(configuration))
- task: PublishTestResults@2
displayName: Publish unit test results
inputs:
testRunner: NUnit
testResultsFiles: "**\\TestResult.xml"
searchFolder: $(System.DefaultWorkingDirectory)
testRunner: VSTest
testResultsFiles: "**\\*.trx"
searchFolder: $(Common.TestResultsDirectory)
testRunTitle: Windows $(configuration) Unit Tests
publishRunAttachments: true
- script: $(Build.Repository.LocalPath)\Scripts\CI\CreateBuildDrop.bat $(configuration) $(Build.ArtifactStagingDirectory)\Tests
displayName: Create functional test drop
- script: $(Build.Repository.LocalPath)\Scripts\CI\CreateFTDrop.bat $(configuration) $(Build.ArtifactStagingDirectory)\Tests
displayName: Create functional tests drop
- task: PublishBuildArtifacts@1
displayName: Publish functional test drop
displayName: Publish functional tests drop
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)\Tests
artifactName: "FunctionalTests_$(platformFriendlyName)_$(configuration)"
@ -37,10 +43,10 @@ steps:
condition: and(succeeded(), eq(variables['configuration'], 'Release'))
- script: $(Build.Repository.LocalPath)\Scripts\CI\CreateInstallerDrop.bat $(configuration) $(Build.ArtifactStagingDirectory)\Installers
displayName: Create installer drop
displayName: Create installers drop
- task: PublishBuildArtifacts@1
displayName: Publish installers
displayName: Publish installers drop
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)\Installers
artifactName: "Installers_$(platformFriendlyName)_$(configuration)"

Просмотреть файл

@ -1,15 +1,29 @@
steps:
- task: UseDotNet@2
displayName: Use .NET Core SDK 3.0.100
inputs:
packageType: sdk
version: 3.0.100
- task: DownloadBuildArtifacts@0
displayName: Download functional test drop
displayName: Download functional tests drop
inputs:
buildType: current
downloadType: specific
artifactName: FunctionalTests_$(platformFriendlyName)_$(configuration)
downloadPath: $(Build.BinariesDirectory)
- script: $(Build.BinariesDirectory)/FunctionalTests_$(platformFriendlyName)_$(configuration)/src/Scripts/ReinstallScalar.bat $(configuration)
displayName: Run Scalar and G4W installers
- task: DownloadBuildArtifacts@0
displayName: Download installers drop
inputs:
buildType: current
downloadType: specific
artifactName: Installers_$(platformFriendlyName)_$(configuration)
downloadPath: $(Build.BinariesDirectory)
- script: $(Build.BinariesDirectory)/Installers_$(platformFriendlyName)_$(configuration)/InstallScalar.bat
displayName: Install product
- script: git config --global credential.interactive never
displayName: Disable interactive auth
@ -18,7 +32,7 @@ steps:
displayName: Run functional tests
- task: PublishTestResults@2
displayName: Publish functional test results
displayName: Publish functional tests results
inputs:
testRunner: NUnit
testResultsFiles: "**\\TestResult*.xml"

Просмотреть файл

@ -6,37 +6,6 @@ CALL %~dp0\InitializeEnvironment.bat || EXIT /b 10
IF "%1"=="" (SET "Configuration=Debug") ELSE (SET "Configuration=%1")
IF "%2"=="" (SET "ScalarVersion=0.2.173.2") ELSE (SET "ScalarVersion=%2")
SET SolutionConfiguration=%Configuration%.Windows
SET nuget="%Scalar_TOOLSDIR%\nuget.exe"
IF NOT EXIST %nuget% (
mkdir %nuget%\..
powershell -ExecutionPolicy Bypass -Command "Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe' -OutFile %nuget%"
)
:: Acquire vswhere to find dev15 installations reliably.
SET vswherever=2.6.7
%nuget% install vswhere -Version %vswherever% || exit /b 1
SET vswhere=%Scalar_PACKAGESDIR%\vswhere.%vswherever%\tools\vswhere.exe
:: Assumes default installation location for Windows 10 SDKs
IF NOT EXIST "c:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0" (
echo ERROR: Could not find Windows 10 SDK Version 10240
exit /b 1
)
:: Use vswhere to find the latest VS installation with the msbuild component.
:: See https://github.com/Microsoft/vswhere/wiki/Find-MSBuild
for /f "usebackq tokens=*" %%i in (`%vswhere% -all -prerelease -latest -products * -requires Microsoft.Component.MSBuild Microsoft.VisualStudio.Workload.ManagedDesktop Microsoft.VisualStudio.Workload.NativeDesktop Microsoft.VisualStudio.Workload.NetCoreTools Microsoft.Net.Core.Component.SDK.2.1 -find MSBuild\**\Bin\amd64\MSBuild.exe`) do (
set msbuild="%%i"
)
IF NOT DEFINED msbuild (
echo ERROR: Could not locate a Visual Studio installation with required components.
echo Refer to Readme.md for a list of the required Visual Studio components.
exit /b 10
)
%msbuild% %Scalar_SRCDIR%\Scalar.sln /p:ScalarVersion=%ScalarVersion% /p:Configuration=%SolutionConfiguration% /p:Platform=x64 || exit /b 1
dotnet publish %SCALAR_SRCDIR%\Scalar.sln -p:ScalarVersion=%ScalarVersion% --configuration %Configuration% --runtime win-x64 || exit /b 1
ENDLOCAL

Просмотреть файл

@ -1,36 +0,0 @@
@ECHO OFF
CALL %~dp0\..\InitializeEnvironment.bat || EXIT /b 10
IF "%1"=="" GOTO USAGE
IF "%2"=="" GOTO USAGE
SETLOCAL enableextensions
SET Configuration=%1
SET Scalar_STAGEDIR=%2
REM Prepare the staging directories for functional tests.
IF EXIST %Scalar_STAGEDIR% (
rmdir /s /q %Scalar_STAGEDIR%
)
mkdir %Scalar_STAGEDIR%\src\Scripts
mkdir %Scalar_STAGEDIR%\BuildOutput\Scalar.Build
mkdir %Scalar_STAGEDIR%\BuildOutput\Scalar.FunctionalTests\bin\x64\%Configuration%\netcoreapp2.1
REM Make a minimal 'test' enlistment to pass along our pipeline.
copy %Scalar_SCRIPTSDIR%\*.* %Scalar_STAGEDIR%\src\Scripts\ || exit /b 1
copy %Scalar_OUTPUTDIR%\Scalar.Build\*.* %Scalar_STAGEDIR%\BuildOutput\Scalar.Build
dotnet publish %Scalar_SRCDIR%\Scalar.FunctionalTests\Scalar.FunctionalTests.csproj -p:StyleCopEnabled=False --self-contained --framework netcoreapp2.1 -r win-x64 -c Release -o %Scalar_STAGEDIR%\BuildOutput\Scalar.FunctionalTests\bin\x64\%Configuration%\netcoreapp2.1\ || exit /b 1
robocopy %Scalar_OUTPUTDIR%\Scalar.FunctionalTests\bin\x64\%Configuration%\netcoreapp2.1\ %Scalar_STAGEDIR%\BuildOutput\Scalar.FunctionalTests\bin\x64\%Configuration%\netcoreapp2.1\ /E /XC /XN /XO
IF %ERRORLEVEL% GTR 7 (
echo "ERROR: robocopy had at least one failure"
exit /b 1
)
GOTO END
:USAGE
echo "ERROR: Usage: CreateBuildDrop.bat [configuration] [build drop root directory]"
exit /b 1
:END
exit 0

Просмотреть файл

@ -0,0 +1,35 @@
@ECHO OFF
CALL %~dp0\..\InitializeEnvironment.bat || EXIT /b 10
IF "%1"=="" GOTO USAGE
IF "%2"=="" GOTO USAGE
SETLOCAL enableextensions
SET Configuration=%1
SET SCALAR_STAGEDIR=%2
REM Prepare the staging directories for functional tests.
IF EXIST %SCALAR_STAGEDIR% (
rmdir /s /q %SCALAR_STAGEDIR%
)
SET scriptsSrc=%SCALAR_SCRIPTSDIR%\*
SET testsSrc=%SCALAR_OUTPUTDIR%\Scalar.FunctionalTests\bin\%Configuration%\netcoreapp3.0\win-x64\publish
SET scriptsDest=%SCALAR_STAGEDIR%\src\Scripts
SET testsDest=%SCALAR_STAGEDIR%\out\Scalar.FunctionalTests\bin\%Configuration%\netcoreapp3.0\win-x64\publish
mkdir %scriptsDest%
mkdir %testsDest%
REM Make a minimal 'test' enlistment to pass along our pipeline.
xcopy %scriptsSrc% %scriptsDest% /S /Y || EXIT /B 1
xcopy %testsSrc% %testsDest% /S /Y || EXIT /B 1
GOTO END
:USAGE
echo "ERROR: Usage: CreateFTDrop.bat [configuration] [build drop root directory]"
EXIT /b 1
:END
EXIT 0

Просмотреть файл

@ -1,27 +1,27 @@
@ECHO OFF
CALL %~dp0\..\InitializeEnvironment.bat || EXIT /b 10
CALL %~dp0\..\InitializeEnvironment.bat || EXIT /B 10
IF "%1"=="" GOTO USAGE
IF "%2"=="" GOTO USAGE
SETLOCAL enableextensions
SET Configuration=%1
SET Scalar_STAGEDIR=%2
SET SCALAR_STAGEDIR=%2
REM Prepare the staging directories for installer drop.
IF EXIST %Scalar_STAGEDIR% (
rmdir /s /q %Scalar_STAGEDIR%
IF EXIST %SCALAR_STAGEDIR% (
rmdir /S /Q %SCALAR_STAGEDIR%
)
mkdir %Scalar_STAGEDIR%
mkdir %SCALAR_STAGEDIR%
copy %Scalar_OUTPUTDIR%\Scalar.Build\*.exe %Scalar_STAGEDIR%
xcopy %SCALAR_OUTPUTDIR%\Scalar.Distribution.Windows\dist\%Configuration%\* %SCALAR_STAGEDIR% /S /Y
GOTO END
:USAGE
echo "ERROR: Usage: CreateInstallerDrop.bat [configuration] [build drop root directory]"
exit /b 1
EXIT /B 1
:END
exit 0
EXIT 0

Просмотреть файл

@ -2,19 +2,16 @@
REM Set environment variables for interesting paths that scripts might need access to.
PUSHD %~dp0
SET Scalar_SCRIPTSDIR=%CD%
SET SCALAR_SCRIPTSDIR=%CD%
POPD
CALL :RESOLVEPATH "%Scalar_SCRIPTSDIR%\.."
SET Scalar_SRCDIR=%_PARSED_PATH_%
CALL :RESOLVEPATH "%SCALAR_SCRIPTSDIR%\.."
SET SCALAR_SRCDIR=%_PARSED_PATH_%
CALL :RESOLVEPATH "%Scalar_SRCDIR%\.."
SET Scalar_ENLISTMENTDIR=%_PARSED_PATH_%
CALL :RESOLVEPATH "%SCALAR_SRCDIR%\.."
SET SCALAR_ENLISTMENTDIR=%_PARSED_PATH_%
SET Scalar_OUTPUTDIR=%Scalar_ENLISTMENTDIR%\BuildOutput
SET Scalar_PACKAGESDIR=%Scalar_ENLISTMENTDIR%\packages
SET Scalar_PUBLISHDIR=%Scalar_ENLISTMENTDIR%\Publish
SET Scalar_TOOLSDIR=%Scalar_ENLISTMENTDIR%\.tools
SET SCALAR_OUTPUTDIR=%SCALAR_ENLISTMENTDIR%\out
REM Clean up
SET _PARSED_PATH_=

Просмотреть файл

@ -7,86 +7,14 @@ if [ -z $CONFIGURATION ]; then
CONFIGURATION=Debug
fi
runVersionUpdater="yes"
VERSION=$2
if [ -z $VERSION ]; then
VERSION="0.2.173.2"
# don't update version number for developer builds
runVersionUpdater="no"
fi
if [ ! -d $Scalar_OUTPUTDIR ]; then
mkdir $Scalar_OUTPUTDIR
fi
# Create the directory where we'll do pre build tasks
BUILDDIR=$Scalar_OUTPUTDIR/Scalar.Build
if [ ! -d $BUILDDIR ]; then
mkdir $BUILDDIR || exit 1
fi
echo 'Downloading a Scalar-enabled version of Git...'
$Scalar_SCRIPTDIR/DownloadScalarGit.sh || exit 1
GITVERSION="$($Scalar_SCRIPTDIR/GetGitVersionNumber.sh)"
GITPATH="$(find $Scalar_PACKAGESDIR/gitformac.gvfs.installer/$GITVERSION -type f -name *.dmg)" || exit 1
echo "Downloaded Git $GITVERSION"
# Now that we have a path containing the version number, generate ScalarConstants.GitVersion.cs
$Scalar_SCRIPTDIR/GenerateGitVersionConstants.sh "$GITPATH" $BUILDDIR || exit 1
# If we're building the Profiling(Release) configuration, remove Profiling() for building .NET code
if [ "$CONFIGURATION" == "Profiling(Release)" ]; then
CONFIGURATION=Release
fi
echo "Generating CommonAssemblyVersion.cs as $VERSION..."
$Scalar_SCRIPTDIR/GenerateCommonAssemblyVersion.sh $VERSION || exit 1
# /warnasmessage:MSB4011. Reference: https://bugzilla.xamarin.com/show_bug.cgi?id=58564
# Visual Studio Mac does not support explicit import of Sdks. Scalar.Installer.Mac.csproj
# does need this ability to override "Build" and "Publish" targets. As a workaround the
# project implicitly imports "Microsoft.Net.Sdk" in the beginning of its csproj (because
# otherwise Visual Studio Mac IDE will not be able to open the Scalar.Install.Mac project)
# and explicitly imports Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" later, before
# overriding build targets. The duplicate import generates warning MSB4011 that is ignored
# by this switch.
echo 'Restoring packages...'
dotnet restore $Scalar_SRCDIR/Scalar.sln /p:Configuration=$CONFIGURATION.Mac --packages $Scalar_PACKAGESDIR /warnasmessage:MSB4011 || exit 1
dotnet build $Scalar_SRCDIR/Scalar.sln --runtime osx-x64 --framework netcoreapp2.1 --configuration $CONFIGURATION.Mac /maxcpucount:1 /warnasmessage:MSB4011 || exit 1
USERNOTIFICATIONDIR=$Scalar_SRCDIR/Scalar.Notifications/Scalar.Mac
USERNOTIFICATIONPROJECT="$USERNOTIFICATIONDIR/Scalar.xcodeproj"
USERNOTIFICATIONSCHEME="Scalar"
if [ "$runVersionUpdater" == "yes" ]; then
updateAppVersionCmd="(cd \"$USERNOTIFICATIONDIR\" && /usr/bin/xcrun agvtool new-marketing-version \"$VERSION\")"
echo $updateAppVersionCmd
eval $updateAppVersionCmd || exit 1
fi
# Build user notification app
xcodebuild -configuration $CONFIGURATION -project "$USERNOTIFICATIONPROJECT" build -scheme "$USERNOTIFICATIONSCHEME" -derivedDataPath $Scalar_OUTPUTDIR/Scalar.Notifications/Scalar.Mac || exit 1
# Build the tests in a separate directory, so the binary for distribution does not contain
# test plugins created and injected by the test build.
xcodebuild -configuration $CONFIGURATION -project "$USERNOTIFICATIONPROJECT" test -scheme "$USERNOTIFICATIONSCHEME" -derivedDataPath $Scalar_OUTPUTDIR/Scalar.Notifications/Scalar.Mac/Tests || exit 1
if [ ! -d $Scalar_PUBLISHDIR ]; then
mkdir $Scalar_PUBLISHDIR || exit 1
fi
dotnet publish $Scalar_SRCDIR/Scalar.sln /p:Configuration=$CONFIGURATION.Mac /p:Platform=x64 --runtime osx-x64 --framework netcoreapp2.1 --self-contained --output $Scalar_PUBLISHDIR /maxcpucount:1 /warnasmessage:MSB4011 || exit 1
echo 'Copying Git installer to the output directory...'
$Scalar_SCRIPTDIR/PublishGit.sh $GITPATH || exit 1
echo 'Installing shared data queue stall workaround...'
# We'll generate a temporary project if and only if we don't find the correct dylib already in place.
BUILDDIR=$Scalar_OUTPUTDIR/Scalar.Build
if [ ! -e $BUILDDIR/libSharedDataQueue.dylib ]; then
cp $Scalar_SRCDIR/nuget.config $BUILDDIR
dotnet new classlib -n Restore.SharedDataQueueStallWorkaround -o $BUILDDIR --force
dotnet add $BUILDDIR/Restore.SharedDataQueueStallWorkaround.csproj package --package-directory $Scalar_PACKAGESDIR SharedDataQueueStallWorkaround --version '1.0.0'
cp $Scalar_PACKAGESDIR/shareddataqueuestallworkaround/1.0.0/libSharedDataQueue.dylib $BUILDDIR/libSharedDataQueue.dylib
fi
echo 'Running Scalar unit tests...'
$Scalar_PUBLISHDIR/Scalar.UnitTests || exit 1
dotnet publish $SCALAR_SRCDIR/Scalar.sln --runtime osx-x64 --configuration $CONFIGURATION || exit 1

Просмотреть файл

@ -1,26 +0,0 @@
#!/bin/bash
. "$(dirname ${BASH_SOURCE[0]})/../InitializeEnvironment.sh"
CONFIGURATION=$1
BUILDDROP_ROOT=$2
if [ -z $BUILDDROP_ROOT ] || [ -z $CONFIGURATION ]; then
echo 'ERROR: Usage: CreateBuildDrop.sh [configuration] [build drop root directory]'
exit 1
fi
# Set up some paths
BUILDDROP_BUILDOUTPUT=$BUILDDROP_ROOT/BuildOutput
BUILDDROP_SRC=$BUILDDROP_ROOT/src
# Set up the build drop directory structure
rm -rf $BUILDDROP_ROOT
mkdir -p $BUILDDROP_BUILDOUTPUT
mkdir -p $BUILDDROP_SRC
mkdir -p $BUILDDROP_KEXT
# Copy to the build drop, retaining directory structure.
rsync -avm $Scalar_OUTPUTDIR/Git $BUILDDROP_BUILDOUTPUT
rsync -avm $Scalar_PUBLISHDIR $BUILDDROP_ROOT
rsync -avm $Scalar_SCRIPTDIR $BUILDDROP_SRC/Scripts
cp $Scalar_SRCDIR/nuget.config $BUILDDROP_SRC

26
Scripts/Mac/CI/CreateFTDrop.sh Executable file
Просмотреть файл

@ -0,0 +1,26 @@
#!/bin/bash
. "$(dirname ${BASH_SOURCE[0]})/../InitializeEnvironment.sh"
CONFIGURATION=$1
SCALAR_STAGEDIR=$2
if [ -z $SCALAR_STAGEDIR ] || [ -z $CONFIGURATION ]; then
echo 'ERROR: Usage: CreateBuildDrop.sh [configuration] [build drop root directory]'
exit 1
fi
# Set up some paths
SCRIPTS_SRC=$SCALAR_SCRIPTSDIR
TESTS_SRC=$SCALAR_OUTPUTDIR/Scalar.FunctionalTests/bin/$CONFIGURATION/netcoreapp3.0/osx-x64/publish
SCRIPTS_DEST=$SCALAR_STAGEDIR/src/Scripts/Mac
TESTS_DEST=$SCALAR_STAGEDIR/out/Scalar.FunctionalTests/bin/$CONFIGURATION/netcoreapp3.0/osx-x64/publish
# Set up the build drop directory structure
rm -rf $SCALAR_STAGEDIR
mkdir -p $SCRIPTS_DEST
mkdir -p $TESTS_DEST
# Copy to the build drop, retaining directory structure
cp -Rf $SCRIPTS_SRC/ $SCRIPTS_DEST
cp -Rf $TESTS_SRC/ $TESTS_DEST

Просмотреть файл

@ -3,18 +3,15 @@
. "$(dirname ${BASH_SOURCE[0]})/../InitializeEnvironment.sh"
CONFIGURATION=$1
BUILDDROP_ROOT=$2
if [ -z $BUILDDROP_ROOT ] || [ -z $CONFIGURATION ]; then
SCALAR_STAGEDIR=$2
if [ -z $SCALAR_STAGEDIR ] || [ -z $CONFIGURATION ]; then
echo 'ERROR: Usage: CreateInstallerDrop.sh [configuration] [build drop root directory]'
exit 1
fi
# Set up the installer directory structure
rm -rf $BUILDDROP_ROOT
mkdir -p $BUILDDROP_ROOT
rm -rf $SCALAR_STAGEDIR
mkdir -p $SCALAR_STAGEDIR
# Generate Scalar Distribution
$Scalar_SCRIPTDIR/CreateScalarDistribution.sh $CONFIGURATION
# Copy to the build drop, retaining directory structure.
cp -Rf $Scalar_OUTPUTDIR/Scalar.Distribution $BUILDDROP_ROOT
# Copy to the build drop, retaining directory structure
cp -Rf $SCALAR_OUTPUTDIR/Scalar.Distribution.Mac/dist/$CONFIGURATION/ $SCALAR_STAGEDIR

Просмотреть файл

@ -1,159 +0,0 @@
<#
.SYNOPSIS
Generates the text for Scalar.Installer.Mac nuspec file from the provided inputs
#>
function Write-Nuspec
{
param
(
[Parameter(Mandatory)]
[string]
$PackageVersion,
[Parameter(Mandatory)]
[string]
$GvfsInstallerPkg,
[Parameter(Mandatory)]
[string]
$GitInstallerPkg,
[Parameter(Mandatory)]
[string]
$GcmInstallerPkg
)
$template =
"<?xml version=""1.0""?>
<package xmlns=""http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"">
<metadata>
<id>Scalar.Installers.Mac</id>
<version>$PackageVersion</version>
<authors>Microsoft</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Scalar and G4M Mac installers</description>
</metadata>
<files>
<file src=""$GvfsInstallerPkg"" target=""Scalar"" />
<file src=""$GitInstallerPkg"" target=""G4M"" />
<file src=""$GcmInstallerPkg"" target=""GCM"" />
</files>
</package>"
return $template
}
<#
.DESCRIPTION
Downloads the specified version of GCM Core to the specified DownloadLocation
#>
function Download-GCM
{
param
(
[Parameter(Mandatory)]
[string]
$GcmReleaseVersion,
[Parameter(Mandatory)]
[string]
$GcmPackageName,
[Parameter(Mandatory)]
[string]
$DownloadLocation
)
$url = "https://github.com/microsoft/Git-Credential-Manager-Core/releases/download/$GcmReleaseVersion/$GcmPackageName"
$outfile = $DownloadLocation + "/" + $GcmPackageName
Invoke-WebRequest -Uri $url -Outfile $outfile
return $outfile
}
<#
.SYNOPSIS
Parses the version of the NuGet package that contains the Git installer from a props file.
#>
function Get-GitPackageVersionFromProps
{
param
(
[Parameter(Mandatory)]
[string]
$GvfsPropsPath
)
$gitPackageVersionLine = Get-ChildItem -Path $GvfsPropsPath | Select-String -Pattern 'GitPackageVersion'
$matchFount = $gitPackageVersionLine -match '<GitPackageVersion>(.*?)</GitPackageVersion>'
return $matches[1]
}
<#
.SYNOPSIS
Given a path to where NuGet packages are located, find the GitForMac NuGetPackage version and extract the Git version.
#>
function Get-GitVersionFromNuGetPackage
{
param
(
[Parameter(Mandatory)]
[string]
$NuGetPackagesDir,
[Parameter(Mandatory)]
[string]
$GitPackageVersion
)
# Find the git version number (looking through packages directory)
$gitInstallerPath = $NuGetPackagesDir + "/gitformac.gvfs.installer/" + $GitPackageVersion + "/tools"
$toolsContents = Get-ChildItem -Path ($NuGetPackagesDir + "/gitformac.gvfs.installer/" + $GitPackageVersion + "/tools") -Include *.pkg
$gitInstallerPkgName = $toolsContents[0].Name
return $gitInstallerPkgName
}
<#
.DESCRIPTION
Generate and write a Scalar.Installers.Mac NuSpec from given
parameters. This function orchestrates finding the various packages
required for generating the installer assuming the behavior for how
the current CI/CD Release pipleline lays out artifacts. It will also
download GCM core.
#>
function Generate-NuSpec
{
param
(
[Parameter(Mandatory)]
[string]
$PackageDir,
[Parameter(Mandatory)]
[string]
$GvfsVersion,
[Parameter(Mandatory)]
[string]
$GcmReleaseVersion,
[Parameter(Mandatory)]
[string]
$GcmPackageName
)
# Git installer pkg: Look throuhg the packages directory to find the git installer pkg
$gitInstallers = Get-ChildItem -Path ($PackageDir + "/*") -Include 'git-*.pkg'
$gitInstallerPkg = $gitInstallers[0]
# Gcm installer pkg: Download
$GcmInstallerPkg = Download-GCM -GcmReleaseVersion $GcmReleaseVersion -GcmPackageName $GcmPackageName -DownloadLocation $PackageDir
# Scalar installer pkg
$GvfsInstallerPkg = $PackageDir + "/" + "Scalar.$GvfsVersion.pkg"
$template = Write-Nuspec -PackageVersion $GvfsVersion -GvfsInstallerPkg $GvfsInstallerPkg -GitInstallerPkg $gitInstallerPkg -GcmInstallerPkg $GcmInstallerPkg
return $template
}

Просмотреть файл

@ -1,83 +1,8 @@
#!/bin/bash
# ---------------------------------------------------------
# CreateScalarDistribution.sh
#
# Description: Gathers components required for a complete Scalar installation
# and organizes them with a script to install Scalar and supporting
# components.
# ---------------------------------------------------------
set -e
. "$(dirname ${BASH_SOURCE[0]})/../InitializeEnvironment.sh"
## To enable extra output when running the script, uncomment the following set commands
# set -x
# set -v
DISTDIR=$SCALAR_OUTPUTDIR/Scalar.Distribution.Mac/dist
. "$(dirname ${BASH_SOURCE[0]})/InitializeEnvironment.sh"
# Gather different parameters
SCALAR_SRC_DIR=$Scalar_SRCDIR
SCALAR_ENLISTMENT_DIR=$Scalar_ENLISTMENTDIR
SCALAR_PACKAGES_DIR="$SCALAR_ENLISTMENT_DIR/packages"
SCALAR_SCRIPT_DIR=$Scalar_SCRIPTDIR
BUILD_OUTPUT_DIR="$Scalar_OUTPUTDIR"
DISTRIBUTION_DIR="$BUILD_OUTPUT_DIR/Scalar.Distribution"
if [ -z $SCALAR_ENLISTMENT_DIR ]; then
echo "Scalar enlistment directory not set - exiting."
exit 1;
fi
if [ -z $SCALAR_SRC_DIR ]; then
echo "Scalar source directory not set - exiting."
exit 1;
fi
CONFIGURATION=$1
CONFIGURATION=${CONFIGURATION:-"Debug"}
function GetScalarVersion()
{
SCALAR_PROPS=$SCALAR_SRC_DIR/Scalar.Build/Scalar.props
SCALAR_VERSION="$(cat $SCALAR_PROPS | grep ScalarVersion | grep -Eo '[0-9.]+(-\w+)*')"
}
# Git Version, Git Installer Package
GIT_VERSION="$($SCALAR_SCRIPT_DIR/GetGitVersionNumber.sh)"
GIT_INSTALLER_PKG_SRC_PATH="$(find $SCALAR_PACKAGES_DIR/gitformac.gvfs.installer/$GIT_VERSION -type f -name *.pkg)" || exit 1
GIT_INSTALLER_PKG="${GIT_INSTALLER_PKG_SRC_PATH##*/}"
# GCM Version
GCM_VERSION=""
GCM_INSTALLER_PKG="gcmcore-osx-2.0.33.21076.pkg"
GCM_INSTALLER_DOWNLOAD_URL="https://github.com/microsoft/Git-Credential-Manager-Core/releases/download/v2.0.33-beta/$GCM_INSTALLER_PKG"
# Scalar Version
GetScalarVersion
SCALAR_INSTALLER_PKG="Scalar.$SCALAR_VERSION.pkg"
SCALAR_INSTALLER_PKG_SRC_PATH="$BUILD_OUTPUT_DIR/Scalar.Installer.Mac/bin/x64/$CONFIGURATION/netcoreapp2.1/osx-x64/$SCALAR_INSTALLER_PKG"
# Clean target folder
rm -Rf "$DISTRIBUTION_DIR"
# Create target folder
mkdir "$DISTRIBUTION_DIR"
mkdir "$DISTRIBUTION_DIR/GCM"
mkdir "$DISTRIBUTION_DIR/Git"
mkdir "$DISTRIBUTION_DIR/Scalar"
# Download GCM Core
curl -L -o "$DISTRIBUTION_DIR/GCM/$GCM_INSTALLER_PKG" "$GCM_INSTALLER_DOWNLOAD_URL"
# Copy Git installer package
cp -Rf "$GIT_INSTALLER_PKG_SRC_PATH" "$DISTRIBUTION_DIR/Git/$GIT_INSTALLER_PKG"
# Copy Scalar
cp -Rf "$SCALAR_INSTALLER_PKG_SRC_PATH" "$DISTRIBUTION_DIR/Scalar/$SCALAR_INSTALLER_PKG"
# Write out Scalar Installation Script
/usr/bin/sed -e "s|##GIT_INSTALLER_PKG_PLACEHOLDER##|$GIT_INSTALLER_PKG|g" "$SCALAR_SCRIPT_DIR/InstallScalarTemplate.sh" > "$DISTRIBUTION_DIR/InstallScalar.sh"
/usr/bin/sed -i.bak "s|##GCM_CORE_INSTALLER_PKG_PLACEHOLDER##|$GCM_INSTALLER_PKG|g" "$DISTRIBUTION_DIR/InstallScalar.sh"
/usr/bin/sed -i.bak "s|##SCALAR_INSTALLER_PKG_PLACEHOLDER##|$SCALAR_INSTALLER_PKG|g" "$DISTRIBUTION_DIR/InstallScalar.sh"
/bin/chmod +x "$DISTRIBUTION_DIR/InstallScalar.sh"
echo "No need to run this script anymore!"
echo "Run 'BuildScalarForMac.sh' and look in: ${DISTDIR}"

Просмотреть файл

@ -1,7 +0,0 @@
. "$(dirname ${BASH_SOURCE[0]})/InitializeEnvironment.sh"
BUILDDIR=$Scalar_OUTPUTDIR/Scalar.Build
GITVERSION="$($Scalar_SCRIPTDIR/GetGitVersionNumber.sh)"
cp $Scalar_SRCDIR/nuget.config $BUILDDIR
dotnet new classlib -n Restore.GitInstaller -o $BUILDDIR --force
dotnet add $BUILDDIR/Restore.GitInstaller.csproj package --package-directory $Scalar_PACKAGESDIR gitformac.gvfs.Installer --version $GITVERSION

Просмотреть файл

@ -1,16 +0,0 @@
. "$(dirname ${BASH_SOURCE[0]})/InitializeEnvironment.sh"
if [ -z $1 ]; then
echo "Version Number not defined for CommonAssemblyVersion.cs"
fi
# Update the version number in Scalar.props for other consumers of ScalarVersion
sed -i "" -E "s@<ScalarVersion>[0-9]+(\.[0-9]+)*</ScalarVersion>@<ScalarVersion>$1</ScalarVersion>@g" $Scalar_SRCDIR/Scalar.Build/Scalar.props
# Then generate CommonAssemblyVersion.cs
cat >$Scalar_OUTPUTDIR/CommonAssemblyVersion.cs <<TEMPLATE
using System.Reflection;
[assembly: AssemblyVersion("$1")]
[assembly: AssemblyFileVersion("$1")]
TEMPLATE

Просмотреть файл

@ -1,16 +0,0 @@
VERSIONREGEX="([[:digit:]]+).([[:digit:]]+).([[:digit:]]+).([[:alpha:]]+).([[:digit:]]+).([[:digit:]]+)"
if [[ $1 =~ $VERSIONREGEX ]]
then
cat >$2/ScalarConstants.GitVersion.cs <<TEMPLATE
// This file is auto-generated by Scalar.PreBuild.GenerateGitVersionConstants. Any changes made directly in this file will be lost.
using Scalar.Common.Git;
namespace Scalar.Common
{
public static partial class ScalarConstants
{
public static readonly GitVersion SupportedGitVersion = new GitVersion(${BASH_REMATCH[1]}, ${BASH_REMATCH[2]}, ${BASH_REMATCH[3]}, "${BASH_REMATCH[4]}", ${BASH_REMATCH[5]}, ${BASH_REMATCH[6]});
}
}
TEMPLATE
fi

Просмотреть файл

@ -1,22 +0,0 @@
<#
Generate and write the Scalar.Mac.Installer nuspec file
#>
param (
[Parameter(Mandatory)]
[string]$PackageDir,
[Parameter(Mandatory)]
[string]$GvfsVersion,
[Parameter(Mandatory)]
[string]$OutputPath
)
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12
. "$PSScriptRoot\Common-Functions.ps1"
$GcmReleaseVersion = "v2.0.33-beta"
$GcmPackageName = "gcmcore-osx-2.0.33.21076.pkg"
$nuspec = Generate-NuSpec -PackageDir $PackageDir -GvfsVersion $GvfsVersion -GcmReleaseVersion $GcmReleaseVersion -GcmPackageName $GcmPackageName
Set-Content -Path $OutputPath/Scalar.Installers.Mac.nuspec -Value $nuspec

Просмотреть файл

@ -1,5 +0,0 @@
. "$(dirname ${BASH_SOURCE[0]})/InitializeEnvironment.sh"
ScalarPROPS=$Scalar_SRCDIR/Scalar.Build/Scalar.props
GITVERSION="$(cat $ScalarPROPS | grep GitPackageVersion | grep -Eo '[0-9.]+(-\w+)*')"
echo $GITVERSION

Просмотреть файл

@ -2,12 +2,10 @@ SCRIPTDIR="$(dirname ${BASH_SOURCE[0]})"
# convert to an absolute path because it is required by `dotnet publish`
pushd $SCRIPTDIR &>/dev/null
export Scalar_SCRIPTDIR="$(pwd)"
export SCALAR_SCRIPTSDIR="$(pwd)"
popd &>/dev/null
export Scalar_SRCDIR=$Scalar_SCRIPTDIR/../..
export SCALAR_SRCDIR=$SCALAR_SCRIPTSDIR/../..
export Scalar_ENLISTMENTDIR=$Scalar_SRCDIR/..
export Scalar_OUTPUTDIR=$Scalar_ENLISTMENTDIR/BuildOutput
export Scalar_PUBLISHDIR=$Scalar_ENLISTMENTDIR/Publish
export Scalar_PACKAGESDIR=$Scalar_ENLISTMENTDIR/packages
export SCALAR_ENLISTMENTDIR=$SCALAR_SRCDIR/..
export SCALAR_OUTPUTDIR=$SCALAR_ENLISTMENTDIR/out

Просмотреть файл

@ -1,124 +0,0 @@
#!/bin/sh
# ---------------------------------------------------------
# ScalarInstall.sh
#
# Description: Main logic for installing Scalar and supporting
# Components. Before this script can be run, the
# necessary version configuration variables below
# must be set.
# ---------------------------------------------------------
set -e
GIT_INSTALLER_PKG="##GIT_INSTALLER_PKG_PLACEHOLDER##"
GCM_CORE_INSTALLER_PKG="##GCM_CORE_INSTALLER_PKG_PLACEHOLDER##"
SCALAR_INSTALLER_PKG="##SCALAR_INSTALLER_PKG_PLACEHOLDER##"
SCRIPTDIR="$(dirname ${BASH_SOURCE[0]})"
## Argument 1 is the directory containing the sources for installation
## Assume it is the current directory.
SCALAR_DISTRIBUTION_ROOT=$1
SCALAR_DISTRIBUTION_ROOT=${SCALAR_DISTRIBUTION_ROOT:-"$SCRIPTDIR"}
echo ""
echo "Welcome - running Scalar installation script"
CURRENT_USER=$(/usr/bin/logname)
if [ -z GIT_INSTALLER_PKG ]; then
echo "ERROR: GIT_INSTALLER_PKG environment variable not set - exiting"
exit 1;
fi
if [ -z GCM_CORE_INSTALLER_PKG ]; then
echo "ERROR: GCM_CORE_INSTALLER_PKG environment variable not set - exiting"
exit 1;
fi
if [ -z SCALAR_INSTALLER_PKG ]; then
echo "ERROR: SCALAR_INSTALLER_PKG environment variable not set - exiting"
exit 1;
fi
echo "Scalar distribution root: $SCALAR_DISTRIBUTION_ROOT"
echo "Git installer pkg: $GIT_INSTALLER_PKG"
echo "GCM installer pkg: $GCM_CORE_INSTALLER_PKG"
echo "Scalar installer pkg: $SCALAR_INSTALLER_PKG"
echo ""
echo "=============================="
echo "Checking prerequisites..."
## Check for brew installation
BREW_INSTALLED=0
if which -s brew; then
BREW_INSTALLED=1
else
BREW_INSTALLED=0
fi
if [ $BREW_INSTALLED -eq 0 ]; then
echo ""
echo "Homebrew is required to install watchman. Please install Homebrew with the following command and run the installation script again:"
echo "/usr/bin/ruby -e \"\$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\""
exit 1
else
echo "brew already installed!"
fi
# Install Git
echo ""
echo "=============================="
echo "Installing Git for Mac for Scalar"
sudo /usr/sbin/installer -pkg "$SCALAR_DISTRIBUTION_ROOT/Git/$GIT_INSTALLER_PKG" -target /
# Install GCM Core
echo ""
echo "=============================="
echo "Installing GCM Core"
sudo /usr/sbin/installer -pkg "$SCALAR_DISTRIBUTION_ROOT/GCM/$GCM_CORE_INSTALLER_PKG" -target /
# Configure GCM
# GCM Core installer does not current configure itself properly in all scenarios
# Configure it here to ensure it is configured correctly
echo ""
echo "=============================="
echo "Configuring Git to use GCM"
sudo /usr/local/bin/git config --system credential.helper /usr/local/share/gcm-core/git-credential-manager
sudo /usr/local/bin/git config --system credential.dev.azure.com.usehttppath true
# Install Scalar
echo ""
echo "=============================="
echo "Installing Scalar"
sudo /usr/sbin/installer -pkg "$SCALAR_DISTRIBUTION_ROOT/Scalar/$SCALAR_INSTALLER_PKG" -target /
echo ""
echo "=============================="
echo "Installing watchman as: $CURRENT_USER"
sudo -u $CURRENT_USER brew update
sudo -u $CURRENT_USER brew install watchman
# Install optional package if specified
if [ ! -z "$OPTIONAL_INSTALLER_PKG" ]; then
echo ""
echo "=============================="
echo "Installing Optional Install Package"
sudo /usr/sbin/installer -pkg "$SCALAR_DISTRIBUTION_ROOT/Optional/$OPTIONAL_INSTALLER_PKG" -target /
fi
# Run the post install script (if any)
if [ -f "$SCALAR_DISTRIBUTION_ROOT/Scripts/PostInstall.sh" ]; then
echo ""
echo "=============================="
echo "Running post install script"
sudo /bin/bash "$SCALAR_DISTRIBUTION_ROOT/Scripts/PostInstall.sh"
fi
# Installation Complete!
echo ""
echo "=============================="
echo "Installation Complete!!!"

Просмотреть файл

@ -1,5 +0,0 @@
. "$(dirname ${BASH_SOURCE[0]})/InitializeEnvironment.sh"
# DYLD_LIBRARY_PATH contains /usr/local/lib by default, so we'll copy this library there.
BUILDDIR=$Scalar_OUTPUTDIR/Scalar.Build
cp $BUILDDIR/libSharedDataQueue.dylib /usr/local/lib

Просмотреть файл

@ -2,9 +2,7 @@
. "$(dirname ${BASH_SOURCE[0]})/InitializeEnvironment.sh"
sudo rm -Rf $Scalar_OUTPUTDIR
rm -Rf $Scalar_PACKAGESDIR
rm -Rf $Scalar_PUBLISHDIR
sudo rm -Rf $SCALAR_OUTPUTDIR
echo git --work-tree=$Scalar_SRCDIR clean -Xdf -n
git --work-tree=$Scalar_SRCDIR clean -Xdf -n
echo git --work-tree=$SCALAR_SRCDIR clean -Xdf -n
git --work-tree=$SCALAR_SRCDIR clean -Xdf -n

Просмотреть файл

@ -1,14 +0,0 @@
#!/bin/bash
. "$(dirname ${BASH_SOURCE[0]})/InitializeEnvironment.sh"
# Install Scalar-aware Git (that was published by the build script)
GITPUBLISH=$Scalar_OUTPUTDIR/Git
if [[ ! -d $GITPUBLISH ]]; then
echo "Scalar-aware Git package not found. Run BuildScalarForMac.sh and try again"
exit 1
fi
hdiutil attach $GITPUBLISH/*.dmg || exit 1
GITPKG="$(find /Volumes/Git* -type f -name *.pkg)" || exit 1
sudo installer -pkg "$GITPKG" -target / || exit 1
hdiutil detach /Volumes/Git*

Просмотреть файл

@ -1,15 +0,0 @@
. "$(dirname ${BASH_SOURCE[0]})/InitializeEnvironment.sh"
GITPATH=$1
INSTALLER=$(basename $GITPATH)
GITPUBLISH=$Scalar_OUTPUTDIR/Git
if [[ ! -d $GITPUBLISH ]] ; then
mkdir $GITPUBLISH
fi
find $GITPUBLISH -type f ! -name $INSTALLER -delete
if [[ ! -e $GITPUBLISH/$INSTALLER ]] ; then
cp $GITPATH $GITPUBLISH
fi

Просмотреть файл

@ -7,9 +7,15 @@ if [ -z $CONFIGURATION ]; then
CONFIGURATION=Debug
fi
TESTS_EXEC=$SCALAR_OUTPUTDIR/Scalar.FunctionalTests/bin/$CONFIGURATION/netcoreapp3.0/osx-x64/publish/Scalar.FunctionalTests
mkdir ~/Scalar.FT
# Consume the first argument
shift
$Scalar_PUBLISHDIR/Scalar.FunctionalTests --full-suite "$@"
# Ensure the binary is executable
chmod +x $TESTS_EXEC
# Run the tests!
$TESTS_EXEC --full-suite "$@"

15
Scripts/Mac/RunUnitTests.sh Executable file
Просмотреть файл

@ -0,0 +1,15 @@
#!/bin/bash
. "$(dirname ${BASH_SOURCE[0]})/InitializeEnvironment.sh"
CONFIGURATION=$1
if [ -z $CONFIGURATION ]; then
CONFIGURATION=Debug
fi
TESTRESULTSDIR=$2
if [ -z $TESTRESULTSDIR ]; then
TESTRESULTSDIR=$SCALAR_OUTPUTDIR/TestResults
fi
dotnet test $SCALAR_SRCDIR/Scalar.sln --configuration $CONFIGURATION --logger trx --results-directory $TESTRESULTSDIR || exit 1

Просмотреть файл

@ -8,4 +8,4 @@ if [ -z $CONFIGURATION ]; then
CONFIGURATION=Debug
fi
$Scalar_PUBLISHDIR/scalar clone $REPOURL ~/ScalarTest --local-cache-path ~/ScalarTest/.scalarCache
$SCALAR_OUTPUTDIR/Scalar/bin/$CONFIGURATION/netcoreapp3.0/osx-x64/publish/scalar clone $REPOURL ~/ScalarTest --local-cache-path ~/ScalarTest/.scalarCache

Просмотреть файл

@ -7,4 +7,4 @@ if [ -z $CONFIGURATION ]; then
CONFIGURATION=Debug
fi
$Scalar_PUBLISHDIR/scalar mount ~/ScalarTest
$SCALAR_OUTPUTDIR/Scalar/bin/$CONFIGURATION/netcoreapp3.0/osx-x64/publish/scalar mount ~/ScalarTest

Просмотреть файл

@ -7,4 +7,4 @@ if [ -z $CONFIGURATION ]; then
CONFIGURATION=Debug
fi
$Scalar_PUBLISHDIR/scalar unmount ~/ScalarTest
$SCALAR_OUTPUTDIR/Scalar/bin/$CONFIGURATION/netcoreapp3.0/osx-x64/publish/scalar unmount ~/ScalarTest

Просмотреть файл

@ -18,25 +18,11 @@ IF EXIST C:\Repos\ScalarPerfTest (
ECHO no perf test enlistment found
)
IF EXIST %Scalar_OUTPUTDIR% (
IF EXIST %SCALAR_OUTPUTDIR% (
ECHO deleting build outputs
rmdir /s /q %Scalar_OUTPUTDIR%
) ELSE (
ECHO no build outputs found
)
IF EXIST %Scalar_PUBLISHDIR% (
ECHO deleting published output
rmdir /s /q %Scalar_PUBLISHDIR%
) ELSE (
ECHO no packages found
)
IF EXIST %Scalar_PACKAGESDIR% (
ECHO deleting packages
rmdir /s /q %Scalar_PACKAGESDIR%
) ELSE (
ECHO no packages found
)
call %Scalar_SCRIPTSDIR%\StopAllServices.bat
call %SCALAR_SCRIPTSDIR%\StopAllServices.bat

Просмотреть файл

@ -3,7 +3,7 @@ CALL %~dp0\InitializeEnvironment.bat || EXIT /b 10
IF "%1"=="" (SET "Configuration=Debug") ELSE (SET "Configuration=%1")
call %Scalar_SCRIPTSDIR%\UninstallScalar.bat
call %SCALAR_SCRIPTSDIR%\UninstallScalar.bat
if not exist "c:\Program Files\Git" goto :noGit
for /F "delims=" %%g in ('dir "c:\Program Files\Git\unins*.exe" /B /S /O:-D') do %%g /VERYSILENT /SUPPRESSMSGBOXES /NORESTART & goto :deleteGit
@ -16,4 +16,4 @@ REM This is a hacky way to sleep for 2 seconds in a non-interactive window. The
ping 1.1.1.1 -n 1 -w 2000 >NUL
:runInstallers
call %Scalar_OUTPUTDIR%\Scalar.Build\InstallProduct.bat
call %SCALAR_OUTPUTDIR%\Scalar.Distribution.Windows\dist\%Configuration%\InstallScalar.bat

Просмотреть файл

@ -1,20 +1,3 @@
@ECHO OFF
CALL %~dp0\InitializeEnvironment.bat || EXIT /b 10
SETLOCAL
IF "%1"=="" (SET "Configuration=Debug") ELSE (SET "Configuration=%1")
SET SolutionConfiguration=%Configuration%.Windows
SET nuget="%Scalar_TOOLSDIR%\nuget.exe"
IF NOT EXIST %nuget% (
mkdir %nuget%\..
powershell -ExecutionPolicy Bypass -Command "Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe' -OutFile %nuget%"
)
%nuget% restore %Scalar_SRCDIR%\Scalar.sln || exit /b 1
dotnet restore %Scalar_SRCDIR%\Scalar.sln /p:Configuration=%SolutionConfiguration% /p:VCTargetsPath="C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140" --packages %Scalar_PACKAGESDIR% || exit /b 1
ENDLOCAL
REM NO-OP

Просмотреть файл

@ -6,34 +6,42 @@ IF "%1"=="" (SET "Configuration=Debug") ELSE (SET "Configuration=%1")
SETLOCAL
SET PATH=C:\Program Files\Scalar;C:\Program Files\Git\cmd;%PATH%
if not "%2"=="--test-scalar-on-path" goto :startFunctionalTests
SET publishFragment=bin\%Configuration%\netcoreapp3.0\win-x64\publish
SET functionalTestsDir=%SCALAR_OUTPUTDIR%\Scalar.FunctionalTests\%publishFragment%
REM Force Scalar.FunctionalTests.exe to use the installed version of Scalar
del %Scalar_OUTPUTDIR%\Scalar.FunctionalTests\bin\x64\%Configuration%\netcoreapp2.1\Scalar.exe
del %Scalar_OUTPUTDIR%\Scalar.FunctionalTests\bin\x64\%Configuration%\netcoreapp2.1\Scalar.Mount.exe
del %Scalar_OUTPUTDIR%\Scalar.FunctionalTests\bin\x64\%Configuration%\netcoreapp2.1\Scalar.Service.exe
del %Scalar_OUTPUTDIR%\Scalar.FunctionalTests\bin\x64\%Configuration%\netcoreapp2.1\Scalar.Service.UI.exe
IF "%2"=="--test-scalar-on-path" GOTO :testPath
REM Same for Scalar.FunctionalTests.Windows.exe
del %Scalar_OUTPUTDIR%\Scalar.FunctionalTests.Windows\bin\x64\%Configuration%\Scalar.exe
del %Scalar_OUTPUTDIR%\Scalar.FunctionalTests.Windows\bin\x64\%Configuration%\Scalar.Mount.exe
del %Scalar_OUTPUTDIR%\Scalar.FunctionalTests.Windows\bin\x64\%Configuration%\Scalar.Service.exe
del %Scalar_OUTPUTDIR%\Scalar.FunctionalTests.Windows\bin\x64\%Configuration%\Scalar.Service.UI.exe
:testBuilt
ECHO *******************************
ECHO Testing built version of Scalar
ECHO *******************************
REM Copy most recently build Scalar binaries
SET copyOptions=/s /njh /njs /nfl /ndl
robocopy %SCALAR_OUTPUTDIR%\Scalar\%publishFragment% %functionalTestsDir% %copyOptions%
robocopy %SCALAR_OUTPUTDIR%\Scalar.Mount\%publishFragment% %functionalTestsDir% %copyOptions%
robocopy %SCALAR_OUTPUTDIR%\Scalar.Service\%publishFragment% %functionalTestsDir% %copyOptions%
robocopy %SCALAR_OUTPUTDIR%\Scalar.Service.UI\%publishFragment% %functionalTestsDir% %copyOptions%
robocopy %SCALAR_OUTPUTDIR%\Scalar.Upgrader\%publishFragment% %functionalTestsDir% %copyOptions%
GOTO :startTests
echo PATH = %PATH%
echo scalar location:
:testPath
ECHO **************************
ECHO Testing Scalar on the PATH
ECHO **************************
ECHO PATH:
ECHO %PATH%
ECHO Scalar location:
where scalar
echo Scalar.Service location:
where Scalar.Service
echo git location:
ECHO Scalar.Service location:
where scalar.service
ECHO Git location:
where git
:startFunctionalTests
dotnet %Scalar_OUTPUTDIR%\Scalar.FunctionalTests\bin\x64\%Configuration%\netcoreapp2.1\Scalar.FunctionalTests.dll /result:TestResultNetCore.xml %2 %3 %4 %5 %6 %7 %8 || goto :endFunctionalTests
:startTests
%functionalTestsDir%\Scalar.FunctionalTests /result:TestResultNetCore.xml %2 %3 %4 %5 %6 %7 %8 || goto :endTests
:endFunctionalTests
set error=%errorlevel%
:endTests
SET error=%errorlevel%
CALL %SCALAR_SCRIPTSDIR%\StopAllServices.bat
call %Scalar_SCRIPTSDIR%\StopAllServices.bat
exit /b %error%
EXIT /b %error%

Просмотреть файл

@ -2,10 +2,10 @@
CALL %~dp0\InitializeEnvironment.bat || EXIT /b 10
IF "%1"=="" (SET "Configuration=Debug") ELSE (SET "Configuration=%1")
IF "%2"=="" (SET "TestResultsDir=%SCALAR_OUTPUTDIR%\TestResults") ELSE (SET "TestResultsDir=%2" )
set RESULT=0
%Scalar_OUTPUTDIR%\Scalar.UnitTests.Windows\bin\x64\%Configuration%\Scalar.UnitTests.Windows.exe || set RESULT=1
dotnet %Scalar_OUTPUTDIR%\Scalar.UnitTests\bin\x64\%Configuration%\netcoreapp2.1\Scalar.UnitTests.dll || set RESULT=1
dotnet test %SCALAR_SRCDIR%\Scalar.sln --configuration %Configuration% --logger trx --results-directory %TestResultsDir% || set RESULT=1
exit /b %RESULT%

Просмотреть файл

@ -1,5 +1,5 @@
@ECHO OFF
CALL %~dp0\InitializeEnvironment.bat || EXIT /b 10
call %Scalar_SCRIPTSDIR%\StopService.bat Scalar.Service
call %Scalar_SCRIPTSDIR%\StopService.bat Test.Scalar.Service
call %SCALAR_SCRIPTSDIR%\StopService.bat Scalar.Service
call %SCALAR_SCRIPTSDIR%\StopService.bat Test.Scalar.Service

Просмотреть файл

@ -5,15 +5,15 @@ taskkill /F /T /FI "IMAGENAME eq git.exe"
taskkill /F /T /FI "IMAGENAME eq Scalar.exe"
taskkill /F /T /FI "IMAGENAME eq Scalar.Mount.exe"
if not exist "c:\Program Files\Scalar" goto :end
if not exist "C:\Program Files\Scalar" goto :end
call %Scalar_SCRIPTSDIR%\StopAllServices.bat
call %SCALAR_SCRIPTSDIR%\StopAllServices.bat
REM Find the latest uninstaller file by date and run it. Goto the next step after a single execution.
for /F "delims=" %%f in ('dir "c:\Program Files\Scalar\unins*.exe" /B /S /O:-D') do %%f /VERYSILENT /SUPPRESSMSGBOXES /NORESTART & goto :deleteScalar
for /F "delims=" %%f in ('dir "C:\Program Files\Scalar\unins*.exe" /B /S /O:-D') do %%f /VERYSILENT /SUPPRESSMSGBOXES /NORESTART & goto :deleteScalar
:deleteScalar
rmdir /q/s "c:\Program Files\Scalar"
rmdir /q/s "C:\Program Files\Scalar"
REM Delete ProgramData\Scalar directory (logs, downloaded upgrades, repo-registry, scalar.config). It can affect the behavior of a future Scalar install.
if exist "C:\ProgramData\Scalar" rmdir /q/s "C:\ProgramData\Scalar"