@@ -87,7 +87,7 @@ let changelog = scrapeChangelog () |> Seq.toList
8787let currentVersionInfo = changelog.[ 0 ]
8888/// Indicates the extra version number that's added to the template package. When releasing a new version of Interstellar, reset this to 0. Whenever making a
8989/// change to just the template, increment this.
90- let currentTemplateMinorVersion = 2
90+ let currentTemplateMinorVersion = 1
9191
9292let addProperties props defaults = { defaults with Properties = [ yield ! defaults.Properties; yield ! props]}
9393
@@ -134,13 +134,12 @@ let getNupkgPath version projPath =
134134 Path.Combine ([| projDir; " bin" ; " Release" ;
135135 sprintf " %s%s .nupkg" ( Path.GetFileNameWithoutExtension projPath) vstr|])
136136
137- let getNupkgArtifactPath proj = Path.Combine ( artifactsPath, sprintf " %s .nupkg" ( Path.GetFileNameWithoutExtension proj))
138-
139137Target.create " Clean" ( fun _ ->
140138 Trace.log " --- Cleaning --- "
141139 for proj in projects do
142- try File.Delete ( getNupkgPath ( Some currentVersionInfo.versionName) proj) with _ -> ()
143- try File.Delete ( getNupkgArtifactPath proj) with _ -> ()
140+ let vstr = currentVersionInfo.versionName
141+ File.delete ( getNupkgPath ( Some vstr) proj)
142+ !! ( Path.Combine ( artifactsPath, " **/*.nupkg" )) |> File.deleteAll
144143 let projects =
145144 if Environment.isWindows then [ Projects.winFormsLib; Projects.wpfLib; yield ! Templates.winProjects ]
146145 else if Environment.isMacOS then [ Solutions.macos; yield ! Templates.macosProjects ]
@@ -150,7 +149,6 @@ Target.create "Clean" (fun _ ->
150149 Shell.deleteDir " .fsdocs"
151150 Shell.deleteDir " output"
152151 Shell.deleteDir " temp"
153- Shell.deleteDir artifactsPath
154152)
155153
156154Target.create " Restore" ( fun _ ->
@@ -201,14 +199,14 @@ Target.create "Pack" (fun _ ->
201199 Trace.log ( sprintf " PROJECT LIST: %A " projects)
202200 for proj in projects do
203201 msbuild id proj
204- // Strip version stuff from the file name, and collect all generated package archives into a common folder
205- let oldNupkgPath = getNupkgPath ( Some currentVersionInfo.versionName) proj
206- Directory.CreateDirectory " artifacts " |> ignore
207- let nupkgArtifact = getNupkgArtifactPath proj
208- Trace.log ( sprintf " Moving %s -> %s " oldNupkgPath nupkgArtifact )
209- try File.Delete nupkgArtifact with _ -> ()
210- File.Copy ( oldNupkgPath , nupkgArtifact )
211- `` Nupkg-hack `` .hackNupkgAtPath nupkgArtifact // see #3
202+ // Collect all generated package archives into a common folder
203+ let vstr = currentVersionInfo.versionName
204+ let oldNupkgPath = getNupkgPath ( Some vstr ) proj
205+ Shell.mkdir artifactsPath
206+ Shell.moveFile artifactsPath oldNupkgPath
207+ // see https://github.com/jwosty/Interstellar/issues/3
208+ !! ( Path.Combine ( artifactsPath , " ** " , " *.nupkg " ) )
209+ |> Seq.iter ( `` Nupkg-hack `` .hackNupkgAtPath)
212210)
213211
214212Target.create " BuildTemplateProjects" ( fun _ ->
@@ -243,20 +241,20 @@ Target.create "PackTemplates" (fun _ ->
243241
244242Target.create " PackAll" ignore
245243
244+ Target.create " TestAll" ignore
245+
246246Target.create " All" ignore
247247
248248open Fake.Core .TargetOperators
249249
250250// *** Define Dependencies ***
251- " Clean"
252- ==> " Restore"
251+ " Restore"
253252 ==> " Build"
254253 ==> " Pack"
255254 ==> " PackAll"
256255 ==> " All"
257256
258- " Clean"
259- ==> " PackTemplates"
257+ " PackTemplates"
260258 ==> " PackAll"
261259 ==> " All"
262260
@@ -265,6 +263,14 @@ open Fake.Core.TargetOperators
265263 ==> " ReleaseDocs"
266264 ==> " All"
267265
266+ " BuildTemplateProjects"
267+ ==> " TestAll"
268+
269+ // "Build"
270+ // ==> "Test"
271+ " Test"
272+ ==> " TestAll"
273+
268274" Build"
269275 ==> " BuildTemplateProjects"
270276
0 commit comments