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
53 changes: 53 additions & 0 deletions .azure-pipelines/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: $(date:yy)$(DayOfYear)$(rev:.r)

trigger:
- master
- releases/shipped

variables:
majorAndMinorVersion: '0.5'
revision: '$(Build.BuildNumber)'

jobs:
- job: Build_Windows
variables:
platformFriendlyName: Windows
strategy:
maxParallel: 2
Comment thread
jrbriggs marked this conversation as resolved.
matrix:
debug:
configuration: Debug
release:
configuration: Release
pool:
vmImage: vs2017-win2016
steps:
- template: templates/windows-build-and-unit-test.yml

- job: Build_macOS
variables:
platformFriendlyName: macOS
strategy:
maxParallel: 2
matrix:
debug:
configuration: Debug
release:
configuration: Release
pool:
vmImage: macOS 10.13
steps:
- template: templates/macos-build-and-unit-test.yml

- job: FunctionalTests_Windows
timeoutInMinutes: 240
variables:
platformFriendlyName: Windows
configuration: Release
pool:
name: FunctionalTests
dependsOn: Build_Windows
condition: succeeded()
steps:
- checkout: none # We'll get the build drop from Build_Windows job
- template: templates/windows-functional-test.yml
22 changes: 22 additions & 0 deletions .azure-pipelines/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: $(date:yy)$(DayOfYear)$(rev:.r)

trigger: none

variables:
majorAndMinorVersion: '0.4'
revision: '$(Build.BuildNumber)'
platform: 'x64'
configuration: release

jobs:
- job: Windows
pool:
vmImage: vs2017-win2016
steps:
- template: templates/windows-build-and-unit-test.yml

- job: macOS
pool:
vmImage: macOS 10.13
Comment thread
jrbriggs marked this conversation as resolved.
steps:
- template: templates/macos-build-and-unit-test.yml
30 changes: 30 additions & 0 deletions .azure-pipelines/templates/macos-build-and-unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
steps:

- task: DotNetCoreInstaller@0
displayName: Use .NET Core SDK 2.1.301
inputs:
packageType: sdk
version: '2.1.301'

- task: InstallAppleCertificate@2
displayName: Install kext certificate
inputs:
certSecureFile: PrjFSKextAug272018.p12
certPwd: $(PrjFSKextCertPassword)
keychain: temp

- script: Scripts/Mac/BuildGVFSForMac.sh $(configuration)
displayName: Build VFSForGit $(configuration)

- script: MirrorProvider/Scripts/Mac/Build.sh $(configuration)
displayName: Build MirrorProvider $(configuration)

- task: PublishTestResults@2
displayName: Publish test results
inputs:
testRunner: NUnit
testResultsFiles: '**/TestResult.xml'
searchFolder: $(System.DefaultWorkingDirectory)
testRunTitle: Mac $(configuration) Unit Tests
publishRunAttachments: true
condition: succeededOrFailed()
40 changes: 40 additions & 0 deletions .azure-pipelines/templates/windows-build-and-unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
steps:

- script: $(Build.Repository.LocalPath)\\Scripts\\NukeBuildOutputs.bat
Comment thread
jrbriggs marked this conversation as resolved.
displayName: Delete previous build outputs
continueOnError: true

- powershell: |
& 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\sn.exe' -Vr *,31bf3856ad364e35
& 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\sn.exe' -Vr *,31bf3856ad364e35
displayName: Disable strong name validation for MS delay-signed assemblies

- script: $(Build.Repository.LocalPath)\Scripts\BuildGVFSForWindows.bat $(configuration) $(majorAndMinorVersion).$(revision)
displayName: Run VFSForGit build script ($(configuration))

- script: $(Build.Repository.LocalPath)\MirrorProvider\Scripts\Windows\Build.bat $(configuration)
displayName: Build MirrorProvider ($(configuration))

