# インフラ構成図

## CI/CDパイプライン全体構成

```mermaid
flowchart TB
    subgraph GitHub["GitHub"]
        GH_REPO["AvaloniaUI/Avalonia<br/>リポジトリ"]
        GH_PR["Pull Request"]
        GH_ACTIONS["GitHub Actions<br/>CLAボット"]
    end

    subgraph AzureDevOps["Azure DevOps Pipelines"]
        subgraph MainPipeline["azure-pipelines.yml"]
            JOB_VERSION["GetPRNumber Job<br/>ubuntu-24.04"]
            JOB_LINUX["Linux Job<br/>ubuntu-24.04"]
            JOB_MACOS["macOS Job<br/>macos-15"]
            JOB_WIN["Windows Job<br/>windows-2025"]
        end

        subgraph IntegrationPipeline["azure-pipelines-integrationtests.yml"]
            JOB_MAC_INT["Mac Integration Job<br/>AvaloniaMacPool"]
            JOB_WIN_INT["Windows Integration Job<br/>windows-2025"]
        end
    end

    subgraph Artifacts["成果物"]
        NUGET_PKG["NuGetパッケージ"]
        TEST_RESULTS["テスト結果"]
        NATIVE_OSX["Avalonia.Native.OSX"]
        SAMPLES["サンプルアプリ"]
    end

    subgraph External["外部サービス"]
        NUGET_ORG["NuGet.org"]
        NUGET_AZURE["Azure Artifacts<br/>dotnet10-transport"]
    end

    GH_REPO --> |"トリガー"| MainPipeline
    GH_REPO --> |"トリガー"| IntegrationPipeline
    GH_PR --> |"PRイベント"| GH_ACTIONS

    JOB_VERSION --> |"バージョン情報"| Artifacts
    JOB_LINUX --> TEST_RESULTS
    JOB_MACOS --> NUGET_PKG
    JOB_MACOS --> NATIVE_OSX
    JOB_WIN --> NUGET_PKG
    JOB_WIN --> SAMPLES

    JOB_MAC_INT --> TEST_RESULTS
    JOB_WIN_INT --> TEST_RESULTS

    NUGET_PKG --> |"公開"| NUGET_ORG
    NUGET_AZURE --> |"依存関係"| MainPipeline
    NUGET_ORG --> |"依存関係"| MainPipeline
```

## ビルドジョブ詳細構成

```mermaid
flowchart LR
    subgraph LinuxJob["Linux Job"]
        L1["Use .NET 8.0 Runtime"]
        L2["Use .NET 10.0 SDK"]
        L3["Install Workloads<br/>android, macos, wasm-tools"]
        L4["Run Build<br/>CiAzureLinux"]
        L5["Publish Test Results"]
        L1 --> L2 --> L3 --> L4 --> L5
    end

    subgraph MacJob["macOS Job"]
        M1["Use .NET 8.0 Runtime"]
        M2["Use .NET 10.0 SDK"]
        M3["Install Workloads<br/>android, ios, maccatalyst, macos, wasm-tools"]
        M4["Generate C++ Headers"]
        M5["Xcode Build<br/>Native Components"]
        M6["Run Build<br/>CiAzureOSX"]
        M7["Publish Results"]
        M1 --> M2 --> M3 --> M4 --> M5 --> M6 --> M7
    end

    subgraph WinJob["Windows Job"]
        W1["Use .NET 8.0 Runtime"]
        W2["Use .NET 10.0 SDK"]
        W3["Install Workloads<br/>android, maccatalyst, ios, tvos, wasm-tools"]
        W4["Install Nuke"]
        W5["Run Nuke<br/>CiAzureWindows"]
        W6["Publish Results"]
        W1 --> W2 --> W3 --> W4 --> W5 --> W6
    end
```

## Nuke Build ターゲット依存関係

