Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ability to control type library export (/tlb flag) of RegAsm. #668

Merged
merged 1 commit into from
Mar 4, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/app/FakeLib/RegAsmHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ open System
type RegAsmParams =
{ ToolPath : string
WorkingDir : string
TimeOut : TimeSpan }
TimeOut : TimeSpan
ExportTypeLibrary : bool }

/// RegAsm default params
let RegAsmDefaults =
{ ToolPath = @"C:\Windows\Microsoft.NET\Framework\v2.0.50727\regasm.exe"
WorkingDir = "."
TimeOut = TimeSpan.FromMinutes 5. }
TimeOut = TimeSpan.FromMinutes 5.
ExportTypeLibrary = true }

/// Runs regasm on the given lib
/// ## Parameters
Expand All @@ -24,7 +26,10 @@ let RegAsmDefaults =
let RegAsm setParams lib =
traceStartTask "RegAsm" lib
let parameters = setParams RegAsmDefaults
let args = sprintf "%s /tlb:%s" lib (replace ".dll" ".tlb" lib)
let args = if parameters.ExportTypeLibrary then
sprintf "\"%s\" /tlb:\"%s\"" lib (replace ".dll" ".tlb" lib)
else
sprintf "\"%s\"" lib
if 0 <> ExecProcess (fun info ->
info.FileName <- parameters.ToolPath
info.WorkingDirectory <- parameters.WorkingDir
Expand Down