Skip to content

Commit dd4e107

Browse files
CopilotmathtoneCopilot
authored
Modernize MIST for .NET 10 and replace PowerShell install scripts with NuGet build integration (#17)
* Modernize MIST: target .NET through .NET 10 and replace PowerShell install scripts with NuGet props/targets Agent-Logs-Url: https://github.com/mathtone/MIST/sessions/ab5d4939-5085-49bc-9512-6130ad9f811e Co-authored-by: mathtone <7595818+mathtone@users.noreply.github.com> * Remove accidentally-committed .nuget/nuget.exe and gitignore it Agent-Logs-Url: https://github.com/mathtone/MIST/sessions/ab5d4939-5085-49bc-9512-6130ad9f811e Co-authored-by: mathtone <7595818+mathtone@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Add net6.0 target for builder task assembly Agent-Logs-Url: https://github.com/mathtone/MIST/sessions/7f93e584-91cb-41be-b25a-1b77b25a3a6e Co-authored-by: mathtone <7595818+mathtone@users.noreply.github.com> * Fix PDB requirement when debug is false and update package description Agent-Logs-Url: https://github.com/mathtone/MIST/sessions/f6c4a3a1-ca8a-4179-ac12-ed05b544dfa2 Co-authored-by: mathtone <7595818+mathtone@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: mathtone <7595818+mathtone@users.noreply.github.com> Co-authored-by: mik3c <mike.carleton@gmail.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 5756b45 commit dd4e107

20 files changed

Lines changed: 199 additions & 785 deletions

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ bld/
2222
[Bb]in/
2323
[Oo]bj/
2424

25+
# NuGet build integration files (props/targets shipped inside the package)
26+
!Mathtone.MIST.Builder/build/
27+
!Mathtone.MIST.Builder/buildTransitive/
28+
2529
# Visual Studio 2015 cache/options directory
2630
.vs/
2731

@@ -210,3 +214,6 @@ FakesAssemblies/
210214
GeneratedArtifacts/
211215
_Pvt_Extensions/
212216
ModelManifest.xml
217+
218+
# nuget.exe bootstrapped by MSBuild restore
219+
.nuget/

Mathtone.MIST.Builder.Scripts/Install.ps1

Lines changed: 0 additions & 81 deletions
This file was deleted.

Mathtone.MIST.Builder.Scripts/Mathtone.MIST.Builder.Scripts.pssproj

Lines changed: 0 additions & 43 deletions
This file was deleted.

Mathtone.MIST.Builder.Scripts/Uninstall.ps1

Lines changed: 0 additions & 59 deletions
This file was deleted.
Lines changed: 53 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4+
<!--
5+
The build task itself only needs to load inside MSBuild, so it targets
6+
the two MSBuild runtimes:
7+
- net472 : full-framework MSBuild (Visual Studio, msbuild.exe)
8+
- net8.0 : .NET SDK / "dotnet build" (Roslyn build server)
9+
This is independent of which target framework the *consumer* of the
10+
package compiles against — Mathtone.MIST (the attribute library)
11+
supports netstandard2.0, net472, and net6.0 through net10.0.
12+
-->
413
<TargetFrameworks>net472;net6.0;net8.0</TargetFrameworks>
514
<AssemblyName>Mathtone.MIST.Builder</AssemblyName>
615
<RootNamespace>Mathtone.MIST</RootNamespace>
@@ -13,19 +22,23 @@
1322
<PackageId>Mathtone.MIST.Builder</PackageId>
1423
<PackageVersion>2.0.0</PackageVersion>
1524
<Title>MIST Builder - IL Weaving Build Task</Title>
16-
<Description>Build task for MIST IL weaving that implements INotifyPropertyChanged.</Description>
25+
<Description>Build task for MIST IL weaving that implements INotifyPropertyChanged. Supports both legacy MSBuild (net472) and the .NET SDK (.NET 6+).</Description>
1726
<Authors>Mathtone Industries</Authors>
1827
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1928
<PackageProjectUrl>https://github.com/mathtone/MIST</PackageProjectUrl>
2029
<RepositoryUrl>https://github.com/mathtone/MIST</RepositoryUrl>
2130
<PackageTags>INotifyPropertyChanged;IL;Weaving;MVVM;WPF;PropertyChanged;Build;MSBuild</PackageTags>
2231
<DevelopmentDependency>true</DevelopmentDependency>
2332
<IncludeBuildOutput>false</IncludeBuildOutput>
33+
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
34+
<!-- NU5100: build task assemblies live under tasks/<tfm>/, not lib/, by design. -->
35+
<NoWarn>$(NoWarn);NU5100</NoWarn>
36+
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);PackBuildTaskAssemblies</TargetsForTfmSpecificContentInPackage>
2437
</PropertyGroup>
2538

2639
<ItemGroup>
27-
<PackageReference Include="Microsoft.Build.Framework" Version="17.0.0" PrivateAssets="all" />
28-
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.0.0" PrivateAssets="all" />
40+
<PackageReference Include="Microsoft.Build.Framework" Version="17.0.0" PrivateAssets="all" ExcludeAssets="runtime" />
41+
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.0.0" PrivateAssets="all" ExcludeAssets="runtime" />
2942
<PackageReference Include="Mono.Cecil" Version="0.11.4" PrivateAssets="all" />
3043
</ItemGroup>
3144

