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

SignToolHelper not available in Fake script #1045

Closed
pdfforge opened this issue Dec 18, 2015 · 4 comments
Closed

SignToolHelper not available in Fake script #1045

pdfforge opened this issue Dec 18, 2015 · 4 comments

Comments

@pdfforge
Copy link

Disclaimer: I am completely new to FAKE and just performing my first steps, so I might be missing something important or obvious

I am trying to access the SignToolHelper from the build script. For some reason, SignTool is available, but SignToolHelper is not.

From what I understand, it should be included though, as the SignToolHelper.fs lies just next to the SignTool.fs in the repo.

This is my attempt of a minimal (non-) working sample:
(The parameters for the SignToolHelper are wrong, of course)

 #r "packages/FAKE/tools/FakeLib.dll"

 open Fake

 // works
 Target "SignWorking" (fun _ ->
     !! "bin/myapp.exe"
       |> SignTool "packages/signtool" "Dev.pfx" "pass.txt"
 )

 // says "The value or constructor SignToolHelper is not defined"
 Target "SignWorking" (fun _ ->
     !! "bin/myapp.exe"
       |> SignToolHelper "packages/signtool" "Dev.pfx" "pass.txt"
 )

Any idea why this is not working is greatly appreciated

@forki
Copy link
Member

forki commented Dec 18, 2015

SignToolHelper is a module, not a function. The closest thing in C# is a namespace. So you can open that thing and use methods in it.

@pdfforge
Copy link
Author

oh, yes, that's true, but SignToolHelper.Sign gives me "namespace SignToolHelper does not exist" as well. I now copied the contents of the SignToolHelper.fs locally an performaned a #load on that file an then I can access the module. Could it be that there is a problem with that in FAKE 4.10.5?

With the local copy, I can call

 Sign "packages/signtool" signParams

Which, in return, makes it harder to pipe files into that, as they are wrapped inside the params

@inosik
Copy link
Contributor

inosik commented Dec 18, 2015

Just checked it, FakeLib.fsproj does not have a <Compile /> node for the SignToolHelper.fs file. Seems that #535 added only the source file.

If we bring it in, is it a good idea to [<AutoOpen>] it? And should we remove the old SignHelper then?

@pdfforge
Copy link
Author

Thanks for pointing this out!

As for the [], I have no idea, but it seems to be used quite often among the project.

For the rest: I have created a pull request to fix this. I have removed the SignHelper there, as the SignToolHelper contains a function that provides the same syntax as the SignHelper did.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants