Skip to content

Commit aedbf48

Browse files
Add local nuget repo publishing option to build script (#257)
* Add local nuget repo publishing option to build script * Exclude LocalNuget target from All, exclude examples folder from CreateNuget target
1 parent a2738e7 commit aedbf48

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

build.fsx

+16
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ let overrideVersionSuffix (project:string) =
202202
| _ -> versionSuffix // add additional matches to publish different versions for different projects in solution
203203
Target "CreateNuget" (fun _ ->
204204
let projects = !! "src/**/*.csproj"
205+
-- "src/examples/**/*" // Don't publish any examples
205206
-- "src/**/*Tests.csproj" // Don't publish unit tests
206207
-- "src/**/*Tests*.csproj"
207208

@@ -236,6 +237,19 @@ Target "PublishNuget" (fun _ ->
236237
projects |> Seq.iter (runSingleProject)
237238
)
238239

240+
Target "PublishLocalNuget" (fun _ ->
241+
let projects = !! "./bin/nuget/*.nupkg"
242+
let source = getBuildParamOrDefault "nugetpublishurl" ""
243+
244+
if (not (source = "")) then
245+
let runSingleProject project =
246+
Shell.Exec
247+
(toolsDir @@ "nuget", sprintf "add %s -source %s" project source)
248+
|> ignore
249+
250+
projects |> Seq.iter (runSingleProject)
251+
)
252+
239253
//--------------------------------------------------------------------------------
240254
// Documentation
241255
//--------------------------------------------------------------------------------
@@ -293,6 +307,7 @@ Target "Help" <| fun _ ->
293307
Target "BuildRelease" DoNothing
294308
Target "All" DoNothing
295309
Target "Nuget" DoNothing
310+
Target "LocalNuget" DoNothing
296311

297312
// build dependencies
298313
"Clean" ==> "AssemblyInfo" ==> "Build" ==> "BuildRelease"
@@ -304,6 +319,7 @@ Target "Nuget" DoNothing
304319
// nuget dependencies
305320
"Clean" ==> "Build" ==> "CreateNuget"
306321
"CreateNuget" ==> "SignPackages" ==> "PublishNuget" ==> "Nuget"
322+
"CreateNuget" ==> "PublishLocalNuget" ==> "LocalNuget"
307323

308324
// docs
309325
"Clean" ==> "BuildRelease" ==> "Docfx"

0 commit comments

Comments
 (0)