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

Release/next wixhelper #2002

Merged
merged 11 commits into from
Jul 21, 2018
Merged

Conversation

cthangn
Copy link
Contributor

@cthangn cthangn commented Jun 19, 2018

Add Wix to FAKE 5

@cthangn cthangn force-pushed the release/next-wixhelper branch from 0fca153 to 3f819a6 Compare June 19, 2018 10:28
Copy link
Member

@matthid matthid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking care of this! In general (layout and new project) it looks good but some more changes are required according to the fake 5 guidelines.

  • In particular we try to limit the public API surface for users such that it's more clear how to use the API.
  • We get rid of obsolete stuff
  • functions should be lower-case

@@ -0,0 +1,2008 @@
/// Contains tasks to create msi installers using the [WiX toolset](http://wixtoolset.org/)

module Fake.Windows.Wix
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add [<RequireQualifiedAccess>] if reasonable

let mutable internal fileCount = 0
let mutable internal dirs = Dictionary()

let getDirName dir =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

internal?


let mutable internal compRefs = Dictionary()

let getCompRefName compRef =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

internal?


let mutable internal comps = Dictionary()

let getCompName comp =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

internal?

}

/// Use this for generating service dependencies
let generateServiceDependency (setParams : ServiceDependency -> ServiceDependency) =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

internal?

}

/// Use this for generating service configs
let generateServiceConfig (setParams : ServiceConfig -> ServiceConfig) =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

internal?

sprintf "<ServiceConfig xmlns=\"http://schemas.microsoft.com/wix/UtilExtension\" %s/>"
(Seq.fold(fun acc (key, value) -> acc + sprintf " %s=\"%s\"" key value) "" (w.createAttributeList()))

let ServiceConfigDefaults =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

internal?

(Seq.fold(fun acc (key, value) -> acc + sprintf " %s=\"%s\"" key value) "" (w.createAttributeList()))

/// Defaults for service control element
let ServiceControlDefaults =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

internal?

}

/// Use this for generating service controls
let generateServiceControl (setParams : ServiceControl -> ServiceControl) =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

internal?

match w.AllowDowngrades with
| Yes -> ""
| No -> " DowngradeErrorMessage=\"" + w.DowngradeErrorMessage + "\""
"<MajorUpgrade Schedule=\"" + w.Schedule.ToString() +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite understand, which function I should remove here. Can you please clarify?

@kblohm
Copy link
Contributor

kblohm commented Jun 29, 2018

Probably not too important, but shouldn't this go under Fake.Installer? There is also an old Squirrel-Helper and it might make it harder to find all of these.

mark some functions as internal
@matthid
Copy link
Member

matthid commented Jul 8, 2018

I tend to agree with @kblohm especially since we have the Fake.Installer namespace already. So can you move this to Fake.Installer.Wix please?

The second thing is that there are still a lot "helper" functions which are public and I don't think they should be. However, I never used this module myself so it might be that they are indeed useful for using this module. In particular the *.Defaults field are usually internal/private in fake 5. But also others like getWixFileTag and getFilesAsWiXString look a lot like internal helpers and not used from users via Wix.getFilesAsWiXString.

It is easier for us to make things public later on than the other way around. @cthangn can you please go over the functions again with that mindset (sorry I didn't mark every place in the first review because there were too many).

Sorry for the late reply.

Mark more things internal (revert some)
@cthangn
Copy link
Contributor Author

cthangn commented Jul 9, 2018

Thank you for the clarification. I have moved Wix under Fake.Installer. I have marked all *Defaults internal, which makes sense.

About getFilesAsWiXString there is an example in the code how to use it.

About those generate* functions, we are using some of them even in our script and they are helpers for users to create those required structures with overriding the *Defaults, so I think they should be public. Maybe there are some, which can be internal/private, but I don't have such extensive knowledge of this module to decide which ones.

@matthid
Copy link
Member

matthid commented Jul 9, 2018

but I don't have such extensive knowledge of this module to decide which ones.

Me neither, but wheen in doubt we should make internal/private and wait for people to complain then we can defer designing a proper API for such functions to a later point... Because for all public functions we need to make sure they align with the new API guideline.

@matthid matthid mentioned this pull request Jul 13, 2018
@matthid
Copy link
Member

matthid commented Jul 21, 2018

Ok sorry for the back and forth. Good job looks really neat now!

@matthid matthid merged commit 7f552f5 into fsprojects:release/next Jul 21, 2018
@cthangn cthangn deleted the release/next-wixhelper branch August 1, 2018 08:41
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

Successfully merging this pull request may close these issues.

4 participants