- script: $(Build.Repository.LocalPath)\Scripts\RunUnitTests.bat $(configuration)
displayName: Run unit tests

- task: PublishTestResults@2
displayName: Publish unit test results
inputs:
testRunner: NUnit
testResultsFiles: "**\\TestResult.xml"
searchFolder: $(System.DefaultWorkingDirectory)
testRunTitle: Windows $(configuration) Unit Tests
publishRunAttachments: true

- script: $(Build.Repository.LocalPath)\Scripts\CI\CreateBuildDrop.bat $(configuration) $(Build.ArtifactStagingDirectory)\Tests
displayName: Create functional test drop.

- task: PublishBuildArtifacts@1
displayName: Publish functional test drop artifact.
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)\Tests
artifactName: "FunctionalTests_$(platformFriendlyName)_$(configuration)"
parallel: true
parallelCount: 8
condition: succeededOrFailed()
28 changes: 28 additions & 0 deletions .azure-pipelines/templates/windows-functional-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
steps:

- task: DownloadBuildArtifacts@0
displayName: Download functional test drop
inputs:
buildType: current
downloadType: specific
artifactName: FunctionalTests_$(platformFriendlyName)_$(configuration)
Comment thread
jrbriggs marked this conversation as resolved.
downloadPath: $(Build.BinariesDirectory)

- script: $(Build.BinariesDirectory)/FunctionalTests_$(platformFriendlyName)_$(configuration)/src/Scripts/ReinstallGVFS.bat $(configuration)
displayName: Run VFSForGit and G4W installers

- script: git config --global credential.interactive never
displayName: Disable interactive auth

- script: $(Build.BinariesDirectory)/FunctionalTests_$(platformFriendlyName)_$(configuration)/src/Scripts/RunFunctionalTests.bat $(configuration) --test-gvfs-on-path --replace-inbox-projfs
displayName: Run functional tests

- task: PublishTestResults@2
displayName: Publish functional test results
inputs:
testRunner: NUnit
testResultsFiles: "**\\TestResult*.xml"
searchFolder: $(System.DefaultWorkingDirectory)
testRunTitle: Windows $(configuration) Functional Tests
publishRunAttachments: true
condition: succeededOrFailed()
24 changes: 17 additions & 7 deletions GVFS/GVFS.Build/GVFS.PreBuild.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
<PackagesPath ParameterType="System.String" Required="true" />
<OutputFile ParameterType="System.String" Required="true" />
<LatestInstaller ParameterType="System.String" Output="true" />
<LatestInstallerFilename ParameterType="System.String" Output="true" />
</ParameterGroup>
<Task>
<Code Type="Class" Source="GenerateGitVersionConstants.cs" />
Expand All @@ -95,10 +96,11 @@

<UsingTask TaskName="GenerateInstallScripts" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v12.0.dll">
<ParameterGroup>
<G4WInstallerPath ParameterType="System.String" Required="true" />
<GVFSSetupPath ParameterType="System.String" Required="true" />
<G4WInstallBatPath ParameterType="System.String" Required="true" />
<GVFSInstallBatPath ParameterType="System.String" Required="true" />
<GitInstallerFilename ParameterType="System.String" Required="true" />
<VFSForGitSetupFilename ParameterType="System.String" Required="true" />
<GitInstallBatPath ParameterType="System.String" Required="true" />
<VFSForGitInstallBatPath ParameterType="System.String" Required="true" />
<UnifiedInstallBatPath ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Code Type="Class" Source="GenerateInstallScripts.cs" />
Expand Down Expand Up @@ -140,11 +142,13 @@
</UsingTask>

