Skip to content

Commit

Permalink
update WinformsDI
Browse files Browse the repository at this point in the history
  • Loading branch information
carsten-riedel committed Jun 17, 2024
1 parent 99de654 commit aa0b5c5
Show file tree
Hide file tree
Showing 12 changed files with 700 additions and 2 deletions.
6 changes: 5 additions & 1 deletion notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -368,4 +368,8 @@ Quartz.NET
NAudio
CsvHelper
Spectre.Console
coverlet.collector
coverlet.collector

in src:
dotnet pack -c Debug
dotnet new install Projects\Coree.Template.Project\bin\Package\Coree.Template.Project.0.2.8934.6807-local.nupkg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) Carsten Riedel 2023
Copyright (c) 2024 Carsten Riedel

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "Carsten Riedel",
"classifications": [ "Common", "dotnet", "Windows", "Winforms", "Coree" ],
"identity": "CoreeTemplatesProjectWinformsDependencyInjection",
"name": ".NET Winforms Dependency Injection",
"shortName": "winformsdi-coree",
"tags": {
"language": "C#",
"type": "project"
},
"defaultName": "Organization.Domain.Winforms", // Default Solution and Projectname scheme "Organization.Domain.Functionality"
"sourceName": "WinformsDI", // Matching nameingscheme folders, csproj and namespace
"preferNameDirectory": true,
"symbols": {
"TargetFramework": {
"type": "parameter",
"description": "The target frameworks for the project.",
"datatype": "choice",
"allowMultipleValues": false,
"enableQuotelessLiterals": true,
"choices": [
{
"choice": "net6.0-windows",
"description": "Target .NET 6.0",
"displayName": ".NET 6.0 Windows"
},
{
"choice": "net7.0-windows",
"description": "Target .NET 7.0",
"displayName": ".NET 7.0 Windows"
},
{
"choice": "net8.0-windows",
"description": "Target .NET 8.0",
"displayName": ".NET 8.0 Windows"
}
],
"defaultValue": "net8.0-windows",
"replaces": "net8.0-windows"

},
"RuntimeIdentifier": {
"type": "parameter",
"description": "The target RuntimeIdentifier for the project.",
"datatype": "choice",
"allowMultipleValues": false,
"enableQuotelessLiterals": true,
"choices": [
{
"choice": "win-x86",
"description": "Target x86",
"displayName": "Windows x86"
},
{
"choice": "win-x64",
"description": "Target x64",
"displayName": "Windows x64"
}
],
"defaultValue": "win-x64"
},
"Publish": {
"type": "parameter",
"description": "Choose the publish type. Option 2) or 3) recommended.",
"datatype": "choice",
"allowMultipleValues": false,
"enableQuotelessLiterals": true,
"choices": [
{
"choice": "FrameworkRequired",
"description": "",
"displayName": "1) Framework-required. (Purpose: Installer)"
},
{
"choice": "FrameworkRequiredSingle",
"description": "",
"displayName": "2) Framework-required, Single-file. (Purpose: Copy smallest)"
},
{
"choice": "FrameworkIncluded",
"description": "",
"displayName": "3) Framework-included. (Purpose: Installer)"
},
{
"choice": "FrameworkIncludedSingle",
"description": "See Single-file deployment. -> DOTNET_BUNDLE_EXTRACT_BASE_DIR",
"displayName": "4) Framework-included, Single-file. (Purpose: Copy large)"
},
{
"choice": "FrameworkIncludedSingleCompressed",
"description": "See Single-file deployment. -> DOTNET_BUNDLE_EXTRACT_BASE_DIR",
"displayName": "5) Framework-included, Single-file, Compressed. (Purpose: Copy medium)"
}
],
"defaultValue": "FrameworkRequiredSingle"
},
"Author": {
"type": "parameter",
"dataType": "string",
"replaces": "MyAuthor",
"description": "The author of the project.",
"displayName": "Author",
"isRequired": "true"
},
"Company": {
"type": "parameter",
"dataType": "string",
"defaultValue": "",
"replaces": "MyCompany",
"description": "The company of the project.",
"displayName": "Company"
},
"CompanyIsSet": {
"type": "computed",
"value": "(PackageCompany != \"\")"
},
"CopyrightYear": {
"type": "generated",
"generator": "now",
"replaces": "1975",
"parameters": {
"format": "yyyy"
}
},
"DateNowShort": {
"type": "generated",
"generator": "now",
"replaces": "1975-01-01",
"parameters": {
"format": "yyyy-MM-dd"
}
},
"AssemblyVersioningScheme": {
"type": "parameter",
"dataType": "bool",
"defaultValue": "true",
"description": "Generates assembly versioning scheme utilizing build and revision date.",
"displayName": "Automatic assembly versioning scheme."
},
"DefaultRename": {
"type": "derived",
"valueSource": "name",
"valueTransform": "WithoutTrailingNumbers",
"description": "A value derived from the 'name' param, used to rename Application1.cs",
"fileRename": "Default"
},
"DefaultSourceNameWithoutTrailingNumbers": {
"type": "derived",
"valueSource": "name",
"valueTransform": "WithoutTrailingNumbers",
"description": "A value derived from the 'name' param, used to rename Application1.cs",
"replaces" : "SourceNameWithoutTrailingNumbers"
},
"DefaultSourceNameRemoveDots": {
"type": "derived",
"valueSource": "name",
"valueTransform": "RemoveDots",
"description": "A value derived from the 'name' param, used to rename Application1.cs",
"replaces" : "SourceNameRemoveDots"
},
"ProfileOptimizationStartup": {
"type": "parameter",
"dataType": "bool",
"defaultValue": "true",
"description": "ProfileOptimization in startup.",
"displayName": "ProfileOptimization in startup."
},
"StartupMutex": {
"type": "parameter",
"dataType": "bool",
"defaultValue": "true",
"description": "Startup mutex.",
"displayName": "Startup mutex."
}
},
"guids": [
"8CDD8387-B905-44A8-B5D5-07BB50E05BEA",
"35BBE988-7105-4CF2-BF49-11DBD588309E",
"43DA960A-5EB3-4648-9643-7F837744A68C"
],
"forms": {
"WithoutTrailingNumbers": {
"identifier": "replace",
"pattern": "\\d+$", // regex to match every number at the end of the string
"replacement": "" // replace it with empty string
},
"RemoveDots": {
"identifier": "replace",
"pattern": "\\.", // regex to match every number at the end of the string
"replacement": "" // replace it with empty string
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UseWindowsForms>true</UseWindowsForms>
<DebugType>embedded</DebugType>
<!--#if (RuntimeIdentifier == win-x86) -->
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<!--#endif -->
<!--#if (RuntimeIdentifier == win-x64) -->
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<!--#endif -->
</PropertyGroup>

<!-- Specific package specs -->
<PropertyGroup>
<IsPackable>false</IsPackable>
<PublishRelease>false</PublishRelease>
</PropertyGroup>

<PropertyGroup>
<VersionMajor>0</VersionMajor>
<VersionMinor>1</VersionMinor>
<VersionBuild>0</VersionBuild>
<VersionRevision>0</VersionRevision>
<VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionBuild).$(VersionRevision)</VersionPrefix>
<VersionSuffix Condition="'$(Configuration)' == 'Debug'">prerelease</VersionSuffix>
<PackageVersion Condition="'$(VersionSuffix)' == ''">$(VersionPrefix)</PackageVersion>
<PackageVersion Condition="'$(VersionSuffix)' != ''">$(VersionPrefix)-$(VersionSuffix)</PackageVersion>
<InformationalVersion>$(PackageVersion)</InformationalVersion>
<AssemblyVersion>$(VersionPrefix)</AssemblyVersion>
</PropertyGroup>

<PropertyGroup>
<Authors>MyAuthor</Authors>
<!--#if (PackageCompany != '') -->
<Owners>MyCompany</Owners>
<!--#endif -->
<!--#if (PackageCompany == '') -->
<Owners>MyAuthor</Owners>
<!--#endif -->
<!--#if (PackageCompany != '') -->
<Company>MyCompany</Company>
<!--#endif -->
<!--#if (PackageCompany == '') -->
<Company></Company>
<!--#endif -->
<!--#if (PackageCompany != '') -->
<Copyright>Copyright © MyCompany 1975</Copyright>
<!--#endif -->
<!--#if (PackageCompany == '') -->
<Copyright>Copyright © MyAuthor 1975</Copyright>
<!--#endif -->
</PropertyGroup>

<!--#if (AssemblyVersioningScheme == true) -->
<Target Name="OverrideBuildRevision" BeforeTargets="GenerateNuspec" AfterTargets="BeforeBuild" >
<PropertyGroup>
<AssemblyVersionBaseTicks>$([MSBuild]::Subtract($([System.DateTime]::UtcNow.Ticks), 630822816000000000))</AssemblyVersionBaseTicks>
<TicksPerDay>$([System.TimeSpan]::TicksPerDay)</TicksPerDay>
<TicksPerSecond>$([System.TimeSpan]::TicksPerSecond)</TicksPerSecond>
<AssemblyVersionBuild>$([System.Math]::Truncate($([MSBuild]::Divide($(AssemblyVersionBaseTicks), $(TicksPerDay)))))</AssemblyVersionBuild>
<AssemblyVersionTotalSeconds>$([System.Math]::Truncate($([MSBuild]::Divide($(AssemblyVersionBaseTicks), $(TicksPerSecond)))))</AssemblyVersionTotalSeconds>
<AssemblyVersionRemainingSeconds>$([System.Math]::Truncate($([MSBuild]::Modulo($(AssemblyVersionTotalSeconds), 86400))))</AssemblyVersionRemainingSeconds>
<AssemblyVersionRevision>$([System.Math]::Truncate($([MSBuild]::Divide($(AssemblyVersionRemainingSeconds), 2))))</AssemblyVersionRevision>
<VersionBuild>$(AssemblyVersionBuild)</VersionBuild>
<VersionRevision>$(AssemblyVersionRevision)</VersionRevision>
<VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionBuild).$(VersionRevision)</VersionPrefix>
<PackageVersion Condition="'$(VersionSuffix)' == ''">$(VersionPrefix)</PackageVersion>
<PackageVersion Condition="'$(VersionSuffix)' != ''">$(VersionPrefix)-$(VersionSuffix)</PackageVersion>
<InformationalVersion>$(PackageVersion)</InformationalVersion>
<AssemblyVersion>$(VersionPrefix)</AssemblyVersion>
</PropertyGroup>
</Target>
<!--#endif -->

</Project>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit aa0b5c5

Please sign in to comment.