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

WIP: Feature/project settings #396

Merged
merged 31 commits into from
May 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
5c688fe
initial logic to allow override namespace
dpvreony May 16, 2024
48f0f7e
default classes to internal
dpvreony May 16, 2024
c2c481d
more rough concept for assemblies, and namespace config
dpvreony May 16, 2024
1bd3758
change default rootnamespace to VetuviemGenerated
dpvreony May 16, 2024
73cba4b
logic to load properties
dpvreony May 17, 2024
f1ef450
net8 related bumps
dpvreony May 17, 2024
7647aaa
default to internal for abstraction
dpvreony May 17, 2024
e0d18fe
push rootnamespace around
dpvreony May 17, 2024
7b0d4fe
correct sub namespacing
dpvreony May 17, 2024
0a4ec2c
sample now uses makeclassespublic
dpvreony May 17, 2024
ae284c6
correct xmldoc gen for unbound ctor
dpvreony May 19, 2024
3120da3
restructure projects to have in per platform drop ins
dpvreony May 23, 2024
5fb5c3c
refactor namespaces
dpvreony May 23, 2024
ea689d6
fix usings
dpvreony May 23, 2024
9b8a04e
Merge branch 'main' into feature/project-settings
dpvreony May 23, 2024
c92ddb9
github actions to dotnet build
dpvreony May 23, 2024
c06c97e
Merge branch 'feature/project-settings' of https://github.com/dpvreon…
dpvreony May 23, 2024
9dbb421
drop uwp
dpvreony May 23, 2024
9770e45
workaorund for winui3
dpvreony May 23, 2024
a5a0623
remove uwp int tests
dpvreony May 23, 2024
10126f6
adjust packing
dpvreony May 23, 2024
65fb86e
fix sln arg in codeql
dpvreony May 23, 2024
03f43ba
fix workloads for codeql, renovate to common config
dpvreony May 23, 2024
dbc35b4
update xml doc for source gen code
dpvreony May 23, 2024
938e292
add core props file in nupkg
dpvreony May 24, 2024
e5cea90
rework analyzers to nupkg
dpvreony May 24, 2024
c53e616
fix roslyn analzyer rule config
dpvreony May 24, 2024
f7a2c35
embed common code rather than dll
dpvreony May 24, 2024
f9f78fa
adjust packing of core dll
dpvreony May 26, 2024
92bf206
rename packed props file
dpvreony May 26, 2024
a0177e4
Update Vetuviem.WinUi.SourceGenerator.csproj
dpvreony May 26, 2024
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
29 changes: 11 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ jobs:
solutionpath: src\Vetuviem.sln
unittestprojectpath: src\Vetuviem.UnitTests\Vetuviem.UnitTests.csproj
steps:
- name: Get Latest Visual Studio Version
shell: bash
run: |
dotnet tool update -g dotnet-vs
vs where release
vs update release Enterprise
vs modify release Enterprise +mobile +desktop +uwp +web
vs where release
#- name: Get Latest Visual Studio Version
# shell: bash
# run: |
# dotnet tool update -g dotnet-vs
# vs where release
# vs update release Enterprise
# vs modify release Enterprise +mobile +desktop +uwp +web
# vs where release

- name: Checkout code
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
Expand Down Expand Up @@ -98,11 +98,9 @@ jobs:
run: |
dotnet restore ${{ env.solutionpath }} /bl:artifacts\\binlog\\restore.binlog

# msbuild used because we run targets not supported by dotnet build
- name: Run Build
run: |
msbuild /t:build /nowarn:MSB4011 /maxcpucount /p:NoPackageAnalysis=true /verbosity:minimal /p:Configuration=Release
working-directory: src
dotnet build ${{ env.solutionpath }} --configuration Release --no-restore /bl:artifacts\\binlog\\build.binlog /p:ContinuousIntegrationBuild=true

- name: Run Unit Tests
run: |
Expand All @@ -117,18 +115,13 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Produce Nuget Packages
run: msbuild /t:pack /nowarn:MSB4011 /maxcpucount /p:NoPackageAnalysis=true /verbosity:minimal /p:Configuration=Release /p:PackageOutputPath=..\..\artifacts\nuget /p:ContinuousIntegrationBuild=true
working-directory: src
run: |
dotnet pack ${{ env.solutionpath }} --configuration Release --no-build /bl:artifacts\\binlog\\pack.binlog --nologo /p:PackageOutputPath=..\..\artifacts\nuget /p:ContinuousIntegrationBuild=true

- name: List outdated packages
run: |
dotnet outdated -o artifacts\outdated\outdated.json src


- name: Run Resharper Duplicate Code Finder
run: |
jb dupfinder ${{ env.solutionpath }} -o=artifacts\dupfinder\report.xml

