Skip to content

Commit 3a138bc

Browse files
Create single Spice86.DataGrid package with integrated Semi theme
1 parent fae33cd commit 3a138bc

75 files changed

Lines changed: 32031 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/codeql.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
pull_request
16+
17+
jobs:
18+
analyze:
19+
name: Analyze
20+
runs-on: 'ubuntu-latest'
21+
permissions:
22+
actions: read
23+
contents: read
24+
security-events: write
25+
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
language: [ 'csharp' ]
30+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
31+
# Use only 'java' to analyze code written in Java, Kotlin or both
32+
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
33+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
34+
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@v3
38+
39+
# Initializes the CodeQL tools for scanning.
40+
- name: Initialize CodeQL
41+
uses: github/codeql-action/init@v2
42+
with:
43+
languages: ${{ matrix.language }}
44+
# If you wish to specify custom queries, you can do so here or in a config file.
45+
# By default, queries listed here will override any specified in a config file.
46+
# Prefix the list here with "+" to use these queries and those in the config file.
47+
48+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
49+
queries: security-and-quality
50+
51+
52+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
53+
# If this step fails, then you should remove it and run the build manually (see below)
54+
# - name: Autobuild
55+
# uses: github/codeql-action/autobuild@v2
56+
57+
# ℹ️ Command-line programs to run using the OS shell.
58+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
59+
60+
# If the Autobuild fails above, remove it and uncomment the following three lines.
61+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
62+
63+
- name: Setup .NET
64+
uses: actions/setup-dotnet@v1
65+
with:
66+
dotnet-version: '10.0.x'
67+
68+
- run: |
69+
echo "running custom build action..."
70+
dotnet build ./Spice86.DataGrid.slnx
71+
72+
- name: Perform CodeQL Analysis
73+
uses: github/codeql-action/analyze@v2
74+
with:
75+
category: "/language:${{matrix.language}}"

.github/workflows/nuget.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Test and Publish NuGet
2+
3+
# Trigger the workflow on push to master
4+
on:
5+
push:
6+
branches:
7+
- "main"
8+
9+
jobs:
10+
build:
11+
strategy:
12+
matrix:
13+
os: [macos-latest, windows-latest, ubuntu-latest]
14+
fail-fast: false
15+
16+
runs-on: ${{ matrix.os }}
17+
18+
steps:
19+
- uses: actions/checkout@v1
20+
21+
- name: Setup .NET
22+
uses: actions/setup-dotnet@v1
23+
with:
24+
dotnet-version: "10.0.x"
25+
26+
- name: Package NuGet
27+
run: dotnet pack Spice86.DataGrid.slnx --include-symbols --include-source --configuration Release -p:NoWarn=1591
28+
29+
- name: Upload NuGet Spice86.DataGrid
30+
if: github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest'
31+
working-directory: ./src/Spice86.DataGrid/Avalonia.Controls.DataGrid/bin/Release
32+
run: dotnet nuget push Spice86.DataGrid.*.nupkg --api-key "${{ secrets.NUGET_API_KEY }}" --source "https://api.nuget.org/v3/index.json" --skip-duplicate

.github/workflows/pr.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Run tests
2+
3+
# Trigger the workflow on PRs
4+
on:
5+
pull_request
6+
7+
jobs:
8+
build:
9+
10+
strategy:
11+
matrix:
12+
os: [macos-latest, windows-latest, ubuntu-latest]
13+
fail-fast: false
14+
15+
runs-on: ${{ matrix.os }}
16+
17+
steps:
18+
- uses: actions/checkout@v1
19+
20+
- name: Setup .NET
21+
uses: actions/setup-dotnet@v1
22+
with:
23+
dotnet-version: '10.0.x'
24+
25+
- name: Build with dotnet
26+
run: dotnet build Spice86.DataGrid.slnx --configuration Release

