novotnyllc / MSBuildSdkExtras

Extra properties for MSBuild SDK projects
MIT License
347 stars 42 forks source link

Workflow Foundation: XamlAppDef #59

Open michalsteyn opened 6 years ago

michalsteyn commented 6 years ago

I'm trying to do a similar thing for Workflow Foundation XAML Activities.

A typical activity item is added to a csproj as follow:

<ItemGroup>
    <XamlAppDef Include="Activity1.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </XamlAppDef>
  </ItemGroup>

What would be required to make this work, similar to WPF XAML?

Nirmal4G commented 6 years ago

In my list of things to support for my own projects, see #56 (i.e. complete build and project support for .NETFramework based projects)

clairernovotny commented 6 years ago

The trick here, is around the implicit includes and what they should be. WPF, UWP, Workflow, and XamForms, all use the XAML file extension and need to be included in different ways.

Question is how to tell them apart in a meaningful way.

I wonder if it'd be enough if the project had something like:

<XamlAppDef Include="Activity1.xaml" /> or a glob <XamlAppDef Include="myactivities/*.xaml" />

in your project file. In that scenario, it's easy to add the additional metadata (Generator and Compile).

Any thoughts?

Nirmal4G commented 6 years ago

I did something like this:

At least for .NET Framework, I used a FrameworkProjectType property

WPF-Application L3-L8

WinForms-Application L3-L9

Still what if a project has a mix of WF, WPF, WWF, ASP.NET, etc... I had one project like that before I split that up but this seems a perfect excuse to cook that up again.

I was also thinking up of rules like *Page*, *Activity*, *Flow*, *App*, *Window*, *Form*, *Dialog*, etc... just like #47 to include TFMs either as a parent folder or part of a filename.