# only store binlog on failure
- name: store binlogs
if: ${{ failure() }}
Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
SOLUTION_PATH: src\\Vetuviem.sln
solutionpath: src\Vetuviem.sln

strategy:
fail-fast: false
Expand All @@ -46,6 +46,17 @@ jobs:
with:
fetch-depth: 0

- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Install DotNet workloads
shell: bash
run: |
dotnet workload install android ios tvos macos maui wasm-tools
dotnet workload list

- name: Install Windows SDK 10.0.16299
shell: pwsh
run: |
Expand All @@ -58,23 +69,16 @@ jobs:
$process.Start()
$process.WaitForExit()

- name: Install .NET 7
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x

- name: Add MSBuild to PATH
uses: glennawatson/setup-msbuild@v1.0.3
with:
prerelease: true
uses: microsoft/setup-msbuild@v2.0.0

# This mitigates an issue with websdk projects loading analyzers from old packages.
- name: Cleanup nuget local storage
run: dotnet nuget locals all --clear

- name: Restore Packages
run: |
dotnet restore ${{ env.SOLUTION_PATH }} /bl:artifacts\\binlog\\restore.binlog
dotnet restore ${{ env.solutionpath }} /bl:artifacts\\binlog\\restore.binlog

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand All @@ -88,8 +92,7 @@ jobs:

- name: Run Build
run: |
msbuild /t:build,pack /p:Configuration=Release /maxcpucount /bl:artifacts\\binlog\\build.binlog /p:ContinuousIntegrationBuild=true /p:PackageOutputPath=..\..\artifacts\nuget /p:UseSharedCompilation=false
working-directory: src
dotnet build ${{ env.solutionpath }} --configuration Release --no-restore /bl:artifacts\\binlog\\build.binlog /p:ContinuousIntegrationBuild=true

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand Down
24 changes: 1 addition & 23 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,3 @@
{
"extends": [
"config:base"
],
"assigneesFromCodeOwners": true,
"packageRules": [{
"matchPackagePatterns": ["Microsoft.*"],
"groupName": "all microsoft dependencies",
"groupSlug": "all-microsoft",
"labels": ["dependencies"]
},
{
"matchPackagePatterns": ["ReactiveUI.*"],
"groupName": "all reactiveui dependencies",
"groupSlug": "all-reactiveui",
"labels": ["dependencies"]
},
{
"matchPackagePatterns": ["Xamarin.*"],
"groupName": "all xamarin dependencies",
"groupSlug": "all-xamarin",
"labels": ["dependencies"]
}]
"extends": ["local>dpvreony/.github:renovate"]
}

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<!--<WarningsAsErrors>8032,8785</WarningsAsErrors>-->
<TreatWarningsAsErrors />
<OutputType>Library</OutputType>
<IsPackable>False</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand All @@ -21,8 +22,11 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ReactiveUI.Blazor.VetuViemGenerator\ReactiveUI.Blazor.VetuViemGenerator.csproj" OutputItemType="Analyzer" />
<ProjectReference Include="..\Vetuviem.Core\Vetuviem.Core.csproj" />
</ItemGroup>

<Import Project="..\Vetuviem.SourceGenerator\Vetuviem-SourceGenerator.props" />
<PropertyGroup>
<Vetuviem_Make_Classes_Public>true</Vetuviem_Make_Classes_Public>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>9</LangVersion>
<DebugType>full</DebugType>
<DebugSymbols>True</DebugSymbols>
Expand All @@ -11,10 +11,15 @@
-->
<!--<WarningsAsErrors>8032,8785</WarningsAsErrors>-->
<TreatWarningsAsErrors />
<IsPackable>False</IsPackable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\ReactiveUI.Maui.VetuViemGenerator\ReactiveUI.Maui.VetuViemGenerator.csproj" OutputItemType="Analyzer" />
<ProjectReference Include="..\Vetuviem.Core\Vetuviem.Core.csproj" />
</ItemGroup>

<Import Project="..\Vetuviem.SourceGenerator\Vetuviem-SourceGenerator.props" />
<PropertyGroup>
<Vetuviem_Make_Classes_Public>true</Vetuviem_Make_Classes_Public>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,9 @@
<HintPath>$(MSBuildProgramFiles32)\Windows Kits\10\UnionMetadata\10.0.16299.0\Windows.winmd</HintPath>
</Reference>
</ItemGroup>

