-
Notifications
You must be signed in to change notification settings - Fork 146
/
BuildCache.cmd
89 lines (73 loc) · 2.38 KB
/
BuildCache.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
@echo off
setlocal
set EXE_DIR=%~dp0out\Bin\debug\net472
set EXE=%EXE_DIR%\BuildCache.Tool.exe
set CACHE_ROOT=%BUILDXL_CACHE_DIRECTORY%
REM Directory that receives exported cache
set BUILDXL_CACHE_EXPORT_DIRECTORY=%~d0\BuildXLCacheExport
REM CacheRoot for local import test
set TEST_CACHE_ROOT=%~d0\BuildXLCacheImportTest
REM AppFabric Cache was created with following command
REM New-Cache -CacheName BuildXLSelfhost -Eviction LRU -Expirable false -Force -Secondaries 1 -MinSecondaries 1
set CMD=%1
if "%CMD%"=="" (
echo Unknown command argument
echo BuildCache.cmd ShowContentBag CD8F61D41C579DC2B676BF6ACC1E008EF01417C6
echo BuildCache.cmd ShowContentToken EE879A24868414BD709CDE5378F6647192EE0074
echo BuildCache.cmd ShowContentProvenance EE879A24868414BD709CDE5378F6647192EE0074
echo BuildCache.cmd ShowContentProvenance %~dp0Out\Bin\Debug\bxl.exe
exit /b 1
)
if /i "%CMD%"=="ShowContentBag" (
if "%2"=="" (
echo Missing first argument: fingerprint
exit /b 1
)
set ARGS_CMD=/fingerprint=%2 /forceJson=false
)
if /i "%CMD%"=="DeleteContentBag" (
if "%2"=="" (
echo Missing first argument: fingerprint
exit /b 1
)
set ARGS_CMD=/fingerprint=%2
)
if /i "%CMD%"=="ShowContentToken" (
if "%2"=="" (
echo Missing first argument: hash
exit /b 1
)
set ARGS_CMD=/contentHash=%2
)
if /i "%CMD%"=="ShowContentProvenance" (
if "%2"=="" (
echo Missing first argument: hash
exit /b 1
)
set ARGS_CMD=/contentHashOrPath=%2
)
if /i "%CMD%"=="ListContent" (
set ARGS_CMD=
)
if /i "%CMD%"=="Validate" (
set ARGS_CMD=
)
if /i "%CMD%"=="DiskStats" (
set ARGS_CMD=
)
if /i "%CMD%"=="Export" (
set ARGS_CMD=/directoryPath=%BUILDXL_CACHE_EXPORT_DIRECTORY% /exportMode=Append /includeContent
)
if /i "%CMD%"=="Import" (
set CACHE_ROOT=%TEST_CACHE_ROOT%
set ARGS_CMD=/machine=%COMPUTERNAME% /directoryPath=%BUILDXL_CACHE_EXPORT_DIRECTORY%
)
set ARGS_COMMON=^
/cacheRoot=%CACHE_ROOT% ^
/hashType=Vso0 ^
/contentbagtypeassemblypath=%EXE_DIR%\BuildXL.Engine.Cache.dll ^
/contentbagtypename=BuildXL.Engine.Cache.Fingerprints.PipFingerprintEntry ^
/cacheConfigPaths=%~dp0BuildCacheDefault.json;%~dp0BuildCacheOverride.json
set CMDLINE=%EXE% %CMD% %ARGS_COMMON% %ARGS_CMD%
echo %CMDLINE%
%CMDLINE%