@joebigelow / wix-1 / commits / 027d1ac9

Bring back binder extensions and missing layout base extension

Rob Mensching committed Dec 22, 2017 at 15:47 UTC 027d1ac927aa6b0ee0c934b1f6b540d2a1667df2
6 files changed +92 -14
src/WixToolset.Extensibility/BaseBinderExtension.cs new
+32
@@ -0,0 +1,32 @@
1 +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2 +
3 +namespace WixToolset.Extensibility
4 +{
5 + using WixToolset.Data.Bind;
6 +
7 + /// <summary>
8 + /// Base class for creating a resolver extension.
9 + /// </summary>
10 + public abstract class BaseBinderExtension : IBinderExtension
11 + {
12 + /// <summary>
13 + /// Context for use by the extension.
14 + /// </summary>
15 + protected IBindContext Context { get; private set; }
16 +
17 + /// <summary>
18 + /// Called at the beginning of bind.
19 + /// </summary>
20 + public virtual void PreBind(IBindContext context)
21 + {
22 + this.Context = context;
23 + }
24 +
25 + /// <summary>
26 + /// Called at the end of bind.
27 + /// </summary>
28 + public virtual void PostBind(BindResult result)
29 + {
30 + }
31 + }
32 +}
src/WixToolset.Extensibility/BaseLayoutExtension.cs new
+30
@@ -0,0 +1,30 @@
1 +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2 +
3 +namespace WixToolset.Extensibility
4 +{
5 + /// <summary>
6 + /// Base class for creating a resolver extension.
7 + /// </summary>
8 + public abstract class BaseLayoutExtension : ILayoutExtension
9 + {
10 + /// <summary>
11 + /// Context for use by the extension.
12 + /// </summary>
13 + protected ILayoutContext Context { get; private set; }
14 +
15 + /// <summary>
16 + /// Called at the beginning of layout.
17 + /// </summary>
18 + public virtual void PreLayout(ILayoutContext context)
19 + {
20 + this.Context = context;
21 + }
22 +
23 + /// <summary>
24 + /// Called at the end of ayout.
25 + /// </summary>
26 + public virtual void PostLayout()
27 + {
28 + }
29 + }
30 +}
src/WixToolset.Extensibility/IBindContext.cs
+3 -9
@@ -19,12 +19,14 @@ namespace WixToolset.Extensibility
19
20 int Codepage { get; set; }
21
22 - CompressionLevel DefaultCompressionLevel { get; set; }
22 + CompressionLevel? DefaultCompressionLevel { get; set; }
23
24 IEnumerable<IDelayedField> DelayedFields { get; set; }
25
26 IEnumerable<IExpectedExtractFile> ExpectedEmbeddedFiles { get; set; }
27
28 + IEnumerable<IBinderExtension> Extensions { get; set; }
29 +
30 IEnumerable<IFileSystemExtension> FileSystemExtensions { get; set; }
31
32 IEnumerable<string> Ices { get; set; }
@@ -40,13 +42,5 @@ namespace WixToolset.Extensibility
42 IEnumerable<string> SuppressIces { get; set; }
43
44 bool SuppressValidation { get; set; }
43 -
44 - string ContentsFile { get; set; }
45 -
46 - string OutputsFile { get; set; }
47 -
48 - string BuiltOutputsFile { get; set; }
49 -
50 - string WixprojectFile { get; set; }
45 }
46 }
src/WixToolset.Extensibility/IBindExtension.cs new
+22
@@ -0,0 +1,22 @@
1 +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2 +
3 +namespace WixToolset.Extensibility
4 +{
5 + using WixToolset.Data.Bind;
6 +
7 + /// <summary>
8 + /// Interface all binder extensions implement.
9 + /// </summary>
10 + public interface IBinderExtension
11 + {
12 + /// <summary>
13 + /// Called before binding occurs.
14 + /// </summary>
15 + void PreBind(IBindContext context);
16 +
17 + /// <summary>
18 + /// Called after all binding occurs.
19 + /// </summary>
20 + void PostBind(BindResult result);
21 + }
22 +}
src/WixToolset.Extensibility/ILayoutExtension.cs
+3 -3
@@ -3,17 +3,17 @@
3 namespace WixToolset.Extensibility
4 {
5 /// <summary>
6 - /// Interface all resolver extensions implement.
6 + /// Interface all layout extensions implement.
7 /// </summary>
8 public interface ILayoutExtension
9 {
10 /// <summary>
11 - /// Called before resolving occurs.
11 + /// Called before layout occurs.
12 /// </summary>
13 void PreLayout(ILayoutContext context);
14
15 /// <summary>
16 - /// Called after all resolving occurs.
16 + /// Called after all layout occurs.
17 /// </summary>
18 void PostLayout();
19 }
src/WixToolset.Extensibility/ResolveResult.cs
+2 -2
@@ -9,10 +9,10 @@ namespace WixToolset.Extensibility
9 {
10 public int Codepage { get; set; }
11
12 - public IEnumerable<IExpectedExtractFile> ExpectedEmbeddedFiles { get; set; }
13 -
12 public IEnumerable<IDelayedField> DelayedFields { get; set; }
13
14 + public IEnumerable<IExpectedExtractFile> ExpectedEmbeddedFiles { get; set; }
15 +
16 public Intermediate IntermediateRepresentation { get; set; }
17 }
18 }
\ No newline at end of file