diff --git a/.azure-pipelines/templates/macos-build-and-unit-test.yml b/.azure-pipelines/templates/macos-build-and-unit-test.yml
deleted file mode 100644
index 5a335578d0..0000000000
--- a/.azure-pipelines/templates/macos-build-and-unit-test.yml
+++ /dev/null
@@ -1,42 +0,0 @@
-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()
-
- - script: Scripts/Mac/CI/CreateBuildDrop.sh $(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()
diff --git a/.azure-pipelines/templates/macos-functional-test.yml b/.azure-pipelines/templates/macos-functional-test.yml
deleted file mode 100644
index 6c2da8f63c..0000000000
--- a/.azure-pipelines/templates/macos-functional-test.yml
+++ /dev/null
@@ -1,71 +0,0 @@
-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
-
- - bash: rm -rf $(Build.BinariesDirectory)/FunctionalTests_$(platformFriendlyName)_$(configuration)/BuildOutput/Git/*
- displayName: Clean previous Git installations
-
- - 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)/src/ProjFS.Mac/Scripts/*.sh
- chmod +x $(Build.BinariesDirectory)/FunctionalTests_$(platformFriendlyName)_$(configuration)/Publish/*
- chmod +x $(Build.BinariesDirectory)/FunctionalTests_$(platformFriendlyName)_$(configuration)/BuildOutput/ProjFS.Mac/Native/$(configuration)/prjfs-log
- 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/ProjFS.Mac/Scripts/LoadPrjFSKext.sh $(configuration)
- $BUILD_BINARIESDIRECTORY/FunctionalTests_$(platformFriendlyName)_$(configuration)/BuildOutput/ProjFS.Mac/Native/$(configuration)/prjfs-log > $BUILD_ARTIFACTSTAGINGDIRECTORY/kext.log 2>&1 &
- displayName: Enable kext logging
-
- - bash: $(Build.BinariesDirectory)/FunctionalTests_$(platformFriendlyName)_$(configuration)/src/Scripts/Mac/RunFunctionalTests.sh $(configuration)
- 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()
-
- - bash: $(Build.BinariesDirectory)/FunctionalTests_$(platformFriendlyName)_$(configuration)/src/Scripts/Mac/CleanupFunctionalTests.sh
- displayName: Cleanup
- condition: always()
-
- - task: PublishBuildArtifacts@1
- displayName: Publish kext logs
- inputs:
- pathtoPublish: $(Build.ArtifactStagingDirectory)/kext.log
- artifactName: kext.log
-
- - bash: sudo rm -rf $(Build.BinariesDirectory)/FunctionalTests_$(platformFriendlyName)_$(configuration)
- displayName: Cleanup phase 2
- condition: always()
-
diff --git a/GVFS.sln b/GVFS.sln
index 2cee10493b..b79f30d251 100644
--- a/GVFS.sln
+++ b/GVFS.sln
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.27428.2015
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30509.20
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DCE11095-DA5F-4878-B58D-2702765560F5}"
ProjectSection(SolutionItems) = preProject
@@ -58,8 +58,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GVFS.Service.Windows", "GVF
{24D161E9-D1F0-4299-BBD3-5D940BEDD535} = {24D161E9-D1F0-4299-BBD3-5D940BEDD535}
EndProjectSection
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GVFS.Service.Mac", "GVFS\GVFS.Service\GVFS.Service.Mac.csproj", "{03769A07-F216-456B-886B-E07CAF6C5E81}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GVFS.ReadObjectHook.Windows", "GVFS\GVFS.ReadObjectHook\GVFS.ReadObjectHook.Windows.vcxproj", "{5A6656D5-81C7-472C-9DC8-32D071CB2258}"
ProjectSection(ProjectDependencies) = postProject
{A4984251-840E-4622-AD0C-66DFCE2B2574} = {A4984251-840E-4622-AD0C-66DFCE2B2574}
@@ -92,23 +90,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GVFS.Installer.Windows", "G
{2F63B22B-EE26-4266-BF17-28A9146483A1} = {2F63B22B-EE26-4266-BF17-28A9146483A1}
EndProjectSection
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GVFS.Installer.Mac", "GVFS\GVFS.Installer.Mac\GVFS.Installer.Mac.csproj", "{25229A04-6554-49B1-A95A-3F3B76C5B0C8}"
- ProjectSection(ProjectDependencies) = postProject
- {03769A07-F216-456B-886B-E07CAF6C5E81} = {03769A07-F216-456B-886B-E07CAF6C5E81}
- {4CC2A90D-D240-4382-B4BF-5E175515E492} = {4CC2A90D-D240-4382-B4BF-5E175515E492}
- {28939122-7263-41E7-A7E2-CBFB01AD6A04} = {28939122-7263-41E7-A7E2-CBFB01AD6A04}
- {A4984251-840E-4622-AD0C-66DFCE2B2574} = {A4984251-840E-4622-AD0C-66DFCE2B2574}
- {F468B05A-95E5-46BC-8C67-B80A78527B7D} = {F468B05A-95E5-46BC-8C67-B80A78527B7D}
- {1DAC3DA6-3D21-4917-B9A8-D60C8712252A} = {1DAC3DA6-3D21-4917-B9A8-D60C8712252A}
- {FAC6EFC5-A890-4CB2-8C80-6358E358C637} = {FAC6EFC5-A890-4CB2-8C80-6358E358C637}
- {374BF1E5-0B2D-4D4A-BD5E-4212299DEF09} = {374BF1E5-0B2D-4D4A-BD5E-4212299DEF09}
- {35CA4DFB-1320-4055-B8F6-F12E0F252FF0} = {35CA4DFB-1320-4055-B8F6-F12E0F252FF0}
- {AECEC217-2499-403D-B0BB-2962B9BE5970} = {AECEC217-2499-403D-B0BB-2962B9BE5970}
- EndProjectSection
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GVFS.SignFiles", "GVFS\GVFS.SignFiles\GVFS.SignFiles.csproj", "{2F63B22B-EE26-4266-BF17-28A9146483A1}"
ProjectSection(ProjectDependencies) = postProject
{17498502-AEFF-4E70-90CC-1D0B56A8ADF5} = {17498502-AEFF-4E70-90CC-1D0B56A8ADF5}
+ {AECEC217-2499-403D-B0BB-2962B9BE5970} = {AECEC217-2499-403D-B0BB-2962B9BE5970}
{1118B427-7063-422F-83B9-5023C8EC5A7A} = {1118B427-7063-422F-83B9-5023C8EC5A7A}
{2D23AB54-541F-4ABC-8DCA-08C199E97ABB} = {2D23AB54-541F-4ABC-8DCA-08C199E97ABB}
{F468B05A-95E5-46BC-8C67-B80A78527B7D} = {F468B05A-95E5-46BC-8C67-B80A78527B7D}
@@ -121,7 +106,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GVFS.SignFiles", "GVFS\GVFS
{4CE404E7-D3FC-471C-993C-64615861EA63} = {4CE404E7-D3FC-471C-993C-64615861EA63}
{24D161E9-D1F0-4299-BBD3-5D940BEDD535} = {24D161E9-D1F0-4299-BBD3-5D940BEDD535}
{93B403FD-DAFB-46C5-9636-B122792A548A} = {93B403FD-DAFB-46C5-9636-B122792A548A}
- {AECEC217-2499-403D-B0BB-2962B9BE5970} = {AECEC217-2499-403D-B0BB-2962B9BE5970}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GVFS.VirtualFileSystemHook.Windows", "GVFS\GVFS.VirtualFileSystemHook\GVFS.VirtualFileSystemHook.Windows.vcxproj", "{2D23AB54-541F-4ABC-8DCA-08C199E97ABB}"
@@ -131,18 +115,15 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GVFS.VirtualFileSystemHook.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GVFS.Virtualization", "GVFS\GVFS.Virtualization\GVFS.Virtualization.csproj", "{F468B05A-95E5-46BC-8C67-B80A78527B7D}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PrjFSLib.Mac.Managed", "ProjFS.Mac\PrjFSLib.Mac.Managed\PrjFSLib.Mac.Managed.csproj", "{FAC6EFC5-A890-4CB2-8C80-6358E358C637}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GVFS.Platform.Mac", "GVFS\GVFS.Platform.Mac\GVFS.Platform.Mac.csproj", "{1DAC3DA6-3D21-4917-B9A8-D60C8712252A}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GVFS.Platform.POSIX", "GVFS\GVFS.Platform.POSIX\GVFS.Platform.POSIX.csproj", "{15FAE44C-0D21-4312-9FD3-28F05A5AB7A6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GVFS.UnitTests", "GVFS\GVFS.UnitTests\GVFS.UnitTests.csproj", "{0D434FA7-6D8C-481E-B0CE-779B59EAEF53}"
+ ProjectSection(ProjectDependencies) = postProject
+ {93B403FD-DAFB-46C5-9636-B122792A548A} = {93B403FD-DAFB-46C5-9636-B122792A548A}
+ EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GVFS.Platform.Windows", "GVFS\GVFS.Platform.Windows\GVFS.Platform.Windows.csproj", "{4CE404E7-D3FC-471C-993C-64615861EA63}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GVFS.Mac", "GVFS\GVFS\GVFS.Mac.csproj", "{28939122-7263-41E7-A7E2-CBFB01AD6A04}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GVFS.Windows", "GVFS\GVFS\GVFS.Windows.csproj", "{32220664-594C-4425-B9A0-88E0BE2F3D2A}"
ProjectSection(ProjectDependencies) = postProject
{2D23AB54-541F-4ABC-8DCA-08C199E97ABB} = {2D23AB54-541F-4ABC-8DCA-08C199E97ABB}
@@ -160,8 +141,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GVFS.Mount.Windows", "GVFS\
{24D161E9-D1F0-4299-BBD3-5D940BEDD535} = {24D161E9-D1F0-4299-BBD3-5D940BEDD535}
EndProjectSection
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GVFS.Mount.Mac", "GVFS\GVFS.Mount\GVFS.Mount.Mac.csproj", "{35CA4DFB-1320-4055-B8F6-F12E0F252FF0}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GVFS.FunctionalTests.Windows", "GVFS\GVFS.FunctionalTests.Windows\GVFS.FunctionalTests.Windows.csproj", "{0F0A008E-AB12-40EC-A671-37A541B08C7F}"
ProjectSection(ProjectDependencies) = postProject
{17498502-AEFF-4E70-90CC-1D0B56A8ADF5} = {17498502-AEFF-4E70-90CC-1D0B56A8ADF5}
@@ -176,22 +155,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GVFS.FunctionalTests", "GVF
ProjectSection(ProjectDependencies) = postProject
{17498502-AEFF-4E70-90CC-1D0B56A8ADF5} = {17498502-AEFF-4E70-90CC-1D0B56A8ADF5}
{07F2A520-2AB7-46DD-97C0-75D8E988D55B} = {07F2A520-2AB7-46DD-97C0-75D8E988D55B}
- {28939122-7263-41E7-A7E2-CBFB01AD6A04} = {28939122-7263-41E7-A7E2-CBFB01AD6A04}
{3771C555-B5C1-45E2-B8B7-2CEF1619CDC5} = {3771C555-B5C1-45E2-B8B7-2CEF1619CDC5}
{32220664-594C-4425-B9A0-88E0BE2F3D2A} = {32220664-594C-4425-B9A0-88E0BE2F3D2A}
{FA273F69-5762-43D8-AEA1-B4F08090D624} = {FA273F69-5762-43D8-AEA1-B4F08090D624}
{B8C1DFBA-CAFD-4F7E-A1A3-E11907B5467B} = {B8C1DFBA-CAFD-4F7E-A1A3-E11907B5467B}
{BDA91EE5-C684-4FC5-A90A-B7D677421917} = {BDA91EE5-C684-4FC5-A90A-B7D677421917}
- {35CA4DFB-1320-4055-B8F6-F12E0F252FF0} = {35CA4DFB-1320-4055-B8F6-F12E0F252FF0}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GVFS.FunctionalTests.LockHolder", "GVFS\GVFS.FunctionalTests.LockHolder\GVFS.FunctionalTests.LockHolder.csproj", "{FA273F69-5762-43D8-AEA1-B4F08090D624}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GVFS.Hooks.Mac", "GVFS\GVFS.Hooks\GVFS.Hooks.Mac.csproj", "{4CC2A90D-D240-4382-B4BF-5E175515E492}"
- ProjectSection(ProjectDependencies) = postProject
- {A4984251-840E-4622-AD0C-66DFCE2B2574} = {A4984251-840E-4622-AD0C-66DFCE2B2574}
- EndProjectSection
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GVFS.Upgrader", "GVFS\GVFS.Upgrader\GVFS.Upgrader.csproj", "{AECEC217-2499-403D-B0BB-2962B9BE5970}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GVFS.PostIndexChangedHook.Windows", "GVFS\GVFS.PostIndexChangedHook\GVFS.PostIndexChangedHook.Windows.vcxproj", "{24D161E9-D1F0-4299-BBD3-5D940BEDD535}"
@@ -261,14 +233,6 @@ Global
{B8C1DFBA-CAFD-4F7E-A1A3-E11907B5467B}.Release.Mac|x64.ActiveCfg = Release|x64
{B8C1DFBA-CAFD-4F7E-A1A3-E11907B5467B}.Release.Windows|x64.ActiveCfg = Release|x64
{B8C1DFBA-CAFD-4F7E-A1A3-E11907B5467B}.Release.Windows|x64.Build.0 = Release|x64
- {03769A07-F216-456B-886B-E07CAF6C5E81}.Debug.Mac|x64.ActiveCfg = Debug|x64
- {03769A07-F216-456B-886B-E07CAF6C5E81}.Debug.Mac|x64.Build.0 = Debug|x64
- {03769A07-F216-456B-886B-E07CAF6C5E81}.Debug.Windows|x64.ActiveCfg = Debug|x64
- {03769A07-F216-456B-886B-E07CAF6C5E81}.Debug.Windows|x64.Build.0 = Debug|x64
- {03769A07-F216-456B-886B-E07CAF6C5E81}.Release.Mac|x64.ActiveCfg = Release|x64
- {03769A07-F216-456B-886B-E07CAF6C5E81}.Release.Mac|x64.Build.0 = Release|x64
- {03769A07-F216-456B-886B-E07CAF6C5E81}.Release.Windows|x64.ActiveCfg = Release|x64
- {03769A07-F216-456B-886B-E07CAF6C5E81}.Release.Windows|x64.Build.0 = Release|x64
{5A6656D5-81C7-472C-9DC8-32D071CB2258}.Debug.Mac|x64.ActiveCfg = Debug|x64
{5A6656D5-81C7-472C-9DC8-32D071CB2258}.Debug.Windows|x64.ActiveCfg = Debug|x64
{5A6656D5-81C7-472C-9DC8-32D071CB2258}.Debug.Windows|x64.Build.0 = Debug|x64
@@ -305,12 +269,6 @@ Global
{3AB4FB1F-9E23-4CD8-BFAC-8A2221C8F893}.Release.Mac|x64.ActiveCfg = Release|x64
{3AB4FB1F-9E23-4CD8-BFAC-8A2221C8F893}.Release.Windows|x64.ActiveCfg = Release|x64
{3AB4FB1F-9E23-4CD8-BFAC-8A2221C8F893}.Release.Windows|x64.Build.0 = Release|x64
- {25229A04-6554-49B1-A95A-3F3B76C5B0C8}.Debug.Mac|x64.ActiveCfg = Debug|x64
- {25229A04-6554-49B1-A95A-3F3B76C5B0C8}.Debug.Mac|x64.Build.0 = Debug|x64
- {25229A04-6554-49B1-A95A-3F3B76C5B0C8}.Debug.Windows|x64.ActiveCfg = Debug|x64
- {25229A04-6554-49B1-A95A-3F3B76C5B0C8}.Release.Mac|x64.ActiveCfg = Release|x64
- {25229A04-6554-49B1-A95A-3F3B76C5B0C8}.Release.Mac|x64.Build.0 = Release|x64
- {25229A04-6554-49B1-A95A-3F3B76C5B0C8}.Release.Windows|x64.ActiveCfg = Release|x64
{2F63B22B-EE26-4266-BF17-28A9146483A1}.Debug.Mac|x64.ActiveCfg = Debug|x64
{2F63B22B-EE26-4266-BF17-28A9146483A1}.Debug.Windows|x64.ActiveCfg = Debug|x64
{2F63B22B-EE26-4266-BF17-28A9146483A1}.Debug.Windows|x64.Build.0 = Debug|x64
@@ -331,22 +289,6 @@ Global
{F468B05A-95E5-46BC-8C67-B80A78527B7D}.Release.Mac|x64.Build.0 = Release|x64
{F468B05A-95E5-46BC-8C67-B80A78527B7D}.Release.Windows|x64.ActiveCfg = Release|x64
{F468B05A-95E5-46BC-8C67-B80A78527B7D}.Release.Windows|x64.Build.0 = Release|x64
- {FAC6EFC5-A890-4CB2-8C80-6358E358C637}.Debug.Mac|x64.ActiveCfg = Debug|x64
- {FAC6EFC5-A890-4CB2-8C80-6358E358C637}.Debug.Mac|x64.Build.0 = Debug|x64
- {FAC6EFC5-A890-4CB2-8C80-6358E358C637}.Debug.Windows|x64.ActiveCfg = Debug|x64
- {FAC6EFC5-A890-4CB2-8C80-6358E358C637}.Debug.Windows|x64.Build.0 = Debug|x64
- {FAC6EFC5-A890-4CB2-8C80-6358E358C637}.Release.Mac|x64.ActiveCfg = Release|x64
- {FAC6EFC5-A890-4CB2-8C80-6358E358C637}.Release.Mac|x64.Build.0 = Release|x64
- {FAC6EFC5-A890-4CB2-8C80-6358E358C637}.Release.Windows|x64.ActiveCfg = Release|x64
- {FAC6EFC5-A890-4CB2-8C80-6358E358C637}.Release.Windows|x64.Build.0 = Release|x64
- {1DAC3DA6-3D21-4917-B9A8-D60C8712252A}.Debug.Mac|x64.ActiveCfg = Debug|x64
- {1DAC3DA6-3D21-4917-B9A8-D60C8712252A}.Debug.Mac|x64.Build.0 = Debug|x64
- {1DAC3DA6-3D21-4917-B9A8-D60C8712252A}.Debug.Windows|x64.ActiveCfg = Debug|x64
- {1DAC3DA6-3D21-4917-B9A8-D60C8712252A}.Debug.Windows|x64.Build.0 = Debug|x64
- {1DAC3DA6-3D21-4917-B9A8-D60C8712252A}.Release.Mac|x64.ActiveCfg = Release|x64
- {1DAC3DA6-3D21-4917-B9A8-D60C8712252A}.Release.Mac|x64.Build.0 = Release|x64
- {1DAC3DA6-3D21-4917-B9A8-D60C8712252A}.Release.Windows|x64.ActiveCfg = Release|x64
- {1DAC3DA6-3D21-4917-B9A8-D60C8712252A}.Release.Windows|x64.Build.0 = Release|x64
{15FAE44C-0D21-4312-9FD3-28F05A5AB7A6}.Debug.Mac|x64.ActiveCfg = Debug|x64
{15FAE44C-0D21-4312-9FD3-28F05A5AB7A6}.Debug.Mac|x64.Build.0 = Debug|x64
{15FAE44C-0D21-4312-9FD3-28F05A5AB7A6}.Debug.Windows|x64.ActiveCfg = Debug|x64
@@ -369,14 +311,6 @@ Global
{4CE404E7-D3FC-471C-993C-64615861EA63}.Release.Mac|x64.ActiveCfg = Release|x64
{4CE404E7-D3FC-471C-993C-64615861EA63}.Release.Windows|x64.ActiveCfg = Release|x64
{4CE404E7-D3FC-471C-993C-64615861EA63}.Release.Windows|x64.Build.0 = Release|x64
- {28939122-7263-41E7-A7E2-CBFB01AD6A04}.Debug.Mac|x64.ActiveCfg = Debug|x64
- {28939122-7263-41E7-A7E2-CBFB01AD6A04}.Debug.Mac|x64.Build.0 = Debug|x64
- {28939122-7263-41E7-A7E2-CBFB01AD6A04}.Debug.Windows|x64.ActiveCfg = Debug|x64
- {28939122-7263-41E7-A7E2-CBFB01AD6A04}.Debug.Windows|x64.Build.0 = Debug|x64
- {28939122-7263-41E7-A7E2-CBFB01AD6A04}.Release.Mac|x64.ActiveCfg = Release|x64
- {28939122-7263-41E7-A7E2-CBFB01AD6A04}.Release.Mac|x64.Build.0 = Release|x64
- {28939122-7263-41E7-A7E2-CBFB01AD6A04}.Release.Windows|x64.ActiveCfg = Release|x64
- {28939122-7263-41E7-A7E2-CBFB01AD6A04}.Release.Windows|x64.Build.0 = Release|x64
{32220664-594C-4425-B9A0-88E0BE2F3D2A}.Debug.Mac|x64.ActiveCfg = Debug|x64
{32220664-594C-4425-B9A0-88E0BE2F3D2A}.Debug.Windows|x64.ActiveCfg = Debug|x64
{32220664-594C-4425-B9A0-88E0BE2F3D2A}.Debug.Windows|x64.Build.0 = Debug|x64
@@ -389,14 +323,6 @@ Global
{17498502-AEFF-4E70-90CC-1D0B56A8ADF5}.Release.Mac|x64.ActiveCfg = Release|x64
{17498502-AEFF-4E70-90CC-1D0B56A8ADF5}.Release.Windows|x64.ActiveCfg = Release|x64
{17498502-AEFF-4E70-90CC-1D0B56A8ADF5}.Release.Windows|x64.Build.0 = Release|x64
- {35CA4DFB-1320-4055-B8F6-F12E0F252FF0}.Debug.Mac|x64.ActiveCfg = Debug|x64
- {35CA4DFB-1320-4055-B8F6-F12E0F252FF0}.Debug.Mac|x64.Build.0 = Debug|x64
- {35CA4DFB-1320-4055-B8F6-F12E0F252FF0}.Debug.Windows|x64.ActiveCfg = Debug|x64
- {35CA4DFB-1320-4055-B8F6-F12E0F252FF0}.Debug.Windows|x64.Build.0 = Debug|x64
- {35CA4DFB-1320-4055-B8F6-F12E0F252FF0}.Release.Mac|x64.ActiveCfg = Release|x64
- {35CA4DFB-1320-4055-B8F6-F12E0F252FF0}.Release.Mac|x64.Build.0 = Release|x64
- {35CA4DFB-1320-4055-B8F6-F12E0F252FF0}.Release.Windows|x64.ActiveCfg = Release|x64
- {35CA4DFB-1320-4055-B8F6-F12E0F252FF0}.Release.Windows|x64.Build.0 = Release|x64
{0F0A008E-AB12-40EC-A671-37A541B08C7F}.Debug.Mac|x64.ActiveCfg = Debug|x64
{0F0A008E-AB12-40EC-A671-37A541B08C7F}.Debug.Windows|x64.ActiveCfg = Debug|x64
{0F0A008E-AB12-40EC-A671-37A541B08C7F}.Debug.Windows|x64.Build.0 = Debug|x64
@@ -419,22 +345,14 @@ Global
{FA273F69-5762-43D8-AEA1-B4F08090D624}.Release.Mac|x64.Build.0 = Release|x64
{FA273F69-5762-43D8-AEA1-B4F08090D624}.Release.Windows|x64.ActiveCfg = Release|x64
{FA273F69-5762-43D8-AEA1-B4F08090D624}.Release.Windows|x64.Build.0 = Release|x64
- {4CC2A90D-D240-4382-B4BF-5E175515E492}.Debug.Mac|x64.ActiveCfg = Debug|x64
- {4CC2A90D-D240-4382-B4BF-5E175515E492}.Debug.Mac|x64.Build.0 = Debug|x64
- {4CC2A90D-D240-4382-B4BF-5E175515E492}.Debug.Windows|x64.ActiveCfg = Debug|x64
- {4CC2A90D-D240-4382-B4BF-5E175515E492}.Debug.Windows|x64.Build.0 = Debug|x64
- {4CC2A90D-D240-4382-B4BF-5E175515E492}.Release.Mac|x64.ActiveCfg = Release|x64
- {4CC2A90D-D240-4382-B4BF-5E175515E492}.Release.Mac|x64.Build.0 = Release|x64
- {4CC2A90D-D240-4382-B4BF-5E175515E492}.Release.Windows|x64.ActiveCfg = Release|x64
- {4CC2A90D-D240-4382-B4BF-5E175515E492}.Release.Windows|x64.Build.0 = Release|x64
{AECEC217-2499-403D-B0BB-2962B9BE5970}.Debug.Mac|x64.ActiveCfg = Debug|x64
+ {AECEC217-2499-403D-B0BB-2962B9BE5970}.Debug.Mac|x64.Build.0 = Debug|x64
{AECEC217-2499-403D-B0BB-2962B9BE5970}.Debug.Windows|x64.ActiveCfg = Debug|x64
{AECEC217-2499-403D-B0BB-2962B9BE5970}.Debug.Windows|x64.Build.0 = Debug|x64
{AECEC217-2499-403D-B0BB-2962B9BE5970}.Release.Mac|x64.ActiveCfg = Release|x64
+ {AECEC217-2499-403D-B0BB-2962B9BE5970}.Release.Mac|x64.Build.0 = Release|x64
{AECEC217-2499-403D-B0BB-2962B9BE5970}.Release.Windows|x64.ActiveCfg = Release|x64
{AECEC217-2499-403D-B0BB-2962B9BE5970}.Release.Windows|x64.Build.0 = Release|x64
- {AECEC217-2499-403D-B0BB-2962B9BE5970}.Debug.Mac|x64.Build.0 = Debug|x64
- {AECEC217-2499-403D-B0BB-2962B9BE5970}.Release.Mac|x64.Build.0 = Release|x64
{24D161E9-D1F0-4299-BBD3-5D940BEDD535}.Debug.Mac|x64.ActiveCfg = Debug|x64
{24D161E9-D1F0-4299-BBD3-5D940BEDD535}.Debug.Windows|x64.ActiveCfg = Debug|x64
{24D161E9-D1F0-4299-BBD3-5D940BEDD535}.Debug.Windows|x64.Build.0 = Debug|x64
@@ -454,30 +372,23 @@ Global
{3771C555-B5C1-45E2-B8B7-2CEF1619CDC5} = {C41F10F9-1163-4CFA-A465-EA728F75E9FA}
{BDA91EE5-C684-4FC5-A90A-B7D677421917} = {2EF2EC94-3A68-4ED7-9A58-B7057ADBA01C}
{B8C1DFBA-CAFD-4F7E-A1A3-E11907B5467B} = {2EF2EC94-3A68-4ED7-9A58-B7057ADBA01C}
- {03769A07-F216-456B-886B-E07CAF6C5E81} = {2EF2EC94-3A68-4ED7-9A58-B7057ADBA01C}
{5A6656D5-81C7-472C-9DC8-32D071CB2258} = {2EF2EC94-3A68-4ED7-9A58-B7057ADBA01C}
{28674A4B-1223-4633-A460-C8CC39B09318} = {DCE11095-DA5F-4878-B58D-2702765560F5}
{C5D3CA26-562F-4CA4-A378-B93E97A730E3} = {C41F10F9-1163-4CFA-A465-EA728F75E9FA}
{93B403FD-DAFB-46C5-9636-B122792A548A} = {2EF2EC94-3A68-4ED7-9A58-B7057ADBA01C}
{A4984251-840E-4622-AD0C-66DFCE2B2574} = {AB0D9230-3893-4486-8899-F9C871FB5D5F}
{3AB4FB1F-9E23-4CD8-BFAC-8A2221C8F893} = {2EF2EC94-3A68-4ED7-9A58-B7057ADBA01C}
- {25229A04-6554-49B1-A95A-3F3B76C5B0C8} = {2EF2EC94-3A68-4ED7-9A58-B7057ADBA01C}
{2F63B22B-EE26-4266-BF17-28A9146483A1} = {2EF2EC94-3A68-4ED7-9A58-B7057ADBA01C}
{2D23AB54-541F-4ABC-8DCA-08C199E97ABB} = {2EF2EC94-3A68-4ED7-9A58-B7057ADBA01C}
{F468B05A-95E5-46BC-8C67-B80A78527B7D} = {2EF2EC94-3A68-4ED7-9A58-B7057ADBA01C}
- {FAC6EFC5-A890-4CB2-8C80-6358E358C637} = {2EF2EC94-3A68-4ED7-9A58-B7057ADBA01C}
- {1DAC3DA6-3D21-4917-B9A8-D60C8712252A} = {2EF2EC94-3A68-4ED7-9A58-B7057ADBA01C}
{15FAE44C-0D21-4312-9FD3-28F05A5AB7A6} = {2EF2EC94-3A68-4ED7-9A58-B7057ADBA01C}
{0D434FA7-6D8C-481E-B0CE-779B59EAEF53} = {C41F10F9-1163-4CFA-A465-EA728F75E9FA}
{4CE404E7-D3FC-471C-993C-64615861EA63} = {2EF2EC94-3A68-4ED7-9A58-B7057ADBA01C}
- {28939122-7263-41E7-A7E2-CBFB01AD6A04} = {2EF2EC94-3A68-4ED7-9A58-B7057ADBA01C}
{32220664-594C-4425-B9A0-88E0BE2F3D2A} = {2EF2EC94-3A68-4ED7-9A58-B7057ADBA01C}
{17498502-AEFF-4E70-90CC-1D0B56A8ADF5} = {2EF2EC94-3A68-4ED7-9A58-B7057ADBA01C}
- {35CA4DFB-1320-4055-B8F6-F12E0F252FF0} = {2EF2EC94-3A68-4ED7-9A58-B7057ADBA01C}
{0F0A008E-AB12-40EC-A671-37A541B08C7F} = {C41F10F9-1163-4CFA-A465-EA728F75E9FA}
{BD7C5776-82F2-40C6-AF01-B3CC1E2D83AF} = {C41F10F9-1163-4CFA-A465-EA728F75E9FA}
{FA273F69-5762-43D8-AEA1-B4F08090D624} = {C41F10F9-1163-4CFA-A465-EA728F75E9FA}
- {4CC2A90D-D240-4382-B4BF-5E175515E492} = {2EF2EC94-3A68-4ED7-9A58-B7057ADBA01C}
{AECEC217-2499-403D-B0BB-2962B9BE5970} = {2EF2EC94-3A68-4ED7-9A58-B7057ADBA01C}
{24D161E9-D1F0-4299-BBD3-5D940BEDD535} = {2EF2EC94-3A68-4ED7-9A58-B7057ADBA01C}
EndGlobalSection
diff --git a/GVFS/GVFS.FunctionalTests.LockHolder/AcquireGVFSLock.cs b/GVFS/GVFS.FunctionalTests.LockHolder/AcquireGVFSLock.cs
index a1e47f35d5..2a64fdeadc 100644
--- a/GVFS/GVFS.FunctionalTests.LockHolder/AcquireGVFSLock.cs
+++ b/GVFS/GVFS.FunctionalTests.LockHolder/AcquireGVFSLock.cs
@@ -1,7 +1,6 @@
using CommandLine;
using GVFS.Common;
using GVFS.Common.NamedPipes;
-using GVFS.Platform.Mac;
using GVFS.Platform.Windows;
using System;
using System.Diagnostics;
@@ -43,11 +42,6 @@ public void Execute()
private static bool TryGetGVFSEnlistmentRootImplementation(string directory, out string enlistmentRoot, out string errorMessage)
{
- if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
- {
- return MacPlatform.TryGetGVFSEnlistmentRootImplementation(directory, out enlistmentRoot, out errorMessage);
- }
-
// Not able to use WindowsPlatform here - because of its dependency on WindowsIdentity (and also kernel32.dll).
enlistmentRoot = null;
@@ -70,11 +64,6 @@ private static bool TryGetGVFSEnlistmentRootImplementation(string directory, out
private static string GetNamedPipeNameImplementation(string enlistmentRoot)
{
- if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
- {
- return MacPlatform.GetNamedPipeNameImplementation(enlistmentRoot);
- }
-
// Not able to use WindowsPlatform here - because of its dependency on WindowsIdentity (and also kernel32.dll).
return "GVFS_" + enlistmentRoot.ToUpper().Replace(':', '_');
}
diff --git a/GVFS/GVFS.FunctionalTests.LockHolder/GVFS.FunctionalTests.LockHolder.csproj b/GVFS/GVFS.FunctionalTests.LockHolder/GVFS.FunctionalTests.LockHolder.csproj
index 82a673437f..837fd98698 100644
--- a/GVFS/GVFS.FunctionalTests.LockHolder/GVFS.FunctionalTests.LockHolder.csproj
+++ b/GVFS/GVFS.FunctionalTests.LockHolder/GVFS.FunctionalTests.LockHolder.csproj
@@ -25,7 +25,6 @@
-
diff --git a/GVFS/GVFS.Hooks/GVFS.Hooks.Mac.csproj b/GVFS/GVFS.Hooks/GVFS.Hooks.Mac.csproj
deleted file mode 100644
index 9cf4b76519..0000000000
--- a/GVFS/GVFS.Hooks/GVFS.Hooks.Mac.csproj
+++ /dev/null
@@ -1,112 +0,0 @@
-
-
-
- Exe
- GVFS.Hooks
- netcoreapp2.1
- x64
- osx-x64
- false
-
-
-
- GVFS.Hooks
- GVFS.Hooks
-
-
- $(GVFSVersion)
-
-
- $(GVFSVersion)
-
-
-
-
-
-
-
-
- Common\ConsoleHelper.cs
-
-
- Common\Git\GitConfigHelper.cs
-
-
- Common\Git\GitConfigSetting.cs
-
-
- Common\Git\GitVersion.cs
-
-
- Common\GVFSConstants.cs
-
-
- Common\GVFSEnlistment.Shared.cs
-
-
- Common\GVFSLock.Shared.cs
-
-
- Common\NamedPipes\BrokenPipeException.cs
-
-
- Common\NamedPipes\LockNamedPipeMessages.cs
-
-
- Common\NamedPipes\NamedPipeClient.cs
-
-
- Common\NamedPipes\NamedPipeStreamReader.cs
-
-
- Common\NamedPipes\NamedPipeStreamWriter.cs
-
-
- Common\NativeMethods.Shared.cs
-
-
- Common\Paths.Shared.cs
-
-
- Common\ProcessHelper.cs
-
-
- Common\ProcessResult.cs
-
-
-
- Common\Tracing\EventLevel.cs
-
-
- Common\Tracing\EventMetadata.cs
-
-
- Common\Tracing\EventOpcode.cs
-
-
- Common\Tracing\ITracer.cs
-
-
- Common\Tracing\Keywords.cs
-
-
- POSIX\POSIXFileSystem.Shared.cs
-
-
- POSIX\POSIXPlatform.Shared.cs
-
-
- Mac\MacPlatform.Shared.cs
-
-
-
-
-
- all
-
-
-
diff --git a/GVFS/GVFS.Installer.Mac/CreateMacInstaller.sh b/GVFS/GVFS.Installer.Mac/CreateMacInstaller.sh
deleted file mode 100755
index 50bb22e42b..0000000000
--- a/GVFS/GVFS.Installer.Mac/CreateMacInstaller.sh
+++ /dev/null
@@ -1,223 +0,0 @@
-#!/bin/bash
-
-SOURCEDIRECTORY=$1
-if [ -z $SOURCEDIRECTORY ]; then
- echo "Error: Source directory not specified"
- exit 1
-fi
-
-CONFIGURATION=$2
-if [ -z $CONFIGURATION ]; then
- echo "Error: Build configuration not specified"
- exit 1
-fi
-
-PACKAGEVERSION=$3
-if [ -z $PACKAGEVERSION ]; then
- echo "Error: Installer package version not specified"
- exit 1
-fi
-
-BUILDOUTPUTDIR=${4%/}
-if [ -z $BUILDOUTPUTDIR ]; then
- echo "Error: Build output directory not specified"
- exit 1
-fi
-
-if [ -z $VFS_OUTPUTDIR ]; then
- echo "Error: Missing environment variable. VFS_OUTPUTDIR is not set"
- exit 1
-fi
-
-if [ -z $VFS_PUBLISHDIR ]; then
- echo "Error: Missing environment variable. VFS_PUBLISHDIR is not set"
- exit 1
-fi
-
-STAGINGDIR="${BUILDOUTPUTDIR}/Staging"
-PACKAGESTAGINGDIR="${BUILDOUTPUTDIR}/Packages"
-VFSFORGITDESTINATION="usr/local/vfsforgit"
-DAEMONPLISTDESTINATION="Library/LaunchDaemons"
-AGENTPLISTDESTINATION="Library/LaunchAgents"
-LIBRARYEXTENSIONSDESTINATION="Library/Extensions"
-LIBRARYAPPSUPPORTDESTINATION="Library/Application Support/VFS For Git"
-INSTALLERPACKAGENAME="VFSForGit.$PACKAGEVERSION"
-INSTALLERPACKAGEID="com.vfsforgit.pkg"
-UNINSTALLERPATH="${SOURCEDIRECTORY}/uninstall_vfsforgit.sh"
-SCRIPTSPATH="${SOURCEDIRECTORY}/scripts"
-COMPONENTSPLISTPATH="${SOURCEDIRECTORY}/vfsforgit_components.plist"
-DIST_FILE_NAME="Distribution.updated.xml"
-
-function CheckBuildIsAvailable()
-{
- if [ ! -d "$VFS_OUTPUTDIR" ] || [ ! -d "$VFS_PUBLISHDIR" ]; then
- echo "Error: Could not find VFSForGit Build to package."
- exit 1
- fi
-}
-
-function SetPermissions()
-{
- chmodCommand="chmod -R 755 \"${STAGINGDIR}\""
- eval $chmodCommand || exit 1
-}
-
-function CreateInstallerRoot()
-{
- mkdirVfsForGit="mkdir -p \"${STAGINGDIR}/$VFSFORGITDESTINATION\""
- eval $mkdirVfsForGit || exit 1
-
- mkdirPkgStaging="mkdir -p \"${PACKAGESTAGINGDIR}\""
- eval $mkdirPkgStaging || exit 1
-
- mkdirBin="mkdir -p \"${STAGINGDIR}/usr/local/bin\""
- eval $mkdirBin || exit 1
-
- mkdirBin="mkdir -p \"${STAGINGDIR}/$LIBRARYEXTENSIONSDESTINATION\""
- eval $mkdirBin || exit 1
-
- mkdirBin="mkdir -p \"${STAGINGDIR}/$LIBRARYAPPSUPPORTDESTINATION\""
- eval $mkdirBin || exit 1
-
- mkdirBin="mkdir -p \"${STAGINGDIR}/$DAEMONPLISTDESTINATION\""
- eval $mkdirBin || exit 1
-
- mkdirBin="mkdir -p \"${STAGINGDIR}/$AGENTPLISTDESTINATION\""
- eval $mkdirBin || exit 1
-}
-
-function CopyBinariesToInstall()
-{
- copyPublishDirectory="cp -Rf \"${VFS_PUBLISHDIR}\"/* \"${STAGINGDIR}/${VFSFORGITDESTINATION}/.\""
- eval $copyPublishDirectory || exit 1
-
- removeTestAssemblies="find \"${STAGINGDIR}/${VFSFORGITDESTINATION}\" -name \"*GVFS.*Tests*\" -exec rm -f \"{}\" \";\""
- eval $removeTestAssemblies || exit 1
-
- removeDataDirectory="rm -Rf \"${STAGINGDIR}/${VFSFORGITDESTINATION}/Data\""
- eval $removeDataDirectory || exit 1
-
- copyPrjFS="cp -Rf \"${VFS_OUTPUTDIR}/ProjFS.Mac/Native/$CONFIGURATION\"/*.dylib \"${STAGINGDIR}/${VFSFORGITDESTINATION}/.\""
- eval $copyPrjFS || exit 1
-
- copyPrjFS="cp -Rf \"${VFS_OUTPUTDIR}/ProjFS.Mac/Native/$CONFIGURATION\"/prjfs-log \"${STAGINGDIR}/${VFSFORGITDESTINATION}/.\""
- eval $copyPrjFS || exit 1
-
- copyPrjFS="cp -Rf \"${VFS_OUTPUTDIR}/ProjFS.Mac/Native/$CONFIGURATION\"/PrjFSKextLogDaemon \"${STAGINGDIR}/${VFSFORGITDESTINATION}/.\""
- eval $copyPrjFS || exit 1
-
- copyUnInstaller="cp -f \"${UNINSTALLERPATH}\" \"${STAGINGDIR}/${VFSFORGITDESTINATION}/.\""
- eval $copyUnInstaller || exit 1
-
- copyPrjFS="cp -Rf \"${VFS_OUTPUTDIR}/ProjFS.Mac/Native/$CONFIGURATION\"/PrjFSKext.kext \"${STAGINGDIR}/${LIBRARYEXTENSIONSDESTINATION}/.\""
- eval $copyPrjFS || exit 1
-
- copyPrjFS="cp -Rf \"${VFS_OUTPUTDIR}/ProjFS.Mac/Native/$CONFIGURATION/org.vfsforgit.prjfs.PrjFSKextLogDaemon.plist\" \"${STAGINGDIR}/${DAEMONPLISTDESTINATION}/.\""
- eval $copyPrjFS || exit 1
-
- copyNotificationApp="cp -Rf \"${VFS_OUTPUTDIR}/GVFS.Notifications/VFSForGit.Mac/Build/Products/$CONFIGURATION/VFS For Git.app\" \"${STAGINGDIR}/${LIBRARYAPPSUPPORTDESTINATION}/.\""
- eval $copyNotificationApp || exit 1
-
- copyNotificationPlist="cp -Rf \"${SOURCEDIRECTORY}/../GVFS.Notifications/VFSForGit.Mac/org.vfsforgit.usernotification.plist\" \"${STAGINGDIR}/${AGENTPLISTDESTINATION}/.\""
- eval $copyNotificationPlist || exit 1
-
- copyServicePlist="cp -Rf \"${SOURCEDIRECTORY}/../GVFS.Service/Mac/org.vfsforgit.service.plist\" \"${STAGINGDIR}/${AGENTPLISTDESTINATION}/.\""
- eval $copyServicePlist || exit 1
-
- currentDirectory=`pwd`
- cd "${STAGINGDIR}/usr/local/bin"
- linkCommand="ln -sf ../vfsforgit/gvfs gvfs"
- eval $linkCommand
- cd $currentDirectory
-}
-
-function CreateVFSForGitInstaller()
-{
- pkgBuildCommand="/usr/bin/pkgbuild --identifier $INSTALLERPACKAGEID --component-plist \"${COMPONENTSPLISTPATH}\" --scripts \"${SCRIPTSPATH}\" --root \"${STAGINGDIR}\" \"${PACKAGESTAGINGDIR}/$INSTALLERPACKAGENAME.pkg\""
- eval $pkgBuildCommand || exit 1
-}
-
-function UpdateDistributionFile()
-{
- VFSFORGIT_PKG_VERSION=$PACKAGEVERSION
- VFSFORGIT_PKG_NAME="$INSTALLERPACKAGENAME.pkg"
- GIT_PKG_NAME=$1
- GIT_PKG_VERSION=$2
-
- /usr/bin/sed -e "s|VFSFORGIT_VERSION_PLACHOLDER|$VFSFORGIT_PKG_VERSION|g" "$SCRIPTSPATH/Distribution.xml" > "${BUILDOUTPUTDIR}/$DIST_FILE_NAME"
- /usr/bin/sed -i.bak "s|VFSFORGIT_PKG_NAME_PLACEHOLDER|$VFSFORGIT_PKG_NAME|g" "${BUILDOUTPUTDIR}/$DIST_FILE_NAME"
-
- if [ ! -z "$GIT_PKG_NAME" ] && [ ! -z "$GIT_PKG_VERSION" ]; then
- GIT_CHOICE_OUTLINE_ELEMENT_TEXT=""
- GIT_CHOICE_ID_ELEMENT_TEXT=" "
- GIT_PKG_REF_ELEMENT_TEXT="$GIT_PKG_NAME"
- else
- GIT_CHOICE_OUTLINE_ELEMENT_TEXT=""
- GIT_CHOICE_ID_ELEMENT_TEXT=""
- GIT_PKG_REF_ELEMENT_TEXT=""
- fi
-
- /usr/bin/sed -i.bak "s|GIT_CHOICE_OUTLINE_PLACEHOLDER|$GIT_CHOICE_OUTLINE_ELEMENT_TEXT|g" "${BUILDOUTPUTDIR}/$DIST_FILE_NAME"
- /usr/bin/sed -i.bak "s|GIT_CHOICE_ID_PLACEHOLDER|$GIT_CHOICE_ID_ELEMENT_TEXT|g" "${BUILDOUTPUTDIR}/$DIST_FILE_NAME"
- /usr/bin/sed -i.bak "s|GIT_PKG_REF_PLACEHOLDER|$GIT_PKG_REF_ELEMENT_TEXT|g" "${BUILDOUTPUTDIR}/$DIST_FILE_NAME"
-
- /bin/rm -f "${BUILDOUTPUTDIR}/$DIST_FILE_NAME.bak"
-}
-
-function CreateVFSForGitDistribution()
-{
- # Update distribution file(removes Git info from template.)
- UpdateDistributionFile "" ""
-
- buildVFSForGitDistCmd="/usr/bin/productbuild --distribution \"${BUILDOUTPUTDIR}/Distribution.updated.xml\" --package-path \"$PACKAGESTAGINGDIR\" \"${BUILDOUTPUTDIR}/$INSTALLERPACKAGENAME.pkg\""
- echo $buildVFSForGitDistCmd
- eval $buildVFSForGitDistCmd || exit 1
-
- /bin/rm -f "${BUILDOUTPUTDIR}/$DIST_FILE_NAME"
-}
-
-function CreateMetaDistribution()
-{
- GITVERSION="$($VFS_SCRIPTDIR/GetGitVersionNumber.sh)"
- GITINSTALLERPKGPATH="$(find $VFS_PACKAGESDIR/gitformac.gvfs.installer/$GITVERSION -type f -name *.pkg)" || exit 1
-
- GITPKGNAME="${GITINSTALLERPKGPATH##*/}"
- GITINSTALLERPKGNAME="${GITPKGNAME%.pkg}"
- GITVERSIONSTRING=`echo $GITINSTALLERPKGNAME | cut -d"-" -f2`
-
- if [[ -z "$GITVERSION" || -z "$GITVERSIONSTRING" ]]; then
- echo "Error creating metapackage: could not determine Git package version."
- exit 1
- fi
-
- if [ ! -f "$GITINSTALLERPKGPATH" ]; then
- echo "Error creating metapackage: could not find Git installer package."
- exit 1
- fi
-
- copyGitInstallerPkgToStgCmd="/bin/cp -Rf \"${GITINSTALLERPKGPATH}\" \"${PACKAGESTAGINGDIR}/.\""
- echo $copyGitInstallerPkgToStgCmd
- eval $copyGitInstallerPkgToStgCmd || exit 1
-
- UpdateDistributionFile "$GITPKGNAME" "$GITVERSIONSTRING"
-
- METAPACKAGENAME="$INSTALLERPACKAGENAME-Git.$GITVERSION.pkg"
- buildMetapkgCmd="/usr/bin/productbuild --distribution \"${BUILDOUTPUTDIR}/Distribution.updated.xml\" --package-path \"$PACKAGESTAGINGDIR\" \"${BUILDOUTPUTDIR}/$METAPACKAGENAME\""
- echo $buildMetapkgCmd
- eval $buildMetapkgCmd || exit 1
-
- /bin/rm -f "${BUILDOUTPUTDIR}/$DIST_FILE_NAME"
-}
-
-function Run()
-{
- CheckBuildIsAvailable
- CreateInstallerRoot
- CopyBinariesToInstall
- SetPermissions
- CreateVFSForGitInstaller
- CreateVFSForGitDistribution
- CreateMetaDistribution
-}
-
-Run
diff --git a/GVFS/GVFS.Installer.Mac/GVFS.Installer.Mac.csproj b/GVFS/GVFS.Installer.Mac/GVFS.Installer.Mac.csproj
deleted file mode 100644
index 5c05fceb38..0000000000
--- a/GVFS/GVFS.Installer.Mac/GVFS.Installer.Mac.csproj
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
- GVFS.Installer.Mac
- GVFS.Installer.Mac
- netcoreapp2.1
- x64
- osx-x64
-
-
-
- $(GVFSVersion)
-
-
-
- $(GVFSVersion)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/GVFS/GVFS.Installer.Mac/scripts/Distribution.xml b/GVFS/GVFS.Installer.Mac/scripts/Distribution.xml
deleted file mode 100644
index 26853166d5..0000000000
--- a/GVFS/GVFS.Installer.Mac/scripts/Distribution.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
- VFS For Git
-
-
-
-
-
-
- GIT_CHOICE_OUTLINE_PLACEHOLDER
-
-
-
-
-
-
- VFSFORGIT_PKG_NAME_PLACEHOLDER
- GIT_CHOICE_ID_PLACEHOLDER
- GIT_PKG_REF_PLACEHOLDER
-
-
-
diff --git a/GVFS/GVFS.Installer.Mac/scripts/postinstall b/GVFS/GVFS.Installer.Mac/scripts/postinstall
deleted file mode 100755
index 6b10d368a3..0000000000
--- a/GVFS/GVFS.Installer.Mac/scripts/postinstall
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/bash
-
-function startOrRestartService()
-{
- domain=$1
- service=$2
- if [[ $domain == system* ]]; then
- plistPath="/Library/LaunchDaemons"
- elif [[ $domain == gui/* ]]; then
- plistPath="/Library/LaunchAgents"
- fi
- startCmd="/bin/launchctl bootstrap $domain $plistPath/$service.plist"
- restartCmd="/bin/launchctl kickstart -k $domain/$service"
- isLoaded=`/bin/launchctl print $domain/$service | wc -l`
- if [ $isLoaded -gt "0" ]; then
- echo "Restarting Service: '$restartCmd'"
- eval $restartCmd || exit 1
- else
- echo "Starting Service: '$startCmd'"
- eval $startCmd || exit 1
- fi
-}
-
-# Load PrjFSKext if it is not loaded already
-# PrjFSKext is an IOKit kext and should get automatically loaded
-# by macOS after install. But the system does not seem to auto-load it
-# consistently after every install. The code below checks if it has
-# been auto-loaded. If not, it will attempt to load it.
-# The BundleID of the Kext(ProjFS.Mac/PrjFS.xcodeproj) is defined in
-# ProjFS.Mac/PrjFS.xcodeproj project.
-KEXTBUNDLEID="org.vfsforgit.PrjFSKext"
-KEXTPATH="/Library/Extensions/PrjFSKext.kext"
-kextstatCmd="/usr/sbin/kextstat -l -b $KEXTBUNDLEID"
-kextstatOutput=$(eval $kextstatCmd)
-if [[ -z "${kextstatOutput// }" ]]; then
-# load the kext using kextload command. Installer is run as the
-# admin user, so we already have required privileges. In case load
-# still fails, then exit 1. This will cause the installer to display
-# an installation failed error message.
- loadCmd="/sbin/kextload \"$KEXTPATH\""
- echo $loadCmd
- eval $loadCmd || exit 1
-else
- echo "$kextstatCmd returned non-zero output. This might possibly indicate an error."
- echo "$kextstatOutput"
-fi
-
-startOrRestartService "system" "org.vfsforgit.prjfs.PrjFSKextLogDaemon"
-
-# Load Launch Agents in all active User sessions
-# There will be one loginwindow instance for each logged in user,
-# get its uid (this will correspond to the logged in user's id.)
-# Then use launchctl bootstrap gui/uid to auto load the Service
-# for each user.
-declare -a launchAgents=(
- "org.vfsforgit.usernotification"
- "org.vfsforgit.service"
-)
-for uid in $(ps -Ac -o uid,command | grep -iw "Finder" | awk '{print $1}'); do
- for nextLaunchAgent in "${launchAgents[@]}"; do
- startOrRestartService "gui/$uid" $nextLaunchAgent
- done
-done
diff --git a/GVFS/GVFS.Installer.Mac/scripts/preinstall b/GVFS/GVFS.Installer.Mac/scripts/preinstall
deleted file mode 100755
index 14495d22e1..0000000000
--- a/GVFS/GVFS.Installer.Mac/scripts/preinstall
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-
-# Unmount all registered repositories before unloading
-# the Kext.
-GVFSBINPATH="/usr/local/vfsforgit/gvfs"
-if [ -f "${GVFSBINPATH}" ]; then
- unmountCmd="${GVFSBINPATH} service --unmount-all"
- echo $unmountCmd
- eval $unmountCmd || exit 1
-fi
-
-KEXTBUNDLEID="org.vfsforgit.PrjFSKext"
-isKextLoadedCmd="/usr/sbin/kextstat -l -b $KEXTBUNDLEID | wc -l"
-isKextLoaded=$(eval $isKextLoadedCmd)
-if [ "$isKextLoaded" -gt 0 ]; then
- unloadCmd="/sbin/kextunload -b $KEXTBUNDLEID"
- echo $unloadCmd
- eval $unloadCmd || exit 1
-fi
-
-LEGACYKEXTBUNDLEID="io.gvfs.PrjFSKext"
-isKextLoadedCmd="/usr/sbin/kextstat -l -b $LEGACYKEXTBUNDLEID | wc -l"
-isKextLoaded=$(eval $isKextLoadedCmd)
-if [ "$isKextLoaded" -gt 0 ]; then
- unloadCmd="/sbin/kextunload -b $LEGACYKEXTBUNDLEID"
- echo $unloadCmd
- eval $unloadCmd || exit 1
-fi
diff --git a/GVFS/GVFS.Installer.Mac/uninstall_vfsforgit.sh b/GVFS/GVFS.Installer.Mac/uninstall_vfsforgit.sh
deleted file mode 100755
index 43327cbfcf..0000000000
--- a/GVFS/GVFS.Installer.Mac/uninstall_vfsforgit.sh
+++ /dev/null
@@ -1,117 +0,0 @@
-#!/bin/bash
-
-KEXTFILENAME="PrjFSKext.kext"
-VFSFORDIRECTORY="/usr/local/vfsforgit"
-PRJFSKEXTDIRECTORY="/Library/Extensions"
-LAUNCHDAEMONDIRECTORY="/Library/LaunchDaemons"
-LAUNCHAGENTDIRECTORY="/Library/LaunchAgents"
-LIBRARYAPPSUPPORTDIRECTORY="/Library/Application Support/VFS For Git"
-SERVICEAPPDIRECTORY="${HOME}/Library/Application Support/GVFS"
-LOGDAEMONLAUNCHDFILENAME="org.vfsforgit.prjfs.PrjFSKextLogDaemon.plist"
-SERVICEAGENTLAUNCHDFILENAME="org.vfsforgit.service.plist"
-GVFSCOMMANDPATH="/usr/local/bin/gvfs"
-UNINSTALLERCOMMANDPATH="/usr/local/bin/uninstall_vfsforgit.sh"
-INSTALLERPACKAGEID="com.vfsforgit.pkg"
-KEXTID="org.vfsforgit.PrjFSKext"
-
-function UnloadKext()
-{
- kextLoaded=`/usr/sbin/kextstat -b "$KEXTID" | wc -l`
- if [ $kextLoaded -eq "2" ]; then
- unloadCmd="sudo /sbin/kextunload -b $KEXTID"
- echo "$unloadCmd..."
- eval $unloadCmd || exit 1
- fi
-}
-
-function UnInstallVFSForGit()
-{
- if [ -d "${PRJFSKEXTDIRECTORY}/$KEXTFILENAME" ]; then
- rmCmd="sudo /bin/rm -Rf ${PRJFSKEXTDIRECTORY}/$KEXTFILENAME"
- echo "$rmCmd..."
- eval $rmCmd || { echo "Error: Could not delete ${PRJFSKEXTDIRECTORY}/$KEXTFILENAME. Delete it manually."; exit 1; }
- fi
-
- # Check if the daemon is loaded. Unload only if necessary.
- isLoadedCmd="sudo launchctl kill SIGCONT system/org.vfsforgit.prjfs.PrjFSKextLogDaemon"
- echo "$isLoadedCmd"
- if $isLoadedCmd; then
- unloadCmd="sudo launchctl unload ${LAUNCHDAEMONDIRECTORY}/$LOGDAEMONLAUNCHDFILENAME"
- echo "$unloadCmd..."
- eval $unloadCmd || { echo "Error: Could not unload ${LAUNCHDAEMONDIRECTORY}/$LOGDAEMONLAUNCHDFILENAME. Unload it manually (\"$unloadCmd\")."; exit 1; }
- fi
-
- if [ -f "${LAUNCHDAEMONDIRECTORY}/$LOGDAEMONLAUNCHDFILENAME" ]; then
- rmCmd="sudo /bin/rm -Rf ${LAUNCHDAEMONDIRECTORY}/$LOGDAEMONLAUNCHDFILENAME"
- echo "$rmCmd..."
- eval $rmCmd || { echo "Error: Could not delete ${LAUNCHDAEMONDIRECTORY}/$LOGDAEMONLAUNCHDFILENAME. Delete it manually."; exit 1; }
- fi
-
- # Unloading Service LaunchAgent for each user
- # There will be one loginwindow instance for each logged in user,
- # get its uid (this will correspond to the logged in user's id.)
- # Then use launchctl bootout gui/uid to unload the Service
- # for each user.
- declare -a launchAgents=(
- "org.vfsforgit.usernotification"
- "org.vfsforgit.service"
- )
- for nextLaunchAgent in "${launchAgents[@]}"; do
- for uid in $(ps -Ac -o uid,command | grep -iw "loginwindow" | awk '{print $1}'); do
- isLoadedCmd="sudo launchctl kill SIGCONT gui/$uid/$nextLaunchAgent"
- echo "$isLoadedCmd"
- if $isLoadedCmd; then
- unloadCmd="launchctl bootout gui/$uid /Library/LaunchAgents/$nextLaunchAgent.plist"
- echo "Unloading Service: '$unloadCmd'..."
- eval $unloadCmd || exit 1
- fi
- done
-
- rmCmd="sudo /bin/rm -Rf ${LAUNCHAGENTDIRECTORY}/$nextLaunchAgent.plist"
- echo "$rmCmd..."
- eval $rmCmd || { echo "Error: Could not delete ${LAUNCHAGENTDIRECTORY}/$nextLaunchAgent.plist. Delete it manually."; exit 1; }
- done
-
- if [ -s "${GVFSCOMMANDPATH}" ]; then
- rmCmd="sudo /bin/rm -Rf ${GVFSCOMMANDPATH}"
- echo "$rmCmd..."
- eval $rmCmd || { echo "Error: Could not delete ${GVFSCOMMANDPATH}. Delete it manually."; exit 1; }
- fi
-
- if [ -d "${LIBRARYAPPSUPPORTDIRECTORY}" ]; then
- rmCmd="sudo /bin/rm -Rf \"${LIBRARYAPPSUPPORTDIRECTORY}\""
- echo "$rmCmd..."
- eval $rmCmd || { echo "Error: Could not delete ${LIBRARYAPPSUPPORTDIRECTORY}. Delete it manually."; exit 1; }
- fi
-
- if [ -d "${SERVICEAPPDIRECTORY}" ]; then
- rmCmd="sudo /bin/rm -Rf \"${SERVICEAPPDIRECTORY}\""
- echo "$rmCmd..."
- eval $rmCmd || { echo "Error: Could not delete ${SERVICEAPPDIRECTORY}. Delete it manually."; exit 1; }
- fi
-
- if [ -d "${VFSFORDIRECTORY}" ]; then
- rmCmd="sudo /bin/rm -Rf ${VFSFORDIRECTORY}"
- echo "$rmCmd..."
- eval $rmCmd || { echo "Error: Could not delete ${VFSFORDIRECTORY}. Delete it manually."; exit 1; }
- fi
-}
-
-function ForgetPackage()
-{
- if [ -f "/usr/sbin/pkgutil" ]; then
- forgetCmd="sudo /usr/sbin/pkgutil --forget $INSTALLERPACKAGEID"
- echo "$forgetCmd..."
- eval $forgetCmd
- fi
-}
-
-function Run()
-{
- UnloadKext
- UnInstallVFSForGit
- ForgetPackage
- echo "Successfully uninstalled VFSForGit"
-}
-
-Run
diff --git a/GVFS/GVFS.Installer.Mac/vfsforgit_components.plist b/GVFS/GVFS.Installer.Mac/vfsforgit_components.plist
deleted file mode 100644
index 9e7ca98507..0000000000
--- a/GVFS/GVFS.Installer.Mac/vfsforgit_components.plist
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
- BundleHasStrictIdentifier
-
- BundleIsRelocatable
-
- BundleIsVersionChecked
-
- BundleOverwriteAction
- upgrade
- RootRelativeBundlePath
- Library/Application Support/VFS For Git/VFS For Git.app
-
-
- BundleIsVersionChecked
-
- BundleOverwriteAction
- upgrade
- RootRelativeBundlePath
- Library/Extensions/PrjFSKext.kext
-
-
-
diff --git a/GVFS/GVFS.Mount/GVFS.Mount.Mac.csproj b/GVFS/GVFS.Mount/GVFS.Mount.Mac.csproj
deleted file mode 100644
index 11d456863f..0000000000
--- a/GVFS/GVFS.Mount/GVFS.Mount.Mac.csproj
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
- Exe
- gvfs.mount
- netcoreapp2.1
- x64
- osx-x64
-
-
-
- $(GVFSVersion)
-
-
- $(GVFSVersion)
-
-
-
-
- PlatformLoader.Mac.cs
-
-
-
-
-
-
-
-
-
-
- all
-
-
-
-
diff --git a/GVFS/GVFS.Native.Mac/GVFS.Native.Mac.xcworkspace/contents.xcworkspacedata b/GVFS/GVFS.Native.Mac/GVFS.Native.Mac.xcworkspace/contents.xcworkspacedata
deleted file mode 100644
index 790b6419be..0000000000
--- a/GVFS/GVFS.Native.Mac/GVFS.Native.Mac.xcworkspace/contents.xcworkspacedata
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/GVFS/GVFS.Native.Mac/GVFS.Native.Mac.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/GVFS/GVFS.Native.Mac/GVFS.Native.Mac.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
deleted file mode 100644
index 18d981003d..0000000000
--- a/GVFS/GVFS.Native.Mac/GVFS.Native.Mac.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- IDEDidComputeMac32BitWarning
-
-
-
diff --git a/GVFS/GVFS.Native.Mac/GVFS.Native.Mac.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/GVFS/GVFS.Native.Mac/GVFS.Native.Mac.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
deleted file mode 100644
index 08de0be8d3..0000000000
--- a/GVFS/GVFS.Native.Mac/GVFS.Native.Mac.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded
-
-
-
diff --git a/GVFS/GVFS.Native.Mac/GVFS.Native.Mac.xcworkspace/xcshareddata/xcschemes/GVFS.Native.Mac.xcscheme b/GVFS/GVFS.Native.Mac/GVFS.Native.Mac.xcworkspace/xcshareddata/xcschemes/GVFS.Native.Mac.xcscheme
deleted file mode 100644
index c6476e6593..0000000000
--- a/GVFS/GVFS.Native.Mac/GVFS.Native.Mac.xcworkspace/xcshareddata/xcschemes/GVFS.Native.Mac.xcscheme
+++ /dev/null
@@ -1,122 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/GVFS/GVFS.Platform.Mac/DiskLayoutUpgrades/DiskLayout18to19Upgrade_SqlitePlacholders.cs b/GVFS/GVFS.Platform.Mac/DiskLayoutUpgrades/DiskLayout18to19Upgrade_SqlitePlacholders.cs
deleted file mode 100644
index f844b235b8..0000000000
--- a/GVFS/GVFS.Platform.Mac/DiskLayoutUpgrades/DiskLayout18to19Upgrade_SqlitePlacholders.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using GVFS.Common.DiskLayoutUpgrades;
-
-namespace GVFS.Platform.Mac.DiskLayoutUpgrades
-{
- public class DiskLayout18to19Upgrade_SqlitePlacholders : DiskLayoutUpgrade_SqlitePlaceholders
- {
- protected override int SourceMajorVersion => 18;
- }
-}
diff --git a/GVFS/GVFS.Platform.Mac/DiskLayoutUpgrades/MacDiskLayoutUpgradeData.cs b/GVFS/GVFS.Platform.Mac/DiskLayoutUpgrades/MacDiskLayoutUpgradeData.cs
deleted file mode 100644
index bd257b313c..0000000000
--- a/GVFS/GVFS.Platform.Mac/DiskLayoutUpgrades/MacDiskLayoutUpgradeData.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using GVFS.Common;
-using GVFS.DiskLayoutUpgrades;
-using GVFS.Platform.Mac.DiskLayoutUpgrades;
-
-namespace GVFS.Platform.Mac
-{
- public class MacDiskLayoutUpgradeData : IDiskLayoutUpgradeData
- {
- public DiskLayoutUpgrade[] Upgrades
- {
- get
- {
- return new DiskLayoutUpgrade[]
- {
- new DiskLayout18to19Upgrade_SqlitePlacholders(),
- };
- }
- }
-
- public DiskLayoutVersion Version => new DiskLayoutVersion(
- currentMajorVersion: 19,
- currentMinorVersion: 0,
- minimumSupportedMajorVersion: 18);
-
- public bool TryParseLegacyDiskLayoutVersion(string dotGVFSPath, out int majorVersion)
- {
- majorVersion = 0;
- return false;
- }
- }
-}
diff --git a/GVFS/GVFS.Platform.Mac/GVFS.Platform.Mac.csproj b/GVFS/GVFS.Platform.Mac/GVFS.Platform.Mac.csproj
deleted file mode 100644
index d702269054..0000000000
--- a/GVFS/GVFS.Platform.Mac/GVFS.Platform.Mac.csproj
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
- netcoreapp2.1;netstandard2.0
- x64
- true
- true
-
-
-
- $(GVFSVersion)
-
-
- $(GVFSVersion)
-
-
-
- $(GVFSVersion)
-
-
-
-
-
-
-
-
-
-
-
-
- all
-
-
-
-
-
-
-
diff --git a/GVFS/GVFS.Platform.Mac/MacDaemonController.cs b/GVFS/GVFS.Platform.Mac/MacDaemonController.cs
deleted file mode 100644
index a54e9a38dc..0000000000
--- a/GVFS/GVFS.Platform.Mac/MacDaemonController.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-using GVFS.Common;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-
-namespace GVFS.Platform.Mac
-{
- ///
- /// Class to query the configured services on macOS
- ///
- public class MacDaemonController
- {
- private const string LaunchCtlPath = @"/bin/launchctl";
- private const string LaunchCtlArg = @"list";
-
- private IProcessRunner processRunner;
-
- public MacDaemonController(IProcessRunner processRunner)
- {
- this.processRunner = processRunner;
- }
-
- public bool TryGetDaemons(string currentUser, out List daemons, out string error)
- {
- // Consider for future improvement:
- // Use Launchtl to run Launchctl as the "real" user, so we can get the process list from the user.
- ProcessResult result = this.processRunner.Run(LaunchCtlPath, "asuser " + currentUser + " " + LaunchCtlPath + " " + LaunchCtlArg, true);
-
- if (result.ExitCode != 0)
- {
- error = result.Output;
- daemons = null;
- return false;
- }
-
- return this.TryParseOutput(result.Output, out daemons, out error);
- }
-
- private bool TryParseOutput(string output, out List daemonInfos, out string error)
- {
- daemonInfos = new List();
-
- // 1st line is the header, skip it
- foreach (string line in output.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries).Skip(1))
- {
- // The expected output is a list of tab delimited entried:
- // PID\tSTATUS\tLABEL
- string[] tokens = line.Split('\t');
-
- if (tokens.Length != 3)
- {
- daemonInfos = null;
- error = $"Unexpected number of tokens in line: {line}";
- return false;
- }
-
- string label = tokens[2];
- bool isRunning = int.TryParse(tokens[0], out _);
-
- daemonInfos.Add(new DaemonInfo() { Name = label, IsRunning = isRunning });
- }
-
- error = null;
- return true;
- }
-
- public class DaemonInfo
- {
- public string Name { get; set; }
- public bool IsRunning { get; set; }
- }
- }
-}
diff --git a/GVFS/GVFS.Platform.Mac/MacFileBasedLock.cs b/GVFS/GVFS.Platform.Mac/MacFileBasedLock.cs
deleted file mode 100644
index 10451482fe..0000000000
--- a/GVFS/GVFS.Platform.Mac/MacFileBasedLock.cs
+++ /dev/null
@@ -1,133 +0,0 @@
-using GVFS.Common;
-using GVFS.Common.FileSystem;
-using GVFS.Common.Tracing;
-using System;
-using System.IO;
-using System.Runtime.InteropServices;
-
-namespace GVFS.Platform.Mac
-{
- public class MacFileBasedLock : FileBasedLock
- {
- private int lockFileDescriptor;
-
- public MacFileBasedLock(
- PhysicalFileSystem fileSystem,
- ITracer tracer,
- string lockPath)
- : base(fileSystem, tracer, lockPath)
- {
- this.lockFileDescriptor = NativeMethods.InvalidFileDescriptor;
- }
-
- public override bool TryAcquireLock()
- {
- if (this.lockFileDescriptor == NativeMethods.InvalidFileDescriptor)
- {
- this.FileSystem.CreateDirectory(Path.GetDirectoryName(this.LockPath));
-
- this.lockFileDescriptor = NativeMethods.Open(
- this.LockPath,
- NativeMethods.OpenCreate | NativeMethods.OpenWriteOnly,
- NativeMethods.FileMode644);
-
- if (this.lockFileDescriptor == NativeMethods.InvalidFileDescriptor)
- {
- int errno = Marshal.GetLastWin32Error();
- EventMetadata metadata = this.CreateEventMetadata(errno);
- this.Tracer.RelatedWarning(
- metadata,
- $"{nameof(MacFileBasedLock)}.{nameof(this.TryAcquireLock)}: Failed to open lock file");
-
- return false;
- }
- }
-
- if (NativeMethods.FLock(this.lockFileDescriptor, NativeMethods.LockEx | NativeMethods.LockNb) != 0)
- {
- int errno = Marshal.GetLastWin32Error();
- if (errno != NativeMethods.EIntr && errno != NativeMethods.EWouldBlock)
- {
- EventMetadata metadata = this.CreateEventMetadata(errno);
- this.Tracer.RelatedWarning(
- metadata,
- $"{nameof(MacFileBasedLock)}.{nameof(this.TryAcquireLock)}: Unexpected error when locking file");
- }
-
- return false;
- }
-
- return true;
- }
-
- public override void Dispose()
- {
- if (this.lockFileDescriptor != NativeMethods.InvalidFileDescriptor)
- {
- if (NativeMethods.Close(this.lockFileDescriptor) != 0)
- {
- // Failures of close() are logged for diagnostic purposes only.
- // It's possible that errors from a previous operation (e.g. write(2))
- // are only reported in close(). We should *not* retry the close() if
- // it fails since it may cause a re-used file descriptor from another
- // thread to be closed.
-
- int errno = Marshal.GetLastWin32Error();
- EventMetadata metadata = this.CreateEventMetadata(errno);
- this.Tracer.RelatedWarning(
- metadata,
- $"{nameof(MacFileBasedLock)}.{nameof(this.Dispose)}: Error when closing lock fd");
- }
-
- this.lockFileDescriptor = NativeMethods.InvalidFileDescriptor;
- }
- }
-
- private EventMetadata CreateEventMetadata(int errno = 0)
- {
- EventMetadata metadata = new EventMetadata();
- metadata.Add("Area", nameof(MacFileBasedLock));
- metadata.Add(nameof(this.LockPath), this.LockPath);
- if (errno != 0)
- {
- metadata.Add(nameof(errno), errno);
- }
-
- return metadata;
- }
-
- private static class NativeMethods
- {
- // #define O_WRONLY 0x0001 /* open for writing only */
- public const int OpenWriteOnly = 0x0001;
-
- // #define O_CREAT 0x0200 /* create if nonexistant */
- public const int OpenCreate = 0x0200;
-
- // #define EINTR 4 /* Interrupted system call */
- public const int EIntr = 4;
-
- // #define EAGAIN 35 /* Resource temporarily unavailable */
- // #define EWOULDBLOCK EAGAIN /* Operation would block */
- public const int EWouldBlock = 35;
-
- public const int LockSh = 1; // #define LOCK_SH 1 /* shared lock */
- public const int LockEx = 2; // #define LOCK_EX 2 /* exclusive lock */
- public const int LockNb = 4; // #define LOCK_NB 4 /* don't block when locking */
- public const int LockUn = 8; // #define LOCK_UN 8 /* unlock */
-
- public const int InvalidFileDescriptor = -1;
-
- public static readonly ushort FileMode644 = Convert.ToUInt16("644", 8);
-
- [DllImport("libc", EntryPoint = "open", SetLastError = true)]
- public static extern int Open(string pathname, int flags, ushort mode);
-
- [DllImport("libc", EntryPoint = "close", SetLastError = true)]
- public static extern int Close(int fd);
-
- [DllImport("libc", EntryPoint = "flock", SetLastError = true)]
- public static extern int FLock(int fd, int operation);
- }
- }
-}
diff --git a/GVFS/GVFS.Platform.Mac/MacFileSystem.cs b/GVFS/GVFS.Platform.Mac/MacFileSystem.cs
deleted file mode 100644
index 39119e30e5..0000000000
--- a/GVFS/GVFS.Platform.Mac/MacFileSystem.cs
+++ /dev/null
@@ -1,186 +0,0 @@
-using GVFS.Common;
-using GVFS.Platform.POSIX;
-using System;
-using System.IO;
-using System.Runtime.InteropServices;
-
-namespace GVFS.Platform.Mac
-{
- public class MacFileSystem : POSIXFileSystem
- {
- public override void ChangeMode(string path, ushort mode)
- {
- Chmod(path, mode);
- }
-
- public override bool HydrateFile(string fileName, byte[] buffer)
- {
- return NativeFileReader.TryReadFirstByteOfFile(fileName, buffer);
- }
-
- public override bool IsExecutable(string fileName)
- {
- NativeStat.StatBuffer statBuffer = this.StatFile(fileName);
- return NativeStat.IsExecutable(statBuffer.Mode);
- }
-
- public override bool IsSocket(string fileName)
- {
- NativeStat.StatBuffer statBuffer = this.StatFile(fileName);
- return NativeStat.IsSock(statBuffer.Mode);
- }
-
- public override bool IsFileSystemSupported(string path, out string error)
- {
- error = null;
-
- try
- {
- string lowerCaseFilePath = Path.Combine(path, $"casetest{Guid.NewGuid().ToString()}");
- string upperCaseFilePath = lowerCaseFilePath.ToUpper();
-
- File.Create(lowerCaseFilePath);
- if (File.Exists(upperCaseFilePath))
- {
- File.Delete(lowerCaseFilePath);
- return true;
- }
-
- File.Delete(lowerCaseFilePath);
- error = "VFS for Git does not support case sensitive filesystems";
- return false;
- }
- catch (Exception ex)
- {
- error = $"Exception when performing {nameof(MacFileSystem)}.{nameof(this.IsFileSystemSupported)}: {ex.ToString()}";
- return false;
- }
- }
-
- [DllImport("libc", EntryPoint = "chmod", SetLastError = true)]
- private static extern int Chmod(string pathname, ushort mode);
-
- private NativeStat.StatBuffer StatFile(string fileName)
- {
- if (NativeStat.Stat(fileName, out NativeStat.StatBuffer statBuffer) != 0)
- {
- NativeMethods.ThrowLastWin32Exception($"Failed to stat {fileName}");
- }
-
- return statBuffer;
- }
-
- private static class NativeStat
- {
- // #define S_IFMT 0170000 /* [XSI] type of file mask */
- private static readonly ushort IFMT = Convert.ToUInt16("170000", 8);
-
- // #define S_IFSOCK 0140000 /* [XSI] socket */
- private static readonly ushort IFSOCK = Convert.ToUInt16("0140000", 8);
-
- // #define S_IXUSR 0000100 /* [XSI] X for owner */
- private static readonly ushort IXUSR = Convert.ToUInt16("100", 8);
-
- // #define S_IXGRP 0000010 /* [XSI] X for group */
- private static readonly ushort IXGRP = Convert.ToUInt16("10", 8);
-
- // #define S_IXOTH 0000001 /* [XSI] X for other */
- private static readonly ushort IXOTH = Convert.ToUInt16("1", 8);
-
- public static bool IsSock(ushort mode)
- {
- // #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) /* socket */
- return (mode & IFMT) == IFSOCK;
- }
-
- public static bool IsExecutable(ushort mode)
- {
- return (mode & (IXUSR | IXGRP | IXOTH)) != 0;
- }
-
- [DllImport("libc", EntryPoint = "stat$INODE64", SetLastError = true)]
- public static extern int Stat(string path, [Out] out StatBuffer statBuffer);
-
- [StructLayout(LayoutKind.Sequential)]
- public struct TimeSpec
- {
- public long Sec;
- public long Nsec;
- }
-
- [StructLayout(LayoutKind.Sequential)]
- public struct StatBuffer
- {
- public int Dev; /* ID of device containing file */
- public ushort Mode; /* Mode of file (see below) */
- public ushort NLink; /* Number of hard links */
- public ulong Ino; /* File serial number */
- public uint UID; /* User ID of the file */
- public uint GID; /* Group ID of the file */
- public int RDev; /* Device ID */
-
- public TimeSpec ATimespec; /* time of last access */
- public TimeSpec MTimespec; /* time of last data modification */
- public TimeSpec CTimespec; /* time of last status change */
- public TimeSpec BirthTimespec; /* time of file creation(birth) */
-
- public long Size; /* file size, in bytes */
- public long Blocks; /* blocks allocated for file */
- public int BlkSize; /* optimal blocksize for I/O */
- public uint Glags; /* user defined flags for file */
- public uint Gen; /* file generation number */
- public int LSpare; /* RESERVED: DO NOT USE! */
-
- [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
- public long[] QSpare; /* RESERVED: DO NOT USE! */
- }
- }
-
- private static class NativeFileReader
- {
- // #define O_RDONLY 0x0000 /* open for reading only */
- private const int ReadOnly = 0x0000;
-
- internal static bool TryReadFirstByteOfFile(string fileName, byte[] buffer)
- {
- int fileDescriptor = -1;
- bool readStatus = false;
- try
- {
- fileDescriptor = Open(fileName, ReadOnly);
- if (fileDescriptor != -1)
- {
- readStatus = TryReadOneByte(fileDescriptor, buffer);
- }
- }
- finally
- {
- Close(fileDescriptor);
- }
-
- return readStatus;
- }
-
- [DllImport("libc", EntryPoint = "open", SetLastError = true)]
- private static extern int Open(string path, int flag);
-
- [DllImport("libc", EntryPoint = "close", SetLastError = true)]
- private static extern int Close(int fd);
-
- [DllImport("libc", EntryPoint = "read", SetLastError = true)]
- private static extern int Read(int fd, [Out] byte[] buf, int count);
-
- private static bool TryReadOneByte(int fileDescriptor, byte[] buffer)
- {
- int numBytes = Read(fileDescriptor, buffer, 1);
-
- if (numBytes == -1)
- {
- return false;
- }
-
- return true;
- }
- }
- }
-}
diff --git a/GVFS/GVFS.Platform.Mac/MacFileSystemVirtualizer.cs b/GVFS/GVFS.Platform.Mac/MacFileSystemVirtualizer.cs
deleted file mode 100644
index 2efb84f2e3..0000000000
--- a/GVFS/GVFS.Platform.Mac/MacFileSystemVirtualizer.cs
+++ /dev/null
@@ -1,734 +0,0 @@
-using GVFS.Common;
-using GVFS.Common.Git;
-using GVFS.Common.Tracing;
-using GVFS.Virtualization.BlobSize;
-using GVFS.Virtualization.FileSystem;
-using GVFS.Virtualization.Projection;
-using PrjFSLib.Mac;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
-using System.Threading;
-
-namespace GVFS.Platform.Mac
-{
- public class MacFileSystemVirtualizer : FileSystemVirtualizer
- {
- public static readonly byte[] PlaceholderVersionId = ToVersionIdByteArray(new byte[] { PlaceholderVersion });
-
- private const int SymLinkTargetBufferSize = 4096;
- private const long DummyFileSize = -1;
-
- private const string ClassName = nameof(MacFileSystemVirtualizer);
-
- private VirtualizationInstance virtualizationInstance;
-
- public MacFileSystemVirtualizer(GVFSContext context, GVFSGitObjects gitObjects)
- : this(context, gitObjects, virtualizationInstance: null)
- {
- }
-
- public MacFileSystemVirtualizer(
- GVFSContext context,
- GVFSGitObjects gitObjects,
- VirtualizationInstance virtualizationInstance)
- : base(context, gitObjects)
- {
- this.virtualizationInstance = virtualizationInstance ?? new VirtualizationInstance();
- }
-
- protected override string EtwArea => ClassName;
-
- public static FSResult ResultToFSResult(Result result)
- {
- switch (result)
- {
- case Result.Invalid:
- return FSResult.IOError;
-
- case Result.Success:
- return FSResult.Ok;
-
- case Result.EFileNotFound:
- case Result.EPathNotFound:
- return FSResult.FileOrPathNotFound;
-
- case Result.EDirectoryNotEmpty:
- return FSResult.DirectoryNotEmpty;
-
- case Result.EVirtualizationInvalidOperation:
- return FSResult.VirtualizationInvalidOperation;
-
- default:
- return FSResult.IOError;
- }
- }
-
- public override FileSystemResult ClearNegativePathCache(out uint totalEntryCount)
- {
- totalEntryCount = 0;
- return new FileSystemResult(FSResult.Ok, rawResult: unchecked((int)Result.Success));
- }
-
- public override FileSystemResult DeleteFile(string relativePath, UpdatePlaceholderType updateFlags, out UpdateFailureReason failureReason)
- {
- UpdateFailureCause failureCause;
- Result result = this.virtualizationInstance.DeleteFile(relativePath, (UpdateType)updateFlags, out failureCause);
- failureReason = (UpdateFailureReason)failureCause;
- return new FileSystemResult(ResultToFSResult(result), unchecked((int)result));
- }
-
- public override void Stop()
- {
- this.Context.Tracer.RelatedEvent(EventLevel.Informational, $"{nameof(this.Stop)}_StopRequested", metadata: null);
- }
-
- ///
- /// Writes a placeholder file.
- ///
- /// Placeholder's path relative to the root of the repo
- /// Length of the file (ignored on this platform)
- /// The SHA of the placeholder's contents, stored as the content ID in the placeholder
- public override FileSystemResult WritePlaceholderFile(
- string relativePath,
- long endOfFile,
- string sha)
- {
- // TODO(#223): Add functional tests that validate file mode is set correctly
- GitIndexProjection.FileType fileType;
- ushort fileMode;
- this.FileSystemCallbacks.GitIndexProjection.GetFileTypeAndMode(relativePath, out fileType, out fileMode);
-
- if (fileType == GitIndexProjection.FileType.Regular)
- {
- Result result = this.virtualizationInstance.WritePlaceholderFile(
- relativePath,
- PlaceholderVersionId,
- ToVersionIdByteArray(FileSystemVirtualizer.ConvertShaToContentId(sha)),
- fileMode);
-
- return new FileSystemResult(ResultToFSResult(result), unchecked((int)result));
- }
- else if (fileType == GitIndexProjection.FileType.SymLink)
- {
- string symLinkTarget;
- if (this.TryGetSymLinkTarget(sha, out symLinkTarget))
- {
- Result result = this.virtualizationInstance.WriteSymLink(relativePath, symLinkTarget);
-
- this.FileSystemCallbacks.OnFileSymLinkCreated(relativePath);
-
- return new FileSystemResult(ResultToFSResult(result), unchecked((int)result));
- }
-
- EventMetadata metadata = this.CreateEventMetadata(relativePath);
- metadata.Add(nameof(sha), sha);
- this.Context.Tracer.RelatedError(metadata, $"{nameof(this.WritePlaceholderFile)}: Failed to read contents of symlink object");
- return new FileSystemResult(FSResult.IOError, 0);
- }
- else
- {
- EventMetadata metadata = this.CreateEventMetadata(relativePath);
- metadata.Add(nameof(fileType), fileType);
- metadata.Add(nameof(fileMode), fileMode);
- this.Context.Tracer.RelatedError(metadata, $"{nameof(this.WritePlaceholderFile)}: Unsupported fileType");
- return new FileSystemResult(FSResult.IOError, 0);
- }
- }
-
- public override FileSystemResult WritePlaceholderDirectory(string relativePath)
- {
- Result result = this.virtualizationInstance.WritePlaceholderDirectory(relativePath);
- return new FileSystemResult(ResultToFSResult(result), unchecked((int)result));
- }
-
- /// Length of the file, not required on the Mac platform
- public override FileSystemResult UpdatePlaceholderIfNeeded(
- string relativePath,
- DateTime creationTime,
- DateTime lastAccessTime,
- DateTime lastWriteTime,
- DateTime changeTime,
- FileAttributes fileAttributes,
- long endOfFile,
- string shaContentId,
- UpdatePlaceholderType updateFlags,
- out UpdateFailureReason failureReason)
- {
- UpdateFailureCause failureCause = UpdateFailureCause.NoFailure;
-
- // TODO(#223): Add functional tests that include:
- // - Mode + content changes between commits
- // - Mode only changes (without any change to content, see issue #223)
- GitIndexProjection.FileType fileType;
- ushort fileMode;
- this.FileSystemCallbacks.GitIndexProjection.GetFileTypeAndMode(relativePath, out fileType, out fileMode);
-
- if (fileType == GitIndexProjection.FileType.Regular)
- {
- Result result = this.virtualizationInstance.UpdatePlaceholderIfNeeded(
- relativePath,
- PlaceholderVersionId,
- ToVersionIdByteArray(ConvertShaToContentId(shaContentId)),
- fileMode,
- (UpdateType)updateFlags,
- out failureCause);
-
- failureReason = (UpdateFailureReason)failureCause;
- return new FileSystemResult(ResultToFSResult(result), unchecked((int)result));
- }
- else if (fileType == GitIndexProjection.FileType.SymLink)
- {
- string symLinkTarget;
- if (this.TryGetSymLinkTarget(shaContentId, out symLinkTarget))
- {
- Result result = this.virtualizationInstance.ReplacePlaceholderFileWithSymLink(
- relativePath,
- symLinkTarget,
- (UpdateType)updateFlags,
- out failureCause);
-
- this.FileSystemCallbacks.OnFileSymLinkCreated(relativePath);
-
- failureReason = (UpdateFailureReason)failureCause;
- return new FileSystemResult(ResultToFSResult(result), unchecked((int)result));
- }
-
- EventMetadata metadata = this.CreateEventMetadata(relativePath);
- metadata.Add(nameof(shaContentId), shaContentId);
- this.Context.Tracer.RelatedError(metadata, $"{nameof(this.UpdatePlaceholderIfNeeded)}: Failed to read contents of symlink object");
- failureReason = UpdateFailureReason.NoFailure;
- return new FileSystemResult(FSResult.IOError, 0);
- }
- else
- {
- EventMetadata metadata = this.CreateEventMetadata(relativePath);
- metadata.Add(nameof(fileType), fileType);
- metadata.Add(nameof(fileMode), fileMode);
- this.Context.Tracer.RelatedError(metadata, $"{nameof(this.UpdatePlaceholderIfNeeded)}: Unsupported fileType");
- failureReason = UpdateFailureReason.NoFailure;
- return new FileSystemResult(FSResult.IOError, 0);
- }
- }
-
- public override FileSystemResult DehydrateFolder(string relativePath)
- {
- FileSystemResult result = new FileSystemResult(FSResult.Ok, 0);
- GitIndexProjection.PathSparseState sparseState = this.FileSystemCallbacks.GitIndexProjection.GetFolderPathSparseState(relativePath);
-
- if (sparseState == GitIndexProjection.PathSparseState.Included)
- {
- // When the folder is included we need to create the placeholder to make sure it is on disk for enumeration
- result = this.WritePlaceholderDirectory(relativePath);
- if (result.Result == FSResult.Ok)
- {
- this.FileSystemCallbacks.OnPlaceholderFolderCreated(relativePath, string.Empty);
- }
- else if (result.Result == FSResult.FileOrPathNotFound)
- {
- // This will happen when the parent folder is also in the dehydrate list and is no longer on disk.
- result = new FileSystemResult(FSResult.Ok, 0);
- }
- else
- {
- EventMetadata metadata = this.CreateEventMetadata(relativePath);
- metadata.Add(nameof(result.Result), result.Result);
- metadata.Add(nameof(result.RawResult), result.RawResult);
- this.Context.Tracer.RelatedError(metadata, $"{nameof(this.DehydrateFolder)}: Write placeholder failed");
- }
- }
-
- return result;
- }
-
- public override bool TryStart(out string error)
- {
- error = string.Empty;
-
- // Callbacks
- this.virtualizationInstance.OnEnumerateDirectory = this.OnEnumerateDirectory;
- this.virtualizationInstance.OnGetFileStream = this.OnGetFileStream;
- this.virtualizationInstance.OnLogError = this.OnLogError;
- this.virtualizationInstance.OnLogWarning = this.OnLogWarning;
- this.virtualizationInstance.OnLogInfo = this.OnLogInfo;
- this.virtualizationInstance.OnFileModified = this.OnFileModified;
- this.virtualizationInstance.OnPreDelete = this.OnPreDelete;
- this.virtualizationInstance.OnNewFileCreated = this.OnNewFileCreated;
- this.virtualizationInstance.OnFileRenamed = this.OnFileRenamed;
- this.virtualizationInstance.OnHardLinkCreated = this.OnHardLinkCreated;
- this.virtualizationInstance.OnFilePreConvertToFull = this.NotifyFilePreConvertToFull;
-
- uint threadCount = (uint)Environment.ProcessorCount * 2;
-
- Result result = this.virtualizationInstance.StartVirtualizationInstance(
- this.Context.Enlistment.WorkingDirectoryRoot,
- threadCount);
-
- if (result != Result.Success)
- {
- this.Context.Tracer.RelatedError($"{nameof(this.virtualizationInstance.StartVirtualizationInstance)} failed: " + result.ToString("X") + "(" + result.ToString("G") + ")");
- error = "Failed to start virtualization instance (" + result.ToString() + ")";
- return false;
- }
-
- this.Context.Tracer.RelatedEvent(EventLevel.Informational, $"{nameof(this.TryStart)}_StartedVirtualization", metadata: null);
- return true;
- }
-
- private static byte[] ToVersionIdByteArray(byte[] version)
- {
- byte[] bytes = new byte[VirtualizationInstance.PlaceholderIdLength];
- Buffer.BlockCopy(version, 0, bytes, 0, version.Length);
- return bytes;
- }
-
- ///
- /// Gets the target of the symbolic link.
- ///
- /// SHA of the loose object containing the target path of the symbolic link
- /// Target path of the symbolic link
- private bool TryGetSymLinkTarget(string sha, out string symLinkTarget)
- {
- symLinkTarget = null;
-
- string symLinkBlobContents = null;
- try
- {
- if (!this.GitObjects.TryCopyBlobContentStream(
- sha,
- CancellationToken.None,
- GVFSGitObjects.RequestSource.SymLinkCreation,
- (stream, blobLength) =>
- {
- byte[] buffer = new byte[SymLinkTargetBufferSize];
- uint bufferIndex = 0;
-
- // TODO(#1361): Find a better solution than reading from the stream one byte at at time
- int nextByte = stream.ReadByte();
- while (nextByte != -1)
- {
- while (bufferIndex < buffer.Length && nextByte != -1)
- {
- buffer[bufferIndex] = (byte)nextByte;
- nextByte = stream.ReadByte();
- ++bufferIndex;
- }
-
- if (bufferIndex < buffer.Length)
- {
- buffer[bufferIndex] = 0;
- symLinkBlobContents = Encoding.UTF8.GetString(buffer);
- }
- else
- {
- buffer[bufferIndex - 1] = 0;
-
- EventMetadata metadata = this.CreateEventMetadata();
- metadata.Add(nameof(sha), sha);
- metadata.Add("bufferContents", Encoding.UTF8.GetString(buffer));
- this.Context.Tracer.RelatedError(metadata, $"{nameof(this.TryGetSymLinkTarget)}: SymLink target exceeds buffer size");
-
- throw new GetSymLinkTargetException("SymLink target exceeds buffer size");
- }
- }
- }))
- {
- EventMetadata metadata = this.CreateEventMetadata();
- metadata.Add(nameof(sha), sha);
- this.Context.Tracer.RelatedError(metadata, $"{nameof(this.TryGetSymLinkTarget)}: TryCopyBlobContentStream failed");
-
- return false;
- }
- }
- catch (GetSymLinkTargetException e)
- {
- EventMetadata metadata = this.CreateEventMetadata(relativePath: null, exception: e);
- metadata.Add(nameof(sha), sha);
- this.Context.Tracer.RelatedError(metadata, $"{nameof(this.TryGetSymLinkTarget)}: TryCopyBlobContentStream caught GetSymLinkTargetException");
-
- return false;
- }
- catch (DecoderFallbackException e)
- {
- EventMetadata metadata = this.CreateEventMetadata(relativePath: null, exception: e);
- metadata.Add(nameof(sha), sha);
- this.Context.Tracer.RelatedError(metadata, $"{nameof(this.TryGetSymLinkTarget)}: TryCopyBlobContentStream caught DecoderFallbackException");
-
- return false;
- }
-
- symLinkTarget = symLinkBlobContents;
-
- return true;
- }
-
- private Result OnGetFileStream(
- ulong commandId,
- string relativePath,
- byte[] providerId,
- byte[] contentId,
- int triggeringProcessId,
- string triggeringProcessName,
- IntPtr fileHandle)
- {
- try
- {
- if (contentId == null)
- {
- this.Context.Tracer.RelatedError($"{nameof(this.OnGetFileStream)} called with null contentId, path: " + relativePath);
- return Result.EInvalidOperation;
- }
-
- if (providerId == null)
- {
- this.Context.Tracer.RelatedError($"{nameof(this.OnGetFileStream)} called with null epochId, path: " + relativePath);
- return Result.EInvalidOperation;
- }
-
- string sha = GetShaFromContentId(contentId);
- byte placeholderVersion = GetPlaceholderVersionFromProviderId(providerId);
-
- EventMetadata metadata = this.CreateEventMetadata(relativePath);
- metadata.Add(nameof(triggeringProcessId), triggeringProcessId);
- metadata.Add(nameof(triggeringProcessName), triggeringProcessName);
- metadata.Add(nameof(sha), sha);
- metadata.Add(nameof(placeholderVersion), placeholderVersion);
- metadata.Add(nameof(commandId), commandId);
- ITracer activity = this.Context.Tracer.StartActivity("GetFileStream", EventLevel.Verbose, Keywords.Telemetry, metadata);
-
- if (placeholderVersion != FileSystemVirtualizer.PlaceholderVersion)
- {
- activity.RelatedError(metadata, nameof(this.OnGetFileStream) + ": Unexpected placeholder version");
- activity.Dispose();
-
- // TODO(#1362): Is this the correct Result to return?
- return Result.EIOError;
- }
-
- try
- {
- if (!this.GitObjects.TryCopyBlobContentStream(
- sha,
- CancellationToken.None,
- GVFSGitObjects.RequestSource.FileStreamCallback,
- (stream, blobLength) =>
- {
- // TODO(#1361): Find a better solution than reading from the stream one byte at at time
- byte[] buffer = new byte[4096];
- uint bufferIndex = 0;
- int nextByte = stream.ReadByte();
- int bytesWritten = 0;
- while (nextByte != -1)
- {
- while (bufferIndex < buffer.Length && nextByte != -1)
- {
- buffer[bufferIndex] = (byte)nextByte;
- nextByte = stream.ReadByte();
- ++bufferIndex;
- }
-
- Result result = this.virtualizationInstance.WriteFileContents(
- fileHandle,
- buffer,
- bufferIndex);
- if (result != Result.Success)
- {
- activity.RelatedError(metadata, $"{nameof(this.virtualizationInstance.WriteFileContents)} failed, error: " + result.ToString("X") + "(" + result.ToString("G") + ")");
- throw new GetFileStreamException(result);
- }
-
- if (bufferIndex == buffer.Length)
- {
- bufferIndex = 0;
- bytesWritten += buffer.Length;
- }
- }
- bytesWritten += Convert.ToInt32(bufferIndex);
-
- if (bytesWritten != blobLength)
- {
- // If the read size does not match the expected size print an error and add the file to ModifiedPaths.dat
- // This allows the user to see that something went wrong with file hydration
- // Unfortunitely we must do this check *after* the file is hydrated since the header isn't corrupt for trunctated objects on mac
- this.Context.Tracer.RelatedError($"Read {relativePath} to {bytesWritten}, not expected size of {blobLength}");
- this.FileSystemCallbacks.OnFailedFileHydration(relativePath);
- }
- }))
- {
- activity.RelatedError(metadata, $"{nameof(this.OnGetFileStream)}: TryCopyBlobContentStream failed");
-
- // TODO(#1362): Is this the correct Result to return?
- return Result.EFileNotFound;
- }
- }
- catch (GetFileStreamException e)
- {
- return e.Result;
- }
-
- this.FileSystemCallbacks.OnPlaceholderFileHydrated(triggeringProcessName);
- return Result.Success;
- }
- catch (Exception e)
- {
- EventMetadata metadata = this.CreateEventMetadata(relativePath, e);
- metadata.Add(nameof(triggeringProcessId), triggeringProcessId);
- metadata.Add(nameof(triggeringProcessName), triggeringProcessName);
- metadata.Add(nameof(commandId), commandId);
- this.LogUnhandledExceptionAndExit(nameof(this.OnGetFileStream), metadata);
- }
-
- return Result.EIOError;
- }
-
- private void OnLogError(string errorMessage)
- {
- this.Context.Tracer.RelatedError($"{nameof(MacFileSystemVirtualizer)}::{nameof(this.OnLogError)}: {errorMessage}");
- }
-
- private void OnLogWarning(string warningMessage)
- {
- this.Context.Tracer.RelatedWarning($"{nameof(MacFileSystemVirtualizer)}::{nameof(this.OnLogWarning)}: {warningMessage}");
- }
-
- private void OnLogInfo(string infoMessage)
- {
- this.Context.Tracer.RelatedInfo($"{nameof(MacFileSystemVirtualizer)}::{nameof(this.OnLogInfo)}: {infoMessage}");
- }
-
- private void OnFileModified(string relativePath)
- {
- try
- {
- if (Virtualization.FileSystemCallbacks.IsPathInsideDotGit(relativePath))
- {
- this.OnDotGitFileOrFolderChanged(relativePath);
- }
- }
- catch (Exception e)
- {
- this.LogUnhandledExceptionAndExit(nameof(this.OnFileModified), this.CreateEventMetadata(relativePath, e));
- }
- }
-
- private Result NotifyFilePreConvertToFull(string relativePath)
- {
- this.OnFilePreConvertToFull(relativePath);
- return Result.Success;
- }
-
- private Result OnPreDelete(string relativePath, bool isDirectory)
- {
- try
- {
- bool pathInsideDotGit = Virtualization.FileSystemCallbacks.IsPathInsideDotGit(relativePath);
- if (pathInsideDotGit)
- {
- if (relativePath.Equals(GVFSConstants.DotGit.Index, GVFSPlatform.Instance.Constants.PathComparison))
- {
- string lockedGitCommand = this.Context.Repository.GVFSLock.GetLockedGitCommand();
- if (string.IsNullOrEmpty(lockedGitCommand))
- {
- EventMetadata metadata = new EventMetadata();
- metadata.Add("Area", this.EtwArea);
- metadata.Add(TracingConstants.MessageKey.WarningMessage, "Blocked index delete outside the lock");
- this.Context.Tracer.RelatedEvent(EventLevel.Warning, $"{nameof(this.OnPreDelete)}_BlockedIndexDelete", metadata);
-
- return Result.EAccessDenied;
- }
- }
-
- this.OnDotGitFileOrFolderDeleted(relativePath);
- }
- else
- {
- this.OnWorkingDirectoryFileOrFolderDeleteNotification(relativePath, isDirectory, isPreDelete: true);
- }
- }
- catch (Exception e)
- {
- EventMetadata metadata = this.CreateEventMetadata(relativePath, e);
- metadata.Add("isDirectory", isDirectory);
- this.LogUnhandledExceptionAndExit(nameof(this.OnPreDelete), metadata);
- }
-
- return Result.Success;
- }
-
- private void OnNewFileCreated(string relativePath, bool isDirectory)
- {
- try
- {
- if (!Virtualization.FileSystemCallbacks.IsPathInsideDotGit(relativePath))
- {
- if (isDirectory)
- {
- string lockedGitCommand = this.Context.Repository.GVFSLock.GetLockedGitCommand();
- GitCommandLineParser gitCommand = new GitCommandLineParser(lockedGitCommand);
- if (gitCommand.IsValidGitCommand)
- {
- EventMetadata metadata = this.CreateEventMetadata(relativePath);
- metadata.Add(nameof(lockedGitCommand), lockedGitCommand);
- metadata.Add(TracingConstants.MessageKey.InfoMessage, "Git command created new folder");
- this.Context.Tracer.RelatedEvent(EventLevel.Informational, $"{nameof(this.OnNewFileCreated)}_GitCreatedFolder", metadata);
-
- // Record this folder as expanded so that GitIndexProjection will re-expand the folder
- // when the projection change completes.
- //
- // Git creates new folders when there are files that it needs to create.
- // However, git will only create files that are in ModifiedPaths.dat. There could
- // be other files in the projection (that were not created by git) and so VFS must re-expand the
- // newly created folder to ensure that all files are written to disk.
- this.FileSystemCallbacks.OnPlaceholderFolderExpanded(relativePath);
- }
- else
- {
- this.FileSystemCallbacks.OnFolderCreated(relativePath, out bool sparseFoldersUpdated);
- if (sparseFoldersUpdated)
- {
- // When sparseFoldersUpdated is true it means the folder was previously excluded from the projection and was
- // included so it needs to enumerate the directory to get and create placeholders
- // for all the directory items that are now included
- this.OnEnumerateDirectory(0, relativePath, -1, $"{nameof(this.OnNewFileCreated)}_FolderIncluded");
- }
- }
- }
- else
- {
- this.FileSystemCallbacks.OnFileCreated(relativePath);
- }
- }
- }
- catch (Exception e)
- {
- EventMetadata metadata = this.CreateEventMetadata(relativePath, e);
- metadata.Add("isDirectory", isDirectory);
- this.LogUnhandledExceptionAndExit(nameof(this.OnNewFileCreated), metadata);
- }
- }
-
- private void OnFileRenamed(string relativeDestinationPath, bool isDirectory)
- {
- // ProjFS for Mac *could* be updated to provide us with relativeSourcePath as well,
- // but because VFSForGit doesn't need the source path on Mac for correct behavior
- // the relativeSourcePath is left out of the notification to keep the kext simple
- this.OnFileRenamed(
- relativeSourcePath: string.Empty,
- relativeDestinationPath: relativeDestinationPath,
- isDirectory: isDirectory);
- }
-
- private Result OnEnumerateDirectory(
- ulong commandId,
- string relativePath,
- int triggeringProcessId,
- string triggeringProcessName)
- {
- try
- {
- IEnumerable projectedItems = this.FileSystemCallbacks.GitIndexProjection.GetProjectedItems(
- CancellationToken.None,
- blobSizesConnection: null,
- folderPath: relativePath);
-
- return this.CreatePlaceholders(relativePath, projectedItems, triggeringProcessName);
- }
- catch (Exception e)
- {
- EventMetadata metadata = this.CreateEventMetadata(relativePath, e);
- metadata.Add("commandId", commandId);
- this.LogUnhandledExceptionAndExit(nameof(this.OnEnumerateDirectory), metadata);
- }
-
- return Result.EIOError;
- }
-
- private Result CreatePlaceholders(string directoryRelativePath, IEnumerable projectedItems, string triggeringProcessName)
- {
- foreach (ProjectedFileInfo fileInfo in projectedItems)
- {
- string childRelativePath = Path.Combine(directoryRelativePath, fileInfo.Name);
-
- string sha;
- FileSystemResult fileSystemResult;
- if (fileInfo.IsFolder)
- {
- sha = string.Empty;
- fileSystemResult = this.WritePlaceholderDirectory(childRelativePath);
- }
- else
- {
- sha = fileInfo.Sha.ToString();
-
- // Writing placeholders on Mac does not require a file size
- fileSystemResult = this.WritePlaceholderFile(childRelativePath, DummyFileSize, sha);
- }
-
- Result result = (Result)fileSystemResult.RawResult;
- if (result != Result.Success)
- {
- EventMetadata metadata = this.CreateEventMetadata(childRelativePath);
- metadata.Add("fileInfo.Name", fileInfo.Name);
- metadata.Add("fileInfo.Size", fileInfo.Size);
- metadata.Add("fileInfo.IsFolder", fileInfo.IsFolder);
- metadata.Add(nameof(result), result.ToString());
- metadata.Add(nameof(sha), sha);
- this.Context.Tracer.RelatedError(metadata, $"{nameof(this.CreatePlaceholders)}: Write placeholder failed");
-
- if (result == Result.EIOError)
- {
- // If there is an IO error writing the placeholder then the file might already exist and it needs to
- // be added to the modified paths so that git will show any differences or errors when interacting with the file
- // This will happen in the include mode when the user creates a file that is already in the files that
- // should be projected but we are trying to create the placeholder after it has already been created
- this.FileSystemCallbacks.OnFileConvertedToFull(childRelativePath);
- }
- else
- {
- return result;
- }
- }
- else
- {
- if (fileInfo.IsFolder)
- {
- this.FileSystemCallbacks.OnPlaceholderFolderCreated(childRelativePath, triggeringProcessName);
- }
- else
- {
- this.FileSystemCallbacks.OnPlaceholderFileCreated(childRelativePath, sha, triggeringProcessName);
- }
- }
- }
-
- this.FileSystemCallbacks.OnPlaceholderFolderExpanded(directoryRelativePath);
-
- return Result.Success;
- }
-
- private class GetFileStreamException : Exception
- {
- public GetFileStreamException(Result errorCode)
- : this("GetFileStreamException exception, error: " + errorCode.ToString(), errorCode)
- {
- }
-
- public GetFileStreamException(string message, Result result)
- : base(message)
- {
- this.Result = result;
- }
-
- public Result Result { get; }
- }
-
- private class GetSymLinkTargetException : Exception
- {
- public GetSymLinkTargetException(string message)
- : base(message)
- {
- }
- }
- }
-}
diff --git a/GVFS/GVFS.Platform.Mac/MacPlatform.Shared.cs b/GVFS/GVFS.Platform.Mac/MacPlatform.Shared.cs
deleted file mode 100644
index c2dfcf071f..0000000000
--- a/GVFS/GVFS.Platform.Mac/MacPlatform.Shared.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-using System;
-using System.IO;
-using GVFS.Common;
-using GVFS.Platform.POSIX;
-
-namespace GVFS.Platform.Mac
-{
- public partial class MacPlatform
- {
- public const string DotGVFSRoot = ".gvfs";
- public const string UpgradeConfirmMessage = "`sudo gvfs upgrade --confirm --no-verify`";
-
- public static string GetDataRootForGVFSImplementation()
- {
- return Path.Combine(
- Environment.GetEnvironmentVariable("HOME"),
- "Library",
- "Application Support",
- "GVFS");
- }
-
- public static string GetDataRootForGVFSComponentImplementation(string componentName)
- {
- return Path.Combine(GetDataRootForGVFSImplementation(), componentName);
- }
-
- public static bool TryGetGVFSEnlistmentRootImplementation(string directory, out string enlistmentRoot, out string errorMessage)
- {
- return POSIXPlatform.TryGetGVFSEnlistmentRootImplementation(directory, DotGVFSRoot, out enlistmentRoot, out errorMessage);
- }
-
- public static string GetUpgradeHighestAvailableVersionDirectoryImplementation()
- {
- return GetUpgradeNonProtectedDirectoryImplementation();
- }
-
- public static string GetUpgradeNonProtectedDirectoryImplementation()
- {
- return Path.Combine(GetDataRootForGVFSImplementation(), ProductUpgraderInfo.UpgradeDirectoryName);
- }
-
- public static string GetNamedPipeNameImplementation(string enlistmentRoot)
- {
- return POSIXPlatform.GetNamedPipeNameImplementation(enlistmentRoot, DotGVFSRoot);
- }
-
- public static string GetUpgradeReminderNotificationImplementation()
- {
- return $"A new version of VFS for Git is available. Run {UpgradeConfirmMessage} to upgrade.";
- }
-
- private string GetUpgradeNonProtectedDataDirectory()
- {
- return GetUpgradeNonProtectedDirectoryImplementation();
- }
- }
-}
diff --git a/GVFS/GVFS.Platform.Mac/MacPlatform.cs b/GVFS/GVFS.Platform.Mac/MacPlatform.cs
deleted file mode 100644
index 64030cde98..0000000000
--- a/GVFS/GVFS.Platform.Mac/MacPlatform.cs
+++ /dev/null
@@ -1,273 +0,0 @@
-using GVFS.Common;
-using GVFS.Common.FileSystem;
-using GVFS.Common.Tracing;
-using GVFS.Platform.POSIX;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Xml;
-using System.Xml.Linq;
-using System.Xml.XPath;
-
-namespace GVFS.Platform.Mac
-{
- public partial class MacPlatform : POSIXPlatform
- {
- private const string UpgradeProtectedDataDirectory = "/usr/local/vfsforgit_upgrader";
- private const string DiagnosticReportsDirectory = "/Library/Logs/DiagnosticReports";
- private const string PanicFileNamePattern = "*panic";
- private const string SystemInstallerLogPath = "/var/log/install.log";
-
- public MacPlatform() : base(
- underConstruction: new UnderConstructionFlags(
- supportsGVFSUpgrade: true,
- supportsGVFSConfig: true,
- supportsNuGetEncryption: false,
- supportsNuGetVerification: false))
- {
- }
-
- public override IDiskLayoutUpgradeData DiskLayoutUpgrade { get; } = new MacDiskLayoutUpgradeData();
- public override IKernelDriver KernelDriver { get; } = new ProjFSKext();
- public override string Name { get => "macOS"; }
- public override GVFSPlatformConstants Constants { get; } = new MacPlatformConstants();
- public override IPlatformFileSystem FileSystem { get; } = new MacFileSystem();
-
- public override string GVFSConfigPath
- {
- get
- {
- return Path.Combine(this.Constants.GVFSBinDirectoryPath, LocalGVFSConfig.FileName);
- }
- }
-
- ///
- /// On the Mac VFSForGit installer messages get captured in the system
- /// wide installer log file. There is no customized log file specific
- /// to VFSForGit installer.
- ///
- public override bool SupportsSystemInstallLog
- {
- get
- {
- return true;
- }
- }
-
- public override string GetOSVersionInformation()
- {
- ProcessResult result = ProcessHelper.Run("sw_vers", args: string.Empty, redirectOutput: true);
- return string.IsNullOrWhiteSpace(result.Output) ? result.Errors : result.Output;
- }
-
- public override string GetSecureDataRootForGVFS()
- {
- // On the Mac, unlike Windows, there is no separate secure data root directory.
- return MacPlatform.GetDataRootForGVFSImplementation();
- }
-
- public override string GetSecureDataRootForGVFSComponent(string componentName)
- {
- // On the Mac, unlike Windows, there is no separate secure data root directory.
- return MacPlatform.GetDataRootForGVFSComponentImplementation(componentName);
- }
-
- public override string GetCommonAppDataRootForGVFS()
- {
- return this.GetSecureDataRootForGVFS();
- }
-
- public override string GetLogsDirectoryForGVFSComponent(string componentName)
- {
- return Path.Combine(this.GetCommonAppDataRootForGVFS(), componentName);
- }
-
- public override bool TryGetGVFSEnlistmentRoot(string directory, out string enlistmentRoot, out string errorMessage)
- {
- return MacPlatform.TryGetGVFSEnlistmentRootImplementation(directory, out enlistmentRoot, out errorMessage);
- }
-
- public override string GetNamedPipeName(string enlistmentRoot)
- {
- return MacPlatform.GetNamedPipeNameImplementation(enlistmentRoot);
- }
-
- public override FileBasedLock CreateFileBasedLock(
- PhysicalFileSystem fileSystem,
- ITracer tracer,
- string lockPath)
- {
- return new MacFileBasedLock(fileSystem, tracer, lockPath);
- }
-
- public override string GetUpgradeProtectedDataDirectory()
- {
- return UpgradeProtectedDataDirectory;
- }
-
- public override string GetUpgradeHighestAvailableVersionDirectory()
- {
- return GetUpgradeHighestAvailableVersionDirectoryImplementation();
- }
-
- ///
- /// This is the directory in which the upgradelogs directory should go.
- /// There can be multiple logs directories, so here we return the containing
- /// directory.
- ///
- public override string GetUpgradeLogDirectoryParentDirectory()
- {
- return this.GetUpgradeNonProtectedDataDirectory();
- }
-
- public override string GetSystemInstallerLogPath()
- {
- return SystemInstallerLogPath;
- }
-
- public override Dictionary GetPhysicalDiskInfo(string path, bool sizeStatsOnly)
- {
- // DiskUtil will return disk statistics in xml format
- ProcessResult processResult = ProcessHelper.Run("diskutil", "info -plist /", true);
- Dictionary result = new Dictionary();
- if (string.IsNullOrEmpty(processResult.Output))
- {
- result.Add("DiskUtilError", processResult.Errors);
- return result;
- }
-
- try
- {
- // Parse the XML looking for FilesystemType
- XDocument xmlDoc = XDocument.Parse(processResult.Output);
- XElement filesystemTypeValue = xmlDoc.XPathSelectElement("plist/dict/key[text()=\"FilesystemType\"]")?.NextNode as XElement;
- result.Add("FileSystemType", filesystemTypeValue != null ? filesystemTypeValue.Value: "Not Found");
- }
- catch (XmlException ex)
- {
- result.Add("DiskUtilError", ex.ToString());
- }
-
- return result;
- }
-
- public override ProductUpgraderPlatformStrategy CreateProductUpgraderPlatformInteractions(
- PhysicalFileSystem fileSystem,
- ITracer tracer)
- {
- return new MacProductUpgraderPlatformStrategy(fileSystem, tracer);
- }
-
- public override void IsServiceInstalledAndRunning(string name, out bool installed, out bool running)
- {
- string currentUser = this.GetCurrentUser();
- MacDaemonController macDaemonController = new MacDaemonController(new ProcessRunnerImpl());
- List daemons;
- if (!macDaemonController.TryGetDaemons(currentUser, out daemons, out string error))
- {
- installed = false;
- running = false;
- }
-
- MacDaemonController.DaemonInfo gvfsService = daemons.FirstOrDefault(sc => string.Equals(sc.Name, "org.vfsforgit.service"));
- installed = gvfsService != null;
- running = installed && gvfsService.IsRunning;
- }
-
- public override bool TryCopyPanicLogs(string copyToDir, out string error)
- {
- error = null;
- try
- {
- if (!Directory.Exists(DiagnosticReportsDirectory))
- {
- return true;
- }
-
- string copyToPanicDir = Path.Combine(copyToDir, ProjFSKext.DriverLogDirectory, "panic_logs");
- Directory.CreateDirectory(copyToPanicDir);
-
- foreach (string filePath in Directory.GetFiles(DiagnosticReportsDirectory, PanicFileNamePattern))
- {
- try
- {
- // We only include panic logs caused by our kext
- // Panics caused by our kext will be in the form DriverName(Version)
- // We match the minimal requirement here
- if (File.ReadAllText(filePath).Contains(ProjFSKext.DriverName + "("))
- {
- File.Copy(filePath, Path.Combine(copyToPanicDir, Path.GetFileName(filePath)));
- }
- }
- catch (Exception ex)
- {
- error = error == null ? string.Empty : error + "\n";
- error += $"{nameof(this.TryCopyPanicLogs)}: Failed to handle log {filePath}: {ex.ToString()}";
- }
- }
- }
- catch (Exception ex)
- {
- error = error == null ? string.Empty : error + "\n";
- error += $"{nameof(this.TryCopyPanicLogs)}: Failed to copy panic logs: {ex.ToString()}";
- return false;
- }
-
- return error == null;
- }
-
- public class MacPlatformConstants : POSIXPlatformConstants
- {
- public override string InstallerExtension
- {
- get { return ".dmg"; }
- }
-
- public override string WorkingDirectoryBackingRootPath
- {
- get { return GVFSConstants.WorkingDirectoryRootName; }
- }
-
- public override string DotGVFSRoot
- {
- get { return MacPlatform.DotGVFSRoot; }
- }
-
- public override string GVFSBinDirectoryPath
- {
- get { return Path.Combine("/usr", "local", this.GVFSBinDirectoryName); }
- }
-
- public override string GVFSBinDirectoryName
- {
- get { return "vfsforgit"; }
- }
-
- // Documented here (in the addressing section): https://www.unix.com/man-page/mojave/4/unix/
- public override int MaxPipePathLength => 104;
-
- public override string UpgradeInstallAdviceMessage
- {
- get { return $"When ready, run {this.UpgradeConfirmCommandMessage} to upgrade."; }
- }
-
- public override string UpgradeConfirmCommandMessage
- {
- get { return UpgradeConfirmMessage; }
- }
-
- public override string StartServiceCommandMessage
- {
- get { return "`launchctl load /Library/LaunchAgents/org.vfsforgit.service.plist`"; }
- }
-
- public override string RunUpdateMessage
- {
- get { return $"Run {UpgradeConfirmMessage}."; }
- }
-
- public override bool CaseSensitiveFileSystem => false;
- }
- }
-}
diff --git a/GVFS/GVFS.Platform.Mac/MacProductUpgraderPlatformStrategy.cs b/GVFS/GVFS.Platform.Mac/MacProductUpgraderPlatformStrategy.cs
deleted file mode 100644
index 3237caad82..0000000000
--- a/GVFS/GVFS.Platform.Mac/MacProductUpgraderPlatformStrategy.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-using GVFS.Common;
-using GVFS.Common.FileSystem;
-using GVFS.Common.Tracing;
-using System;
-using System.IO;
-
-namespace GVFS.Platform.Mac
-{
- public class MacProductUpgraderPlatformStrategy : ProductUpgraderPlatformStrategy
- {
- public MacProductUpgraderPlatformStrategy(PhysicalFileSystem fileSystem, ITracer tracer)
- : base(fileSystem, tracer)
- {
- }
-
- public override bool TryPrepareLogDirectory(out string error)
- {
- error = null;
- return true;
- }
-
- public override bool TryPrepareApplicationDirectory(out string error)
- {
- string upgradeApplicationDirectory = ProductUpgraderInfo.GetUpgradeApplicationDirectory();
-
- Exception deleteDirectoryException;
- if (this.FileSystem.DirectoryExists(upgradeApplicationDirectory) &&
- !this.FileSystem.TryDeleteDirectory(upgradeApplicationDirectory, out deleteDirectoryException))
- {
- error = $"Failed to delete {upgradeApplicationDirectory} - {deleteDirectoryException.Message}";
-
- this.TraceException(deleteDirectoryException, nameof(this.TryPrepareApplicationDirectory), $"Error deleting {upgradeApplicationDirectory}.");
- return false;
- }
-
- this.FileSystem.CreateDirectory(upgradeApplicationDirectory);
-
- error = null;
- return true;
- }
-
- public override bool TryPrepareDownloadDirectory(out string error)
- {
- string directory = ProductUpgraderInfo.GetAssetDownloadsPath();
-
- Exception deleteDirectoryException;
- if (this.FileSystem.DirectoryExists(directory) &&
- !this.FileSystem.TryDeleteDirectory(directory, out deleteDirectoryException))
- {
- error = $"Failed to delete {directory} - {deleteDirectoryException.Message}";
-
- this.TraceException(deleteDirectoryException, nameof(this.TryPrepareDownloadDirectory), $"Error deleting {directory}.");
- return false;
- }
-
- this.FileSystem.CreateDirectory(directory);
-
- error = null;
- return true;
- }
- }
-}
diff --git a/GVFS/GVFS.Platform.Mac/ProjFSKext.cs b/GVFS/GVFS.Platform.Mac/ProjFSKext.cs
deleted file mode 100644
index debaf35e6f..0000000000
--- a/GVFS/GVFS.Platform.Mac/ProjFSKext.cs
+++ /dev/null
@@ -1,137 +0,0 @@
-using GVFS.Common;
-using GVFS.Common.FileSystem;
-using GVFS.Common.Tracing;
-using PrjFSLib.Mac;
-using System;
-using System.IO;
-using System.Linq;
-
-namespace GVFS.Platform.Mac
-{
- public class ProjFSKext : IKernelDriver
- {
- public const string DriverName = "org.vfsforgit.PrjFSKext";
- public const string DriverLogDirectory = "PrjFSKext";
-
- private const int LoadKext_ExitCode_Success = 0;
-
- // This exit code was found in the following article
- // https://developer.apple.com/library/archive/technotes/tn2459/_index.html
- private const int LoadKext_ExitCode_NotApproved = 27;
-
- public bool EnumerationExpandsDirectories { get; } = true;
- public bool EmptyPlaceholdersRequireFileSize { get; } = false;
-
- public string LogsFolderPath
- {
- get
- {
- return Path.Combine(System.IO.Path.GetTempPath(), DriverLogDirectory);
- }
- }
-
- public bool IsGVFSUpgradeSupported()
- {
- return true;
- }
-
- public bool IsSupported(string normalizedEnlistmentRootPath, out string warning, out string error)
- {
- warning = null;
- error = null;
-
- string pathRoot = Path.GetPathRoot(normalizedEnlistmentRootPath);
- DriveInfo rootDriveInfo = DriveInfo.GetDrives().FirstOrDefault(x => x.Name == pathRoot);
- if (rootDriveInfo == null)
- {
- warning = $"Unable to ensure that '{normalizedEnlistmentRootPath}' is an APFS or HFS+ volume.";
- }
- else if (!string.Equals(rootDriveInfo.DriveFormat, "APFS", StringComparison.OrdinalIgnoreCase) &&
- !string.Equals(rootDriveInfo.DriveFormat, "HFS", StringComparison.OrdinalIgnoreCase))
- {
- error = $"Error: Currently only APFS and HFS+ volumes are supported. Ensure repo is located into an APFS or HFS+ volume.";
- return false;
- }
-
- return true;
- }
-
- public bool TryFlushLogs(out string error)
- {
- Directory.CreateDirectory(this.LogsFolderPath);
- ProcessResult logShowOutput = ProcessHelper.Run("log", args: "show --predicate \"subsystem contains \'org.vfsforgit\'\" --info", redirectOutput: true);
- File.WriteAllText(Path.Combine(this.LogsFolderPath, "PrjFSKext.log"), logShowOutput.Output);
- error = string.Empty;
-
- return true;
- }
-
- public bool IsReady(JsonTracer tracer, string enlistmentRoot, TextWriter output, out string error)
- {
- error = null;
- return
- this.IsKextLoaded() ||
- this.TryLoad(tracer, output, out error);
- }
-
- public bool TryPrepareFolderForCallbacks(string folderPath, out string error, out Exception exception)
- {
- exception = null;
- error = string.Empty;
- Result result = VirtualizationInstance.ConvertDirectoryToVirtualizationRoot(folderPath);
- if (result != Result.Success)
- {
- error = "Failed to prepare \"" + folderPath + "\" for callbacks, error: " + result.ToString("F");
- return false;
- }
-
- return true;
- }
-
- public bool RegisterForOfflineIO()
- {
- return PrjFSLib.Mac.Managed.OfflineIO.RegisterForOfflineIO();
- }
-
- public bool UnregisterForOfflineIO()
- {
- return PrjFSLib.Mac.Managed.OfflineIO.UnregisterForOfflineIO();
- }
-
- private bool TryLoad(ITracer tracer, TextWriter output, out string errorMessage)
- {
- output?.WriteLine("Driver not loaded. Attempting to load. You may be prompted for sudo password...");
- EventMetadata metadata = new EventMetadata();
- ProcessResult loadKext = ProcessHelper.Run("sudo", "/sbin/kextload -b " + DriverName);
- if (loadKext.ExitCode == LoadKext_ExitCode_Success)
- {
- tracer.RelatedWarning(metadata, $"{DriverName} was successfully loaded but should have been autoloaded.", Keywords.Telemetry);
- errorMessage = null;
- return true;
- }
- else if (loadKext.ExitCode == LoadKext_ExitCode_NotApproved)
- {
- tracer.RelatedError("Kext unable to load. Not approved by the user");
- errorMessage = DriverName + @" was unable to load. Please check and make sure you have allowed the extension in
-System Preferences -> Security & Privacy";
- }
- else
- {
- metadata.Add("ExitCode", loadKext.ExitCode);
- metadata.Add("Output", loadKext.Output);
- metadata.Add("Errors", loadKext.Errors);
- tracer.RelatedError(metadata, "Failed to load kext");
-
- errorMessage = DriverName + " is not loaded. Make sure the kext is loaded and try again.";
- }
-
- return false;
- }
-
- private bool IsKextLoaded()
- {
- ProcessResult loadedKexts = ProcessHelper.Run("kextstat", args: "-b " + DriverName, redirectOutput: true);
- return loadedKexts.Output.Contains(DriverName);
- }
- }
-}
diff --git a/GVFS/GVFS.Platform.Mac/Properties/AssemblyInfo.cs b/GVFS/GVFS.Platform.Mac/Properties/AssemblyInfo.cs
deleted file mode 100644
index a71456402b..0000000000
--- a/GVFS/GVFS.Platform.Mac/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("GVFS.Platform.Mac")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("GVFS.Platform.Mac")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2019")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("4ce404e7-d3fc-471c-993c-64615861ea63")]
diff --git a/GVFS/GVFS.Service/GVFS.Service.Mac.csproj b/GVFS/GVFS.Service/GVFS.Service.Mac.csproj
deleted file mode 100644
index 4f34b2c450..0000000000
--- a/GVFS/GVFS.Service/GVFS.Service.Mac.csproj
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
- Exe
- GVFS.Service
- GVFS.Service
-
- netcoreapp2.1; netstandard2.0
- x64
- osx-x64
- false
- true
-
-
-
- $(GVFSVersion)
-
-
- $(GVFSVersion)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- all
-
-
-
diff --git a/GVFS/GVFS.UnitTests.Windows/GVFS.UnitTests.Windows.csproj b/GVFS/GVFS.UnitTests.Windows/GVFS.UnitTests.Windows.csproj
index 361446da6f..2150248d73 100644
--- a/GVFS/GVFS.UnitTests.Windows/GVFS.UnitTests.Windows.csproj
+++ b/GVFS/GVFS.UnitTests.Windows/GVFS.UnitTests.Windows.csproj
@@ -141,10 +141,6 @@
-
- {fac6efc5-a890-4cb2-8c80-6358e358c637}
- PrjFSLib.Mac.Managed
-
{374bf1e5-0b2d-4d4a-bd5e-4212299def09}
GVFS.Common
@@ -153,10 +149,6 @@
{1118b427-7063-422f-83b9-5023c8ec5a7a}
GVFS.GVFlt
-
- {1dac3da6-3d21-4917-b9a8-d60c8712252a}
- GVFS.Platform.Mac
-
{15fae44c-0d21-4312-9fd3-28f05a5ab7a6}
GVFS.Platform.POSIX
@@ -169,9 +161,9 @@
{93b403fd-dafb-46c5-9636-b122792a548a}
GVFS.Service.UI
-
- {03769a07-f216-456b-886b-e07caf6c5e81}
- GVFS.Service.Mac
+
+ {b8c1dfba-cafd-4f7e-a1a3-e11907b5467b}
+ GVFS.Service.Windows
{72701bc3-5da9-4c7a-bf10-9e98c9fc8eac}
@@ -194,8 +186,326 @@
-
- NetCore\%(RecursiveDir)\%(Filename)%(Extension)
+
+ NetCore\Category\\CategoryConstants.cs
+
+
+ NetCore\CommandLine\\HooksInstallerTests.cs
+
+
+ NetCore\Common\\AzDevOpsOrgFromNuGetFeedTests.cs
+
+
+ NetCore\Common\\BackgroundTaskQueueTests.cs
+
+
+ NetCore\Common\\CacheServerResolverTests.cs
+
+
+ NetCore\Common\Database\\GVFSDatabaseTests.cs
+
+
+ NetCore\Common\Database\\PlaceholderTableTests.cs
+
+
+ NetCore\Common\Database\\SparseTableTests.cs
+
+
+ NetCore\Common\Database\\TableTests.cs
+
+
+ NetCore\Common\\EpochConverterTests.cs
+
+
+ NetCore\Common\\FileBasedDictionaryTests.cs
+
+
+ NetCore\Common\\GitCommandLineParserTests.cs
+
+
+ NetCore\Common\\GitConfigHelperTests.cs
+
+
+ NetCore\Common\\GitObjectsTests.cs
+
+
+ NetCore\Common\\GitPathConverterTests.cs
+
+
+ NetCore\Common\\GitStatusCacheTests.cs
+
+
+ NetCore\Common\\GitVersionTests.cs
+
+
+ NetCore\Common\Git\\GitSslTests.cs
+
+
+ NetCore\Common\Git\\Sha1IdTests.cs
+
+
+ NetCore\Common\\GVFSEnlistmentHealthTests.cs
+
+
+ NetCore\Common\\GVFSEnlistmentTests.cs
+
+
+ NetCore\Common\\GVFSLockTests.cs
+
+
+ NetCore\Common\\InstallManifestTests.cs
+
+
+ NetCore\Common\\JsonTracerTests.cs
+
+
+ NetCore\Common\\LegacyPlaceholderDatabaseTests.cs
+
+
+ NetCore\Common\\LibGit2RepoInvokerTests.cs
+
+
+ NetCore\Common\\ModifiedPathsDatabaseTests.cs
+
+
+ NetCore\Common\\NamedPipeStreamReaderWriterTests.cs
+
+
+ NetCore\Common\\NamedPipeTests.cs
+
+
+ NetCore\Common\NuGetUpgrade\\NuGetUpgraderTests.cs
+
+
+ NetCore\Common\NuGetUpgrade\\OrgNuGetUpgraderTests.cs
+
+
+ NetCore\Common\\OrgInfoApiClientTests.cs
+
+
+ NetCore\Common\\PathsTests.cs
+
+
+ NetCore\Common\\PhysicalFileSystemDeleteTests.cs
+
+
+ NetCore\Common\\ProductUpgraderInfoTests.cs
+
+
+ NetCore\Common\\RefLogEntryTests.cs
+
+
+ NetCore\Common\\RetryBackoffTests.cs
+
+
+ NetCore\Common\\RetryConfigTests.cs
+
+
+ NetCore\Common\\RetryWrapperTests.cs
+
+
+ NetCore\Common\\SHA1UtilTests.cs
+
+
+ NetCore\Common\\TryCreateProductUpgraderTests.cs
+
+
+ NetCore\Git\\GitAuthenticationTests.cs
+
+
+ NetCore\Git\\GitObjectsTests.cs
+
+
+ NetCore\Git\\GitProcessTests.cs
+
+
+ NetCore\Git\\GVFSGitObjectsTests.cs
+
+
+ NetCore\Maintenance\\GitMaintenanceQueueTests.cs
+
+
+ NetCore\Maintenance\\GitMaintenanceStepTests.cs
+
+
+ NetCore\Maintenance\\LooseObjectStepTests.cs
+
+
+ NetCore\Maintenance\\PackfileMaintenanceStepTests.cs
+
+
+ NetCore\Maintenance\\PostFetchStepTests.cs
+
+
+ NetCore\Mock\Common\\MockFileBasedLock.cs
+
+
+ NetCore\Mock\Common\\MockGitStatusCache.cs
+
+
+ NetCore\Mock\Common\\MockGVFSEnlistment.cs
+
+
+ NetCore\Mock\Common\\MockLocalGVFSConfig.cs
+
+
+ NetCore\Mock\Common\\MockLocalGVFSConfigBuilder.cs
+
+
+ NetCore\Mock\Common\\MockPhysicalGitObjects.cs
+
+
+ NetCore\Mock\Common\\MockPlatform.cs
+
+
+ NetCore\Mock\Common\\MockProductUpgraderPlatformStrategy.cs
+
+
+ NetCore\Mock\Common\\MockTracer.cs
+
+
+ NetCore\Mock\Common\Tracing\\MockListener.cs
+
+
+ NetCore\Mock\FileSystem\\ConfigurableFileSystem.cs
+
+
+ NetCore\Mock\FileSystem\\MockDirectory.cs
+
+
+ NetCore\Mock\FileSystem\\MockFile.cs
+
+
+ NetCore\Mock\FileSystem\\MockFileSystem.cs
+
+
+ NetCore\Mock\FileSystem\\MockFileSystemCallbacks.cs
+
+
+ NetCore\Mock\FileSystem\\MockFileSystemWithCallbacks.cs
+
+
+ NetCore\Mock\FileSystem\\MockPlatformFileSystem.cs
+
+
+ NetCore\Mock\Git\\MockBatchHttpGitObjects.cs
+
+
+ NetCore\Mock\Git\\MockGitInstallation.cs
+
+
+ NetCore\Mock\Git\\MockGitProcess.cs
+
+
+ NetCore\Mock\Git\\MockGitRepo.cs
+
+
+ NetCore\Mock\Git\\MockGVFSGitObjects.cs
+
+
+ NetCore\Mock\Git\\MockHttpGitObjects.cs
+
+
+ NetCore\Mock\Git\\MockLibGit2Repo.cs
+
+
+ NetCore\Mock\\MockCacheServerInfo.cs
+
+
+ NetCore\Mock\\MockGitHubUpgrader.cs
+
+
+ NetCore\Mock\\MockInstallerPreRunChecker.cs
+
+
+ NetCore\Mock\\MockTextWriter.cs
+
+
+ NetCore\Mock\\ReusableMemoryStream.cs
+
+
+ NetCore\Mock\Virtualization\Background\\MockBackgroundTaskManager.cs
+
+
+ NetCore\Mock\Virtualization\BlobSize\\MockBlobSizesDatabase.cs
+
+
+ NetCore\Mock\Virtualization\FileSystem\\MockFileSystemVirtualizer.cs
+
+
+ NetCore\Mock\Virtualization\Projection\\MockGitIndexProjection.cs
+
+
+ NetCore\Prefetch\\BatchObjectDownloadStageTests.cs
+
+
+ NetCore\Prefetch\\BlobPrefetcherTests.cs
+
+
+ NetCore\Prefetch\\DiffHelperTests.cs
+
+
+ NetCore\Prefetch\\DiffTreeResultTests.cs
+
+
+ NetCore\Prefetch\\PrefetchPacksDeserializerTests.cs
+
+
+ NetCore\Prefetch\\PrefetchTracingTests.cs
+
+
+ NetCore\\Program.cs
+
+
+ NetCore\Service\\RepoRegistryTests.cs
+
+
+ NetCore\\Setup.cs
+
+
+ NetCore\Tracing\\EventListenerTests.cs
+
+
+ NetCore\Tracing\\QueuedPipeStringWriterTests.cs
+
+
+ NetCore\Tracing\\TelemetryDaemonEventListenerTests.cs
+
+
+ NetCore\Upgrader\\ProductUpgraderTests.cs
+
+
+ NetCore\Upgrader\\UpgradeOrchestratorTests.cs
+
+
+ NetCore\Upgrader\\UpgradeOrchestratorWithGitHubUpgraderTests.cs
+
+
+ NetCore\Upgrader\\UpgradeTests.cs
+
+
+ NetCore\Virtualization\\FileSystemCallbacksTests.cs
+
+
+ NetCore\Virtualization\Projection\\GitIndexEntryTests.cs
+
+
+ NetCore\Virtualization\Projection\\LazyUTF8StringTests.cs
+
+
+ NetCore\Virtualization\Projection\\ObjectPoolTests.cs
+
+
+ NetCore\Virtualization\Projection\\SortedFolderEntriesTests.cs
+
+
+ NetCore\Virtual\\CommonRepoSetup.cs
+
+
+ NetCore\Virtual\\FileSystemVirtualizerTester.cs
+
+
+ NetCore\Virtual\\TestsWithCommonRepo.cs
Data\%(RecursiveDir)\%(Filename)%(Extension)
@@ -230,4 +540,4 @@
-->
-
+
\ No newline at end of file
diff --git a/GVFS/GVFS.UnitTests/GVFS.UnitTests.csproj b/GVFS/GVFS.UnitTests/GVFS.UnitTests.csproj
index 786009ac60..8013af848b 100644
--- a/GVFS/GVFS.UnitTests/GVFS.UnitTests.csproj
+++ b/GVFS/GVFS.UnitTests/GVFS.UnitTests.csproj
@@ -1,4 +1,4 @@
-
+
Exe
@@ -51,10 +51,9 @@
-
-
-
+
+
diff --git a/GVFS/GVFS.UnitTests/Mock/Mac/MacFileSystemVirtualizerTester.cs b/GVFS/GVFS.UnitTests/Mock/Mac/MacFileSystemVirtualizerTester.cs
deleted file mode 100644
index 6877ae0dcd..0000000000
--- a/GVFS/GVFS.UnitTests/Mock/Mac/MacFileSystemVirtualizerTester.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-using GVFS.Platform.Mac;
-using GVFS.Tests.Should;
-using GVFS.UnitTests.Virtual;
-using GVFS.Virtualization.FileSystem;
-using PrjFSLib.Mac;
-using System;
-using System.IO;
-
-namespace GVFS.UnitTests.Mock.Mac
-{
- public class MacFileSystemVirtualizerTester : FileSystemVirtualizerTester
- {
- public MacFileSystemVirtualizerTester(CommonRepoSetup repo)
- : base(repo)
- {
- }
-
- public MacFileSystemVirtualizerTester(CommonRepoSetup repo, string[] projectedFiles)
- : base(repo, projectedFiles)
- {
- }
-
- public MockVirtualizationInstance MockVirtualization { get; private set; }
- public MacFileSystemVirtualizer MacVirtualizer { get; private set; }
-
- public void InvokeOnGetFileStream(Result expectedResult = Result.Pending, byte[] providerId = null)
- {
- if (providerId == null)
- {
- providerId = MacFileSystemVirtualizer.PlaceholderVersionId;
- }
-
- this.MockVirtualization.OnGetFileStream(
- commandId: 1,
- relativePath: "test.txt",
- providerId: MacFileSystemVirtualizer.PlaceholderVersionId,
- contentId: CommonRepoSetup.DefaultContentId,
- triggeringProcessId: 2,
- triggeringProcessName: "UnitTest",
- fileHandle: IntPtr.Zero).ShouldEqual(expectedResult);
- }
-
- public void InvokeUpdatePlaceholderIfNeeded(string fileName, FileSystemResult expectedResult, UpdateFailureCause expectedFailureCause)
- {
- UpdateFailureReason failureReason = UpdateFailureReason.NoFailure;
- this.MacVirtualizer.UpdatePlaceholderIfNeeded(
- fileName,
- DateTime.Now,
- DateTime.Now,
- DateTime.Now,
- DateTime.Now,
- 0,
- 15,
- string.Empty,
- UpdatePlaceholderType.AllowReadOnly,
- out failureReason)
- .ShouldEqual(expectedResult);
- failureReason.ShouldEqual((UpdateFailureReason)expectedFailureCause);
- }
-
- protected override FileSystemVirtualizer CreateVirtualizer(CommonRepoSetup repo)
- {
- this.MockVirtualization = new MockVirtualizationInstance();
- this.MacVirtualizer = new MacFileSystemVirtualizer(repo.Context, repo.GitObjects, this.MockVirtualization);
- return this.MacVirtualizer;
- }
- }
-}
diff --git a/GVFS/GVFS.UnitTests/Mock/Mac/MockVirtualizationInstance.cs b/GVFS/GVFS.UnitTests/Mock/Mac/MockVirtualizationInstance.cs
deleted file mode 100644
index f53aca9c74..0000000000
--- a/GVFS/GVFS.UnitTests/Mock/Mac/MockVirtualizationInstance.cs
+++ /dev/null
@@ -1,152 +0,0 @@
-using GVFS.Common;
-using GVFS.Tests.Should;
-using PrjFSLib.Mac;
-using System;
-using System.Collections.Concurrent;
-using System.Threading;
-
-namespace GVFS.UnitTests.Mock.Mac
-{
- public class MockVirtualizationInstance : VirtualizationInstance, IDisposable
- {
- private AutoResetEvent commandCompleted;
-
- public MockVirtualizationInstance()
- {
- this.commandCompleted = new AutoResetEvent(false);
- this.CreatedPlaceholders = new ConcurrentDictionary();
- this.UpdatedPlaceholders = new ConcurrentDictionary();
- this.CreatedSymLinks = new ConcurrentHashSet();
- this.WriteFileReturnResult = Result.Success;
- }
-
- public Result CompletionResult { get; set; }
- public uint BytesWritten { get; private set; }
- public Result WriteFileReturnResult { get; set; }
- public Result UpdatePlaceholderIfNeededResult { get; set; }
- public UpdateFailureCause UpdatePlaceholderIfNeededFailureCause { get; set; }
- public Result DeleteFileResult { get; set; }
- public UpdateFailureCause DeleteFileUpdateFailureCause { get; set; }
-
- public ConcurrentDictionary CreatedPlaceholders { get; private set; }
- public ConcurrentDictionary UpdatedPlaceholders { get; private set; }
-
- public ConcurrentHashSet CreatedSymLinks { get; }
-
- public override EnumerateDirectoryCallback OnEnumerateDirectory { get; set; }
- public override GetFileStreamCallback OnGetFileStream { get; set; }
-
- public override Result StartVirtualizationInstance(
- string virtualizationRootFullPath,
- uint poolThreadCount)
- {
- poolThreadCount.ShouldBeAtLeast(1U, "poolThreadCount must be greater than 0");
- return Result.Success;
- }
-
- public override Result StopVirtualizationInstance()
- {
- return Result.Success;
- }
-
- public override Result WriteFileContents(
- IntPtr fileHandle,
- byte[] bytes,
- uint byteCount)
- {
- this.BytesWritten = byteCount;
- return this.WriteFileReturnResult;
- }
-
- public override Result DeleteFile(
- string relativePath,
- UpdateType updateFlags,
- out UpdateFailureCause failureCause)
- {
- failureCause = this.DeleteFileUpdateFailureCause;
- return this.DeleteFileResult;
- }
-
- public override Result WritePlaceholderDirectory(
- string relativePath)
- {
- throw new NotImplementedException();
- }
-
- public override Result WritePlaceholderFile(
- string relativePath,
- byte[] providerId,
- byte[] contentId,
- ushort fileMode)
- {
- this.CreatedPlaceholders.TryAdd(relativePath, fileMode);
- return Result.Success;
- }
-
- public override Result WriteSymLink(
- string relativePath,
- string symLinkTarget)
- {
- this.CreatedSymLinks.Add(relativePath);
- return Result.Success;
- }
-
- public override Result UpdatePlaceholderIfNeeded(
- string relativePath,
- byte[] providerId,
- byte[] contentId,
- ushort fileMode,
- UpdateType updateFlags,
- out UpdateFailureCause failureCause)
- {
- failureCause = this.UpdatePlaceholderIfNeededFailureCause;
- if (failureCause == UpdateFailureCause.NoFailure)
- {
- this.UpdatedPlaceholders[relativePath] = fileMode;
- }
-
- return this.UpdatePlaceholderIfNeededResult;
- }
-
- public override Result ReplacePlaceholderFileWithSymLink(
- string relativePath,
- string symLinkTarget,
- UpdateType updateFlags,
- out UpdateFailureCause failureCause)
- {
- this.CreatedSymLinks.Add(relativePath);
- failureCause = this.UpdatePlaceholderIfNeededFailureCause;
- return this.UpdatePlaceholderIfNeededResult;
- }
-
- public override Result CompleteCommand(
- ulong commandId,
- Result result)
- {
- this.CompletionResult = result;
- this.commandCompleted.Set();
- return Result.Success;
- }
-
- public Result WaitForCompletionStatus()
- {
- this.commandCompleted.WaitOne();
- return this.CompletionResult;
- }
-
- public override Result ConvertDirectoryToPlaceholder(
- string relativeDirectoryPath)
- {
- throw new NotImplementedException();
- }
-
- public void Dispose()
- {
- if (this.commandCompleted != null)
- {
- this.commandCompleted.Dispose();
- this.commandCompleted = null;
- }
- }
- }
-}
diff --git a/GVFS/GVFS.UnitTests/Platform.Mac/MacDaemonControllerTests.cs b/GVFS/GVFS.UnitTests/Platform.Mac/MacDaemonControllerTests.cs
deleted file mode 100644
index d8a43e2780..0000000000
--- a/GVFS/GVFS.UnitTests/Platform.Mac/MacDaemonControllerTests.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-using GVFS.Common;
-using GVFS.Platform.Mac;
-using GVFS.Tests.Should;
-using Moq;
-using NUnit.Framework;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
-
-namespace GVFS.UnitTests.Platform.Mac
-{
- [TestFixture]
- public class MacServiceProcessTests
- {
- [TestCase]
- public void CanGetServices()
- {
- Mock processHelperMock = new Mock(MockBehavior.Strict);
-
- StringBuilder sb = new StringBuilder();
- sb.AppendLine("PID\tStatus\tLabel");
- sb.AppendLine("1\t0\tcom.apple.process1");
- sb.AppendLine("2\t0\tcom.apple.process2");
- sb.AppendLine("3\t0\tcom.apple.process3");
- sb.AppendLine("-\t0\tcom.apple.process4");
-
- ProcessResult processResult = new ProcessResult(sb.ToString(), string.Empty, 0);
-
- processHelperMock.Setup(m => m.Run("/bin/launchctl", "asuser 521 /bin/launchctl list", true)).Returns(processResult);
-
- MacDaemonController daemonController = new MacDaemonController(processHelperMock.Object);
- bool success = daemonController.TryGetDaemons("521", out List daemons, out string error);
-
- success.ShouldBeTrue();
- daemons.ShouldNotBeNull();
- daemons.Count.ShouldEqual(4);
- processHelperMock.VerifyAll();
- }
- }
-}
diff --git a/GVFS/GVFS.UnitTests/Platform.Mac/MacFileSystemVirtualizerTests.cs b/GVFS/GVFS.UnitTests/Platform.Mac/MacFileSystemVirtualizerTests.cs
deleted file mode 100644
index d2bdcb8168..0000000000
--- a/GVFS/GVFS.UnitTests/Platform.Mac/MacFileSystemVirtualizerTests.cs
+++ /dev/null
@@ -1,390 +0,0 @@
-using GVFS.Common;
-using GVFS.Platform.Mac;
-using GVFS.Tests.Should;
-using GVFS.UnitTests.Category;
-using GVFS.UnitTests.Mock.Git;
-using GVFS.UnitTests.Mock.Mac;
-using GVFS.UnitTests.Virtual;
-using GVFS.Virtualization.Background;
-using GVFS.Virtualization.FileSystem;
-using GVFS.Virtualization.Projection;
-using NUnit.Framework;
-using PrjFSLib.Mac;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-
-namespace GVFS.UnitTests.Platform.Mac
-{
- [TestFixture]
- public class MacFileSystemVirtualizerTests : TestsWithCommonRepo
- {
- private static readonly Dictionary MappedResults = new Dictionary()
- {
- { Result.Success, FSResult.Ok },
- { Result.EFileNotFound, FSResult.FileOrPathNotFound },
- { Result.EPathNotFound, FSResult.FileOrPathNotFound },
- { Result.EDirectoryNotEmpty, FSResult.DirectoryNotEmpty },
- { Result.EVirtualizationInvalidOperation, FSResult.VirtualizationInvalidOperation },
- };
-
- [TestCase]
- public void ResultToFSResultMapsHResults()
- {
- foreach (Result result in Enum.GetValues(typeof(Result)))
- {
- if (MappedResults.ContainsKey(result))
- {
- MacFileSystemVirtualizer.ResultToFSResult(result).ShouldEqual(MappedResults[result]);
- }
- else
- {
- MacFileSystemVirtualizer.ResultToFSResult(result).ShouldEqual(FSResult.IOError);
- }
- }
- }
-
- [TestCase]
- public void DeleteFile()
- {
- using (MockVirtualizationInstance mockVirtualization = new MockVirtualizationInstance())
- using (MacFileSystemVirtualizer virtualizer = new MacFileSystemVirtualizer(this.Repo.Context, this.Repo.GitObjects, mockVirtualization))
- {
- const string DeleteTestFileName = "deleteMe.txt";
- UpdateFailureReason failureReason = UpdateFailureReason.NoFailure;
-
- mockVirtualization.DeleteFileResult = Result.Success;
- mockVirtualization.DeleteFileUpdateFailureCause = UpdateFailureCause.NoFailure;
- virtualizer
- .DeleteFile(DeleteTestFileName, UpdatePlaceholderType.AllowReadOnly, out failureReason)
- .ShouldEqual(new FileSystemResult(FSResult.Ok, (int)mockVirtualization.DeleteFileResult));
- failureReason.ShouldEqual((UpdateFailureReason)mockVirtualization.DeleteFileUpdateFailureCause);
-
- mockVirtualization.DeleteFileResult = Result.EFileNotFound;
- mockVirtualization.DeleteFileUpdateFailureCause = UpdateFailureCause.NoFailure;
- virtualizer
- .DeleteFile(DeleteTestFileName, UpdatePlaceholderType.AllowReadOnly, out failureReason)
- .ShouldEqual(new FileSystemResult(FSResult.FileOrPathNotFound, (int)mockVirtualization.DeleteFileResult));
- failureReason.ShouldEqual((UpdateFailureReason)mockVirtualization.DeleteFileUpdateFailureCause);
-
- // TODO: What will the result be when the UpdateFailureCause is DirtyData
- mockVirtualization.DeleteFileResult = Result.EInvalidOperation;
-
- // TODO: The result should probably be VirtualizationInvalidOperation but for now it's IOError
- mockVirtualization.DeleteFileUpdateFailureCause = UpdateFailureCause.DirtyData;
- virtualizer
- .DeleteFile(DeleteTestFileName, UpdatePlaceholderType.AllowReadOnly, out failureReason)
- .ShouldEqual(new FileSystemResult(FSResult.IOError, (int)mockVirtualization.DeleteFileResult));
- failureReason.ShouldEqual((UpdateFailureReason)mockVirtualization.DeleteFileUpdateFailureCause);
- }
- }
-
- [TestCase]
- public void UpdatePlaceholderIfNeeded()
- {
- const string UpdatePlaceholderFileName = "testUpdatePlaceholder.txt";
- using (MacFileSystemVirtualizerTester tester = new MacFileSystemVirtualizerTester(this.Repo, new[] { UpdatePlaceholderFileName }))
- {
- tester.GitIndexProjection.MockFileTypesAndModes.TryAdd(
- UpdatePlaceholderFileName,
- ConvertFileTypeAndModeToIndexFormat(GitIndexProjection.FileType.Regular, GitIndexProjection.FileMode644));
-
- tester.MockVirtualization.UpdatePlaceholderIfNeededResult = Result.Success;
- tester.MockVirtualization.UpdatePlaceholderIfNeededFailureCause = UpdateFailureCause.NoFailure;
- tester.InvokeUpdatePlaceholderIfNeeded(
- UpdatePlaceholderFileName,
- expectedResult: new FileSystemResult(FSResult.Ok, (int)Result.Success),
- expectedFailureCause: UpdateFailureCause.NoFailure);
-
- tester.MockVirtualization.UpdatedPlaceholders.ShouldContain(path => path.Key.Equals(UpdatePlaceholderFileName) && path.Value == GitIndexProjection.FileMode644);
- tester.MockVirtualization.UpdatedPlaceholders.Clear();
-
- tester.MockVirtualization.UpdatePlaceholderIfNeededResult = Result.EFileNotFound;
- tester.MockVirtualization.UpdatePlaceholderIfNeededFailureCause = UpdateFailureCause.NoFailure;
- tester.InvokeUpdatePlaceholderIfNeeded(
- UpdatePlaceholderFileName,
- expectedResult: new FileSystemResult(FSResult.FileOrPathNotFound, (int)Result.EFileNotFound),
- expectedFailureCause: UpdateFailureCause.NoFailure);
-
- // TODO: What will the result be when the UpdateFailureCause is DirtyData
- tester.MockVirtualization.UpdatePlaceholderIfNeededResult = Result.EInvalidOperation;
- tester.MockVirtualization.UpdatePlaceholderIfNeededFailureCause = UpdateFailureCause.DirtyData;
-
- // TODO: The result should probably be VirtualizationInvalidOperation but for now it's IOError
- tester.InvokeUpdatePlaceholderIfNeeded(
- UpdatePlaceholderFileName,
- expectedResult: new FileSystemResult(FSResult.IOError, (int)Result.EInvalidOperation),
- expectedFailureCause: UpdateFailureCause.DirtyData);
- }
- }
-
- [TestCase]
- public void WritePlaceholderForSymLink()
- {
- const string WriteSymLinkFileName = "testWriteSymLink.txt";
- using (MacFileSystemVirtualizerTester tester = new MacFileSystemVirtualizerTester(this.Repo, new[] { WriteSymLinkFileName }))
- {
- tester.GitIndexProjection.MockFileTypesAndModes.TryAdd(
- WriteSymLinkFileName,
- ConvertFileTypeAndModeToIndexFormat(GitIndexProjection.FileType.SymLink, fileMode: 0));
-
- tester.Virtualizer.WritePlaceholderFile(
- WriteSymLinkFileName,
- endOfFile: 0,
- sha: string.Empty).ShouldEqual(new FileSystemResult(FSResult.Ok, (int)Result.Success));
-
- tester.MockVirtualization.CreatedPlaceholders.ShouldBeEmpty();
- tester.MockVirtualization.CreatedSymLinks.Count.ShouldEqual(1);
- tester.MockVirtualization.CreatedSymLinks.ShouldContain(entry => entry.Equals(WriteSymLinkFileName));
-
- tester.BackgroundTaskShouldBeScheduled(WriteSymLinkFileName, FileSystemTask.OperationType.OnFileSymLinkCreated);
- }
- }
-
- [TestCase]
- public void UpdatePlaceholderToSymLink()
- {
- const string PlaceholderToLinkFileName = "testUpdatePlaceholderToLink.txt";
- using (MacFileSystemVirtualizerTester tester = new MacFileSystemVirtualizerTester(this.Repo, new[] { PlaceholderToLinkFileName }))
- {
- tester.GitIndexProjection.MockFileTypesAndModes.TryAdd(
- PlaceholderToLinkFileName,
- ConvertFileTypeAndModeToIndexFormat(GitIndexProjection.FileType.SymLink, fileMode: 0));
-
- tester.MockVirtualization.UpdatePlaceholderIfNeededResult = Result.Success;
- tester.MockVirtualization.UpdatePlaceholderIfNeededFailureCause = UpdateFailureCause.NoFailure;
- tester.InvokeUpdatePlaceholderIfNeeded(
- PlaceholderToLinkFileName,
- expectedResult: new FileSystemResult(FSResult.Ok, (int)Result.Success),
- expectedFailureCause: UpdateFailureCause.NoFailure);
-
- tester.MockVirtualization.UpdatedPlaceholders.Count.ShouldEqual(0, "UpdatePlaceholderIfNeeded should not be called when converting a placeholder to a link");
- tester.MockVirtualization.CreatedSymLinks.Count.ShouldEqual(1);
- tester.MockVirtualization.CreatedSymLinks.ShouldContain(entry => entry.Equals(PlaceholderToLinkFileName));
-
- tester.BackgroundTaskShouldBeScheduled(PlaceholderToLinkFileName, FileSystemTask.OperationType.OnFileSymLinkCreated);
- }
- }
-
- [TestCase]
- public void ClearNegativePathCacheIsNoOp()
- {
- using (MockVirtualizationInstance mockVirtualization = new MockVirtualizationInstance())
- using (MacFileSystemVirtualizer virtualizer = new MacFileSystemVirtualizer(this.Repo.Context, this.Repo.GitObjects, mockVirtualization))
- {
- uint totalEntryCount = 0;
- virtualizer.ClearNegativePathCache(out totalEntryCount).ShouldEqual(new FileSystemResult(FSResult.Ok, (int)Result.Success));
- totalEntryCount.ShouldEqual(0U);
- }
- }
-
- [TestCase]
- public void OnEnumerateDirectoryReturnsSuccessWhenResultsNotInMemory()
- {
- const string TestFileName = "test.txt";
- const string TestFolderName = "testFolder";
- string testFilePath = Path.Combine(TestFolderName, TestFileName);
-
- // Don't include TestFolderName as MockGitIndexProjection returns the same list of files regardless of what folder name
- // it is passed
- using (MacFileSystemVirtualizerTester tester = new MacFileSystemVirtualizerTester(this.Repo))
- {
- tester.GitIndexProjection.MockFileTypesAndModes.TryAdd(
- testFilePath,
- ConvertFileTypeAndModeToIndexFormat(GitIndexProjection.FileType.Regular, GitIndexProjection.FileMode644));
-
- tester.GitIndexProjection.EnumerationInMemory = false;
- tester.MockVirtualization.OnEnumerateDirectory(1, TestFolderName, triggeringProcessId: 1, triggeringProcessName: "UnitTests").ShouldEqual(Result.Success);
- tester.MockVirtualization.CreatedPlaceholders.ShouldContain(
- kvp => kvp.Key.Equals(testFilePath, GVFSPlatform.Instance.Constants.PathComparison) && kvp.Value == GitIndexProjection.FileMode644);
- }
- }
-
- [TestCase]
- public void OnEnumerateDirectoryReturnsSuccessWhenResultsInMemory()
- {
- const string TestFileName = "test.txt";
- const string TestFolderName = "testFolder";
- string testFilePath = Path.Combine(TestFolderName, TestFileName);
-
- // Don't include TestFolderName as MockGitIndexProjection returns the same list of files regardless of what folder name
- // it is passed
- using (MacFileSystemVirtualizerTester tester = new MacFileSystemVirtualizerTester(this.Repo))
- {
- tester.GitIndexProjection.MockFileTypesAndModes.TryAdd(
- testFilePath,
- ConvertFileTypeAndModeToIndexFormat(GitIndexProjection.FileType.Regular, GitIndexProjection.FileMode644));
-
- tester.GitIndexProjection.EnumerationInMemory = true;
- tester.MockVirtualization.OnEnumerateDirectory(1, TestFolderName, triggeringProcessId: 1, triggeringProcessName: "UnitTests").ShouldEqual(Result.Success);
- tester.MockVirtualization.CreatedPlaceholders.ShouldContain(
- kvp => kvp.Key.Equals(testFilePath, GVFSPlatform.Instance.Constants.PathComparison) && kvp.Value == GitIndexProjection.FileMode644);
- tester.GitIndexProjection.ExpandedFolders.ShouldMatchInOrder(TestFolderName);
- }
- }
-
- [TestCase]
- public void OnEnumerateDirectorySetsFileModes()
- {
- const string TestFile644Name = "test644.txt";
- const string TestFile664Name = "test664.txt";
- const string TestFile755Name = "test755.txt";
- const string TestFolderName = "testFolder";
- string testFile644Path = Path.Combine(TestFolderName, TestFile644Name);
- string testFile664Path = Path.Combine(TestFolderName, TestFile664Name);
- string testFile755Path = Path.Combine(TestFolderName, TestFile755Name);
-
- // Don't include TestFolderName as MockGitIndexProjection returns the same list of files regardless of what folder name
- // it is passed
- using (MacFileSystemVirtualizerTester tester = new MacFileSystemVirtualizerTester(this.Repo, new[] { TestFile644Name, TestFile664Name, TestFile755Name }))
- {
- tester.GitIndexProjection.MockFileTypesAndModes.TryAdd(
- testFile644Path,
- ConvertFileTypeAndModeToIndexFormat(GitIndexProjection.FileType.Regular, GitIndexProjection.FileMode644));
- tester.GitIndexProjection.MockFileTypesAndModes.TryAdd(
- testFile664Path,
- ConvertFileTypeAndModeToIndexFormat(GitIndexProjection.FileType.Regular, GitIndexProjection.FileMode664));
- tester.GitIndexProjection.MockFileTypesAndModes.TryAdd(
- testFile755Path,
- ConvertFileTypeAndModeToIndexFormat(GitIndexProjection.FileType.Regular, GitIndexProjection.FileMode755));
-
- tester.GitIndexProjection.EnumerationInMemory = true;
- tester.MockVirtualization.OnEnumerateDirectory(1, TestFolderName, triggeringProcessId: 1, triggeringProcessName: "UnitTests").ShouldEqual(Result.Success);
- tester.MockVirtualization.CreatedPlaceholders.ShouldContain(
- kvp => kvp.Key.Equals(testFile644Path, GVFSPlatform.Instance.Constants.PathComparison) && kvp.Value == GitIndexProjection.FileMode644);
- tester.MockVirtualization.CreatedPlaceholders.ShouldContain(
- kvp => kvp.Key.Equals(testFile664Path, GVFSPlatform.Instance.Constants.PathComparison) && kvp.Value == GitIndexProjection.FileMode664);
- tester.MockVirtualization.CreatedPlaceholders.ShouldContain(
- kvp => kvp.Key.Equals(testFile755Path, GVFSPlatform.Instance.Constants.PathComparison) && kvp.Value == GitIndexProjection.FileMode755);
- }
- }
-
- [TestCase]
- public void OnGetFileStreamReturnsSuccessWhenFileStreamAvailable()
- {
- using (MacFileSystemVirtualizerTester tester = new MacFileSystemVirtualizerTester(this.Repo))
- {
- tester.MockVirtualization.WriteFileReturnResult = Result.Success;
- tester.InvokeOnGetFileStream(expectedResult: Result.Success);
- tester.MockVirtualization.BytesWritten.ShouldEqual(MockGVFSGitObjects.DefaultFileLength);
- }
- }
-
- [TestCase]
- [Category(CategoryConstants.ExceptionExpected)]
- public void OnGetFileStreamReturnsErrorWhenWriteFileContentsFails()
- {
- using (MacFileSystemVirtualizerTester tester = new MacFileSystemVirtualizerTester(this.Repo))
- {
- tester.MockVirtualization.WriteFileReturnResult = Result.EIOError;
- tester.InvokeOnGetFileStream(expectedResult: Result.EIOError);
- }
- }
-
- [TestCase]
- public void OnNewFileCreatedInsideDotGitDirectoryShouldNotScheduleBackgroundTask()
- {
- using (MacFileSystemVirtualizerTester tester = new MacFileSystemVirtualizerTester(this.Repo))
- {
- tester.MockVirtualization.OnNewFileCreated(Path.Combine(".git", "testing.txt"), isDirectory: false);
- tester.BackgroundTaskRunner.Count.ShouldEqual(0);
- }
- }
-
- [TestCase]
- public void OnNewFileCreatedFileShouldScheduleBackgroundTask()
- {
- using (MacFileSystemVirtualizerTester tester = new MacFileSystemVirtualizerTester(this.Repo))
- {
- tester.MockVirtualization.OnNewFileCreated("testing.txt", isDirectory: false);
- tester.BackgroundTaskShouldBeScheduled("testing.txt", FileSystemTask.OperationType.OnFileCreated);
- tester.GitIndexProjection.SparseEntries.Count.ShouldEqual(0);
- }
- }
-
- [TestCase]
- public void OnNewFileCreatedDirectoryIncludedShouldScheduleBackgroundTask()
- {
- using (MacFileSystemVirtualizerTester tester = new MacFileSystemVirtualizerTester(this.Repo))
- {
- tester.GitIndexProjection.GetFolderPathSparseStateValue = GitIndexProjection.PathSparseState.Included;
- tester.MockVirtualization.OnNewFileCreated("testing", isDirectory: true);
- tester.BackgroundTaskShouldBeScheduled("testing", FileSystemTask.OperationType.OnFolderCreated);
- tester.GitIndexProjection.SparseEntries.Count.ShouldEqual(0);
- }
- }
-
- [TestCase]
- public void OnNewFileCreatedDirectoryExcludedShouldNotScheduleBackgroundTask()
- {
- const string TestFileName = "test.txt";
- const string TestFolderName = "testFolder";
- string testFilePath = Path.Combine(TestFolderName, TestFileName);
-
- using (MacFileSystemVirtualizerTester tester = new MacFileSystemVirtualizerTester(this.Repo))
- {
- tester.GitIndexProjection.MockFileTypesAndModes.TryAdd(
- testFilePath,
- ConvertFileTypeAndModeToIndexFormat(GitIndexProjection.FileType.Regular, GitIndexProjection.FileMode644));
-
- tester.GitIndexProjection.GetFolderPathSparseStateValue = GitIndexProjection.PathSparseState.Excluded;
- tester.MockVirtualization.OnNewFileCreated(TestFolderName, isDirectory: true);
- tester.BackgroundTaskRunner.Count.ShouldEqual(0);
- tester.GitIndexProjection.SparseEntries.Count.ShouldEqual(1);
- tester.GitIndexProjection.SparseEntries.First().ShouldEqual(TestFolderName);
- tester.MockVirtualization.CreatedPlaceholders.ShouldContain(
- kvp => kvp.Key.Equals(testFilePath, GVFSPlatform.Instance.Constants.PathComparison) && kvp.Value == GitIndexProjection.FileMode644);
- }
- }
-
- [TestCase]
- public void OnNewFileCreatedDirectoryNotFoundShouldScheduleBackgroundTask()
- {
- using (MacFileSystemVirtualizerTester tester = new MacFileSystemVirtualizerTester(this.Repo))
- {
- tester.GitIndexProjection.GetFolderPathSparseStateValue = GitIndexProjection.PathSparseState.NotFound;
- tester.MockVirtualization.OnNewFileCreated("testing", isDirectory: true);
- tester.BackgroundTaskShouldBeScheduled("testing", FileSystemTask.OperationType.OnFolderCreated);
- tester.GitIndexProjection.SparseEntries.Count.ShouldEqual(0);
- }
- }
-
- [TestCase]
- public void OnNewFileCreatedDirectoryExcludedTryAddSparseFolderFailureShouldScheduleBackgroundTask()
- {
- using (MacFileSystemVirtualizerTester tester = new MacFileSystemVirtualizerTester(this.Repo))
- {
- tester.GitIndexProjection.GetFolderPathSparseStateValue = GitIndexProjection.PathSparseState.Excluded;
- tester.GitIndexProjection.TryAddSparseFolderReturnValue = false;
- tester.MockVirtualization.OnNewFileCreated("testing", isDirectory: true);
- tester.BackgroundTaskShouldBeScheduled("testing", FileSystemTask.OperationType.OnFolderCreated);
- tester.GitIndexProjection.SparseEntries.Count.ShouldEqual(0);
- }
- }
-
- private static ushort ConvertFileTypeAndModeToIndexFormat(GitIndexProjection.FileType fileType, ushort fileMode)
- {
- // Values used in the index file to indicate the type of the file
- const ushort RegularFileIndexEntry = 0x8000;
- const ushort SymLinkFileIndexEntry = 0xA000;
- const ushort GitLinkFileIndexEntry = 0xE000;
-
- switch (fileType)
- {
- case GitIndexProjection.FileType.Regular:
- return (ushort)(RegularFileIndexEntry | fileMode);
-
- case GitIndexProjection.FileType.SymLink:
- return (ushort)(SymLinkFileIndexEntry | fileMode);
-
- case GitIndexProjection.FileType.GitLink:
- return (ushort)(GitLinkFileIndexEntry | fileMode);
-
- default:
- Assert.Fail($"Invalid fileType {fileType}");
- return 0;
- }
- }
- }
-}
diff --git a/GVFS/GVFS.UnitTests/Service/Mac/MacServiceTests.cs b/GVFS/GVFS.UnitTests/Service/Mac/MacServiceTests.cs
deleted file mode 100644
index 5dffa80a49..0000000000
--- a/GVFS/GVFS.UnitTests/Service/Mac/MacServiceTests.cs
+++ /dev/null
@@ -1,137 +0,0 @@
-using GVFS.Common;
-using GVFS.Common.NamedPipes;
-using GVFS.Service;
-using GVFS.Service.Handlers;
-using GVFS.UnitTests.Mock.Common;
-using GVFS.UnitTests.Mock.FileSystem;
-using Moq;
-using NUnit.Framework;
-using System.IO;
-
-namespace GVFS.UnitTests.Service.Mac
-{
- [TestFixture]
- public class MacServiceTests
- {
- private const string GVFSServiceName = "GVFS.Service";
- private const int ExpectedActiveUserId = 502;
- private const int ExpectedSessionId = 502;
- private static readonly string ExpectedActiveRepoPath = Path.Combine("mock:", "code", "repo2");
- private static readonly string ServiceDataLocation = Path.Combine("mock:", "registryDataFolder");
-
- private MockFileSystem fileSystem;
- private MockTracer tracer;
- private MockPlatform gvfsPlatform;
-
- [SetUp]
- public void SetUp()
- {
- this.tracer = new MockTracer();
- this.fileSystem = new MockFileSystem(new MockDirectory(ServiceDataLocation, null, null));
- this.gvfsPlatform = (MockPlatform)GVFSPlatform.Instance;
- this.gvfsPlatform.MockCurrentUser = ExpectedActiveUserId.ToString();
- }
-
- [TestCase]
- public void ServiceStartTriggersAutoMountForCurrentUser()
- {
- Mock repoRegistry = new Mock(MockBehavior.Strict);
- repoRegistry.Setup(r => r.AutoMountRepos(ExpectedActiveUserId.ToString(), ExpectedSessionId, true));
- repoRegistry.Setup(r => r.TraceStatus());
-
- GVFSService service = new GVFSService(
- this.tracer,
- serviceName: null,
- repoRegistry: repoRegistry.Object);
-
- service.Run();
-
- repoRegistry.VerifyAll();
- }
-
- [TestCase]
- public void ServiceHandlesEnablePrjfsRequest()
- {
- string expectedServiceResponse = "TRequestResponse|{\"State\":1,\"ErrorMessage\":null}";
- Mock connectionMock = new Mock(
- MockBehavior.Strict,
- null, // serverStream
- this.tracer, // tracer
- null); // isStopping
- connectionMock.Setup(mp => mp.TrySendResponse(expectedServiceResponse)).Returns(true);
-
- NamedPipeMessages.EnableAndAttachProjFSRequest request = new NamedPipeMessages.EnableAndAttachProjFSRequest();
- request.EnlistmentRoot = string.Empty;
-
- RequestHandler serviceRequestHandler = new RequestHandler(this.tracer, etwArea: string.Empty, repoRegistry: null);
- serviceRequestHandler.HandleRequest(this.tracer, request.ToMessage().ToString(), connectionMock.Object);
-
- connectionMock.VerifyAll();
- }
-
- [TestCase]
- public void RepoRegistryMountsOnlyRegisteredRepos()
- {
- Mock repoMounterMock = new Mock(MockBehavior.Strict);
- repoMounterMock.Setup(mp => mp.MountRepository(ExpectedActiveRepoPath, ExpectedActiveUserId)).Returns(true);
-
- this.CreateTestRepos(ServiceDataLocation);
-
- RepoRegistry repoRegistry = new RepoRegistry(
- this.tracer,
- this.fileSystem,
- ServiceDataLocation,
- repoMounterMock.Object,
- null);
-
- repoRegistry.AutoMountRepos(ExpectedActiveUserId.ToString(), ExpectedSessionId, checkDirectoryExists: false);
-
- repoMounterMock.VerifyAll();
- }
-
- [TestCase]
- public void MountProcessLaunchedUsingCorrectArgs()
- {
- string executable = @"/bin/launchctl";
- string gvfsBinPath = Path.Combine(this.gvfsPlatform.Constants.GVFSBinDirectoryPath, this.gvfsPlatform.Constants.GVFSExecutableName);
- string expectedArgs = $"asuser {ExpectedActiveUserId} {gvfsBinPath} mount {ExpectedActiveRepoPath}";
-
- Mock mountLauncherMock = new Mock(MockBehavior.Strict, this.tracer);
- mountLauncherMock.Setup(mp => mp.LaunchProcess(
- executable,
- expectedArgs,
- ExpectedActiveRepoPath))
- .Returns(true);
-
- string errorString = null;
- mountLauncherMock.Setup(mp => mp.WaitUntilMounted(
- this.tracer,
- ExpectedActiveRepoPath,
- It.IsAny(),
- out errorString))
- .Returns(true);
-
- GVFSMountProcess mountProcess = new GVFSMountProcess(this.tracer, mountLauncherMock.Object);
- mountProcess.MountRepository(ExpectedActiveRepoPath, ExpectedActiveUserId);
-
- mountLauncherMock.VerifyAll();
- }
-
- private void CreateTestRepos(string dataLocation)
- {
- string repo1 = Path.Combine("mock:", "code", "repo1");
- string repo2 = ExpectedActiveRepoPath;
- string repo3 = Path.Combine("mock:", "code", "repo3");
- string repo4 = Path.Combine("mock:", "code", "repo4");
-
- this.fileSystem.WriteAllText(
- Path.Combine(dataLocation, RepoRegistry.RegistryName),
- $@"1
- {{""EnlistmentRoot"":""{repo1.Replace("\\", "\\\\")}"",""OwnerSID"":502,""IsActive"":false}}
- {{""EnlistmentRoot"":""{repo2.Replace("\\", "\\\\")}"",""OwnerSID"":502,""IsActive"":true}}
- {{""EnlistmentRoot"":""{repo3.Replace("\\", "\\\\")}"",""OwnerSID"":501,""IsActive"":false}}
- {{""EnlistmentRoot"":""{repo4.Replace("\\", "\\\\")}"",""OwnerSID"":501,""IsActive"":true}}
- ");
- }
- }
-}
diff --git a/GVFS/GVFS/GVFS.Mac.csproj b/GVFS/GVFS/GVFS.Mac.csproj
deleted file mode 100644
index 50dd74a110..0000000000
--- a/GVFS/GVFS/GVFS.Mac.csproj
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
- Exe
- gvfs
- netcoreapp2.1
- x64
- osx-x64
-
-
-
- $(GVFSVersion)
-
-
- $(GVFSVersion)
-
-
-
- all
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/MirrorProvider/MirrorProvider.Mac/MacFileSystemVirtualizer.cs b/MirrorProvider/MirrorProvider.Mac/MacFileSystemVirtualizer.cs
deleted file mode 100644
index be40214ce5..0000000000
--- a/MirrorProvider/MirrorProvider.Mac/MacFileSystemVirtualizer.cs
+++ /dev/null
@@ -1,273 +0,0 @@
-using PrjFSLib.Mac;
-using System;
-using System.IO;
-using System.Runtime.InteropServices;
-using System.Text;
-
-namespace MirrorProvider.Mac
-{
- public class MacFileSystemVirtualizer : FileSystemVirtualizer
- {
- private VirtualizationInstance virtualizationInstance = new VirtualizationInstance();
-
- protected override StringComparison PathComparison => StringComparison.OrdinalIgnoreCase;
- protected override StringComparer PathComparer => StringComparer.OrdinalIgnoreCase;
-
- public override bool TryConvertVirtualizationRoot(string directory, out string error)
- {
- Result result = VirtualizationInstance.ConvertDirectoryToVirtualizationRoot(directory);
-
- error = result.ToString();
- return result == Result.Success;
- }
-
- public override bool TryStartVirtualizationInstance(Enlistment enlistment, out string error)
- {
- this.virtualizationInstance.OnEnumerateDirectory = this.OnEnumerateDirectory;
- this.virtualizationInstance.OnGetFileStream = this.OnGetFileStream;
- this.virtualizationInstance.OnLogError = this.OnLogError;
- this.virtualizationInstance.OnLogWarning = this.OnLogWarning;
- this.virtualizationInstance.OnLogInfo = this.OnLogInfo;
- this.virtualizationInstance.OnFileModified = this.OnFileModified;
- this.virtualizationInstance.OnPreDelete = this.OnPreDelete;
- this.virtualizationInstance.OnNewFileCreated = this.OnNewFileCreated;
- this.virtualizationInstance.OnFileRenamed = this.OnFileRenamed;
- this.virtualizationInstance.OnHardLinkCreated = this.OnHardLinkCreated;
- this.virtualizationInstance.OnFilePreConvertToFull = this.OnFilePreConvertToFull;
-
- Result result = this.virtualizationInstance.StartVirtualizationInstance(
- enlistment.SrcRoot,
- poolThreadCount: (uint)Environment.ProcessorCount * 2);
-
- if (result == Result.Success)
- {
- return base.TryStartVirtualizationInstance(enlistment, out error);
- }
- else
- {
- error = result.ToString();
- return false;
- }
- }
-
- private Result OnEnumerateDirectory(
- ulong commandId,
- string relativePath,
- int triggeringProcessId,
- string triggeringProcessName)
- {
- Console.WriteLine($"OnEnumerateDirectory({commandId}, '{relativePath}', {triggeringProcessId}, {triggeringProcessName})");
-
- try
- {
- if (!this.DirectoryExists(relativePath))
- {
- return Result.EFileNotFound;
- }
-
- foreach (ProjectedFileInfo child in this.GetChildItems(relativePath))
- {
- if (child.Type == ProjectedFileInfo.FileType.Directory)
- {
- Result result = this.virtualizationInstance.WritePlaceholderDirectory(
- Path.Combine(relativePath, child.Name));
-
- if (result != Result.Success)
- {
- Console.WriteLine($"WritePlaceholderDirectory failed: {result}");
- return result;
- }
- }
- else if (child.Type == ProjectedFileInfo.FileType.SymLink)
- {
- string childRelativePath = Path.Combine(relativePath, child.Name);
-
- string symLinkTarget;
- if (this.TryGetSymLinkTarget(childRelativePath, out symLinkTarget))
- {
- Result result = this.virtualizationInstance.WriteSymLink(
- childRelativePath,
- symLinkTarget);
-
- if (result != Result.Success)
- {
- Console.WriteLine($"WriteSymLink failed: {result}");
- return result;
- }
- }
- else
- {
- return Result.EIOError;
- }
- }
- else
- {
- // The MirrorProvider marks every file as executable (mode 755), but this is just a shortcut to avoid the pain of
- // having to p/invoke to determine if the original file is exectuable or not.
- // A real provider will have to get this information from its data source. For example, GVFS gets this info
- // out of the git index along with all the other info for projecting files.
- UInt16 fileMode = Convert.ToUInt16("755", 8);
-
- Result result = this.virtualizationInstance.WritePlaceholderFile(
- Path.Combine(relativePath, child.Name),
- providerId: ToVersionIdByteArray(1),
- contentId: ToVersionIdByteArray(0),
- fileMode: fileMode);
- if (result != Result.Success)
- {
- Console.WriteLine($"WritePlaceholderFile failed: {result}");
- return result;
- }
- }
- }
- }
- catch (IOException e)
- {
- Console.WriteLine($"IOException in OnEnumerateDirectory: {e.Message}");
- return Result.EIOError;
- }
-
- return Result.Success;
- }
-
- private Result OnGetFileStream(
- ulong commandId,
- string relativePath,
- byte[] providerId,
- byte[] contentId,
- int triggeringProcessId,
- string triggeringProcessName,
- IntPtr fileHandle)
- {
- Console.WriteLine($"OnGetFileStream({commandId}, '{relativePath}', {contentId.Length}/{contentId[0]}:{contentId[1]}, {providerId.Length}/{providerId[0]}:{providerId[1]}, {triggeringProcessId}, {triggeringProcessName}, 0x{fileHandle.ToInt64():X})");
-
- if (!this.FileExists(relativePath))
- {
- return Result.EFileNotFound;
- }
-
- try
- {
- const int bufferSize = 4096;
- FileSystemResult hydrateFileResult = this.HydrateFile(
- relativePath,
- bufferSize,
- (buffer, bytesToCopy) =>
- {
- Result result = this.virtualizationInstance.WriteFileContents(
- fileHandle,
- buffer,
- (uint)bytesToCopy);
- if (result != Result.Success)
- {
- Console.WriteLine($"WriteFileContents failed: {result}");
- return false;
- }
-
- return true;
- });
-
- if (hydrateFileResult != FileSystemResult.Success)
- {
- return Result.EIOError;
- }
- }
- catch (IOException e)
- {
- Console.WriteLine($"IOException in OnGetFileStream: {e.Message}");
- return Result.EIOError;
- }
-
- return Result.Success;
- }
-
- private void OnLogError(string errorMessage)
- {
- Console.WriteLine($"OnLogError: {errorMessage}");
- }
-
- private void OnLogWarning(string warningMessage)
- {
- Console.WriteLine($"OnLogWarning: {warningMessage}");
- }
- private void OnLogInfo(string infoMessage)
- {
- Console.WriteLine($"OnLogInfo: {infoMessage}");
- }
-
- private void OnFileModified(string relativePath)
- {
- Console.WriteLine($"OnFileModified: {relativePath}");
- }
-
- private Result OnPreDelete(string relativePath, bool isDirectory)
- {
- Console.WriteLine($"OnPreDelete (isDirectory: {isDirectory}): {relativePath}");
- return Result.Success;
- }
-
- private void OnNewFileCreated(string relativePath, bool isDirectory)
- {
- Console.WriteLine($"OnNewFileCreated (isDirectory: {isDirectory}): {relativePath}");
- }
-
- private void OnFileRenamed(string relativeDestinationPath, bool isDirectory)
- {
- Console.WriteLine($"OnFileRenamed (isDirectory: {isDirectory}) destination: {relativeDestinationPath}");
- }
-
- private void OnHardLinkCreated(string existingRelativePath, string relativeNewLinkPath)
- {
- Console.WriteLine($"OnHardLinkCreated {relativeNewLinkPath} from {existingRelativePath}");
- }
-
- private Result OnFilePreConvertToFull(string relativePath)
- {
- Console.WriteLine($"OnFilePreConvertToFull: {relativePath}");
- return Result.Success;
- }
-
- private bool TryGetSymLinkTarget(string relativePath, out string symLinkTarget)
- {
- symLinkTarget = null;
- string fullPathInMirror = this.GetFullPathInMirror(relativePath);
-
- const ulong BufSize = 4096;
- byte[] targetBuffer = new byte[BufSize];
- long bytesRead = ReadLink(fullPathInMirror, targetBuffer, BufSize);
- if (bytesRead < 0)
- {
- Console.WriteLine($"GetSymLinkTarget failed: {Marshal.GetLastWin32Error()}");
- return false;
- }
-
- targetBuffer[bytesRead] = 0;
- symLinkTarget = Encoding.UTF8.GetString(targetBuffer);
-
- if (symLinkTarget.StartsWith(this.Enlistment.MirrorRoot, PathComparison))
- {
- // Link target is an absolute path inside the MirrorRoot.
- // The target needs to be adjusted to point inside the src root
- symLinkTarget = Path.Combine(
- this.Enlistment.SrcRoot.TrimEnd(Path.DirectorySeparatorChar),
- symLinkTarget.Substring(this.Enlistment.MirrorRoot.Length).TrimStart(Path.DirectorySeparatorChar));
- }
-
- return true;
- }
-
- private static byte[] ToVersionIdByteArray(byte version)
- {
- byte[] bytes = new byte[VirtualizationInstance.PlaceholderIdLength];
- bytes[0] = version;
-
- return bytes;
- }
-
- [DllImport("libc", EntryPoint = "readlink", SetLastError = true)]
- private static extern long ReadLink(
- string path,
- byte[] buf,
- ulong bufsize);
- }
-}
diff --git a/MirrorProvider/MirrorProvider.Mac/MirrorProvider.Mac.csproj b/MirrorProvider/MirrorProvider.Mac/MirrorProvider.Mac.csproj
deleted file mode 100644
index 11e84c84e3..0000000000
--- a/MirrorProvider/MirrorProvider.Mac/MirrorProvider.Mac.csproj
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
- Exe
- netcoreapp2.1
- osx.10.12-x64
- x64
- Debug;Release
-
-
-
- ..\..\..\BuildOutput
-
-
-
- $(BuildOutputDir)\MirrorProvider.Mac\obj\$(Configuration)\$(Platform)
- $(BuildOutputDir)\MirrorProvider.Mac\bin\$(Configuration)\$(Platform)
- true
-
-
-
- true
- full
- false
- TRACE;DEBUG
-
-
-
- true
- TRACE;RELEASE
-
-
-
-
-
-
-
-
-
-
-
diff --git a/MirrorProvider/MirrorProvider.Mac/Program.cs b/MirrorProvider/MirrorProvider.Mac/Program.cs
deleted file mode 100644
index 52483ddf16..0000000000
--- a/MirrorProvider/MirrorProvider.Mac/Program.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace MirrorProvider.Mac
-{
- class Program
- {
- static void Main(string[] args)
- {
- MirrorProviderCLI.Run(args, new MacFileSystemVirtualizer());
- }
- }
-}
diff --git a/MirrorProvider/MirrorProvider.Windows/ActiveEnumeration.cs b/MirrorProvider/MirrorProvider.Windows/ActiveEnumeration.cs
deleted file mode 100644
index 6116def251..0000000000
--- a/MirrorProvider/MirrorProvider.Windows/ActiveEnumeration.cs
+++ /dev/null
@@ -1,157 +0,0 @@
-using Microsoft.Windows.ProjFS;
-using System.Collections.Generic;
-
-namespace MirrorProvider.Windows
-{
- public class ActiveEnumeration
- {
- // Use our own enumerator to avoid having to dispose anything
- private ProjectedFileInfoEnumerator fileInfoEnumerator;
- private string filterString = null;
-
- public ActiveEnumeration(List fileInfos)
- {
- this.fileInfoEnumerator = new ProjectedFileInfoEnumerator(fileInfos);
- this.ResetEnumerator();
- this.MoveNext();
- }
-
- ///
- /// true if Current refers to an element in the enumeration, false if Current is past the end of the collection
- ///
- public bool IsCurrentValid { get; private set; }
-
- ///
- /// Gets the element in the collection at the current position of the enumerator
- ///
- public ProjectedFileInfo Current
- {
- get { return this.fileInfoEnumerator.Current; }
- }
-
- ///
- /// Resets the enumerator and advances it to the first ProjectedFileInfo in the enumeration
- ///
- /// Filter string to save. Can be null.
- public void RestartEnumeration(string filter)
- {
- this.ResetEnumerator();
- this.IsCurrentValid = this.fileInfoEnumerator.MoveNext();
- this.SaveFilter(filter);
- }
-
- ///
- /// Advances the enumerator to the next element of the collection (that is being projected).
- /// If a filter string is set, MoveNext will advance to the next entry that matches the filter.
- ///
- ///
- /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection
- ///
- public bool MoveNext()
- {
- this.IsCurrentValid = this.fileInfoEnumerator.MoveNext();
- while (this.IsCurrentValid && this.IsCurrentHidden())
- {
- this.IsCurrentValid = this.fileInfoEnumerator.MoveNext();
- }
-
- return this.IsCurrentValid;
- }
-
- ///
- /// Attempts to save the filter string for this enumeration. When setting a filter string, if Current is valid
- /// and does not match the specified filter, the enumerator will be advanced until an element is found that
- /// matches the filter (or the end of the collection is reached).
- ///
- /// Filter string to save. Can be null.
- /// True if the filter string was saved. False if the filter string was not saved (because a filter string
- /// was previously saved).
- ///
- ///
- /// Per MSDN (https://msdn.microsoft.com/en-us/library/windows/hardware/ff567047(v=vs.85).aspx, the filter string
- /// specified in the first call to ZwQueryDirectoryFile will be used for all subsequent calls for the handle (and
- /// the string specified in subsequent calls should be ignored)
- ///
- public bool TrySaveFilterString(string filter)
- {
- if (this.filterString == null)
- {
- this.SaveFilter(filter);
- return true;
- }
-
- return false;
- }
-
- ///
- /// Returns the current filter string or null if no filter string has been saved
- ///
- /// The current filter string or null if no filter string has been saved
- public string GetFilterString()
- {
- return this.filterString;
- }
-
- private void SaveFilter(string filter)
- {
- if (string.IsNullOrEmpty(filter))
- {
- this.filterString = string.Empty;
- }
- else
- {
- this.filterString = filter;
- if (this.IsCurrentValid && this.IsCurrentHidden())
- {
- this.MoveNext();
- }
- }
- }
-
- private bool IsCurrentHidden()
- {
- return !Utils.IsFileNameMatch(this.Current.Name, this.GetFilterString());
- }
-
- private void ResetEnumerator()
- {
- this.fileInfoEnumerator.Reset();
- }
-
- private class ProjectedFileInfoEnumerator
- {
- private List list;
- private int index;
-
- public ProjectedFileInfoEnumerator(List projectedFileInfos)
- {
- this.list = projectedFileInfos;
- this.Reset();
- }
-
- public ProjectedFileInfo Current { get; private set; }
-
- // Combination of the logic in List.Enumerator MoveNext() and MoveNextRare()
- // https://github.com/dotnet/corefx/blob/b492409b4a1952cda4b078f800499d382e1765fc/src/Common/src/CoreLib/System/Collections/Generic/List.cs#L1137
- public bool MoveNext()
- {
- if (this.index < this.list.Count)
- {
- this.Current = this.list[this.index];
- this.index++;
- return true;
- }
-
- this.index = this.list.Count + 1;
- this.Current = null;
- return false;
- }
-
- public void Reset()
- {
- this.index = 0;
- this.Current = null;
- }
- }
- }
-}
diff --git a/MirrorProvider/MirrorProvider.Windows/App.config b/MirrorProvider/MirrorProvider.Windows/App.config
deleted file mode 100644
index 00bfd114af..0000000000
--- a/MirrorProvider/MirrorProvider.Windows/App.config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/MirrorProvider/MirrorProvider.Windows/MirrorProvider.Windows.csproj b/MirrorProvider/MirrorProvider.Windows/MirrorProvider.Windows.csproj
deleted file mode 100644
index 9abb7dca33..0000000000
--- a/MirrorProvider/MirrorProvider.Windows/MirrorProvider.Windows.csproj
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
- Debug
- x64
- {1ED51604-045C-4914-8054-15AAED90FF45}
- Exe
- MirrorProvider.Windows
- MirrorProvider.Windows
- v4.6.1
- 512
- true
-
-
- ..\..\..\BuildOutput
-
-
- $(BuildOutputDir)\MirrorProvider.Windows\bin\$(Platform)\$(Configuration)\
- $(BuildOutputDir)\MirrorProvider.Windows\obj\$(Platform)\$(Configuration)\
- true
- x64
-
-
- true
- DEBUG;TRACE
- full
- prompt
-
-
- TRACE
- true
- pdbonly
- prompt
-
-
-
- ..\..\..\packages\CommandLineParser.2.2.1\lib\net45\CommandLine.dll
-
-
- ..\..\..\packages\Microsoft.Windows.ProjFS.1.1.19156.1\lib\net461\ProjectedFSLib.Managed.dll
-
-
-
-
- ..\..\..\packages\System.Console.4.0.0\lib\net46\System.Console.dll
- True
-
-
-
- ..\..\..\packages\System.Reflection.TypeExtensions.4.1.0\lib\net46\System.Reflection.TypeExtensions.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Designer
-
-
-
-
-
- {128451a2-7598-4142-ba2a-9b963d91ccbc}
- MirrorProvider
-
-
-
-
\ No newline at end of file
diff --git a/MirrorProvider/MirrorProvider.Windows/Program.cs b/MirrorProvider/MirrorProvider.Windows/Program.cs
deleted file mode 100644
index ad6878ba0c..0000000000
--- a/MirrorProvider/MirrorProvider.Windows/Program.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace MirrorProvider.Windows
-{
- class Program
- {
- static void Main(string[] args)
- {
- MirrorProviderCLI.Run(args, new WindowsFileSystemVirtualizer());
- }
- }
-}
diff --git a/MirrorProvider/MirrorProvider.Windows/Properties/AssemblyInfo.cs b/MirrorProvider/MirrorProvider.Windows/Properties/AssemblyInfo.cs
deleted file mode 100644
index 593a36852e..0000000000
--- a/MirrorProvider/MirrorProvider.Windows/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("MirrorProvider.Windows")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("MirrorProvider.Windows")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2019")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("1ed51604-045c-4914-8054-15aaed90ff45")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/MirrorProvider/MirrorProvider.Windows/WindowsFileSystemVirtualizer.cs b/MirrorProvider/MirrorProvider.Windows/WindowsFileSystemVirtualizer.cs
deleted file mode 100644
index a2e51a2a16..0000000000
--- a/MirrorProvider/MirrorProvider.Windows/WindowsFileSystemVirtualizer.cs
+++ /dev/null
@@ -1,346 +0,0 @@
-using Microsoft.Windows.ProjFS;
-using System;
-using System.Collections.Concurrent;
-using System.ComponentModel;
-using System.IO;
-using System.Linq;
-
-namespace MirrorProvider.Windows
-{
- public class WindowsFileSystemVirtualizer : FileSystemVirtualizer, IRequiredCallbacks
- {
- private VirtualizationInstance virtualizationInstance;
- private ConcurrentDictionary activeEnumerations = new ConcurrentDictionary();
-
- protected override StringComparison PathComparison => StringComparison.OrdinalIgnoreCase;
- protected override StringComparer PathComparer => StringComparer.OrdinalIgnoreCase;
-
- public override bool TryConvertVirtualizationRoot(string directory, out string error)
- {
- error = string.Empty;
- HResult result = VirtualizationInstance.MarkDirectoryAsVirtualizationRoot(directory, Guid.NewGuid());
- if (result != HResult.Ok)
- {
- error = result.ToString("F");
- return false;
- }
-
- return true;
- }
-
- public override bool TryStartVirtualizationInstance(Enlistment enlistment, out string error)
- {
- this.virtualizationInstance.OnQueryFileName = this.QueryFileName;
- this.virtualizationInstance.OnNotifyPreDelete = this.OnPreDelete;
- this.virtualizationInstance.OnNotifyNewFileCreated = this.OnNewFileCreated;
- this.virtualizationInstance.OnNotifyFileHandleClosedFileModifiedOrDeleted = this.OnFileModifiedOrDeleted;
- this.virtualizationInstance.OnNotifyFileRenamed = this.OnFileRenamed;
- this.virtualizationInstance.OnNotifyHardlinkCreated = this.OnHardlinkCreated;
- this.virtualizationInstance.OnNotifyFilePreConvertToFull = this.OnFilePreConvertToFull;
-
- uint threadCount = (uint)Environment.ProcessorCount * 2;
-
- NotificationMapping[] notificationMappings = new NotificationMapping[]
- {
- new NotificationMapping(
- NotificationType.NewFileCreated |
- NotificationType.PreDelete |
- NotificationType.FileRenamed |
- NotificationType.HardlinkCreated |
- NotificationType.FileHandleClosedFileModified,
- string.Empty),
- };
-
- this.virtualizationInstance = new VirtualizationInstance(
- enlistment.SrcRoot,
- poolThreadCount: threadCount,
- concurrentThreadCount: threadCount,
- enableNegativePathCache: false,
- notificationMappings: notificationMappings);
-
- HResult result = this.virtualizationInstance.StartVirtualizing(this);
-
- if (result == HResult.Ok)
- {
- return base.TryStartVirtualizationInstance(enlistment, out error);
- }
-
- error = result.ToString("F");
- return false;
- }
-
- public HResult StartDirectoryEnumerationCallback(int commandId, Guid enumerationId, string relativePath, uint triggeringProcessId, string triggeringProcessImageFileName)
- {
- Console.WriteLine($"StartDirectoryEnumeration: `{relativePath}`, {enumerationId}");
-
- // On Windows, we have to sort the child items. The PrjFlt driver takes our list and merges it with
- // what is on disk, and it assumes that both lists are already sorted.
- ActiveEnumeration activeEnumeration = new ActiveEnumeration(
- this.GetChildItems(relativePath)
- .OrderBy(file => file.Name, PathComparer)
- .ToList());
-
- if (!this.activeEnumerations.TryAdd(enumerationId, activeEnumeration))
- {
- return HResult.InternalError;
- }
-
- return HResult.Ok;
- }
-
- public HResult EndDirectoryEnumerationCallback(Guid enumerationId)
- {
- Console.WriteLine($"EndDirectioryEnumeration: {enumerationId}");
-
- ActiveEnumeration activeEnumeration;
- if (!this.activeEnumerations.TryRemove(enumerationId, out activeEnumeration))
- {
- return HResult.InternalError;
- }
-
- return HResult.Ok;
- }
-
- public HResult GetDirectoryEnumerationCallback(
- int commandId,
- Guid enumerationId,
- string filterFileName,
- bool restartScan,
- IDirectoryEnumerationResults results)
- {
- Console.WriteLine($"GetDiretoryEnumeration: {enumerationId}, {filterFileName}");
-
- try
- {
- ActiveEnumeration activeEnumeration = null;
- if (!this.activeEnumerations.TryGetValue(enumerationId, out activeEnumeration))
- {
- return HResult.InternalError;
- }
-
- if (restartScan)
- {
- activeEnumeration.RestartEnumeration(filterFileName);
- }
- else
- {
- activeEnumeration.TrySaveFilterString(filterFileName);
- }
-
- bool entryAdded = false;
-
- HResult result = HResult.Ok;
- while (activeEnumeration.IsCurrentValid)
- {
- ProjectedFileInfo fileInfo = activeEnumeration.Current;
-
- DateTime now = DateTime.UtcNow;
- if (results.Add(
- fileName: fileInfo.Name,
- fileSize: fileInfo.IsDirectory ? 0 : fileInfo.Size,
- isDirectory: fileInfo.IsDirectory,
- fileAttributes: fileInfo.IsDirectory ? FileAttributes.Directory : FileAttributes.Archive,
- creationTime: now,
- lastAccessTime: now,
- lastWriteTime: now,
- changeTime: now))
- {
- entryAdded = true;
- activeEnumeration.MoveNext();
- }
- else
- {
- result = entryAdded ? HResult.Ok : HResult.InsufficientBuffer;
- break;
- }
- }
-
- return result;
- }
- catch (Win32Exception e)
- {
- return HResultFromWin32(e.NativeErrorCode);
- }
- catch (Exception)
- {
- return HResult.InternalError;
- }
- }
-
- public HResult GetPlaceholderInfoCallback(
- int commandId,
- string relativePath,
- uint triggeringProcessId,
- string triggeringProcessImageFileName)
- {
- Console.WriteLine($"GetPlaceholderInfoCallback: `{relativePath}`");
-
- ProjectedFileInfo fileInfo = this.GetFileInfo(relativePath);
- if (fileInfo == null)
- {
- return HResult.FileNotFound;
- }
-
- DateTime now = DateTime.UtcNow;
- HResult result = this.virtualizationInstance.WritePlaceholderInfo(
- Path.Combine(Path.GetDirectoryName(relativePath), fileInfo.Name),
- creationTime: now,
- lastAccessTime: now,
- lastWriteTime: now,
- changeTime: now,
- fileAttributes: fileInfo.IsDirectory ? FileAttributes.Directory : FileAttributes.Archive,
- endOfFile: fileInfo.Size,
- isDirectory: fileInfo.IsDirectory,
- contentId: new byte[] { 0 },
- providerId: new byte[] { 1 });
-
- if (result != HResult.Ok)
- {
- Console.WriteLine("WritePlaceholderInformation failed: " + result);
- }
-
- return result;
- }
-
- public HResult GetFileDataCallback(
- int commandId,
- string relativePath,
- ulong byteOffset,
- uint length,
- Guid streamGuid,
- byte[] contentId,
- byte[] providerId,
- uint triggeringProcessId,
- string triggeringProcessImageFileName)
- {
- Console.WriteLine($"GetFileDataCallback: `{relativePath}`");
-
- if (!this.FileExists(relativePath))
- {
- return HResult.FileNotFound;
- }
-
- try
- {
- const int bufferSize = 64 * 1024;
- using (IWriteBuffer writeBuffer = this.virtualizationInstance.CreateWriteBuffer(bufferSize))
- {
- ulong writeOffset = 0;
-
- FileSystemResult hydrateFileResult = this.HydrateFile(
- relativePath,
- bufferSize,
- (readBuffer, bytesToCopy) =>
- {
- writeBuffer.Stream.Seek(0, SeekOrigin.Begin);
- writeBuffer.Stream.Write(readBuffer, 0, (int)bytesToCopy);
-
- HResult writeResult = this.virtualizationInstance.WriteFileData(streamGuid, writeBuffer, writeOffset, bytesToCopy);
- if (writeResult != HResult.Ok)
- {
- Console.WriteLine("WriteFile faild: " + writeResult);
- return false;
- }
-
- writeOffset += bytesToCopy;
-
- return true;
- });
-
- if (hydrateFileResult != FileSystemResult.Success)
- {
- return HResult.InternalError;
- }
- }
- }
- catch (IOException e)
- {
- Console.WriteLine("IOException in GetFileDataCallback: " + e.Message);
- return HResult.InternalError;
- }
- catch (UnauthorizedAccessException e)
- {
- Console.WriteLine("UnauthorizedAccessException in GetFileDataCallback: " + e.Message);
- return HResult.InternalError;
- }
-
- return HResult.Ok;
- }
-
- private HResult QueryFileName(string relativePath)
- {
- Console.WriteLine($"QueryFileName: `{relativePath}`");
-
- string parentDirectory = Path.GetDirectoryName(relativePath);
- string childName = Path.GetFileName(relativePath);
- if (this.GetChildItems(parentDirectory).Any(child => child.Name.Equals(childName, PathComparison)))
- {
- return HResult.Ok;
- }
-
- return HResult.FileNotFound;
- }
-
- private bool OnPreDelete(string relativePath, bool isDirectory, uint triggeringProcessId, string triggeringProcessImageFileName)
- {
- Console.WriteLine($"OnPreDelete (isDirectory: {isDirectory}): {relativePath}, triggeringProcessId: {triggeringProcessId}, triggeringProcessImageFileName: {triggeringProcessImageFileName}");
- return true;
- }
-
- private void OnNewFileCreated(
- string relativePath,
- bool isDirectory,
- uint triggeringProcessId,
- string triggeringProcessImageFileName,
- out NotificationType notificationMask)
- {
- notificationMask = NotificationType.UseExistingMask;
- Console.WriteLine($"OnNewFileCreated (isDirectory: {isDirectory}): {relativePath}, triggeringProcessId: {triggeringProcessId}, triggeringProcessImageFileName: {triggeringProcessImageFileName}");
- }
-
- private void OnFileModifiedOrDeleted(string relativePath, bool isDirectory, bool isFileModified, bool isFileDeleted, uint triggeringProcessId, string triggeringProcessImageFileName)
- {
- // To keep WindowsFileSystemVirtualizer in sync with MacFileSystemVirtualizer we're only registering for
- // NotificationType.FileHandleClosedFileModified and so this method will only be called for modifications.
- // Once MacFileSystemVirtualizer supports delete notifications we'll register for
- // NotificationType.FileHandleClosedFileDeleted and this method will be called for both modifications and deletions.
- Console.WriteLine($"OnFileModifiedOrDeleted: `{relativePath}`, isDirectory: {isDirectory}, isModfied: {isFileModified}, isDeleted: {isFileDeleted}, triggeringProcessId: {triggeringProcessId}, triggeringProcessImageFileName: {triggeringProcessImageFileName}");
- }
-
- private void OnFileRenamed(
- string relativeSourcePath,
- string relativeDestinationPath,
- bool isDirectory,
- uint triggeringProcessId,
- string triggeringProcessImageFileName,
- out NotificationType notificationMask)
- {
- notificationMask = NotificationType.UseExistingMask;
- Console.WriteLine($"OnFileRenamed (isDirectory: {isDirectory}), relativeSourcePath: {relativeSourcePath}, relativeDestinationPath: {relativeDestinationPath}, triggeringProcessId: {triggeringProcessId}, triggeringProcessImageFileName: {triggeringProcessImageFileName}");
- }
-
- private void OnHardlinkCreated(
- string relativeExistingFilePath,
- string relativeNewLinkFilePath,
- uint triggeringProcessId,
- string triggeringProcessImageFileName)
- {
- Console.WriteLine($"OnHardlinkCreated, relativeExistingFilePath: {relativeExistingFilePath}, relativeNewLinkFilePath: {relativeNewLinkFilePath}, triggeringProcessId: {triggeringProcessId}, triggeringProcessImageFileName: {triggeringProcessImageFileName}");
- }
-
- private bool OnFilePreConvertToFull(string virtualPath, uint triggeringProcessId, string triggeringProcessImageFileName)
- {
- Console.WriteLine($"OnPreConvertToFull (virtualPath: {virtualPath}), triggeringProcessId: {triggeringProcessId}, triggeringProcessImageFileName: {triggeringProcessImageFileName}");
- return true;
- }
-
- // TODO: Add this to the ProjFS API
- private static HResult HResultFromWin32(int win32error)
- {
- // HRESULT_FROM_WIN32(unsigned long x) { return (HRESULT)(x) <= 0 ? (HRESULT)(x) : (HRESULT) (((x) & 0x0000FFFF) | (FACILITY_WIN32 << 16) | 0x80000000);}
-
- const int FacilityWin32 = 7;
- return win32error <= 0 ? (HResult)win32error : (HResult)unchecked((win32error & 0x0000FFFF) | (FacilityWin32 << 16) | 0x80000000);
- }
- }
-}
diff --git a/MirrorProvider/MirrorProvider.Windows/packages.config b/MirrorProvider/MirrorProvider.Windows/packages.config
deleted file mode 100644
index 20f77b72b3..0000000000
--- a/MirrorProvider/MirrorProvider.Windows/packages.config
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/MirrorProvider/MirrorProvider.sln b/MirrorProvider/MirrorProvider.sln
deleted file mode 100644
index b0f715af2f..0000000000
--- a/MirrorProvider/MirrorProvider.sln
+++ /dev/null
@@ -1,54 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.27428.2011
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrjFSLib.Mac.Managed", "..\ProjFS.Mac\PrjFSLib.Mac.Managed\PrjFSLib.Mac.Managed.csproj", "{064685CA-00F6-41AB-A2AB-3350AEC4419C}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MirrorProvider.Windows", "MirrorProvider.Windows\MirrorProvider.Windows.csproj", "{1ED51604-045C-4914-8054-15AAED90FF45}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MirrorProvider.Mac", "MirrorProvider.Mac\MirrorProvider.Mac.csproj", "{4BD96573-BE04-421B-B8C4-207956970136}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MirrorProvider", "MirrorProvider\MirrorProvider.csproj", "{128451A2-7598-4142-BA2A-9B963D91CCBC}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug.Mac|x64 = Debug.Mac|x64
- Debug.Windows|x64 = Debug.Windows|x64
- Release.Mac|x64 = Release.Mac|x64
- Release.Windows|x64 = Release.Windows|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {064685CA-00F6-41AB-A2AB-3350AEC4419C}.Debug.Mac|x64.ActiveCfg = Debug|x64
- {064685CA-00F6-41AB-A2AB-3350AEC4419C}.Debug.Mac|x64.Build.0 = Debug|x64
- {064685CA-00F6-41AB-A2AB-3350AEC4419C}.Debug.Windows|x64.ActiveCfg = Debug|x64
- {064685CA-00F6-41AB-A2AB-3350AEC4419C}.Release.Mac|x64.ActiveCfg = Release|x64
- {064685CA-00F6-41AB-A2AB-3350AEC4419C}.Release.Mac|x64.Build.0 = Release|x64
- {064685CA-00F6-41AB-A2AB-3350AEC4419C}.Release.Windows|x64.ActiveCfg = Release|x64
- {1ED51604-045C-4914-8054-15AAED90FF45}.Debug.Mac|x64.ActiveCfg = Debug|x64
- {1ED51604-045C-4914-8054-15AAED90FF45}.Debug.Windows|x64.ActiveCfg = Debug|x64
- {1ED51604-045C-4914-8054-15AAED90FF45}.Debug.Windows|x64.Build.0 = Debug|x64
- {1ED51604-045C-4914-8054-15AAED90FF45}.Release.Mac|x64.ActiveCfg = Release|x64
- {1ED51604-045C-4914-8054-15AAED90FF45}.Release.Windows|x64.ActiveCfg = Release|x64
- {1ED51604-045C-4914-8054-15AAED90FF45}.Release.Windows|x64.Build.0 = Release|x64
- {4BD96573-BE04-421B-B8C4-207956970136}.Debug.Mac|x64.ActiveCfg = Debug|x64
- {4BD96573-BE04-421B-B8C4-207956970136}.Debug.Mac|x64.Build.0 = Debug|x64
- {4BD96573-BE04-421B-B8C4-207956970136}.Debug.Windows|x64.ActiveCfg = Debug|x64
- {4BD96573-BE04-421B-B8C4-207956970136}.Release.Mac|x64.ActiveCfg = Release|x64
- {4BD96573-BE04-421B-B8C4-207956970136}.Release.Mac|x64.Build.0 = Release|x64
- {4BD96573-BE04-421B-B8C4-207956970136}.Release.Windows|x64.ActiveCfg = Release|x64
- {128451A2-7598-4142-BA2A-9B963D91CCBC}.Debug.Mac|x64.ActiveCfg = Debug|x64
- {128451A2-7598-4142-BA2A-9B963D91CCBC}.Debug.Mac|x64.Build.0 = Debug|x64
- {128451A2-7598-4142-BA2A-9B963D91CCBC}.Debug.Windows|x64.ActiveCfg = Debug|x64
- {128451A2-7598-4142-BA2A-9B963D91CCBC}.Debug.Windows|x64.Build.0 = Debug|x64
- {128451A2-7598-4142-BA2A-9B963D91CCBC}.Release.Mac|x64.ActiveCfg = Release|x64
- {128451A2-7598-4142-BA2A-9B963D91CCBC}.Release.Mac|x64.Build.0 = Release|x64
- {128451A2-7598-4142-BA2A-9B963D91CCBC}.Release.Windows|x64.ActiveCfg = Release|x64
- {128451A2-7598-4142-BA2A-9B963D91CCBC}.Release.Windows|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {D4A658E3-D34D-4C17-9F26-1CCDC2EF33C1}
- EndGlobalSection
-EndGlobal
diff --git a/MirrorProvider/MirrorProvider/CloneVerb.cs b/MirrorProvider/MirrorProvider/CloneVerb.cs
deleted file mode 100644
index 088fcbf004..0000000000
--- a/MirrorProvider/MirrorProvider/CloneVerb.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-using System;
-using System.IO;
-using CommandLine;
-
-namespace MirrorProvider
-{
- [Verb("clone")]
- public class CloneVerb
- {
- [Value(
- 0,
- Required = true,
- MetaName = "Path to mirror",
- HelpText = "The local path to mirror from")]
- public string PathToMirror { get; set; }
-
- [Value(
- 1,
- Required = true,
- MetaName = "Enlistment root",
- HelpText = "The path to create the mirrored enlistment in")]
- public string EnlistmentRoot { get; set; }
-
- public void Execute(FileSystemVirtualizer fileSystemVirtualizer)
- {
- Console.WriteLine($"Cloning from {Path.GetFullPath(this.PathToMirror)} to {Path.GetFullPath(this.EnlistmentRoot)}");
-
- if (Directory.Exists(this.EnlistmentRoot))
- {
- Console.WriteLine($"Error: Directory {this.EnlistmentRoot} already exists");
- return;
- }
-
- Enlistment enlistment = Enlistment.CreateNewEnlistment(this.EnlistmentRoot, this.PathToMirror);
- if (enlistment == null)
- {
- Console.WriteLine("Error: Unable to create enlistment");
- return;
- }
-
- if (fileSystemVirtualizer.TryConvertVirtualizationRoot(enlistment.SrcRoot, out string error))
- {
- Console.WriteLine($"Virtualization root created successfully at {enlistment.SrcRoot}");
- }
- else
- {
- Console.WriteLine("Error: Failed to create virtualization root: " + error);
- }
- }
- }
-}
diff --git a/MirrorProvider/MirrorProvider/Enlistment.cs b/MirrorProvider/MirrorProvider/Enlistment.cs
deleted file mode 100644
index e1544764fa..0000000000
--- a/MirrorProvider/MirrorProvider/Enlistment.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-using System.IO;
-
-namespace MirrorProvider
-{
- public class Enlistment
- {
- private Enlistment(string root, string mirrorRoot)
- {
- this.EnlistmentRoot = root;
- this.DotMirrorRoot = Path.Combine(root, ".mirror");
- this.SrcRoot = Path.Combine(root, "src");
-
- this.ConfigFile = Path.Combine(this.DotMirrorRoot, "config");
- this.MirrorRoot = mirrorRoot;
- }
-
- public string EnlistmentRoot { get; private set; }
- public string DotMirrorRoot { get; private set; }
- public string SrcRoot { get; private set; }
-
- public string ConfigFile { get; private set; }
-
- public string MirrorRoot { get; private set; }
-
- public static Enlistment CreateNewEnlistment(string enlistmentRoot, string mirrorRoot)
- {
- if (!Directory.Exists(enlistmentRoot) && Directory.Exists(mirrorRoot))
- {
- Enlistment enlistment = new Enlistment(enlistmentRoot, mirrorRoot);
-
- Directory.CreateDirectory(enlistment.EnlistmentRoot);
- Directory.CreateDirectory(enlistment.DotMirrorRoot);
- Directory.CreateDirectory(enlistment.SrcRoot);
-
- File.WriteAllText(enlistment.ConfigFile, mirrorRoot);
- return enlistment;
- }
-
- return null;
- }
-
- public static Enlistment LoadExistingEnlistment(string enlistmentRoot)
- {
- if (Directory.Exists(enlistmentRoot))
- {
- Enlistment enlistment = new Enlistment(enlistmentRoot, null);
- enlistment.MirrorRoot = File.ReadAllText(enlistment.ConfigFile);
-
- if (Directory.Exists(enlistment.MirrorRoot))
- {
- return enlistment;
- }
- }
-
- return null;
- }
- }
-}
diff --git a/MirrorProvider/MirrorProvider/FileSystemResult.cs b/MirrorProvider/MirrorProvider/FileSystemResult.cs
deleted file mode 100644
index fd568d4936..0000000000
--- a/MirrorProvider/MirrorProvider/FileSystemResult.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-namespace MirrorProvider
-{
- public enum FileSystemResult
- {
- Success,
- EFileNotFound,
- EIOError,
- }
-}
diff --git a/MirrorProvider/MirrorProvider/FileSystemVirtualizer.cs b/MirrorProvider/MirrorProvider/FileSystemVirtualizer.cs
deleted file mode 100644
index 6c2a875b00..0000000000
--- a/MirrorProvider/MirrorProvider/FileSystemVirtualizer.cs
+++ /dev/null
@@ -1,178 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-
-namespace MirrorProvider
-{
- public abstract class FileSystemVirtualizer
- {
- protected Enlistment Enlistment { get; private set; }
-
- protected abstract StringComparison PathComparison { get; }
- protected abstract StringComparer PathComparer { get; }
-
- public abstract bool TryConvertVirtualizationRoot(string directory, out string error);
- public virtual bool TryStartVirtualizationInstance(Enlistment enlistment, out string error)
- {
- this.Enlistment = enlistment;
- error = null;
- return true;
- }
-
- protected string GetFullPathInMirror(string relativePath)
- {
- return Path.Combine(this.Enlistment.MirrorRoot, relativePath);
- }
-
- protected bool DirectoryExists(string relativePath)
- {
- string fullPathInMirror = this.GetFullPathInMirror(relativePath);
- DirectoryInfo dirInfo = new DirectoryInfo(fullPathInMirror);
-
- return dirInfo.Exists;
- }
-
- protected bool FileExists(string relativePath)
- {
- string fullPathInMirror = this.GetFullPathInMirror(relativePath);
- FileInfo fileInfo = new FileInfo(fullPathInMirror);
-
- return fileInfo.Exists;
- }
-
- protected ProjectedFileInfo GetFileInfo(string relativePath)
- {
- string fullPathInMirror = this.GetFullPathInMirror(relativePath);
- string fullParentPath = Path.GetDirectoryName(fullPathInMirror);
- string fileName = Path.GetFileName(relativePath);
-
- string actualCaseName;
- ProjectedFileInfo.FileType type;
- if (this.FileOrDirectoryExists(fullParentPath, fileName, out actualCaseName, out type))
- {
- return new ProjectedFileInfo(
- actualCaseName,
- size: (type == ProjectedFileInfo.FileType.File) ? new FileInfo(fullPathInMirror).Length : 0,
- type: type);
- }
-
- return null;
- }
-
- protected IEnumerable GetChildItems(string relativePath)
- {
- string fullPathInMirror = this.GetFullPathInMirror(relativePath);
- DirectoryInfo dirInfo = new DirectoryInfo(fullPathInMirror);
-
- if (!dirInfo.Exists)
- {
- yield break;
- }
-
- foreach (FileSystemInfo fileSystemInfo in dirInfo.GetFileSystemInfos())
- {
- if ((fileSystemInfo.Attributes & FileAttributes.ReparsePoint) == FileAttributes.ReparsePoint)
- {
- // While not 100% accurate on all platforms, for simplicity assume that if the the file has reparse data it's a symlink
- yield return new ProjectedFileInfo(
- fileSystemInfo.Name,
- size: 0,
- type: ProjectedFileInfo.FileType.SymLink);
- }
- else if ((fileSystemInfo.Attributes & FileAttributes.Directory) == FileAttributes.Directory)
- {
- yield return new ProjectedFileInfo(
- fileSystemInfo.Name,
- size: 0,
- type: ProjectedFileInfo.FileType.Directory);
- }
- else
- {
- FileInfo fileInfo = fileSystemInfo as FileInfo;
- yield return new ProjectedFileInfo(
- fileInfo.Name,
- fileInfo.Length,
- ProjectedFileInfo.FileType.File);
- }
-
- }
- }
-
- protected FileSystemResult HydrateFile(string relativePath, int bufferSize, Func tryWriteBytes)
- {
- string fullPathInMirror = this.GetFullPathInMirror(relativePath);
- if (!File.Exists(fullPathInMirror))
- {
- return FileSystemResult.EFileNotFound;
- }
-
- using (FileStream fs = new FileStream(fullPathInMirror, FileMode.Open, FileAccess.Read))
- {
- long remainingData = fs.Length;
- byte[] buffer = new byte[bufferSize];
-
- while (remainingData > 0)
- {
- int bytesToCopy = (int)Math.Min(remainingData, buffer.Length);
- if (fs.Read(buffer, 0, bytesToCopy) != bytesToCopy)
- {
- return FileSystemResult.EIOError;
- }
-
- if (!tryWriteBytes(buffer, (uint)bytesToCopy))
- {
- return FileSystemResult.EIOError;
- }
-
- remainingData -= bytesToCopy;
- }
- }
-
- return FileSystemResult.Success;
- }
-
- private bool FileOrDirectoryExists(
- string fullParentPath,
- string fileName,
- out string actualCaseName,
- out ProjectedFileInfo.FileType type)
- {
- actualCaseName = null;
- type = ProjectedFileInfo.FileType.Invalid;
-
- DirectoryInfo dirInfo = new DirectoryInfo(fullParentPath);
- if (!dirInfo.Exists)
- {
- return false;
- }
-
- FileSystemInfo fileSystemInfo =
- dirInfo
- .GetFileSystemInfos()
- .FirstOrDefault(fsInfo => fsInfo.Name.Equals(fileName, PathComparison));
-
- if (fileSystemInfo == null)
- {
- return false;
- }
-
- actualCaseName = fileSystemInfo.Name;
-
- if ((fileSystemInfo.Attributes & FileAttributes.ReparsePoint) == FileAttributes.ReparsePoint)
- {
- type = ProjectedFileInfo.FileType.SymLink;
- }
- else if ((fileSystemInfo.Attributes & FileAttributes.Directory) == FileAttributes.Directory)
- {
- type = ProjectedFileInfo.FileType.Directory;
- }
- else
- {
- type = ProjectedFileInfo.FileType.File;
- }
-
- return true;
- }
- }
-}
diff --git a/MirrorProvider/MirrorProvider/MirrorProvider.csproj b/MirrorProvider/MirrorProvider/MirrorProvider.csproj
deleted file mode 100644
index 6ae314baad..0000000000
--- a/MirrorProvider/MirrorProvider/MirrorProvider.csproj
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
- netstandard2.0
- x64
- Debug;Release
-
-
-
- ..\..\..\BuildOutput
-
-
-
-
- $(BuildOutputDir)\MirrorProvider\obj\$(Configuration)\$(Platform)
- $(BuildOutputDir)\MirrorProvider\bin\$(Configuration)\$(Platform)
- true
-
-
-
- true
- full
- false
- TRACE;DEBUG
-
-
-
- true
- TRACE;RELEASE
-
-
-
-
-
-
-
diff --git a/MirrorProvider/MirrorProvider/MirrorProviderCLI.cs b/MirrorProvider/MirrorProvider/MirrorProviderCLI.cs
deleted file mode 100644
index 3fc12e92b9..0000000000
--- a/MirrorProvider/MirrorProvider/MirrorProviderCLI.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using CommandLine;
-using System;
-using System.Linq;
-
-namespace MirrorProvider
-{
- public static class MirrorProviderCLI
- {
- public static void Run(string[] args, FileSystemVirtualizer fileSystemVirtualizer)
- {
- new Parser(
- settings =>
- {
- settings.CaseSensitive = false;
- settings.EnableDashDash = true;
- settings.IgnoreUnknownArguments = false;
- settings.HelpWriter = Console.Error;
- })
- .ParseArguments(args, typeof(CloneVerb), typeof(MountVerb))
- .WithNotParsed(
- errors =>
- {
- if (errors.Any(error => error is TokenError))
- {
- Environment.Exit(1);
- }
- })
- .WithParsed(clone => clone.Execute(fileSystemVirtualizer))
- .WithParsed(mount => mount.Execute(fileSystemVirtualizer));
- }
- }
-}
diff --git a/MirrorProvider/MirrorProvider/MountVerb.cs b/MirrorProvider/MirrorProvider/MountVerb.cs
deleted file mode 100644
index 4c271ddc8f..0000000000
--- a/MirrorProvider/MirrorProvider/MountVerb.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using System;
-using System.IO;
-using CommandLine;
-
-namespace MirrorProvider
-{
- [Verb("mount")]
- public class MountVerb
- {
- private Enlistment enlistment;
-
- [Value(
- 0,
- Required = true,
- MetaName = "Enlistment root",
- HelpText = "The path to create the mirrored enlistment in")]
- public string EnlistmentRoot { get; set; }
-
- public void Execute(FileSystemVirtualizer fileSystemVirtualizer)
- {
- this.enlistment = Enlistment.LoadExistingEnlistment(this.EnlistmentRoot);
- if (this.enlistment == null)
- {
- Console.WriteLine("Error: Unable to load enlistment");
- }
-
- Console.WriteLine();
- Console.WriteLine($"Mounting {Path.GetFullPath(this.enlistment.EnlistmentRoot)}");
-
- if (fileSystemVirtualizer.TryStartVirtualizationInstance(this.enlistment, out string error))
- {
- Console.WriteLine("Virtualization instance started successfully");
-
- Console.WriteLine("Press Enter to end the instance");
- Console.ReadLine();
- }
- else
- {
- Console.WriteLine("Virtualization instance failed to start: " + error);
- }
- }
- }
-}
diff --git a/MirrorProvider/MirrorProvider/ProjectedFileInfo.cs b/MirrorProvider/MirrorProvider/ProjectedFileInfo.cs
deleted file mode 100644
index 71269ad2eb..0000000000
--- a/MirrorProvider/MirrorProvider/ProjectedFileInfo.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-namespace MirrorProvider
-{
- public class ProjectedFileInfo
- {
- public ProjectedFileInfo(string name, long size, FileType type)
- {
- this.Name = name;
- this.Size = size;
- this.Type = type;
- }
-
- public enum FileType
- {
- Invalid,
-
- File,
- Directory,
- SymLink
-
- }
-
- public string Name { get; }
- public long Size { get; }
- public FileType Type { get; }
- public bool IsDirectory => this.Type == FileType.Directory;
- }
-}
diff --git a/MirrorProvider/Scripts/Mac/Build.sh b/MirrorProvider/Scripts/Mac/Build.sh
deleted file mode 100755
index 94617466d2..0000000000
--- a/MirrorProvider/Scripts/Mac/Build.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-
-CONFIGURATION=$1
-if [ -z $CONFIGURATION ]; then
- CONFIGURATION=Debug
-fi
-
-SCRIPTDIR=$(dirname ${BASH_SOURCE[0]})
-
-SRCDIR=$SCRIPTDIR/../../..
-ROOTDIR=$SRCDIR/..
-SLN=$SRCDIR/MirrorProvider/MirrorProvider.sln
-
-# Build the ProjFS kext and libraries
-$SRCDIR/ProjFS.Mac/Scripts/Build.sh $CONFIGURATION
-
-# If we're building the Profiling(Release) configuration, remove Profiling() for building .NET code
-if [ "$CONFIGURATION" == "Profiling(Release)" ]; then
- CONFIGURATION=Release
-fi
-
-# Build the MirrorProvider
-dotnet restore $SLN /p:Configuration="$CONFIGURATION.Mac" --packages $ROOTDIR/packages
-dotnet build $SLN --configuration $CONFIGURATION.Mac
diff --git a/MirrorProvider/Scripts/Mac/MirrorProvider_Clone.sh b/MirrorProvider/Scripts/Mac/MirrorProvider_Clone.sh
deleted file mode 100755
index ad73a8ca90..0000000000
--- a/MirrorProvider/Scripts/Mac/MirrorProvider_Clone.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-
-CONFIGURATION=$1
-if [ -z $CONFIGURATION ]; then
- CONFIGURATION=Debug
-fi
-
-SCRIPTDIR=$(dirname ${BASH_SOURCE[0]})
-BUILDDIR=$SCRIPTDIR/../../../../BuildOutput/MirrorProvider.Mac/bin/$CONFIGURATION/x64/netcoreapp2.1
-
-dotnet $BUILDDIR/MirrorProvider.Mac.dll clone ~/PathToMirror ~/TestRoot
diff --git a/MirrorProvider/Scripts/Mac/MirrorProvider_Mount.sh b/MirrorProvider/Scripts/Mac/MirrorProvider_Mount.sh
deleted file mode 100755
index 875a3e7ea1..0000000000
--- a/MirrorProvider/Scripts/Mac/MirrorProvider_Mount.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-
-CONFIGURATION=$1
-if [ -z $CONFIGURATION ]; then
- CONFIGURATION=Debug
-fi
-
-SCRIPTDIR=$(dirname ${BASH_SOURCE[0]})
-BUILDDIR=$SCRIPTDIR/../../../../BuildOutput/MirrorProvider.Mac/bin/$CONFIGURATION/x64/netcoreapp2.1
-
-dotnet $BUILDDIR/MirrorProvider.Mac.dll mount ~/TestRoot
diff --git a/MirrorProvider/Scripts/Windows/Build.bat b/MirrorProvider/Scripts/Windows/Build.bat
deleted file mode 100644
index f012b577bc..0000000000
--- a/MirrorProvider/Scripts/Windows/Build.bat
+++ /dev/null
@@ -1,14 +0,0 @@
-IF "%1"=="" (SET "Configuration=Debug") ELSE (SET "Configuration=%1")
-
-SET SRC=%~dp0\..\..\..
-SET ROOT=%SRC%\..
-SET SLN=%SRC%\MirrorProvider\MirrorProvider.sln
-
-FOR /F "tokens=* USEBACKQ" %%F IN (`where nuget.exe`) DO (
- SET nuget=%%F
- ECHO Found nuget.exe at '%%F'
-)
-
-%nuget% restore %SLN%
-dotnet restore %SLN% /p:Configuration="%Configuration%.Windows" --packages %ROOT%\packages
-dotnet build %SLN% --configuration %Configuration%.Windows
\ No newline at end of file
diff --git a/MirrorProvider/Scripts/Windows/MirrorProvider_Clone.bat b/MirrorProvider/Scripts/Windows/MirrorProvider_Clone.bat
deleted file mode 100644
index c579f0d0c0..0000000000
--- a/MirrorProvider/Scripts/Windows/MirrorProvider_Clone.bat
+++ /dev/null
@@ -1,4 +0,0 @@
-SET BUILDDIR=%~dp0\..\..\..\..\BuildOutput\MirrorProvider.Windows\bin\x64\Debug
-
-%BUILDDIR%\MirrorProvider.Windows.exe clone \PathToMirror \TestRoot
-
diff --git a/MirrorProvider/Scripts/Windows/MirrorProvider_Mount.bat b/MirrorProvider/Scripts/Windows/MirrorProvider_Mount.bat
deleted file mode 100644
index e8c4f2350c..0000000000
--- a/MirrorProvider/Scripts/Windows/MirrorProvider_Mount.bat
+++ /dev/null
@@ -1,4 +0,0 @@
-SET BUILDDIR=%~dp0\..\..\..\..\BuildOutput\MirrorProvider.Windows\bin\x64\Debug
-
-%BUILDDIR%\MirrorProvider.Windows.exe mount \TestRoot
-
diff --git a/ProjFS.Mac/EndpointSecurityPrototype/EndpointSecurityMirror.xcodeproj/project.pbxproj b/ProjFS.Mac/EndpointSecurityPrototype/EndpointSecurityMirror.xcodeproj/project.pbxproj
deleted file mode 100644
index 7f8421550b..0000000000
--- a/ProjFS.Mac/EndpointSecurityPrototype/EndpointSecurityMirror.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,310 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 50;
- objects = {
-
-/* Begin PBXBuildFile section */
- 4A6A654B22C227CA00E207E2 /* libEndpointSecurity.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A6A654A22C227CA00E207E2 /* libEndpointSecurity.tbd */; };
- 4A6A654F22C4A8BE00E207E2 /* EndpointSecurityMirror.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A6A654E22C4A8BE00E207E2 /* EndpointSecurityMirror.cpp */; };
- 4A6A656922C4C33200E207E2 /* libbsm.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A6A656822C4C32B00E207E2 /* libbsm.tbd */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXCopyFilesBuildPhase section */
- 4A6A653D22C227BA00E207E2 /* CopyFiles */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 2147483647;
- dstPath = /usr/share/man/man1/;
- dstSubfolderSpec = 0;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 1;
- };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
- 4A6A653F22C227BA00E207E2 /* EndpointSecurityMirror */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = EndpointSecurityMirror; sourceTree = BUILT_PRODUCTS_DIR; };
- 4A6A654A22C227CA00E207E2 /* libEndpointSecurity.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libEndpointSecurity.tbd; path = usr/lib/libEndpointSecurity.tbd; sourceTree = SDKROOT; };
- 4A6A654C22C22E9500E207E2 /* EndpointSecurityMirror.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = EndpointSecurityMirror.entitlements; sourceTree = ""; };
- 4A6A654E22C4A8BE00E207E2 /* EndpointSecurityMirror.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EndpointSecurityMirror.cpp; sourceTree = ""; };
- 4A6A655022C4A9E000E207E2 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; };
- 4A6A656822C4C32B00E207E2 /* libbsm.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libbsm.tbd; path = usr/lib/libbsm.tbd; sourceTree = SDKROOT; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 4A6A653C22C227BA00E207E2 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 4A6A654B22C227CA00E207E2 /* libEndpointSecurity.tbd in Frameworks */,
- 4A6A656922C4C33200E207E2 /* libbsm.tbd in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 4A6A653622C227BA00E207E2 = {
- isa = PBXGroup;
- children = (
- 4A6A654122C227BA00E207E2 /* EndpointSecurityMirror */,
- 4A6A654022C227BA00E207E2 /* Products */,
- 4A6A654922C227CA00E207E2 /* Frameworks */,
- );
- sourceTree = "";
- };
- 4A6A654022C227BA00E207E2 /* Products */ = {
- isa = PBXGroup;
- children = (
- 4A6A653F22C227BA00E207E2 /* EndpointSecurityMirror */,
- );
- name = Products;
- sourceTree = "";
- };
- 4A6A654122C227BA00E207E2 /* EndpointSecurityMirror */ = {
- isa = PBXGroup;
- children = (
- 4A6A654C22C22E9500E207E2 /* EndpointSecurityMirror.entitlements */,
- 4A6A654E22C4A8BE00E207E2 /* EndpointSecurityMirror.cpp */,
- 4A6A655022C4A9E000E207E2 /* README.md */,
- );
- path = EndpointSecurityMirror;
- sourceTree = "";
- };
- 4A6A654922C227CA00E207E2 /* Frameworks */ = {
- isa = PBXGroup;
- children = (
- 4A6A656822C4C32B00E207E2 /* libbsm.tbd */,
- 4A6A654A22C227CA00E207E2 /* libEndpointSecurity.tbd */,
- );
- name = Frameworks;
- sourceTree = "";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 4A6A653E22C227BA00E207E2 /* EndpointSecurityMirror */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 4A6A654622C227BA00E207E2 /* Build configuration list for PBXNativeTarget "EndpointSecurityMirror" */;
- buildPhases = (
- 4A6A653B22C227BA00E207E2 /* Sources */,
- 4A6A653C22C227BA00E207E2 /* Frameworks */,
- 4A6A653D22C227BA00E207E2 /* CopyFiles */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = EndpointSecurityMirror;
- productName = EndpointSecurityMirror;
- productReference = 4A6A653F22C227BA00E207E2 /* EndpointSecurityMirror */;
- productType = "com.apple.product-type.tool";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 4A6A653722C227BA00E207E2 /* Project object */ = {
- isa = PBXProject;
- attributes = {
- LastUpgradeCheck = 1110;
- ORGANIZATIONNAME = "Microsoft Corporation";
- TargetAttributes = {
- 4A6A653E22C227BA00E207E2 = {
- CreatedOnToolsVersion = 11.0;
- };
- };
- };
- buildConfigurationList = 4A6A653A22C227BA00E207E2 /* Build configuration list for PBXProject "EndpointSecurityMirror" */;
- compatibilityVersion = "Xcode 9.3";
- developmentRegion = en;
- hasScannedForEncodings = 0;
- knownRegions = (
- en,
- Base,
- );
- mainGroup = 4A6A653622C227BA00E207E2;
- productRefGroup = 4A6A654022C227BA00E207E2 /* Products */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 4A6A653E22C227BA00E207E2 /* EndpointSecurityMirror */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXSourcesBuildPhase section */
- 4A6A653B22C227BA00E207E2 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 4A6A654F22C4A8BE00E207E2 /* EndpointSecurityMirror.cpp in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
- 4A6A654422C227BA00E207E2 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_ANALYZER_NONNULL = YES;
- CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_ENABLE_OBJC_WEAK = YES;
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_COMMA = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = YES;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = NO;
- DEBUG_INFORMATION_FORMAT = dwarf;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- ENABLE_TESTABILITY = YES;
- GCC_C_LANGUAGE_STANDARD = gnu11;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.14;
- MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
- MTL_FAST_MATH = YES;
- ONLY_ACTIVE_ARCH = YES;
- SDKROOT = macosx;
- };
- name = Debug;
- };
- 4A6A654522C227BA00E207E2 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_ANALYZER_NONNULL = YES;
- CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_ENABLE_OBJC_WEAK = YES;
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_COMMA = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = YES;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = NO;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- ENABLE_NS_ASSERTIONS = NO;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- GCC_C_LANGUAGE_STANDARD = gnu11;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.14;
- MTL_ENABLE_DEBUG_INFO = NO;
- MTL_FAST_MATH = YES;
- SDKROOT = macosx;
- };
- name = Release;
- };
- 4A6A654722C227BA00E207E2 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CODE_SIGN_ENTITLEMENTS = EndpointSecurityMirror/EndpointSecurityMirror.entitlements;
- CODE_SIGN_IDENTITY = "-";
- CODE_SIGN_STYLE = Automatic;
- DEVELOPMENT_TEAM = PLT8TQHCAJ;
- ENABLE_HARDENED_RUNTIME = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.15;
- PRODUCT_BUNDLE_IDENTIFIER = org.vfsforgit.mirrorprovider.endpointsecurityprototype;
- PRODUCT_NAME = "$(TARGET_NAME)";
- };
- name = Debug;
- };
- 4A6A654822C227BA00E207E2 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CODE_SIGN_ENTITLEMENTS = EndpointSecurityMirror/EndpointSecurityMirror.entitlements;
- CODE_SIGN_IDENTITY = "-";
- CODE_SIGN_STYLE = Automatic;
- DEVELOPMENT_TEAM = PLT8TQHCAJ;
- ENABLE_HARDENED_RUNTIME = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.15;
- PRODUCT_BUNDLE_IDENTIFIER = org.vfsforgit.mirrorprovider.endpointsecurityprototype;
- PRODUCT_NAME = "$(TARGET_NAME)";
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 4A6A653A22C227BA00E207E2 /* Build configuration list for PBXProject "EndpointSecurityMirror" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 4A6A654422C227BA00E207E2 /* Debug */,
- 4A6A654522C227BA00E207E2 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 4A6A654622C227BA00E207E2 /* Build configuration list for PBXNativeTarget "EndpointSecurityMirror" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 4A6A654722C227BA00E207E2 /* Debug */,
- 4A6A654822C227BA00E207E2 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 4A6A653722C227BA00E207E2 /* Project object */;
-}
diff --git a/ProjFS.Mac/EndpointSecurityPrototype/EndpointSecurityMirror.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ProjFS.Mac/EndpointSecurityPrototype/EndpointSecurityMirror.xcodeproj/project.xcworkspace/contents.xcworkspacedata
deleted file mode 100644
index f116d98d8d..0000000000
--- a/ProjFS.Mac/EndpointSecurityPrototype/EndpointSecurityMirror.xcodeproj/project.xcworkspace/contents.xcworkspacedata
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/ProjFS.Mac/EndpointSecurityPrototype/EndpointSecurityMirror.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ProjFS.Mac/EndpointSecurityPrototype/EndpointSecurityMirror.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
deleted file mode 100644
index 18d981003d..0000000000
--- a/ProjFS.Mac/EndpointSecurityPrototype/EndpointSecurityMirror.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- IDEDidComputeMac32BitWarning
-
-
-
diff --git a/ProjFS.Mac/EndpointSecurityPrototype/EndpointSecurityMirror.xcodeproj/xcshareddata/xcschemes/EndpointSecurityMirror.xcscheme b/ProjFS.Mac/EndpointSecurityPrototype/EndpointSecurityMirror.xcodeproj/xcshareddata/xcschemes/EndpointSecurityMirror.xcscheme
deleted file mode 100644
index 575fa5062c..0000000000
--- a/ProjFS.Mac/EndpointSecurityPrototype/EndpointSecurityMirror.xcodeproj/xcshareddata/xcschemes/EndpointSecurityMirror.xcscheme
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/ProjFS.Mac/EndpointSecurityPrototype/EndpointSecurityMirror/EndpointSecurityMirror.cpp b/ProjFS.Mac/EndpointSecurityPrototype/EndpointSecurityMirror/EndpointSecurityMirror.cpp
deleted file mode 100644
index b5fdbbaba2..0000000000
--- a/ProjFS.Mac/EndpointSecurityPrototype/EndpointSecurityMirror/EndpointSecurityMirror.cpp
+++ /dev/null
@@ -1,511 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-using std::string;
-using std::mutex;
-using std::unordered_map;
-using std::vector;
-using std::atomic_uint;
-using std::extent;
-
-typedef std::lock_guard Guard;
-
-// Local function declarations
-
-static void HandleSecurityEvent(
- es_client_t* _Nonnull client, const es_message_t* _Nonnull message);
-static int RecursiveEnumerationCopyfileStatusCallback(
- int what, int stage, copyfile_state_t state, const char * src, const char * dst, void * ctx);
-static void HydrateFileOrAwaitHydration(string eventPath, const es_message_t* message);
-static void HydrateFile(string eventPath, es_message_t* message);
-static const char* CopyfileWhatString(int what) __attribute__((unused));
-static const char* CopyfileStageString(int stage) __attribute__((unused));
-
-// Global/static variable definitions
-
-static pid_t selfpid;
-static constexpr const char* EmptyFileXattr = "org.vfsforgit.endpointsecuritymirror.emptyfile";
-
-static es_client_t* client = nullptr;
-static dispatch_queue_t s_hydrationQueue = nullptr;
-static mutex s_hydrationMutex;
-static unordered_map> s_waitingFileHydrationMessages;
-
-static string s_sourcePrefix, s_targetPrefix;
-
-static atomic_uint s_pendingAuthCount(0);
-static mach_timebase_info_data_t s_machTimebase;
-
-// Helper functions
-
-static uint64_t usecFromMachDuration(uint64_t machDuration)
-{
- // timebase gives ns, divide by 1000 for usec
- return ((machDuration * s_machTimebase.numer) / s_machTimebase.denom) / 1000u;
-}
-
-static int64_t usecFromMachDuration(int64_t machDuration)
-{
- return ((machDuration * s_machTimebase.numer) / s_machTimebase.denom) / 1000;
-}
-
-static const char* FilenameFromPath(const char* path)
-{
- const char* lastSlash = std::strrchr(path, '/');
- if (lastSlash == nullptr)
- {
- return path;
- }
- else
- {
- return lastSlash + 1;
- }
-}
-
-static bool PathLiesWithinTarget(const char* path)
-{
- return 0 == strncmp(s_targetPrefix.c_str(), path, s_targetPrefix.length());
-}
-
-static string SourcePathForTargetFile(const char* targetPath)
-{
- return s_sourcePrefix + (targetPath + s_targetPrefix.length());
-}
-
-
-// Helper function for making "what" argument to copyfile callback human-readable
-static const char* CopyfileWhatString(int what)
-{
- switch (what)
- {
- case COPYFILE_RECURSE_FILE:
- return "COPYFILE_RECURSE_FILE";
- case COPYFILE_RECURSE_DIR:
- return "COPYFILE_RECURSE_DIR";
- case COPYFILE_RECURSE_DIR_CLEANUP:
- return "COPYFILE_RECURSE_DIR_CLEANUP";
- case COPYFILE_RECURSE_ERROR:
- return "COPYFILE_RECURSE_ERROR";
- default:
- return "???";
- }
-}
-
-// Helper function for making "stage" argument to copyfile callback human-readable
-static const char* CopyfileStageString(int stage)
-{
- switch (stage)
- {
- case COPYFILE_START:
- return "COPYFILE_START";
- case COPYFILE_FINISH:
- return "COPYFILE_FINISH";
- case COPYFILE_ERR:
- return "COPYFILE_ERR";
- default:
- return "???";
- }
-}
-
-//
-
-int main(int argc, const char* argv[])
-{
- selfpid = getpid();
- mach_timebase_info(&s_machTimebase); // required for subsequent mach time <-> nsec/usec conversions
-
- if (argc < 3)
- {
- fprintf(stderr, "Run as: %s