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

The Great Tuple to Symbol Rename (tm) #19

Merged
merged 3 commits into from
Jun 27, 2020
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
6 changes: 2 additions & 4 deletions appveyor.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@

nuget restore || exit /b

msbuild -p:Configuration=%_C% -t:Restore || exit /b

msbuild -p:Configuration=%_C% || exit /b
msbuild -p:Configuration=%_C% -Restore || exit /b
dotnet test -c %_C% --no-build src\test\WixToolsetTest.Bal || exit /b

msbuild -p:Configuration=%_C% -t:Pack src\wixext\WixToolset.Bal.wixext.csproj || exit /b
msbuild -p:Configuration=%_C% -t:Pack src\WixToolset.Mba.Host\WixToolset.Mba.Host.csproj || exit /b

@popd
@endlocal
@endlocal
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"msbuild-sdks": {
"WixToolset.Sdk": "4.0.0-build-0143"
}
}
8 changes: 0 additions & 8 deletions src/FindLocalWix.props

This file was deleted.

1 change: 1 addition & 0 deletions src/dnchost/dnchost.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<ItemGroup>
<ProjectReference Include="..\WixToolset.Dnc.Host\WixToolset.Dnc.Host.csproj">
<Project>{0D780900-C2FF-4FA2-8CB5-8A19768724C5}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
</ProjectReference>
</ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/mbahost/mbahost.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
<ItemGroup>
<ProjectReference Include="..\WixToolset.Mba.Host\WixToolset.Mba.Host.csproj">
<Project>{f2ba1935-70fa-4156-b161-fd03850b4faa}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
</ProjectReference>
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/test/WixToolsetTest.Bal/BalExtensionFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void CanBuildUsingWixStdBa()
}
}

