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

add support for light to delay validation #842

Merged
merged 1 commit into from
Feb 1, 2019
Merged
Show file tree
Hide file tree
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
25 changes: 25 additions & 0 deletions lib/omnibus/packagers/msi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,29 @@ def wix_light_extension(extension)
end
expose :wix_light_extension

#
# Signal delay validation for wix light
#
# @example
# wix_light_deplay_validation true
#
# @param [TrueClass, FalseClass] value
# whether to delay validation or not
#
# @return [String]
# whether we're a bundle or not
def wix_light_delay_validation(val = false)
unless val.is_a?(TrueClass) || val.is_a?(FalseClass)
raise InvalidValue.new(:iwix_light_delay_validation, "be TrueClass or FalseClass")
end
@delay_validation ||= val
unless @delay_validation
return ""
end
"-sval"
end
expose :wix_light_delay_validation

#
# Set the wix candle extensions to load
#
Expand Down Expand Up @@ -465,6 +488,7 @@ def light_command(out_file, is_bundle: false)
<<-EOH.split.join(" ").squeeze(" ").strip
light.exe
-nologo
#{wix_light_delay_validation}
-ext WixUIExtension
-ext WixBalExtension
#{wix_extension_switches(wix_light_extensions)}
Expand All @@ -477,6 +501,7 @@ def light_command(out_file, is_bundle: false)
<<-EOH.split.join(" ").squeeze(" ").strip
light.exe
-nologo
#{wix_light_delay_validation}
-ext WixUIExtension
#{wix_extension_switches(wix_light_extensions)}
-cultures:en-us
Expand Down
22 changes: 22 additions & 0 deletions spec/unit/packagers/msi_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,28 @@ module Omnibus
end
end

describe "#wix_light_delay_validation" do
it "is a DSL method" do
expect(subject).to have_exposed_method(:wix_light_delay_validation)
end

it "requires the value to be a TrueClass or a FalseClass" do
expect do
subject.wix_light_delay_validation(Object.new)
end.to raise_error(InvalidValue)
end

it "defaults to an empty String" do
expect(subject.wix_light_delay_validation).to be_a(String)
expect(subject.wix_light_delay_validation).to be_empty
end

it "returns the string `-sval` when true" do
subject.wix_light_delay_validation(true)
expect(subject.wix_light_delay_validation).to eq("-sval")
end
end

describe "#wix_candle_extension" do
it "is a DSL method" do
expect(subject).to have_exposed_method(:wix_candle_extension)
Expand Down