Skip to content

Commit 979c085

Browse files
committed
Updated csproj
1 parent 701a705 commit 979c085

14 files changed

+227
-199
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
run: dotnet --info
5050

5151
- name: Restore packages
52-
run: dotnet restore --verbosity Minimal
52+
run: dotnet restore --verbosity ${env:VERBOSITY}
5353

5454
- name: Build libraries
5555
run: >-

Bytewizer.TinyCLR.sln

+14-7
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,36 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 16
44
VisualStudioVersion = 16.0.29613.14
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bytewizer.TinyCLR.Cube", "src\Cube\Bytewizer.TinyCLR.Cube.csproj", "{1BE45AF4-C879-4D21-B5EE-129879BD2FD0}"
7-
EndProject
86
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{40530C8E-DA66-475B-8FB5-BD7D664CAE1B}"
97
ProjectSection(SolutionItems) = preProject
8+
src\Directory.Build.props = src\Directory.Build.props
109
README.md = README.md
1110
EndProjectSection
1211
EndProject
13-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workflows", "Workflows", "{2FED2E95-7D76-40C9-994A-8C3D5A272B6B}"
12+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Github", "Github", "{2FED2E95-7D76-40C9-994A-8C3D5A272B6B}"
1413
ProjectSection(SolutionItems) = preProject
1514
.github\workflows\build.yml = .github\workflows\build.yml
1615
.github\workflows\release.yml = .github\workflows\release.yml
1716
EndProjectSection
1817
EndProject
18+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bytewizer.TinyCLR.Einstein", "src\Einstein\Bytewizer.TinyCLR.Einstein.csproj", "{227319D7-9F2A-430E-AC8C-2732CB8D16C0}"
19+
EndProject
20+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bytewizer.TinyCLR.Tesla", "src\Tesla\Bytewizer.TinyCLR.Tesla.csproj", "{E5BD63EB-B0FB-401D-9108-8D7B02147722}"
21+
EndProject
1922
Global
2023
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2124
Debug|Any CPU = Debug|Any CPU
2225
Release|Any CPU = Release|Any CPU
2326
EndGlobalSection
2427
GlobalSection(ProjectConfigurationPlatforms) = postSolution
25-
{1BE45AF4-C879-4D21-B5EE-129879BD2FD0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
26-
{1BE45AF4-C879-4D21-B5EE-129879BD2FD0}.Debug|Any CPU.Build.0 = Debug|Any CPU
27-
{1BE45AF4-C879-4D21-B5EE-129879BD2FD0}.Release|Any CPU.ActiveCfg = Release|Any CPU
28-
{1BE45AF4-C879-4D21-B5EE-129879BD2FD0}.Release|Any CPU.Build.0 = Release|Any CPU
28+
{227319D7-9F2A-430E-AC8C-2732CB8D16C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29+
{227319D7-9F2A-430E-AC8C-2732CB8D16C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
30+
{227319D7-9F2A-430E-AC8C-2732CB8D16C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
31+
{227319D7-9F2A-430E-AC8C-2732CB8D16C0}.Release|Any CPU.Build.0 = Release|Any CPU
32+
{E5BD63EB-B0FB-401D-9108-8D7B02147722}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{E5BD63EB-B0FB-401D-9108-8D7B02147722}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{E5BD63EB-B0FB-401D-9108-8D7B02147722}.Release|Any CPU.ActiveCfg = Release|Any CPU
35+
{E5BD63EB-B0FB-401D-9108-8D7B02147722}.Release|Any CPU.Build.0 = Release|Any CPU
2936
EndGlobalSection
3037
GlobalSection(SolutionProperties) = preSolution
3138
HideSolutionNode = FALSE

README.md

+37-37
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Sample TinyCLR Project
1+
# Sample Dotnet Core TinyCLR Project
22

33
[![Build Status](https://img.shields.io/github/workflow/status/microcompiler/tinyclr-github/Build%20CI?style=flat-square)](https://github.com/microcompiler/tinyclr-github/actions)
44

@@ -20,51 +20,51 @@ This repo contains a sample Visual Studio project leveraging github actions to b
2020
## Required CSPROJ file settings
2121

2222
```xml
23+
<Project Sdk="Microsoft.NET.Sdk">
24+
<PropertyGroup>
25+
<TargetFramework>net452</TargetFramework>
26+
<FrameworkPathOverride>$(NugetPackagesPath)\.nuget\packages\ghielectronics.tinyclr.core\1.0.0\</FrameworkPathOverride>
27+
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
28+
</PropertyGroup>
29+
<ItemGroup>
30+
<PackageReference Include="GHIElectronics.TinyCLR.Core" Version="1.0.0" PrivateAssets="all" />
31+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="all" />
32+
</ItemGroup>
33+
</Project>
34+
```
35+
36+
### Required Directory.Build.props file settings
37+
38+
```xml
39+
<Project>
40+
<!-- Nuget Pack Properties -->
2341
<PropertyGroup>
24-
<!-- Nuget Pack Properties -->
25-
<RuntimeIdentifier>win</RuntimeIdentifier>
2642
<GenerateDocumentationFile>true</GenerateDocumentationFile>
27-
<IncludeSymbols>true</IncludeSymbols>
43+
<IncludeSymbols>false</IncludeSymbols>
2844
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
29-
<PackageId>$(AssemblyName)</PackageId>
30-
<AssemblyTitle>$(AssemblyName)</AssemblyTitle>
45+
<AssemblyVersion>1.0.6.0</AssemblyVersion>
46+
<FileVersion>1.0.6.0</FileVersion>
3147
<VersionPrefix>1.0.0</VersionPrefix>
3248
<Version Condition=" '$(Version)' == '' and '$(VersionSuffix)' != '' ">$(VersionPrefix)-$(VersionSuffix)</Version>
33-
<Version Condition=" '$(Version)' == '' ">$(VersionPrefix)</Version>
49+
<Version Condition=" '$(Version)' == '' ">$(VersionPrefix)</Version>
50+
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
51+
<AssemblyVersion>$(VersionPrefix).0</AssemblyVersion>
52+
<FileVersion>$(VersionPrefix).0</FileVersion>
3453
<Authors>Microcompiler</Authors>
35-
<Company>$(AssemblyCompany)</Company>
36-
<Description>Simple TinyCLR Cube Library</Description>
37-
<PackageTags>TinyCLR, firmware, iot</PackageTags>
38-
<PackageProjectUrl>https://github.com/microcompiler/</PackageProjectUrl>
39-
<RepositoryUrl>https://github.com/microcompiler/tinyclr</RepositoryUrl>
54+
<Company>Bytewizer Inc.</Company>
55+
<RepositoryUrl>https://github.com/microcompiler/tinyclr-github</RepositoryUrl>
56+
<PackageId>$(AssemblyName)</PackageId>
57+
<PackageTags>TinyCLR TinyCLROS</PackageTags>
4058
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
4159
<PackageIcon>logo.png</PackageIcon>
42-
<NoWarn>NU5105</NoWarn>
43-
<!-- Nuget Pack Properties -->
60+
<NoWarn>NU5105</NoWarn>
4461
</PropertyGroup>
45-
<ItemGroup>
46-
<PackageReference Include="GHIElectronics.TinyCLR.Core" Version="1.0.0" />
47-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="all" />
48-
<PackageReference Include="NuGet.Build.Tasks.Pack" Version="5.5.0-preview.1.6319">
49-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
50-
<PrivateAssets>all</PrivateAssets>
51-
</PackageReference>
52-
</ItemGroup>
62+
<!-- Nuget Pack Properties -->
5363
<!-- Embedded files -->
5464
<ItemGroup>
55-
<None Include="..\..\LICENSE.md" Link="LICENSE.md">
56-
<Pack>True</Pack>
57-
<PackagePath>
58-
</PackagePath>
59-
</None>
65+
<None Include="..\..\LICENSE.md" Pack="true" PackagePath="$(PackageLicenseFile)"/>
66+
<None Include="..\..\images\logo.png" Pack="true" PackagePath="\"/>
6067
</ItemGroup>
61-
<ItemGroup>
62-
<None Include="..\..\images\logo.png">
63-
<Pack>True</Pack>
64-
<PackagePath>
65-
</PackagePath>
66-
</None>
67-
</ItemGroup>
68-
<!-- Embedded files -->
69-
```
70-
68+
<!-- Embedded files -->
69+
</Project>
70+
```

build.cmd

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dotnet restore --verbosity Minimal
2+
dotnet build -p:Copyright="2020 Bytewizer. All rights reserved." --version-suffix prebuild.100 --no-restore --verbosity Minimal --configuration Release
3+
dotnet pack -p:Copyright="2020 Bytewizer. All rights reserved." --version-suffix prebuild.100 --include-symbols --no-restore --no-build --verbosity Minimal --configuration Release --output .builds/artifacts

global.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sdk": {
3+
"version": "3.1.100"
4+
}
5+
}

samples/Sample/Bytewizer.TinyCLR.Samples.csproj

+5-5
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@
4040
<Compile Include="Properties\AssemblyInfo.cs" />
4141
</ItemGroup>
4242
<ItemGroup>
43-
<PackageReference Include="Bytewizer.TinyCLR.Cube">
44-
<Version>1.0.0</Version>
43+
<PackageReference Include="Bytewizer.TinyCLR.Einstein">
44+
<Version>1.0.0-prebuild.100</Version>
45+
</PackageReference>
46+
<PackageReference Include="Bytewizer.TinyCLR.Tesla">
47+
<Version>1.0.0-prebuild.100</Version>
4548
</PackageReference>
4649
<PackageReference Include="GHIElectronics.TinyCLR.BrainPad">
4750
<Version>1.0.1</Version>
4851
</PackageReference>
49-
<PackageReference Include="GHIElectronics.TinyCLR.Core">
50-
<Version>1.0.0</Version>
51-
</PackageReference>
5252
</ItemGroup>
5353
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
5454
</Project>

samples/Sample/Program.cs

+48-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
using Bytewizer.TinyCLR.Cube;
1+
using System;
2+
using Bytewizer.TinyCLR.Einstein;
3+
using Bytewizer.TinyCLR.Tesla;
24

35
namespace Bytewizer.TinyCLR.Samples
46
{
@@ -49,7 +51,7 @@ static void Main()
4951
rot.X = 360 - accelY;
5052
rot.Y = accelX;
5153
//pos.X += 1;
52-
Translate.Translate3Dto2D(cube_points, cube2, rot, pos);
54+
Translate3Dto2D(cube_points, cube2, rot, pos);
5355

5456
for (int i = 0; i < start.Length; i++)
5557
{ // draw the lines that make up the object
@@ -67,5 +69,49 @@ static void Main()
6769
BrainPad.Wait.Minimum();
6870
}
6971
}
72+
73+
public static void Translate3Dto2D(Vector3[] Points3D, Vector2[] Points2D, Vector3 Rotate, Vector3 Position)
74+
{
75+
int OFFSETX = 64;
76+
int OFFSETY = 32;
77+
int OFFSETZ = 50;
78+
79+
double sinax = Math.Sin(Rotate.X * Math.PI / 180);
80+
double cosax = Math.Cos(Rotate.X * Math.PI / 180);
81+
double sinay = Math.Sin(Rotate.Y * Math.PI / 180);
82+
double cosay = Math.Cos(Rotate.Y * Math.PI / 180);
83+
double sinaz = Math.Sin(Rotate.Z * Math.PI / 180);
84+
double cosaz = Math.Cos(Rotate.Z * Math.PI / 180);
85+
86+
for (int i = 0; i < 8; i++)
87+
{
88+
double x = Points3D[i].X;
89+
double y = Points3D[i].Y;
90+
double z = Points3D[i].Z;
91+
92+
double yt = y * cosax - z * sinax; // rotate around the x axis
93+
double zt = y * sinax + z * cosax; // using the Y and Z for the rotation
94+
y = yt;
95+
z = zt;
96+
97+
double xt = x * cosay - z * sinay; // rotate around the Y axis
98+
zt = x * sinay + z * cosay; // using X and Z
99+
x = xt;
100+
z = zt;
101+
102+
xt = x * cosaz - y * sinaz; // finally rotate around the Z axis
103+
yt = x * sinaz + y * cosaz; // using X and Y
104+
x = xt;
105+
y = yt;
106+
107+
x = x + Position.X; // add the object position offset
108+
y = y + Position.Y; // for both x and y
109+
z = z + OFFSETZ - Position.Z; // as well as Z
110+
111+
Points2D[i].X = (x * 64 / z) + OFFSETX;
112+
Points2D[i].Y = (y * 64 / z) + OFFSETY;
113+
//BrainPad.ImageBuffer.DrawPoint((int)Points2D[i].X, (int)Points2D[i].Y);
114+
}
115+
}
70116
}
71117
}

src/Cube/Properties/AssemblyInfo.cs

-36
This file was deleted.

src/Cube/Translate.cs

-61
This file was deleted.

src/Directory.Build.props

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<Project>
2+
<!-- Nuget Pack Properties -->
3+
<PropertyGroup>
4+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
5+
<IncludeSymbols>false</IncludeSymbols>
6+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
7+
<AssemblyVersion>1.0.6.0</AssemblyVersion>
8+
<FileVersion>1.0.6.0</FileVersion>
9+
<VersionPrefix>1.0.0</VersionPrefix>
10+
<Version Condition=" '$(Version)' == '' and '$(VersionSuffix)' != '' ">$(VersionPrefix)-$(VersionSuffix)</Version>
11+
<Version Condition=" '$(Version)' == '' ">$(VersionPrefix)</Version>
12+
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
13+
<AssemblyVersion>$(VersionPrefix).0</AssemblyVersion>
14+
<FileVersion>$(VersionPrefix).0</FileVersion>
15+
<Authors>Microcompiler</Authors>
16+
<Company>Bytewizer Inc.</Company>
17+
<RepositoryUrl>https://github.com/microcompiler/tinyclr-github</RepositoryUrl>
18+
<PackageId>$(AssemblyName)</PackageId>
19+
<PackageTags>TinyCLR TinyCLROS</PackageTags>
20+
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
21+
<PackageIcon>logo.png</PackageIcon>
22+
<NoWarn>NU5105</NoWarn>
23+
</PropertyGroup>
24+
<!-- Nuget Pack Properties -->
25+
<!-- Embedded files -->
26+
<ItemGroup>
27+
<None Include="..\..\LICENSE.md" Pack="true" PackagePath="$(PackageLicenseFile)"/>
28+
<None Include="..\..\images\logo.png" Pack="true" PackagePath="\"/>
29+
</ItemGroup>
30+
<!-- Embedded files -->
31+
</Project>

0 commit comments

Comments
 (0)