[Fact]
[Fact(Skip = "Skip test until cycle with Netfx.wixext and this repo is resolved")]
public void CantBuildUsingMBAWithNoPrereqs()
{
using (var fs = new DisposableFileSystem())
Expand Down
2 changes: 1 addition & 1 deletion src/test/WixToolsetTest.Bal/WixToolsetTest.Bal.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<PackageReference Include="WixToolset.Core.Burn" Version="4.0.*" />
<PackageReference Include="WixToolset.Core.WindowsInstaller" Version="4.0.*" />
<PackageReference Include="WixToolset.Core.TestPackage" Version="4.0.*" />
<PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.*" />
<!-- <PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.*" /> -->
</ItemGroup>

<ItemGroup>
Expand Down
72 changes: 36 additions & 36 deletions src/wixext/BalBurnBackendExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ namespace WixToolset.Bal
using System;
using System.Collections.Generic;
using System.Linq;
using WixToolset.Bal.Tuples;
using WixToolset.Bal.Symbols;
using WixToolset.Data;
using WixToolset.Data.Burn;
using WixToolset.Data.Tuples;
using WixToolset.Data.Symbols;
using WixToolset.Extensibility;

public class BalBurnBackendExtension : BaseBurnBackendExtension
{
private static readonly IntermediateTupleDefinition[] BurnTupleDefinitions =
private static readonly IntermediateSymbolDefinition[] BurnSymbolDefinitions =
{
BalTupleDefinitions.WixBalBAFactoryAssembly,
BalTupleDefinitions.WixBalBAFunctions,
BalTupleDefinitions.WixBalCondition,
BalTupleDefinitions.WixBalPackageInfo,
BalTupleDefinitions.WixDncOptions,
BalTupleDefinitions.WixMbaPrereqInformation,
BalTupleDefinitions.WixStdbaOptions,
BalTupleDefinitions.WixStdbaOverridableVariable,
BalSymbolDefinitions.WixBalBAFactoryAssembly,
BalSymbolDefinitions.WixBalBAFunctions,
BalSymbolDefinitions.WixBalCondition,
BalSymbolDefinitions.WixBalPackageInfo,
BalSymbolDefinitions.WixDncOptions,
BalSymbolDefinitions.WixMbaPrereqInformation,
BalSymbolDefinitions.WixStdbaOptions,
BalSymbolDefinitions.WixStdbaOverridableVariable,
};

protected override IEnumerable<IntermediateTupleDefinition> TupleDefinitions => BurnTupleDefinitions;
protected override IEnumerable<IntermediateSymbolDefinition> SymbolDefinitions => BurnSymbolDefinitions;

public override void BundleFinalize()
{
Expand All @@ -34,8 +34,8 @@ public override void BundleFinalize()
var intermediate = this.Context.IntermediateRepresentation;
var section = intermediate.Sections.Single();

var baTuple = section.Tuples.OfType<WixBootstrapperApplicationTuple>().SingleOrDefault();
var baId = baTuple?.Id?.Id;
var baSymbol = section.Symbols.OfType<WixBootstrapperApplicationSymbol>().SingleOrDefault();
var baId = baSymbol?.Id?.Id;
if (null == baId)
{
return;
Expand All @@ -59,46 +59,46 @@ public override void BundleFinalize()

private void VerifyBAFunctions(IntermediateSection section)
{
WixBalBAFunctionsTuple baFunctionsTuple = null;
foreach (var tuple in section.Tuples.OfType<WixBalBAFunctionsTuple>())
WixBalBAFunctionsSymbol baFunctionsSymbol = null;
foreach (var symbol in section.Symbols.OfType<WixBalBAFunctionsSymbol>())
{
if (null == baFunctionsTuple)
if (null == baFunctionsSymbol)
{
baFunctionsTuple = tuple;
baFunctionsSymbol = symbol;
}
else
{
this.Messaging.Write(BalErrors.MultipleBAFunctions(tuple.SourceLineNumbers));
this.Messaging.Write(BalErrors.MultipleBAFunctions(symbol.SourceLineNumbers));
}
}

var payloadPropertiesTuples = section.Tuples.OfType<WixBundlePayloadTuple>().ToList();
if (null == baFunctionsTuple)
var payloadPropertiesSymbols = section.Symbols.OfType<WixBundlePayloadSymbol>().ToList();
if (null == baFunctionsSymbol)
{
foreach (var payloadPropertiesTuple in payloadPropertiesTuples)
foreach (var payloadPropertiesSymbol in payloadPropertiesSymbols)
{
// TODO: Make core WiX canonicalize Name (this won't catch '.\bafunctions.dll').
if (string.Equals(payloadPropertiesTuple.Name, "bafunctions.dll", StringComparison.OrdinalIgnoreCase))
if (string.Equals(payloadPropertiesSymbol.Name, "bafunctions.dll", StringComparison.OrdinalIgnoreCase))
{
this.Messaging.Write(BalWarnings.UnmarkedBAFunctionsDLL(payloadPropertiesTuple.SourceLineNumbers));
this.Messaging.Write(BalWarnings.UnmarkedBAFunctionsDLL(payloadPropertiesSymbol.SourceLineNumbers));
}
}
}
else
{
var payloadId = baFunctionsTuple.Id;
var bundlePayloadTuple = payloadPropertiesTuples.Single(x => payloadId == x.Id);
if (BurnConstants.BurnUXContainerName != bundlePayloadTuple.ContainerRef)
var payloadId = baFunctionsSymbol.Id;
var bundlePayloadSymbol = payloadPropertiesSymbols.Single(x => payloadId == x.Id);
if (BurnConstants.BurnUXContainerName != bundlePayloadSymbol.ContainerRef)
{
this.Messaging.Write(BalErrors.BAFunctionsPayloadRequiredInUXContainer(baFunctionsTuple.SourceLineNumbers));
this.Messaging.Write(BalErrors.BAFunctionsPayloadRequiredInUXContainer(baFunctionsSymbol.SourceLineNumbers));
}
}
}

private void VerifyPrereqPackages(IntermediateSection section, bool isDNC)
{
var prereqInfoTuples = section.Tuples.OfType<WixMbaPrereqInformationTuple>().ToList();
if (prereqInfoTuples.Count == 0)
var prereqInfoSymbols = section.Symbols.OfType<WixMbaPrereqInformationSymbol>().ToList();
if (prereqInfoSymbols.Count == 0)
{
var message = isDNC ? BalErrors.MissingDNCPrereq() : BalErrors.MissingMBAPrereq();
this.Messaging.Write(message);
Expand All @@ -108,24 +108,24 @@ private void VerifyPrereqPackages(IntermediateSection section, bool isDNC)
var foundLicenseFile = false;
var foundLicenseUrl = false;

foreach (var prereqInfoTuple in prereqInfoTuples)
foreach (var prereqInfoSymbol in prereqInfoSymbols)
{
if (null != prereqInfoTuple.LicenseFile)
if (null != prereqInfoSymbol.LicenseFile)
{
if (foundLicenseFile || foundLicenseUrl)
{
this.Messaging.Write(BalErrors.MultiplePrereqLicenses(prereqInfoTuple.SourceLineNumbers));
this.Messaging.Write(BalErrors.MultiplePrereqLicenses(prereqInfoSymbol.SourceLineNumbers));
return;
}

foundLicenseFile = true;
}

if (null != prereqInfoTuple.LicenseUrl)
if (null != prereqInfoSymbol.LicenseUrl)
{
if (foundLicenseFile || foundLicenseUrl)
{
this.Messaging.Write(BalErrors.MultiplePrereqLicenses(prereqInfoTuple.SourceLineNumbers));
this.Messaging.Write(BalErrors.MultiplePrereqLicenses(prereqInfoSymbol.SourceLineNumbers));
return;
}

Expand All @@ -138,7 +138,7 @@ private bool VerifySCD(IntermediateSection section)
{
var isSCD = false;

var dncOptions = section.Tuples.OfType<WixDncOptionsTuple>().SingleOrDefault();
var dncOptions = section.Symbols.OfType<WixDncOptionsSymbol>().SingleOrDefault();
if (dncOptions != null)
{
isSCD = dncOptions.SelfContainedDeployment != 0;
Expand Down
Loading