@@ -40,36 +53,49 @@
4053
</EmbeddedResource>
4154
</ItemGroup>
4255

43-
<!-- Package the build integration files -->
56+
<!--
57+
Pack the NuGet build integration files. The props/targets under build\ are
58+
imported automatically when a project (PackageReference) consumes this
59+
package. The same files under buildTransitive\ flow through transitive
60+
package references. This is the modern replacement for the old
61+
Install.ps1 / Uninstall.ps1 NuGet 2.x scripts.
62+
-->
4463
<ItemGroup>
4564
<None Include="build\**" Pack="true" PackagePath="build\" />
4665
<None Include="buildTransitive\**" Pack="true" PackagePath="buildTransitive\" />
4766
</ItemGroup>
4867

49-
<!-- Include the build task assemblies in the package -->
50-
<Target Name="PackTaskDependencies" BeforeTargets="GenerateNuspec">
68+
<!--
69+
Pack the per-TFM task assemblies (and Mono.Cecil) under tasks\<tfm>\.
70+
The build/Mathtone.MIST.Builder.props file selects the right folder at
71+
build time based on $(MSBuildRuntimeType). This target is invoked once
72+
per inner-build (per TargetFramework) by NuGet.Build.Tasks.Pack via the
73+
TargetsForTfmSpecificContentInPackage extension point.
74+
-->
75+
<Target Name="PackBuildTaskAssemblies" DependsOnTargets="Build">
5176
<ItemGroup>
52-
<_PackageFiles Include="$(OutputPath)$(AssemblyName).dll">
53-
<PackagePath>build\$(AssemblyName).dll</PackagePath>
54-
<Visible>false</Visible>
55-
<BuildAction>None</BuildAction>
56-
</_PackageFiles>
57-
<_PackageFiles Include="$(OutputPath)$(AssemblyName).pdb" Condition="Exists('$(OutputPath)$(AssemblyName).pdb')">
58-
<PackagePath>build\$(AssemblyName).pdb</PackagePath>
59-
<Visible>false</Visible>
60-
<BuildAction>None</BuildAction>
61-
</_PackageFiles>
62-
<_PackageFiles Include="$(OutputPath)Mathtone.MIST.dll">
63-
<PackagePath>build\Mathtone.MIST.dll</PackagePath>
64-
<Visible>false</Visible>
65-
<BuildAction>None</BuildAction>
66-
</_PackageFiles>
67-
<_PackageFiles Include="$(OutputPath)Mono.Cecil.dll">
68-
<PackagePath>build\Mono.Cecil.dll</PackagePath>
69-
<Visible>false</Visible>
70-
<BuildAction>None</BuildAction>
71-
</_PackageFiles>
77+
<TfmSpecificPackageFile Include="$(OutputPath)$(AssemblyName).dll">
78+
<PackagePath>tasks\$(TargetFramework)\$(AssemblyName).dll</PackagePath>
79+
</TfmSpecificPackageFile>
80+
<TfmSpecificPackageFile Include="$(OutputPath)$(AssemblyName).pdb" Condition="Exists('$(OutputPath)$(AssemblyName).pdb')">
81+
<PackagePath>tasks\$(TargetFramework)\$(AssemblyName).pdb</PackagePath>
82+
</TfmSpecificPackageFile>
83+
<TfmSpecificPackageFile Include="$(OutputPath)Mathtone.MIST.dll">
84+
<PackagePath>tasks\$(TargetFramework)\Mathtone.MIST.dll</PackagePath>
85+
</TfmSpecificPackageFile>
86+
<TfmSpecificPackageFile Include="$(OutputPath)Mono.Cecil.dll">
87+
<PackagePath>tasks\$(TargetFramework)\Mono.Cecil.dll</PackagePath>
88+
</TfmSpecificPackageFile>
89+
<TfmSpecificPackageFile Include="$(OutputPath)Mono.Cecil.Pdb.dll" Condition="Exists('$(OutputPath)Mono.Cecil.Pdb.dll')">
90+
<PackagePath>tasks\$(TargetFramework)\Mono.Cecil.Pdb.dll</PackagePath>
91+
</TfmSpecificPackageFile>
92+
<TfmSpecificPackageFile Include="$(OutputPath)Mono.Cecil.Mdb.dll" Condition="Exists('$(OutputPath)Mono.Cecil.Mdb.dll')">
93+
<PackagePath>tasks\$(TargetFramework)\Mono.Cecil.Mdb.dll</PackagePath>
94+
</TfmSpecificPackageFile>
95+
<TfmSpecificPackageFile Include="$(OutputPath)Mono.Cecil.Rocks.dll" Condition="Exists('$(OutputPath)Mono.Cecil.Rocks.dll')">
96+
<PackagePath>tasks\$(TargetFramework)\Mono.Cecil.Rocks.dll</PackagePath>
97+
</TfmSpecificPackageFile>
7298
</ItemGroup>
7399
</Target>
74100

75-
</Project>
101+
</Project>

0 commit comments

Comments
 (0)