diff options
Diffstat (limited to 'src/test/examples/LatestCoreMBA')
-rw-r--r-- | src/test/examples/LatestCoreMBA/Example.LatestCoreMBA.csproj | 23 | ||||
-rw-r--r-- | src/test/examples/LatestCoreMBA/LatestCoreBA.cs | 33 | ||||
-rw-r--r-- | src/test/examples/LatestCoreMBA/LatestCoreBAFactory.cs | 22 |
3 files changed, 78 insertions, 0 deletions
diff --git a/src/test/examples/LatestCoreMBA/Example.LatestCoreMBA.csproj b/src/test/examples/LatestCoreMBA/Example.LatestCoreMBA.csproj new file mode 100644 index 00000000..1d325b1b --- /dev/null +++ b/src/test/examples/LatestCoreMBA/Example.LatestCoreMBA.csproj | |||
@@ -0,0 +1,23 @@ | |||
1 | <Project Sdk="Microsoft.NET.Sdk"> | ||
2 | |||
3 | <PropertyGroup> | ||
4 | <TargetFramework>netcoreapp3.1</TargetFramework> | ||
5 | <RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers> | ||
6 | <EnableDynamicLoading>true</EnableDynamicLoading> | ||
7 | <Description>Latest .NET Core MBA</Description> | ||
8 | </PropertyGroup> | ||
9 | |||
10 | <PropertyGroup Condition="'$(PublishTrimmed)'=='true'"> | ||
11 | <PublishReadyToRunShowWarnings>false</PublishReadyToRunShowWarnings> | ||
12 | <PublishReadyToRun>true</PublishReadyToRun> | ||
13 | </PropertyGroup> | ||
14 | |||
15 | <ItemGroup> | ||
16 | <TrimmerRootAssembly Include="System.Runtime.Loader" /> | ||
17 | </ItemGroup> | ||
18 | |||
19 | <ItemGroup> | ||
20 | <PackageReference Include="Nerdbank.GitVersioning" Version="2.1.65" PrivateAssets="all" /> | ||
21 | <PackageReference Include="WixToolset.Mba.Core" Version="4.0.19" /> | ||
22 | </ItemGroup> | ||
23 | </Project> \ No newline at end of file | ||
diff --git a/src/test/examples/LatestCoreMBA/LatestCoreBA.cs b/src/test/examples/LatestCoreMBA/LatestCoreBA.cs new file mode 100644 index 00000000..50386a87 --- /dev/null +++ b/src/test/examples/LatestCoreMBA/LatestCoreBA.cs | |||
@@ -0,0 +1,33 @@ | |||
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 Example.LatestCoreMBA | ||
4 | { | ||
5 | using WixToolset.Mba.Core; | ||
6 | |||
7 | public class LatestCoreBA : BootstrapperApplication | ||
8 | { | ||
9 | public LatestCoreBA(IEngine engine) | ||
10 | : base(engine) | ||
11 | { | ||
12 | } | ||
13 | |||
14 | protected override void Run() | ||
15 | { | ||
16 | } | ||
17 | |||
18 | protected override void OnStartup(StartupEventArgs args) | ||
19 | { | ||
20 | base.OnStartup(args); | ||
21 | |||
22 | this.engine.Log(LogLevel.Standard, nameof(LatestCoreBA)); | ||
23 | } | ||
24 | |||
25 | protected override void OnShutdown(ShutdownEventArgs args) | ||
26 | { | ||
27 | base.OnShutdown(args); | ||
28 | |||
29 | var message = "Shutdown," + args.Action.ToString() + "," + args.HResult.ToString(); | ||
30 | this.engine.Log(LogLevel.Standard, message); | ||
31 | } | ||
32 | } | ||
33 | } | ||
diff --git a/src/test/examples/LatestCoreMBA/LatestCoreBAFactory.cs b/src/test/examples/LatestCoreMBA/LatestCoreBAFactory.cs new file mode 100644 index 00000000..fff3b5c5 --- /dev/null +++ b/src/test/examples/LatestCoreMBA/LatestCoreBAFactory.cs | |||
@@ -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 | [assembly: WixToolset.Mba.Core.BootstrapperApplicationFactory(typeof(Example.LatestCoreMBA.LatestCoreBAFactory))] | ||
4 | namespace Example.LatestCoreMBA | ||
5 | { | ||
6 | using WixToolset.Mba.Core; | ||
7 | |||
8 | public class LatestCoreBAFactory : BaseBootstrapperApplicationFactory | ||
9 | { | ||
10 | private static int loadCount = 0; | ||
11 | |||
12 | protected override IBootstrapperApplication Create(IEngine engine, IBootstrapperCommand bootstrapperCommand) | ||
13 | { | ||
14 | if (loadCount > 0) | ||
15 | { | ||
16 | engine.Log(LogLevel.Standard, $"Reloaded {loadCount} time(s)"); | ||
17 | } | ||
18 | ++loadCount; | ||
19 | return new LatestCoreBA(engine); | ||
20 | } | ||
21 | } | ||
22 | } | ||