Skip to content

Commit

Permalink
Merge pull request #16 from marcominerva/develop
Browse files Browse the repository at this point in the history
Add Source Link support
  • Loading branch information
marcominerva authored Sep 28, 2022
2 parents c1bcd11 + ca0b0d9 commit a0aecc7
Show file tree
Hide file tree
Showing 8 changed files with 134 additions and 47 deletions.
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ csharp_prefer_static_local_function = true:suggestion
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent

# Code-block preferences
csharp_style_prefer_top_level_statements = true:suggestion
csharp_prefer_braces = true:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_style_namespace_declarations = file_scoped:suggestion
Expand Down Expand Up @@ -193,6 +194,7 @@ csharp_space_between_square_brackets = false
# Wrapping preferences
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true
csharp_style_prefer_utf8_string_literals = true:suggestion

#### Naming styles ####

Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: CodeQL

on:
push:
branches-ignore: [ master ]
paths: [ 'src/**' ]
pull_request:
branches: [ master, develop]
paths: [ 'src/**' ]
workflow_dispatch:
schedule:
- cron: '0 0 1,15 * *'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'csharp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# 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
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ?? Command-line programs to run using the OS shell.
# ?? See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
6 changes: 3 additions & 3 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ name: Lint Code Base
#############################
on:
push:
branches-ignore: [master]
branches-ignore: [ master ]
# Remove the line above to run when pushing to master
paths: [ 'src/**' ]
pull_request:
branches: [master]
branches: [ master, develop ]
paths: [ 'src/**' ]
workflow_dispatch:

Expand All @@ -31,7 +31,7 @@ jobs:
# Checkout the code base #
##########################
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.

- name: Setup .NET Core SDK ${{ env.NET_VERSION }}
- name: Setup .NET SDK ${{ env.NET_VERSION }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.NET_VERSION }}
Expand Down
8 changes: 7 additions & 1 deletion MinimalHelpers.Routing.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.editorconfig = .editorconfig
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MinimalSample.Handlers", "samples\MinimalSample.Handlers\MinimalSample.Handlers.csproj", "{871982DC-EBA8-4BAE-A436-42C5E00E3BA1}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MinimalSample.Handlers", "samples\MinimalSample.Handlers\MinimalSample.Handlers.csproj", "{871982DC-EBA8-4BAE-A436-42C5E00E3BA1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{72739819-7239-4B73-86BF-1E944D123C88}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -36,6 +38,10 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{E2C81EC8-A32D-4241-9661-DE2A97E9798F} = {72739819-7239-4B73-86BF-1E944D123C88}
{871982DC-EBA8-4BAE-A436-42C5E00E3BA1} = {72739819-7239-4B73-86BF-1E944D123C88}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {38B57A92-6EA7-4B79-8400-F4BE44873C46}
EndGlobalSection
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Minimal APIs Routing Helpers

[![GitHub Super-Linter](https://github.com/marcominerva/MinimalHelpers.Routing/workflows/Lint%20Code%20Base/badge.svg)](https://github.com/marketplace/actions/super-linter)
[![Lint Code Base](https://github.com/marcominerva/MinimalHelpers.Routing/actions/workflows/linter.yml/badge.svg)](https://github.com/marcominerva/MinimalHelpers.Routing/actions/workflows/linter.yml)
[![Nuget](https://img.shields.io/nuget/v/MinimalHelpers.Routing)](https://www.nuget.org/packages/MinimalHelpers.Routing)
[![Nuget](https://img.shields.io/nuget/dt/MinimalHelpers.Routing)](https://www.nuget.org/packages/MinimalHelpers.Routing)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/marcominerva/MinimalHelpers.Routing/blob/master/LICENSE)

A library that provides Routing helpers for Minimal API projects.
A library that provides Routing helpers for Minimal API projects, mainly for automatic endpoints registration.

**Installation**

Expand Down
2 changes: 2 additions & 0 deletions samples/MinimalSample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@

app.UseHttpsRedirection();

// Maps all the endpoints within this Assembly.
app.MapEndpoints();

// Maps all the endpoints within the same Assembly of the specified type.
app.MapEndpointsFromAssemblyContaining<SuppliersHandler>();

// You can further decide what types to map using a predicate:
Expand Down
89 changes: 50 additions & 39 deletions src/MinimalHelpers.Routing/MinimalHelpers.Routing.csproj
Original file line number Diff line number Diff line change
@@ -1,46 +1,57 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<DocumentationFile>MinimalHelpers.Routing.xml</DocumentationFile>
<Authors>Marco Minerva</Authors>
<Company>Marco Minerva</Company>
<Product>Routing Helpers for Minimal APIs</Product>
<Title>Routing Helpers for Minimal APIs</Title>
<Description>A library that provides Routing helpers for Minimal API projects</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/marcominerva/MinimalHelpers.Routing</PackageProjectUrl>
<PackageIcon>Toolbox.png</PackageIcon>
<PackageTags>csharp visual-studio aspnetcore minimalapi routing utilities helpers</PackageTags>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/marcominerva/MinimalHelpers.Routing.git</RepositoryUrl>
<RepositoryBranch>master</RepositoryBranch>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<DocumentationFile>MinimalHelpers.Routing.xml</DocumentationFile>
<Authors>Marco Minerva</Authors>
<Company>Marco Minerva</Company>
<Product>Routing Helpers for Minimal APIs</Product>
<Title>Routing Helpers for Minimal APIs</Title>
<Description>A library that provides Routing helpers for Minimal API projects, mainly for automatic endpoints registration</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/marcominerva/MinimalHelpers.Routing</PackageProjectUrl>
<PackageIcon>Toolbox.png</PackageIcon>
<PackageTags>csharp visual-studio aspnetcore minimalapi routing utilities helpers</PackageTags>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/marcominerva/MinimalHelpers.Routing.git</RepositoryUrl>
<RepositoryBranch>master</RepositoryBranch>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<DebugType>embedded</DebugType>
</PropertyGroup>

<ItemGroup>
<None Remove="MinimalHelpers.Routing.xml" />
</ItemGroup>
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
<None Remove="MinimalHelpers.Routing.xml" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.5.108">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\Toolbox.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.5.113">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<None Include="..\..\Toolbox.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>

0 comments on commit a0aecc7

Please sign in to comment.