This repository has been archived by the owner on Nov 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dogfood.casper
59 lines (46 loc) · 2.37 KB
/
dogfood.casper
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
import Casper
import Casper.IO
casperDir = Directory('.casper')
oldCasperDir = casperDir.Directory('old')
newCasperDir = casperDir.Directory('new')
localNugetConfig = 'local-nuget.config'
packagesDir = Directory('./out/packages')
buildDogfoodFile = File('build.dogfood.casper')
def quoteExecutable(exec as IFileSystemObject):
return (exec.FullPath if Environment.IsUnixFileSystem else "\"$(exec.FullPath)\"")
task Restore(Exec,
Executable: 'nuget.exe',
Arguments: 'restore')
task Build(Exec,
DependsOn: [Restore],
Executable: quoteExecutable(oldCasperDir.Directory('Casper.Console').Directory('tools').File('casper.exe')),
Arguments: 'build.casper Build',
ShowOutput: true)
task ConfirmBuild(DependsOn: [Build]):
if(not packagesDir.Exists()):
raise CasperException(CasperException.KnownExitCode.TaskFailed, "Expected a package to be produced at \"$(packagesDir.FullPath)\", but no package was found")
task CleanNewCasperDir:
newCasperDir.Delete()
newCasperDir.Create()
task InstallNew(Exec,
DependsOn: [ConfirmBuild, CleanNewCasperDir],
Executable: 'nuget.exe',
Arguments: "install Casper.Console -ExcludeVersion -OutputDirectory \"$(newCasperDir.FullPath)\" -pre -Verbosity quiet -Source \"Casper Dev\" -ConfigFile $(localNugetConfig)")
task ConfirmInstall(DependsOn: [InstallNew]):
newCasperInstallDir = newCasperDir.Directory('Casper.Console')
if(not newCasperInstallDir.Exists()):
raise CasperException(CasperException.KnownExitCode.TaskFailed, "Expected new Casper to be installed at \"$(newCasperInstallDir.FullPath)\", but no package was found")
task CleanOutputs(Exec,
DependsOn: [ConfirmBuild],
Executable: 'msbuild',
Arguments: '/t:Clean /p:Configuration=Release /verbosity:quiet /nologo')
task CleanPackages(DependsOn: [InstallNew]):
packagesDir.Delete()
task BuildNew(Exec,
DependsOn: [ConfirmInstall, CleanOutputs, CleanPackages],
Executable: quoteExecutable(newCasperDir.Directory('Casper.Console').Directory('tools').File('casper.exe')),
Arguments: (buildDogfoodFile.Name if buildDogfoodFile.Exists() else 'build.casper') + ' Build',
ShowOutput: true)
task Dogfood(DependsOn: [BuildNew]):
if(not packagesDir.Exists()):
raise CasperException(CasperException.KnownExitCode.TaskFailed, "Expected a package to be produced at \"$(packagesDir.FullPath)\", but no package was found")