<Import Project="..\Vetuviem.SourceGenerator\Vetuviem-SourceGenerator.props" />
<PropertyGroup>
<Vetuviem_Make_Classes_Public>true</Vetuviem_Make_Classes_Public>
</PropertyGroup>
</Project>
3 changes: 2 additions & 1 deletion src/ReactiveUI.WPF.SampleApp/ReactiveUI.WPF.SampleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<UseWPF>true</UseWPF>
<IsPackable>False</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using System.Windows.Media;
using ReactiveUI.WPF.SampleApp.ViewModels;
using ReactiveUI.WPF.SampleApp.Views;
using ReactiveUI.Wpf.ViewToViewModelBindings.System.Windows.Controls;
using VetuviemGenerated.Wpf.ViewToViewModelBindings.System.Windows.Controls;

Check failure on line 12 in src/ReactiveUI.WPF.SampleApp/ViewBindingModels/QuestionnaireViewBindingModels.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The type or namespace name 'VetuviemGenerated' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 12 in src/ReactiveUI.WPF.SampleApp/ViewBindingModels/QuestionnaireViewBindingModels.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The type or namespace name 'VetuviemGenerated' could not be found (are you missing a using directive or an assembly reference?)
using Vetuviem.Core;

namespace ReactiveUI.WPF.SampleApp.ViewBindingModels
Expand Down Expand Up @@ -92,7 +92,7 @@
vm => vm.AnswerFourLengthRemaining);
}

private static LabelControlBindingModel<QuestionnaireView, QuestionnaireViewModel> GetStandardLengthRemainingLabelViewBindingModel(

Check failure on line 95 in src/ReactiveUI.WPF.SampleApp/ViewBindingModels/QuestionnaireViewBindingModels.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The type or namespace name 'LabelControlBindingModel<,>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 95 in src/ReactiveUI.WPF.SampleApp/ViewBindingModels/QuestionnaireViewBindingModels.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The type or namespace name 'LabelControlBindingModel<,>' could not be found (are you missing a using directive or an assembly reference?)
Expression<Func<QuestionnaireView, Label>> controlExpression,
Expression<Func<QuestionnaireViewModel, object?>> viewModelObjectExpression,
Expression<Func<QuestionnaireViewModel, int>> viewModelNumberExpression)
Expand All @@ -105,18 +105,18 @@
};
}

private static Brush GetBrushForLengthRemaining(int lengthRemaining)
private static SolidColorBrush GetBrushForLengthRemaining(int lengthRemaining)
{
return lengthRemaining switch
{
< 0 => Brushes.Red,
< 10 => Brushes.OrangeRed,
< 20 => Brushes.Orange,
< 10 => Brushes.Orange,
< 20 => Brushes.Gold,
_ => Brushes.Black
};
}

private static TextBoxControlBindingModel<QuestionnaireView, QuestionnaireViewModel> GetStandardTextBoxViewModel(

Check failure on line 119 in src/ReactiveUI.WPF.SampleApp/ViewBindingModels/QuestionnaireViewBindingModels.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The type or namespace name 'TextBoxControlBindingModel<,>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 119 in src/ReactiveUI.WPF.SampleApp/ViewBindingModels/QuestionnaireViewBindingModels.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The type or namespace name 'TextBoxControlBindingModel<,>' could not be found (are you missing a using directive or an assembly reference?)
Expression<Func<QuestionnaireView, TextBox>> controlExpression,
Expression<Func<QuestionnaireViewModel, string?>> viewModelTextExpression)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0-windows10.0.19041</TargetFramework>
<TargetFramework>net8.0-windows10.0.19041</TargetFramework>
<LangVersion>9</LangVersion>
<DebugType>full</DebugType>
<DebugSymbols>True</DebugSymbols>
Expand All @@ -12,14 +12,19 @@
-->
<!--<WarningsAsErrors>8032,8785</WarningsAsErrors>-->
<TreatWarningsAsErrors />
<IsPackable>False</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ReactiveUI.WPF" Version="20.1.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ReactiveUI.WPF.VetuViemGenerator\ReactiveUI.WPF.VetuviemGenerator.csproj" OutputItemType="Analyzer" PrivateAssets="all" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\Vetuviem.WPF.SourceGenerator\Vetuviem.WPF.SourceGenerator.csproj" OutputItemType="Analyzer" />
<ProjectReference Include="..\Vetuviem.Core\Vetuviem.Core.csproj" />
</ItemGroup>

<Import Project="..\Vetuviem.SourceGenerator\Vetuviem-SourceGenerator.props" />
<PropertyGroup>
<Vetuviem_Make_Classes_Public>true</Vetuviem_Make_Classes_Public>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand All @@ -16,32 +16,5 @@
<ItemGroup>
<Analyzer Include="$(ProjectDir)..\Vetuviem.SourceGenerator\bin\$(Configuration)\netstandard2.0\Vetuviem.SourceGenerator.dll" />
</ItemGroup>
<!-- Below is the logic for putting this project into reactiveui and using a nuget reference -->