```mermaid
flowchart TB
    Clean["Clean"]
    InitDnx["InitDnx"]
    GenerateCppHeaders["GenerateCppHeaders"]
    CompileNative["CompileNative<br/>(macOS only)"]
    Compile["Compile"]

    RunCoreLibsTests["RunCoreLibsTests"]
    RunRenderTests["RunRenderTests"]
    RunToolsTests["RunToolsTests"]
    RunHtmlPreviewerTests["RunHtmlPreviewerTests"]
    RunLeakTests["RunLeakTests<br/>(Windows only)"]
    RunTests["RunTests"]

    CreateIntermediateNugetPackages["CreateIntermediateNugetPackages"]
    CreateNugetPackages["CreateNugetPackages"]
    DownloadApiBaselinePackages["DownloadApiBaselinePackages"]
    ValidateApiDiff["ValidateApiDiff"]
    Package["Package"]
    ZipFiles["ZipFiles"]

    CiAzureLinux["CiAzureLinux"]
    CiAzureOSX["CiAzureOSX"]
    CiAzureWindows["CiAzureWindows"]
    VerifyXamlCompilation["VerifyXamlCompilation"]

    Clean --> CompileNative
    Clean --> Compile
    GenerateCppHeaders --> CompileNative
    CompileNative --> Compile
    InitDnx --> Compile

    Compile --> RunCoreLibsTests
    Compile --> RunRenderTests
    Compile --> RunToolsTests
    Compile --> RunHtmlPreviewerTests
    Compile --> RunLeakTests
    Compile --> CreateIntermediateNugetPackages

    RunCoreLibsTests --> RunTests
    RunRenderTests --> RunTests
    RunToolsTests --> RunTests
    RunHtmlPreviewerTests --> RunTests
    RunLeakTests --> RunTests

    CreateIntermediateNugetPackages --> CreateNugetPackages
    CreateNugetPackages --> DownloadApiBaselinePackages
    DownloadApiBaselinePackages --> ValidateApiDiff

    RunTests --> Package
    CreateNugetPackages --> Package
    ValidateApiDiff --> Package

    CreateNugetPackages --> VerifyXamlCompilation

    Package --> ZipFiles

    RunTests --> CiAzureLinux
    Package --> CiAzureOSX
    ZipFiles --> CiAzureOSX
    Package --> CiAzureWindows
    VerifyXamlCompilation --> CiAzureWindows
    ZipFiles --> CiAzureWindows
```

## ターゲットプラットフォーム構成

```mermaid
flowchart TB
    subgraph Avalonia["Avalonia Framework"]
        Core["Avalonia.Base<br/>Avalonia.Controls<br/>Avalonia.Markup"]
    end

    subgraph Desktop["デスクトップ"]
        Win["Windows<br/>net10.0-windows"]
        Mac["macOS<br/>net10.0-macos"]
        Linux["Linux/X11<br/>net10.0"]
    end

    subgraph Mobile["モバイル"]
        iOS["iOS<br/>net10.0-ios26.0"]
        Android["Android<br/>net10.0-android36.0"]
        MacCatalyst["Mac Catalyst<br/>net10.0-maccatalyst26.0"]
        tvOS["tvOS<br/>net10.0-tvos26.0"]
    end

    subgraph Web["Web"]
        Browser["WebAssembly<br/>net10.0-browser"]
    end

    subgraph Rendering["レンダリング"]
        Skia["SkiaSharp"]
        Metal["Metal (macOS/iOS)"]
        OpenGL["OpenGL"]
    end

    Core --> Desktop
    Core --> Mobile
    Core --> Web
    Core --> Rendering

    Win --> |"Win32 API"| Core
    Mac --> |"Avalonia.Native"| Core
    Linux --> |"X11/FreeDesktop"| Core
    iOS --> |"UIKit"| Core
    Android --> |"Android SDK"| Core
    MacCatalyst --> |"UIKit"| Core
    tvOS --> |"UIKit"| Core
    Browser --> |"WebAssembly"| Core
```

## 外部依存関係

```mermaid
flowchart LR
    subgraph NuGetSources["NuGet パッケージソース"]
        NuGetOrg["api.nuget.org<br/>公式パッケージ"]
        AzureArtifacts["Azure Artifacts<br/>dotnet10-transport<br/>.NET 10プレビュー"]
    end

    subgraph BuildDeps["ビルド依存関係"]
        SkiaSharp["SkiaSharp"]
        HarfBuzz["HarfBuzzSharp"]
        RxNET["System.Reactive"]
    end

    subgraph DevTools["開発ツール"]
        NukeBuild["Nuke.GlobalTool<br/>9.0.4"]
        MicroCom["MicroCom.CodeGenerator"]
        Numerge["Numerge"]
    end

    subgraph TestDeps["テスト依存関係"]
        XUnit["xUnit"]
        NUnit["NUnit"]
        Moq["Moq"]
        Appium["Appium"]
        WinAppDriver["WinAppDriver"]
    end

    NuGetOrg --> BuildDeps
    NuGetOrg --> TestDeps
    AzureArtifacts --> BuildDeps
    NuGetOrg --> DevTools
```