<PropertyGroup>
<GVFSSetupFilename>SetupGVFS.$(GVFSVersion).exe</GVFSSetupFilename>
<GVFSSetupPath>$(BuildOutputDir)\GVFS.Installer.Windows\bin\x64\$(Configuration)\SetupGVFS.$(GVFSVersion).exe</GVFSSetupPath>
<OutDir>$(BuildOutputDir)\GVFS.Build\</OutDir>
<GitVersionConstantsPath>$(OutDir)GVFSConstants.GitVersion.cs</GitVersionConstantsPath>
<G4WInstallBatPath>$(OutDir)InstallG4W.bat</G4WInstallBatPath>
<GVFSInstallBatPath>$(OutDir)InstallGVFS.bat</GVFSInstallBatPath>
<UnifiedInstallBatPath>$(OutDir)InstallProduct.bat</UnifiedInstallBatPath>
<GVFSInstallerNuspecPath>$(OutDir)GVFS.Installers.nuspec</GVFSInstallerNuspecPath>
<AssemblyVersionPath>$(BuildOutputDir)\CommonAssemblyVersion.cs</AssemblyVersionPath>
<VersionHeaderPath>$(BuildOutputDir)\CommonVersionHeader.h</VersionHeaderPath>
Expand Down Expand Up @@ -188,13 +192,19 @@
<Target Name="GenerateInstallScripts"
DependsOnTargets="GVFSPackageRestore;$(GenerateInstallScriptsDependsOn)"
Inputs="$(RestoreTimestampPath);@(GeneratedPackageConfig);$(MSBuildThisFileFullPath);$(MSBuildProjectFullPath);$(MSBuildThisFileDirectory)GenerateGitVersionConstants.cs;$(MSBuildThisFileDirectory)GenerateInstallScripts.cs;$(MSBuildThisFileDirectory)GenerateGVFSInstallersNuspec.cs"
Outputs="$(GitVersionConstantsPath);$(G4WInstallBatPath);$(GVFSInstallBatPath);$(GVFSInstallerNuspecPath)"
Outputs="$(GitVersionConstantsPath);$(G4WInstallBatPath);$(GVFSInstallBatPath);$(GVFSInstallerNuspecPath);$(UnifiedInstallBatPath);$(OutDir)$(G4WInstallerFilename)"
Condition="'$(OS)' == 'Windows_NT'">
<GenerateGitVersionConstants GitPackageVersion="$(GitPackageVersion)" PackagesPath="$(PackagesDir)" OutputFile="$(GitVersionConstantsPath)">
<Output PropertyName="G4WInstaller" TaskParameter="LatestInstaller" />
<Output TaskParameter="LatestInstaller" PropertyName="G4WInstaller" />
<Output TaskParameter="LatestInstallerFilename" PropertyName="G4WInstallerFilename" />
</GenerateGitVersionConstants>
<GenerateInstallScripts G4WInstallerPath="$(G4WInstaller)" GVFSSetupPath="$(GVFSSetupPath)" G4WInstallBatPath="$(G4WInstallBatPath)" GVFSInstallBatPath="$(GVFSInstallBatPath)" />
<GenerateInstallScripts GitInstallerFilename="$(G4WInstallerFilename)"
VFSForGitSetupFilename="$(GVFSSetupFilename)"
GitInstallBatPath="$(G4WInstallBatPath)"
VFSForGitInstallBatPath="$(GVFSInstallBatPath)"
UnifiedInstallBatPath="$(UnifiedInstallBatPath)"/>
<GenerateGVFSInstallersNuspec GVFSSetupPath="$(GVFSSetupPath)" GitPackageVersion="$(GitPackageVersion)" PackagesPath="$(PackagesDir)" OutputFile="$(GVFSInstallerNuspecPath)" />
<Copy SourceFiles="$(G4WInstaller)" DestinationFiles="$(OutDir)\$(G4WInstallerFilename)" />
</Target>

<Target Name="GenerateShared"
Expand Down
9 changes: 6 additions & 3 deletions GVFS/GVFS.Build/GenerateGitVersionConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public class GenerateGitVersionConstants : Task
[Output]
public string LatestInstaller { get; set; }

[Output]
public string LatestInstallerFilename { get; set; }

