-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First draft of working library and package
- Loading branch information
Showing
8 changed files
with
134 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,25 @@ | ||
# We require the C++ toolchain to build the native lib | ||
# as well as .NET core to build our library and samples. | ||
|
||
make --directory ./rpi-rgb-led-matrix all | ||
New-Item -Path ./rpi-rgb-led-matrix/lib/librgbmatrix.so -ItemType SymbolicLink -Value librgbmatrix.so.1 -ErrorAction SilentlyContinue | ||
Write-Host "Building the native C++ library" | ||
make --directory ./rpi-rgb-led-matrix | Out-Null | ||
New-Item -Path ./rpi-rgb-led-matrix/lib/librgbmatrix.so -ItemType SymbolicLink -Value librgbmatrix.so.1 -Force | Out-Null | ||
|
||
dotnet pack ./src/SharpPiLed/SharpPiLed.csproj -c Release -o ./nugets | ||
dotnet build ./src/examples/Matrix/Matrix.csproj -c Release | ||
Write-Host "Removing existing build artifacts and clearing local nuget cache" | ||
Get-ChildItem .\ -include nugets,bin,obj -Recurse | | ||
Foreach-Object { | ||
Remove-Item $_.fullname -Force -Recurse | ||
} | ||
|
||
dotnet nuget locals all --clear | Out-Null | ||
|
||
Write-Host "Build SharpPiLed library" | ||
dotnet pack ./src/SharpPiLed -c Release -o ./nugets | ||
|
||
Write-Host "Build all example projects" | ||
Get-ChildItem ./src/examples/ *.csproj -Recurse | | ||
Foreach-Object { | ||
$project = $_.fullname | ||
Write-Host "Building $project" | ||
dotnet publish $project -c Release | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<packageSources> | ||
<add key="Development Store" value="../../nugets" /> | ||
</packageSources> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using System.IO; | ||
using System.Threading; | ||
using SharpPiLed; | ||
|
||
namespace SimpleText | ||
{ | ||
public class Program | ||
{ | ||
public static int Main(string[] args) | ||
{ | ||
BdfFont.ExtractFontFiles("./fonts"); | ||
|
||
var matrix = new LedMatrix(new LedMatrixOptions(), args); | ||
var canvas = matrix.CreateOffscreenCanvas(); | ||
|
||
var font = new BdfFont("./fonts/6x13.bdf"); | ||
|
||
canvas.DrawText(font, 1, 20, new Color(0, 255, 0), "Thank you!"); | ||
matrix.SwapOnVsync(canvas); | ||
|
||
while (!Console.KeyAvailable) | ||
{ | ||
Thread.Sleep(250); | ||
} | ||
|
||
return 0; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
<RuntimeIdentifier>linux-arm</RuntimeIdentifier> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="SharpPiLed" Version="1.0.0" /> | ||
</ItemGroup> | ||
|
||
</Project> |