.github/workflows/prerelease.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: pre-release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
packages: write
11+
12+
jobs:
13+
prerelease:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Determine prerelease version
20+
run: |
21+
COMMIT_SHA=$(git rev-parse --short HEAD)
22+
echo "PRERELEASE_VERSION=0.1.0-${COMMIT_SHA}" >> $GITHUB_ENV
23+
24+
- name: Setup .NET
25+
uses: actions/setup-dotnet@v4
26+
with:
27+
dotnet-version: 10.0.x
28+
29+
- name: Pack prerelease NuGet package
30+
run: dotnet pack ./src/Spice86.DataGrid/Avalonia.Controls.DataGrid/Avalonia.Controls.DataGrid.csproj --configuration Release --include-symbols --include-source -p:PackageVersion=${PRERELEASE_VERSION} -p:SymbolPackageFormat=snupkg -p:NoWarn=1591%3BNU5104%3BNU1507
31+
32+
- name: Publish prerelease package to GitHub Packages
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
PRERELEASE_VERSION: ${{ env.PRERELEASE_VERSION }}
36+
run: |
37+
dotnet nuget push ./src/Spice86.DataGrid/Avalonia.Controls.DataGrid/bin/Release/Spice86.DataGrid.${PRERELEASE_VERSION}.nupkg --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --api-key ${GITHUB_TOKEN} --skip-duplicate

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# Spice86.DataGrid
2-
An internal DataGrid for the AvaloniaUI, ,forked from last FLOSS v11 version, updated for Avaloniav12
2+
An internal DataGrid for AvaloniaUI, forked from the last FLOSS v11 version and updated for Avalonia v12.
3+
4+
This repository ships a single NuGet package, `Spice86.DataGrid`, that contains both the DataGrid controls and the Semi DataGrid theme in the same assembly.

Spice86.DataGrid.slnx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<Solution>
2+
<Project Path="src/Spice86.DataGrid/Avalonia.Controls.DataGrid/Avalonia.Controls.DataGrid.csproj" />
3+
</Solution>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using Avalonia.Automation.Peers;
2+
3+
namespace Avalonia.Controls.Automation.Peers;
4+
5+
#if !DATAGRID_INTERNAL
6+
public
7+
#endif
8+
class DataGridAutomationPeer : ControlAutomationPeer
9+
{
10+
public DataGridAutomationPeer(DataGrid owner)
11+
: base(owner)
12+
{
13+
}
14+
15+
public new DataGrid Owner => (DataGrid)base.Owner;
16+
17+
protected override AutomationControlType GetAutomationControlTypeCore()
18+
{
19+
return AutomationControlType.DataGrid;
20+
}
21+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using Avalonia.Automation.Peers;
2+
3+
namespace Avalonia.Controls.Automation.Peers;
4+
5+
#if !DATAGRID_INTERNAL
6+
public
7+
#endif
8+
class DataGridCellAutomationPeer : ContentControlAutomationPeer
9+
{
10+
public DataGridCellAutomationPeer(DataGridCell owner)
11+
: base(owner)
12+
{
13+
}
14+
15+
public new DataGridCell Owner => (DataGridCell)base.Owner;
16+
17+
protected override AutomationControlType GetAutomationControlTypeCore()
18+
{
19+
return AutomationControlType.Custom;
20+
}
21+
22+
protected override bool IsContentElementCore() => true;
23+
24+
protected override bool IsControlElementCore() => true;
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using Avalonia.Automation.Peers;
2+
3+
namespace Avalonia.Controls.Automation.Peers;
4+
5+
#if !DATAGRID_INTERNAL
6+
public
7+
#endif
8+
class DataGridColumnHeaderAutomationPeer : ContentControlAutomationPeer
9+
{
10+
public DataGridColumnHeaderAutomationPeer(DataGridColumnHeader owner)
11+
: base(owner)
12+
{
13+
}
14+
15+
public new DataGridColumnHeader Owner => (DataGridColumnHeader)base.Owner;
16+
17+
protected override AutomationControlType GetAutomationControlTypeCore()
18+
{
19+
return AutomationControlType.HeaderItem;
20+
}
21+
22+
protected override bool IsContentElementCore() => false;
23+
24+
protected override bool IsControlElementCore() => true;
25+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using Avalonia.Automation.Peers;
2+
using Avalonia.Controls.Primitives;
3+
4+
namespace Avalonia.Controls.Automation.Peers;
5+
6+
#if !DATAGRID_INTERNAL
7+
public
8+
#endif
9+
class DataGridColumnHeadersPresenterAutomationPeer : ControlAutomationPeer
10+
{
11+
public DataGridColumnHeadersPresenterAutomationPeer(DataGridColumnHeadersPresenter owner)
12+
: base(owner)
13+
{
14+
}
15+
16+
public new DataGridColumnHeadersPresenter Owner => (DataGridColumnHeadersPresenter)base.Owner;
17+
18+
protected override AutomationControlType GetAutomationControlTypeCore()
19+
{
20+
return AutomationControlType.Header;
21+
}
22+
23+
protected override bool IsContentElementCore() => false;
24+
25+
protected override bool IsControlElementCore() => true;
26+
}

0 commit comments

Comments
 (0)