public override bool Execute()
{
this.Log.LogMessage(MessageImportance.High, "Creating constants for Git package " + this.GitPackageVersion);
Expand All @@ -36,11 +39,11 @@ public override bool Execute()
}

this.LatestInstaller = Path.GetFullPath(Directory.EnumerateFiles(installerDirectory).Single());
string installer = Path.GetFileName(this.LatestInstaller);
this.LatestInstallerFilename = Path.GetFileName(this.LatestInstaller);
GitVersion version;
if (!GitVersion.TryParseInstallerName(installer, out version))
if (!GitVersion.TryParseInstallerName(this.LatestInstallerFilename, out version))
{
this.Log.LogError("Unable to parse git version: " + installer);
this.Log.LogError("Unable to parse git version: " + this.LatestInstallerFilename);
return false;
}

Expand Down
43 changes: 34 additions & 9 deletions GVFS/GVFS.Build/GenerateInstallScripts.cs
Original file line number Diff line number Diff line change
@@ -1,36 +1,61 @@
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using System.IO;
using System.Text;

namespace GVFS.PreBuild
{
public class GenerateInstallScripts : Task
{
[Required]
public string G4WInstallerPath { get; set; }
public string GitInstallerFilename { get; set; }

[Required]
public string GVFSSetupPath { get; set; }
public string VFSForGitSetupFilename { get; set; }

[Required]
public string G4WInstallBatPath { get; set; }
public string GitInstallBatPath { get; set; }

[Required]
public string GVFSInstallBatPath { get; set; }
public string VFSForGitInstallBatPath { get; set; }

[Required]
public string UnifiedInstallBatPath { get; set; }

public override bool Execute()
{
this.Log.LogMessage(MessageImportance.High, "Creating install script for " + this.G4WInstallerPath);
this.Log.LogMessage(MessageImportance.High, "Creating install scripts for " + this.GitInstallerFilename);

File.WriteAllText(
this.GitInstallBatPath,
this.GetGitInstallCommand());

File.WriteAllText(
this.G4WInstallBatPath,
this.G4WInstallerPath + @" /DIR=""C:\Program Files\Git"" /NOICONS /COMPONENTS=""ext,ext\shellhere,ext\guihere,assoc,assoc_sh"" /GROUP=""Git"" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART");
this.VFSForGitInstallBatPath,
this.GetVFSForGitInstallCommand());

StringBuilder sb = new StringBuilder();
sb.AppendLine("REM AUTOGENERATED DO NOT EDIT");
sb.AppendLine();
sb.AppendLine(this.GetGitInstallCommand());
sb.AppendLine();
sb.AppendLine(this.GetVFSForGitInstallCommand());

File.WriteAllText(
this.GVFSInstallBatPath,
this.GVFSSetupPath + " /VERYSILENT /SUPPRESSMSGBOXES /NORESTART");
this.UnifiedInstallBatPath,
sb.ToString());

return true;
}

public string GetGitInstallCommand()
{
return "%~dp0\\" + this.GitInstallerFilename + @" /DIR=""C:\Program Files\Git"" /NOICONS /COMPONENTS=""ext,ext\shellhere,ext\guihere,assoc,assoc_sh"" /GROUP=""Git"" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART";
}

public string GetVFSForGitInstallCommand()
{
return "%~dp0\\" + this.VFSForGitSetupFilename + " /VERYSILENT /SUPPRESSMSGBOXES /NORESTART";
}
}
}
4 changes: 4 additions & 0 deletions GVFS/GVFS.FunctionalTests/GVFS.FunctionalTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<Platforms>x64</Platforms>
<!-- see https://github.com/NuGet/Home/issues/4837 for reference to CopyLocalLockFileAssemblies -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<RuntimeIdentifiers>win-x64;osx-x64</RuntimeIdentifiers>
</PropertyGroup>

