Skip to content

Commit

Permalink
Enhance project structure; inner dev loop
Browse files Browse the repository at this point in the history
  • Loading branch information
NecatiMeral committed Feb 11, 2023
1 parent 8c8c38f commit d72c187
Show file tree
Hide file tree
Showing 27 changed files with 221 additions and 40 deletions.
26 changes: 26 additions & 0 deletions build/pack-node.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[CmdletBinding()]
param (
[Parameter(Mandatory = $True)]
[string]
$Project
)

Write-Host "Packing logic-node project at ``${Project}``" -ForegroundColor Blue
$RepositoryRoot = Resolve-Path (Join-Path $PSScriptRoot '../')
$SdkDir = Join-path $PSScriptRoot 'tools/gira'
$DistDir = Resolve-Path (Join-Path $PSScriptRoot '../dist')

Write-Host "Repository: ``${RepositoryRoot}``"
Write-Host "SDK-Tools: ``${SdkDir}``"
Write-Host "Output: ``${DistDir}``"

$NodeToolPath = Join-Path -Path $SdkDir -ChildPath 'LogicNodeTool.exe'

$CreateNodeArgs = @(
'create'
"${Project}"
"${DistDir}"
)

Write-Host "${NodeToolPath} ${CreateNodeArgs}" -ForegroundColor Magenta
. $NodeToolPath $CreateNodeArgs
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added dist/.gitkeep
Empty file.
Binary file not shown.
52 changes: 48 additions & 4 deletions dotnet/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,63 @@
</PropertyGroup>

<PropertyGroup>
<GiraDeveloperId>necati_meral_yahoo_de</GiraDeveloperId>
</PropertyGroup>

<PropertyGroup Label="Project classification">
<IsTestProject Condition="$(MSBuildProjectFullPath.Contains('test')) and ($(MSBuildProjectName.EndsWith('.Tests')) or $(MSBuildProjectName.EndsWith('.TestBase')))">true</IsTestProject>

<IsNodeProject Condition="$(MSBuildProjectFullPath.Contains('.Logic.')) and (!$(MSBuildProjectName.Contains('.Tests')))">true</IsNodeProject>

<RepositoryRoot>$(MSBuildThisFileDirectory)</RepositoryRoot>
</PropertyGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(Configuration)' == 'Debug' and $(IsNodeProject) == 'true'">
<Exec Command="pwsh -NoProfile -ExecutionPolicy RemoteSigned -File &quot;$(MSBuildThisFileDirectory)..\build\pack-node.ps1&quot; -Project $(MSBuildProjectDirectory)\$(OutputPath) " />
</Target>

<!-- TODO: Create a more developer and VS friendly approach-->
<!--<PropertyGroup Condition="'$(IsNodeProject)' == 'true'">
<PostBuildEvent>
echo INFO: Creating ZIP archive
echo INFO: INPUT: "$(MSBuildProjectDirectory)\$(OutputPath)bin\Debug\net48"
echo INFO: OUTPUT "$(RepositoryRoot)dist"
echo TEST: "$(TargetDir)"
;"$(MSBuildThisFileDirectory)..\build\tools\gira\LogicNodeTool.exe" create $(MSBuildProjectDirectory)\$(OutputPath) $(RepositoryRoot)dist
;echo INFO: Logic Nodes are not signed yet and can only be used in the simulation in GPA.
;REM "$(SolutionDir)src\LogicNodesSDK\SignLogicNodes.exe" $(SolutionDir)..\..\build\dev\gira-developer-cert.p7b [certificate_password] $(SolutionDir)Zip
</PostBuildEvent>
</PropertyGroup>-->

<ItemGroup Condition="'$(IsTestProject)' != 'true'">
<ItemGroup Label="Implicit usings">
<Using Include="LogicModule.Nodes.Helpers" />
<Using Include="LogicModule.ObjectModel" />
</ItemGroup>

<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<ItemGroup Label="Workaround for missing dependency on implicit usings">
<Using Remove="System.Net.Http" />
</ItemGroup>

<ItemGroup Label="Add Xunit for tests" Condition="'$(IsTestProject)' == 'true'">
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<ItemGroup Label="SDK dependencies">
<Reference Include="LogicModule.Nodes.Helpers">
<HintPath>$(SolutionDir)src\LogicNodesSDK\LogicModule.Nodes.Helpers.dll</HintPath>
</Reference>
<Reference Include="LogicModule.ObjectModel">
<HintPath>$(SolutionDir)src\LogicNodesSDK\LogicModule.ObjectModel.dll</HintPath>
</Reference>
</ItemGroup>

<ItemGroup Label="Test dependencies" Condition="'$(IsTestProject)' == 'true'">
<Reference Include="LogicModule.Nodes.TestHelper">
<HintPath>$(SolutionDir)src\LogicNodesSDK\LogicModule.Nodes.TestHelper.dll</HintPath>
</Reference>

