@@ -8,6 +8,9 @@ var target = Argument("target", "Default");
8
8
var configuration = Argument ( "configuration" , "Release" ) ;
9
9
10
10
var solutionDirectory = Directory ( "./" ) ;
11
+ var artifactsDirectory = solutionDirectory + Directory ( "artifacts" ) ;
12
+ var toolsDirectory = solutionDirectory + Directory ( "Tools" ) ;
13
+
11
14
var solutionFile = solutionDirectory + File ( "CSharpDriver.sln" ) ;
12
15
var gitVersion = GitVersion ( ) ;
13
16
@@ -112,6 +115,50 @@ Task("TestLinux")
112
115
Task ( "Test" )
113
116
. IsDependentOn ( "TestWindows" ) ;
114
117
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
+
115
162
Task ( "Default" )
116
163
. IsDependentOn ( "Build" ) ;
117
164
0 commit comments