<PropertyGroup>
Expand Down
1 change: 1 addition & 0 deletions GVFS/GVFS.Installer.Windows/GVFS.Installer.Windows.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="CreateInstaller" BeforeTargets="Build;SignFiles">
<Exec Command="$(PackagesDir)\Tools.InnoSetup.5.5.9\tools\ISCC.exe /DPlatformAndConfiguration=$(Platform)\$(Configuration) /DProjFSPackage=$(ProjFSPackage) /DBuildOutputDir=$(BuildOutputDir) /DPackagesDir=$(PackagesDir) /DGVFSVersion=$(GVFSVersion) Setup.iss /O$(OutputPath)" />
<Copy SourceFiles="$(OutputPath)SetupGVFS.$(GVFSVersion).exe" DestinationFiles="$(BuildOutputDir)\GVFS.Build\SetupGVFS.$(GVFSVersion).exe" />
</Target>
<Target Name="Clean">
<RemoveDir Directories="$(BuildOutputDir)\$(MSBuildProjectName)" />
Expand Down
3 changes: 3 additions & 0 deletions GVFS/GVFS.Tests/GVFS.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;netstandard2.0</TargetFrameworks>
<Platforms>x64</Platforms>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<RuntimeIdentifiers>win-x64;osx-x64</RuntimeIdentifiers>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Version>$(GVFSVersion)</Version>
Expand Down
33 changes: 33 additions & 0 deletions Scripts/CI/CreateBuildDrop.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@ECHO OFF
CALL %~dp0\..\InitializeEnvironment.bat || EXIT /b 10

IF "%1"=="" GOTO USAGE
IF "%2"=="" GOTO USAGE

SETLOCAL enableextensions
SET Configuration=%1
SET VFS_STAGEDIR=%2

REM Prepare the staging directories for functional tests.
IF EXIST %VFS_STAGEDIR% (
rmdir /s /q %VFS_STAGEDIR%
)
mkdir %VFS_STAGEDIR%\src\Scripts
mkdir %VFS_STAGEDIR%\BuildOutput\GVFS.Build
mkdir %VFS_STAGEDIR%\BuildOutput\GVFS.FunctionalTests\bin\x64\%Configuration%\netcoreapp2.1
mkdir %VFS_STAGEDIR%\BuildOutput\GVFS.FunctionalTests.Windows\bin\x64\%Configuration%\
Comment thread
jrbriggs marked this conversation as resolved.

REM Make a minimal 'test' enlistment to pass along our pipeline.
copy %VFS_SRCDIR%\init.cmd %VFS_STAGEDIR%\src\
copy %VFS_SCRIPTSDIR%\*.* %VFS_STAGEDIR%\src\Scripts\
copy %VFS_OUTPUTDIR%\GVFS.Build\*.* %VFS_STAGEDIR%\BuildOutput\GVFS.Build
dotnet publish %VFS_SRCDIR%\GVFS\GVFS.FunctionalTests\GVFS.FunctionalTests.csproj -p:StyleCopEnabled=False --self-contained --framework netcoreapp2.1 -r win-x64 -c Release -o %VFS_STAGEDIR%\BuildOutput\GVFS.FunctionalTests\bin\x64\%Configuration%\netcoreapp2.1\
robocopy %VFS_OUTPUTDIR%\GVFS.FunctionalTests\bin\x64\%Configuration%\netcoreapp2.1\ %VFS_STAGEDIR%\BuildOutput\GVFS.FunctionalTests\bin\x64\%Configuration%\netcoreapp2.1\ /E /XC /XN /XO
copy %VFS_OUTPUTDIR%\GVFS.FunctionalTests.Windows\bin\x64\%Configuration%\*.* %VFS_STAGEDIR%\BuildOutput\GVFS.FunctionalTests.Windows\bin\x64\%Configuration%\
GOTO END

:USAGE
echo "ERROR: Usage: CreateBuildDrop.bat [configuration] [build drop root directory]"
exit 1

:END
Loading