Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 6 additions & 7 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,19 @@ insert_final_newline = true
trim_trailing_whitespace = true

# C#関連ファイル
[*.{cs,tt,xaml,razor,cshtml,sln}]
[*.{cs,tt,xaml,axaml,razor,cshtml,sln}]
charset = utf-8-bom
end_of_line = crlf

# Visual Studio ソリューションファイル
[*.sln]
indent_style = tab

# Visual Studio XML ソリューションファイル
[*.slnx]
end_of_line = crlf
indent_size = 2

# C#プロジェクトファイル
# EditorConfigなしだとUTF-8(WPFプロジェクトはBOM付き)のCRLFになる。
[*.csproj]
Expand Down Expand Up @@ -51,9 +56,3 @@ trim_trailing_whitespace = false
# C# 生成コード
[{*Generated,**/Generated/**}.cs]
generated_code = true

# Program.cs
# 理由: トップレベルステートメントで誤検知するため。
# https://github.com/dotnet/roslyn-analyzers/issues/6141
[Program.cs]
dotnet_diagnostic.CA1852.severity = none
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
*.cs text eol=crlf
*.tt text eol=crlf
*.xaml text eol=crlf
*.axaml text eol=crlf
*.razor text eol=crlf
*.cshtml text eol=crlf
*.csproj text eol=crlf
*.sln text eol=crlf
*.slnx text eol=crlf
PSScriptAnalyzerSettings.psd1 linguist-vendored
Source/Common/* linguist-vendored
*/wwwroot/* linguist-vendored
5 changes: 1 addition & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@ version: 2
updates:
- package-ecosystem: nuget
directory: /
open-pull-requests-limit: 10
open-pull-requests-limit: 99
schedule:
interval: daily
labels:
- dependencies
ignore:
- dependency-name: Microsoft.SourceLink.GitHub
- dependency-name: StyleCop.Analyzers

- package-ecosystem: github-actions
directory: /
Expand Down
2 changes: 1 addition & 1 deletion .github/dotfiles.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"hash": "9ba280023bd46042eaa00534ce57776471a35333"
"hash": "63c5086b3c460079eca487acab1e702cb5f779d7"
}
2 changes: 2 additions & 0 deletions .github/workflows/build-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ on:
- '**/*.cs'
- '**/*.tt'
- '**/*.xaml'
- '**/*.axaml'
- '**/*.razor'
- '**/*.cshtml'
- '**/*.csproj'
- '**/*.sln'
- '**/*.slnx'
- '**/*.props'
- '**/*.targets'
- '**/.editorconfig'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
uses: finphie/Actions/.github/workflows/release.yml@main
permissions:
contents: write
id-token: write
attestations: write
with:
version: ${{ needs.check.outputs.version }}
tag: ${{ needs.check.outputs.tag }}
Expand All @@ -48,6 +50,8 @@ jobs:
uses: finphie/Actions/.github/workflows/deploy-docker.yml@main
permissions:
packages: write
id-token: write
attestations: write
with:
version: ${{ needs.check.outputs.version }}
version-major: ${{ needs.check.outputs.version-major }}
13 changes: 13 additions & 0 deletions .github/workflows/normalize.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Normalize line endings

on:
pull_request:

permissions:
contents: write

jobs:
main:
name: Main
if: github.event.pull_request.user.login == 'dependabot[bot]'
uses: finphie/Actions/.github/workflows/normalize.yml@main
640 changes: 583 additions & 57 deletions .globalconfig

Large diffs are not rendered by default.

87 changes: 44 additions & 43 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,60 @@
default: true
heading-increment: true
first-heading-h1: false
$schema: "https://raw.githubusercontent.com/DavidAnson/markdownlint/main/schema/markdownlint-config-schema.json"

heading-style:
style: atx
ul-style:
style: dash
list-indent: true
ul-start-left: true
ul-indent:
indent: 2
no-trailing-spaces:
br_spaces: 2
list_item_empty_lines: false
no-hard-tabs: true
no-reversed-links: true
no-multiple-blanks:
maximum: 1
br_spaces: 0
no-hard-tabs:
spaces_per_tab: 2
line-length: false
commands-show-output: true
no-missing-space-atx: true
no-multiple-space-atx: true
blanks-around-headings:
lines_above: 1
lines_below: 1
heading-start-left: true
no-duplicate-heading: false
single-title: true
no-duplicate-heading:
siblings_only: true
no-trailing-punctuation:
punctuation: .,;:!?。,;:!?、
no-multiple-space-blockquote: true
no-blank-blockquote: true
no-blanks-blockquote: false
ol-prefix:
style: one
list-marker-space:
ul_single: 1
ol_single: 1
ul_multi: 1
ol_multi: 1
blanks-around-fences: true
blanks-around-lists: true
no-inline-html: true
no-bare-urls: true
no-inline-html:
allowed_elements:
- details
- summary
hr-style:
style: ---
no-emphasis-as-heading: false
no-space-in-emphasis: true
no-space-in-code: true
no-space-in-links: true
fenced-code-language: true
first-line-heading:
level: 1
no-empty-links: true
fenced-code-language:
allowed_languages:
- text
- csharp
- razor
- typescript
- javascript
- python
- html
- css
- markdown
- xml
- json
- yaml
- shell
- powershell
- batch
- bash
- editorconfig
- dockerfile
language_only: true
required-headings: false
proper-names: true
no-alt-text: true
code-block-style:
style: fenced
single-trailing-newline: true
emphasis-style:
style: asterisk
strong-style:
style: asterisk
link-image-style:
collapsed: false
full: false
shortcut: false
url_inline: false
table-pipe-style:
style: leading_and_trailing
2 changes: 2 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
extends: default

rules:
comments:
min-spaces-from-content: 1
document-start:
present: false
empty-lines:
Expand Down
19 changes: 0 additions & 19 deletions Build/Common/Analyzers/Analyzers.Trimming.props

This file was deleted.

29 changes: 29 additions & 0 deletions Build/Common/Analyzers/Analyzers.Trimming.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<Project>
<!--
トリミングに関するアナライザーの設定
https://learn.microsoft.com/dotnet/core/deploying/trimming/trimming-options
https://learn.microsoft.com/dotnet/core/deploying/native-aot/
-->

<!--
.NET Standardではトリミング関連のアナライザーを有効にできない。
https://github.com/dotnet/sdk/issues/30948
-->
<PropertyGroup Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETCoreApp'">
<!-- AOTと互換性があると宣言する。 -->
<IsAotCompatible>true</IsAotCompatible>

<!-- トリミング可能とマークする。 -->
<IsTrimmable>true</IsTrimmable>

<!-- AOT関連のアナライザーを有効にする。 -->
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
<EnableSingleFileAnalyzer>true</EnableSingleFileAnalyzer>
<EnableAotAnalyzer>true</EnableAotAnalyzer>
<SuppressTrimAnalysisWarnings>false</SuppressTrimAnalysisWarnings>

<!-- ILLinkの警告をエラーとして扱わない。 -->
<ILLinkTreatWarningsAsErrors>false</ILLinkTreatWarningsAsErrors>
</PropertyGroup>

</Project>
11 changes: 0 additions & 11 deletions Build/Common/Analyzers/Analyzers.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,4 @@
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers" Version="*-*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
27 changes: 24 additions & 3 deletions Build/Common/Exe.Platform.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,59 @@

<When Condition="'$(UseWinUI)' == 'true'">
<PropertyGroup>
<IsWinUI>true</IsWinUI>
<IsWinUi>true</IsWinUi>
<ProjectIdentifier>Windows</ProjectIdentifier>
</PropertyGroup>
</When>

<When Condition="'$(UseWPF)' == 'true'">
<PropertyGroup>
<IsWpf>true</IsWpf>
<ProjectIdentifier>Windows</ProjectIdentifier>
</PropertyGroup>
</When>

<!-- UsingMicrosoftMauiSdkは、ビルドを伴わないmsbuildタスク実行時などでは使用できない。 -->
<When Condition="'$(UseMaui)' == 'true'">
<PropertyGroup>
<IsMaui>true</IsMaui>
<ProjectIdentifier>MAUI</ProjectIdentifier>
</PropertyGroup>
</When>

<When Condition="'$(UsingMicrosoftNETSdkBlazorWebAssembly)' == 'true'">
<PropertyGroup>
<IsBlazorWebAssembly>true</IsBlazorWebAssembly>
<ProjectIdentifier>Browser</ProjectIdentifier>
</PropertyGroup>
</When>

<!-- Blazor Web AppまたはBlazor Server -->
<When Condition="'$(UsingMicrosoftNETSdkRazor)' == 'true'">
<PropertyGroup>
<IsBlazorServer>true</IsBlazorServer>
<ProjectIdentifier>Server</ProjectIdentifier>
</PropertyGroup>
</When>

<When Condition="'$(UsingMicrosoftNETSdkWeb)' == 'true'">
<PropertyGroup>
<IsAspNet>true</IsAspNet>
<ProjectIdentifier>Server</ProjectIdentifier>
</PropertyGroup>
</When>

<When Condition="'$(UsingMicrosoftNETSdkBlazorWebAssembly)' == 'true'">
<When Condition="'$(UseAvalonia)' == 'true'">
<PropertyGroup>
<IsBlazorWebAssembly>true</IsBlazorWebAssembly>
<IsAvalonia>true</IsAvalonia>
<ProjectIdentifier>Avalonia</ProjectIdentifier>
</PropertyGroup>
</When>

<Otherwise>
<PropertyGroup>
<IsConsole>true</IsConsole>
<ProjectIdentifier>Console</ProjectIdentifier>
</PropertyGroup>
</Otherwise>

Expand Down
7 changes: 5 additions & 2 deletions Build/Common/Exe.props
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
<Project>
<!--
実行ファイル関連の設定
.NET 8以降のみ対応
このファイルは、プロジェクトファイルの末尾で直接インポートする必要あり。
Directory.Build.propsでインポートした場合、一部のプロパティ設定が機能しない。
-->

<Import Project="$(MSBuildThisFileDirectory)Exe.Platform.props" />

<Import Condition="'$(IsWinUI)' == 'true'" Project="$(BuildCommonPlatformDirectory)Gui/WinUI.props" />
<Import Condition="'$(IsWinUi)' == 'true'" Project="$(BuildCommonPlatformDirectory)Gui/WinUi.props" />
<Import Condition="'$(IsWpf)' == 'true'" Project="$(BuildCommonPlatformDirectory)Gui/Wpf.props" />
<Import Condition="'$(IsMaui)' == 'true'" Project="$(BuildCommonPlatformDirectory)Gui/Maui.props" />
<Import Condition="'$(IsAspNet)' == 'true'" Project="$(BuildCommonPlatformDirectory)AspNet/AspNet.props" />
<Import Condition="'$(IsBlazorWebAssembly)' == 'true'" Project="$(BuildCommonPlatformDirectory)AspNet/BlazorWebAssembly.props" />
<Import Condition="'$(IsBlazorServer)' == 'true'" Project="$(BuildCommonPlatformDirectory)AspNet/BlazorServer.props" />
<Import Condition="'$(IsAspNet)' == 'true'" Project="$(BuildCommonPlatformDirectory)AspNet/AspNet.props" />
<Import Condition="'$(IsAvalonia)' == 'true'" Project="$(BuildCommonPlatformDirectory)Gui/Avalonia.props" />
<Import Condition="'$(IsConsole)' == 'true'" Project="$(BuildCommonPlatformDirectory)Console/Console.props" />

</Project>
2 changes: 1 addition & 1 deletion Build/Common/Exe.targets
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
これにより、リリース先ディレクトリ内にはシンボルファイルが生成されるが、発行先ディレクトリにはコピーされなくなる。

PrepareForPublishターゲットは、パッケージ作成と発行時に実行される。
このファイル自体は、発行対象プロジェクトでのみインポートされるが、コンソールアプリケーションでは、.NETツールとしてパッケージが作成される
このファイル自体は、発行対象プロジェクトでのみインポートされる
.NETツールではシンボルを含めたいため、発行時のみに限定する必要がある
_IsPublishingは、発行時に発行対象プロジェクトでのみtrueとなるプロパティ。(参照されているプロジェクトでは、発行時でもtrueにならない。)
本来は参照するべきではないプロパティだが、他に良い方法がないため妥協している。
Expand Down
Loading
Loading