<PackageReference Include="coverlet.collector" Version="3.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand All @@ -33,7 +77,7 @@
<PackageReference Include="xunit.runner.visualstudio" Version="$(xUnitRunnerVisualStudioPackageVersion)" />
</ItemGroup>

<PropertyGroup>
<PropertyGroup Label="Package versions">

<!-- Microsoft .NET-Framework reference assemblies -->
<MicrosoftNetFramework45PackageVersion>1.0.3</MicrosoftNetFramework45PackageVersion>
Expand Down
22 changes: 21 additions & 1 deletion dotnet/NecatiMeral.LogicNodes.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B4F57F38-7B5
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{1EE7FB73-9DEA-4D45-9CD0-2F4BFE480FF6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NecatiMeral.LogicNodes.Tests", "test\NecatiMeral.LogicNodes.Tests\NecatiMeral.LogicNodes.Tests.csproj", "{8A4DFEEE-CC9F-467E-8903-ED93D272D884}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NecatiMeral.LogicNodes.Tests", "test\NecatiMeral.LogicNodes.Tests\NecatiMeral.LogicNodes.Tests.csproj", "{8A4DFEEE-CC9F-467E-8903-ED93D272D884}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NecatiMeral.Logic.Doorbird", "src\NecatiMeral.Logic.Doorbird\NecatiMeral.Logic.Doorbird.csproj", "{01386FAD-6E3E-408C-9948-D61DA886C584}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Projektmappenelemente", "Projektmappenelemente", "{40954188-75ED-47A1-9E72-5B1B3F7EA544}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
logic-node.props = logic-node.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NecatiMeral.DoorbirdListener.Tests", "test\NecatiMeral.DoorbirdListener.Tests\NecatiMeral.DoorbirdListener.Tests.csproj", "{F3BC8C87-7DEA-432C-A66F-375BA31D1944}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -25,13 +35,23 @@ Global
{8A4DFEEE-CC9F-467E-8903-ED93D272D884}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8A4DFEEE-CC9F-467E-8903-ED93D272D884}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8A4DFEEE-CC9F-467E-8903-ED93D272D884}.Release|Any CPU.Build.0 = Release|Any CPU
{01386FAD-6E3E-408C-9948-D61DA886C584}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{01386FAD-6E3E-408C-9948-D61DA886C584}.Debug|Any CPU.Build.0 = Debug|Any CPU
{01386FAD-6E3E-408C-9948-D61DA886C584}.Release|Any CPU.ActiveCfg = Release|Any CPU
{01386FAD-6E3E-408C-9948-D61DA886C584}.Release|Any CPU.Build.0 = Release|Any CPU
{F3BC8C87-7DEA-432C-A66F-375BA31D1944}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F3BC8C87-7DEA-432C-A66F-375BA31D1944}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F3BC8C87-7DEA-432C-A66F-375BA31D1944}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F3BC8C87-7DEA-432C-A66F-375BA31D1944}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{3F1FF768-FD27-46A2-961C-B6EFDF9CB3B3} = {B4F57F38-7B57-4225-9BD4-264ABC47DE33}
{8A4DFEEE-CC9F-467E-8903-ED93D272D884} = {1EE7FB73-9DEA-4D45-9CD0-2F4BFE480FF6}
{01386FAD-6E3E-408C-9948-D61DA886C584} = {B4F57F38-7B57-4225-9BD4-264ABC47DE33}
{F3BC8C87-7DEA-432C-A66F-375BA31D1944} = {1EE7FB73-9DEA-4D45-9CD0-2F4BFE480FF6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {471310B7-D205-4EEC-A063-0A534164AB9A}
Expand Down
14 changes: 14 additions & 0 deletions dotnet/logic-node.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project>

<!--<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net45" Version="$(MicrosoftNetFramework45PackageVersion)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>-->

<ItemGroup>
<Using Remove="System.Net.Http"/>
</ItemGroup>

</Project>
16 changes: 16 additions & 0 deletions dotnet/src/NecatiMeral.Logic.Doorbird/DoorbirdListenerNode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Necati_Meral_Yahoo_De.LogicNodes;

namespace Necati_Meral_Yahoo_De.Logic.Doorbird;

public class DoorbirdListenerNode : LocalizablePrefixLogicNodeBase
{
protected ITypeService TypeService { get; }

public DoorbirdListenerNode(INodeContext context)
: base(context, LogicNodeConsts.InputPrefix)
{
context.ThrowIfNull("context");

TypeService = context.GetService<ITypeService>();
}
}
31 changes: 31 additions & 0 deletions dotnet/src/NecatiMeral.Logic.Doorbird/Manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"PackageFormatVersion": "1.0",
"Assembly": "Necati_Meral_Yahoo_De.Logic.Doorbird.dll",
"PackageName": {
"en": "Doorbird nodes"
},
"DependentFiles": [
"NecatiMeral.LogicNodes.dll"
],
"Version": "1.0.0",
"Author": "Necati Meral",
"Copyright": "COPYRIGHT",
"DeveloperId": "necati_meral_yahoo_de",
"License": "Free",
"PackageId": "CB18E39C-C1A8-421F-882A-4E3B4B36A996",
"Nodes": [
{
"Type": "Necati_Meral_Yahoo_De.Logic.Doorbird.DoorbirdListenerNode",
"Name": {
"en": "Logic Node"
},
"IsConverter": false,
"Category": "Node",
"DefaultIcon": "",
"HelpTooltip": {
"en": "Logic Node."
},
"HelpFileReference": null
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\..\logic-node.props" />

<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\NecatiMeral.LogicNodes\NecatiMeral.LogicNodes.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="Manifest.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<!-- TODO: Create a more developer and VS friendly approach-->
<!-- <PropertyGroup>
<PostBuildEvent>"$(SolutionDir)src\LogicNodesSDK\LogicNodeTool.exe" create "$(TargetDir) " "$(SolutionDir)Zip"
echo INFO: Logic Nodes are not signed yet and can only be used in the simulation in GPA.
REM "$(SolutionDir)src\LogicNodesSDK\SignLogicNodes.exe" $(SolutionDir)..\..\build\dev\gira-developer-cert.p7b [certificate_password] $(SolutionDir)Zip</PostBuildEvent>
</PropertyGroup> -->

</Project>
5 changes: 5 additions & 0 deletions dotnet/src/NecatiMeral.LogicNodes/LogicNodeConsts.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace Necati_Meral_Yahoo_De.LogicNodes;
public static class LogicNodeConsts
{
public const string InputPrefix = "Input";
}
31 changes: 5 additions & 26 deletions dotnet/src/NecatiMeral.LogicNodes/NecatiMeral.LogicNodes.csproj
Original file line number Diff line number Diff line change
@@ -1,38 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\..\logic-node.props"/>

<PropertyGroup>
<Platform>AnyCPU</Platform>
<ProjectGuid>{3F1FF768-FD27-46A2-961C-B6EFDF9CB3B3}</ProjectGuid>
<OutputType>Library</OutputType>
<TargetFramework>net45</TargetFramework>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Reference Include="LogicModule.Nodes.Helpers">
<HintPath>..\LogicNodesSDK\LogicModule.Nodes.Helpers.dll</HintPath>
</Reference>
<Reference Include="LogicModule.ObjectModel">
<HintPath>..\LogicNodesSDK\LogicModule.ObjectModel.dll</HintPath>
</Reference>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net45" Version="$(MicrosoftNetFramework45PackageVersion)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<None Update="Manifest.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<!-- TODO: Create a more developer and VS friendly approach-->
<!-- <PropertyGroup>
<PostBuildEvent>"$(SolutionDir)src\LogicNodesSDK\LogicNodeTool.exe" create "$(TargetDir) " "$(SolutionDir)Zip"
echo INFO: Logic Nodes are not signed yet and can only be used in the simulation in GPA.
REM "$(SolutionDir)src\LogicNodesSDK\SignLogicNodes.exe" $(SolutionDir)..\..\build\dev\gira-developer-cert.p7b [certificate_password] $(SolutionDir)Zip</PostBuildEvent>
</PropertyGroup> -->
</Project>
2 changes: 1 addition & 1 deletion dotnet/src/NecatiMeral.LogicNodes/Node.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NecatiMeral.LogicNodes;
namespace Necati_Meral_Yahoo_De.LogicNodes;

public class Node : LogicNodeBase
{
Expand Down
10 changes: 10 additions & 0 deletions dotnet/test/NecatiMeral.DoorbirdListener.Tests/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;

namespace Necati_Meral_Yahoo_De.DoorbirdListener.Tests;
public class Class1
{

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\NecatiMeral.Logic.Doorbird\NecatiMeral.Logic.Doorbird.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Platform>AnyCPU</Platform>
<ProjectGuid>{8A4DFEEE-CC9F-467E-8903-ED93D272D884}</ProjectGuid>
<OutputType>Library</OutputType>
<TargetFramework>net45</TargetFramework>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand All @@ -15,12 +15,7 @@
</ItemGroup>

<ItemGroup>
<Reference Include="LogicModule.Nodes.TestHelper">
<HintPath>..\..\src\LogicNodesSDK\LogicModule.Nodes.TestHelper.dll</HintPath>
</Reference>
<Reference Include="LogicModule.ObjectModel">
<HintPath>..\..\src\LogicNodesSDK\LogicModule.ObjectModel.dll</HintPath>
</Reference>
<ProjectReference Include="..\..\src\NecatiMeral.LogicNodes\NecatiMeral.LogicNodes.csproj" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion dotnet/test/NecatiMeral.LogicNodes.Tests/NodeTest.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using LogicModule.Nodes.TestHelper;
using LogicModule.ObjectModel;

namespace NecatiMeral.LogicNodes.Tests;
namespace Necati_Meral_Yahoo_De.LogicNodes.Tests;

public class NodeTest
{
Expand Down

0 comments on commit d72c187

Please sign in to comment.