<!--
<PropertyGroup>
<GetTargetPathDependsOn>$(GetTargetPathDependsOn);GetDependencyTargetPaths</GetTargetPathDependsOn>
</PropertyGroup>

<Target Name="GetDependencyTargetPaths">
<ItemGroup>
<TargetPathWithTargetPlatformMoniker Include="$(PKGVetuviem_SourceGenerator)\lib\netstandard2.0\Vetuviem.SourceGenerators.dll" IncludeRuntimeDependency="false" />
</ItemGroup>
</Target>
-->

<ItemGroup>
<PackageReference Include="Microsoft.ProjectReunion.WinUI" Version="0.8.12" PrivateAssets="all" ReferenceOutputAssembly="true" />
</ItemGroup>

<PropertyGroup>
<GetTargetPathDependsOn>$(GetTargetPathDependsOn);GetDependencyTargetPaths</GetTargetPathDependsOn>
</PropertyGroup>

<Target Name="GetDependencyTargetPaths">
<ItemGroup>
<TargetPathWithTargetPlatformMoniker Include="$(PKGMicrosoft_ProjectReunion_WinUI)\lib\net5.0-windows10.0.18362.0\Microsoft.WinUI.dll" IncludeRuntimeDependency="false" />
</ItemGroup>
</Target>

</Project>
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.19041.24</WindowsSdkPackageVersion>
<WindowsSdkPackageVersion>10.0.19041.29</WindowsSdkPackageVersion>
<UseWinUI>true</UseWinUI>
<LangVersion>9</LangVersion>
<DebugType>full</DebugType>
<DebugSymbols>True</DebugSymbols>
<Platforms>x86;x64</Platforms>
<RuntimeIdentifiers>win10-x86;win10-x64</RuntimeIdentifiers>
<RuntimeIdentifiers>win-x64;win-x86;win-arm64</RuntimeIdentifiers>
<!--
If you're seeing CS8032 warnings, it can be because the upstream source generator dll has been rebuilt or you've changed the
target frameworks in this project. Visual Studio seems to have a cache that invalidates. Reloading Visual Studio can
solve the issue.
-->
<!--<WarningsAsErrors>8032,8785</WarningsAsErrors>-->
<TreatWarningsAsErrors />
<!-- EnableCoreMrtTooling is workaround for: https://github.com/microsoft/WindowsAppSDK/issues/3939 -->
<EnableCoreMrtTooling Condition=" '$(BuildingInsideVisualStudio)' != 'true' ">false</EnableCoreMrtTooling>
<IsPackable>False</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.ProjectReunion" Version="0.8.12" />
<PackageReference Include="Microsoft.ProjectReunion.Foundation" Version="0.8.12" />
<PackageReference Include="Microsoft.ProjectReunion.WinUI" Version="0.8.12" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240428000" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ReactiveUI.WinUI3.VetuViemGenerator\ReactiveUI.WinUI3.VetuViemGenerator.csproj" OutputItemType="Analyzer" PrivateAssets="all" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\Vetuviem.Core\Vetuviem.Core.csproj" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<LangVersion>9</LangVersion>
<DebugType>full</DebugType>
<DebugSymbols>True</DebugSymbols>
Expand All @@ -13,11 +13,15 @@
-->
<!--<WarningsAsErrors>8032,8785</WarningsAsErrors>-->
<TreatWarningsAsErrors />
<IsPackable>False</IsPackable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\ReactiveUI.Winforms.VetuViemGenerator\ReactiveUI.Winforms.VetuViemGenerator.csproj" OutputItemType="Analyzer" />
<ProjectReference Include="..\Vetuviem.Core\Vetuviem.Core.csproj" />
</ItemGroup>

<Import Project="..\Vetuviem.SourceGenerator\Vetuviem-SourceGenerator.props" />
<PropertyGroup>
<Vetuviem_Make_Classes_Public>true</Vetuviem_Make_Classes_Public>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>9</LangVersion>
<DebugType>full</DebugType>
<DebugSymbols>True</DebugSymbols>
<DevelopmentDependency>true</DevelopmentDependency>
<IncludeBuildOutput>false</IncludeBuildOutput>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Vetuviem.SourceGenerator\Vetuviem.SourceGenerator.csproj" PrivateAssets="all" ReferenceOutputAssembly="true" />
</ItemGroup>
<ItemGroup>
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
<None Include="$(OutputPath)\Vetuviem.SourceGenerator.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
<None Include="..\Vetuviem.SourceGenerator\Vetuviem-SourceGenerator.props" Pack="true" PackagePath="build/$(ProjectName).props" Visible="false" />
</ItemGroup>

</Project>
Loading
Loading