@@ -8,6 +8,9 @@ var target = Argument("target", "Default");
88var configuration = Argument ( "configuration" , "Release" ) ;
99
1010var solutionDirectory = Directory ( "./" ) ;
11+ var artifactsDirectory = solutionDirectory + Directory ( "artifacts" ) ;
12+ var toolsDirectory = solutionDirectory + Directory ( "Tools" ) ;
13+
1114var solutionFile = solutionDirectory + File ( "CSharpDriver.sln" ) ;
1215var gitVersion = GitVersion ( ) ;
1316
@@ -112,6 +115,50 @@ Task("TestLinux")
112115Task ( "Test" )
113116 . IsDependentOn ( "TestWindows" ) ;
114117
118+ Task ( "RefDocs" )
119+ . Does ( ( ) =>
120+ {
121+ var hugoDirectory = toolsDirectory + Directory ( "Hugo" ) ;
122+ EnsureDirectoryExists ( hugoDirectory ) ;
123+ CleanDirectory ( hugoDirectory ) ;
124+
125+ var url = "https://github.com/spf13/hugo/releases/download/v0.13/hugo_0.13_windows_amd64.zip" ;
126+ var zipFile = hugoDirectory + File ( "hugo_0.13_windows_amd64.zip" ) ;
127+ DownloadFile ( url , zipFile ) ;
128+ Unzip ( zipFile , hugoDirectory ) ;
129+ var hugoExe = hugoDirectory + File ( "hugo_0.13_windows_amd64.exe" ) ;
130+
131+ var landingDirectory = solutionDirectory + Directory ( "docs" ) + Directory ( "landing" ) ;
132+ var processSettings = new ProcessSettings
133+ {
134+ WorkingDirectory = landingDirectory
135+ } ;
136+ StartProcess ( hugoExe , processSettings ) ;
137+
138+ var referenceDirectory = solutionDirectory + Directory ( "docs" ) + Directory ( "reference" ) ;
139+ processSettings = new ProcessSettings
140+ {
141+ WorkingDirectory = referenceDirectory
142+ } ;
143+ StartProcess ( hugoExe , processSettings ) ;
144+
145+ var tempDirectory = artifactsDirectory + Directory ( "tmp" ) ;
146+ EnsureDirectoryExists ( tempDirectory ) ;
147+ CleanDirectory ( tempDirectory ) ;
148+
149+ var landingPublicDirectory = landingDirectory + Directory ( "public" ) ;
150+ CopyDirectory ( landingPublicDirectory , tempDirectory ) ;
151+
152+ var referencePublicDirectory = referenceDirectory + Directory ( "public" ) ;
153+ var referencePublicDestinationDirectory = tempDirectory + Directory ( gitVersion . Major + "." + gitVersion . Minor ) ;
154+ CopyDirectory ( referencePublicDirectory , referencePublicDestinationDirectory ) ;
155+
156+ var referenceDocsZipFile = artifactsDirectory + File ( "RefDocs-" + gitVersion . SemVer + "-html.zip" ) ;
157+ Zip ( tempDirectory , referenceDocsZipFile ) ;
158+
159+ DeleteDirectory ( tempDirectory , recursive : true ) ;
160+ } ) ;
161+
115162Task ( "Default" )
116163 . IsDependentOn ( "Build" ) ;
117164
0 commit comments