Skip to content

Commit

Permalink
Prepare switch to .NET 8
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollo3zehn committed Feb 21, 2024
1 parent 187230d commit 40aad90
Show file tree
Hide file tree
Showing 48 changed files with 484 additions and 1,313 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# How to format:
# (1) Add dotnet_diagnostic.XXXX.severity = error
# (2) Run dotnet-format: dotnet format --diagnostics XXXX

[*.cs]
# "run cleanup": https://betterprogramming.pub/enforce-net-code-style-with-editorconfig-d2f0d79091ac
# TODO: build real editorconfig file: https://github.com/dotnet/roslyn/blob/main/.editorconfig
Expand Down
Empty file modified .gitignore
100644 → 100755
Empty file.
16 changes: 16 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"--project",
"${workspaceFolder}/src/Minimail/Minimail.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## v1.0.0-beta.2 - 2020-01-01

### Breaking Changes
-

### Features
-

### Bugs Fixed
-

> [See API changes on Fuget.org](http://link_here)
## v1.0.0-beta.1 - 2020-01-01

### Breaking Changes
-

### Features
-

### Bugs Fixed
-

> [See API changes on Fuget.org](http://link_here)
16 changes: 7 additions & 9 deletions Directory.Build.props
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@

<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworkVersion>net6.0</TargetFrameworkVersion>
<TargetFrameworkVersion>net8.0</TargetFrameworkVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>

<PropertyGroup>
<ArtifactsPath>$([MSBuild]::NormalizePath($(MSBuildThisFileDirectory)artifacts))</ArtifactsPath>
<BaseIntermediateOutputPath>$(ArtifactsPath)/obj/$(MSBuildProjectName)</BaseIntermediateOutputPath>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)/$(Configuration)</IntermediateOutputPath>
<OutputPath>$(ArtifactsPath)/bin/$(MSBuildProjectName)/$(Configuration)</OutputPath>
<PackageOutputPath>$(ArtifactsPath)/packages</PackageOutputPath>
<LangVersion>latest</LangVersion>
<RestoreAdditionalProjectSources>
https://www.myget.org/F/apollo3zehn-dev/api/v3/index.json
</RestoreAdditionalProjectSources>
<UseArtifactsOutput>true</UseArtifactsOutput>
<ArtifactsPath>$(MSBuildThisFileDirectory)artifacts</ArtifactsPath>
</PropertyGroup>

</Project>
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/aspnet:6.0
FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /app
COPY app .
CMD ./Minimail
Empty file modified build/create_tag_body.py
100644 → 100755
Empty file.
1 change: 0 additions & 1 deletion build/print_solution.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@
PACKAGELICENSEEXPRESSION={solution_data["license"]}
PACKAGEPROJECTURL={solution_data["project-url"]}
REPOSITORYURL={solution_data["repository-url"]}
PACKAGEICONURL={solution_data["icon-url"]}
""")
4 changes: 2 additions & 2 deletions build/print_version.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

build = sys.argv[1]
is_final_build = sys.argv[2] == "true"
as_pypi_version = sys.argv[3] == "true"
version_type = sys.argv[3]

if is_final_build:
build = None

print(version.get_version(build, as_pypi_version))
print(version.get_version(build, version_type))
28 changes: 20 additions & 8 deletions build/release.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import itertools
import subprocess
import sys
import re
Expand Down Expand Up @@ -38,18 +37,31 @@
if final_version in (release["name"] for release in releases):
raise Exception(f"Release {final_version} already exists.")

print(" unique release: OK")
print(" unique release: OK")

# prompt for annotation
print("Please enter the release message (type 'quit' to stop):")
lines = itertools.takewhile(lambda x: x.strip() != "quit" and x.strip() != "quit()", sys.stdin)
release_message = "".join(lines).rstrip('\n')
# get annotation
with open("CHANGELOG.md") as file:
changelog = file.read()

matches = list(re.finditer(r"^##\s(.*?)\s-\s[0-9]{4}-[0-9]{2}-[0-9]{2}(.*?)(?=(?:\Z|^##\s))", changelog, re.MULTILINE | re.DOTALL))

if not matches:
raise Exception(f"The file CHANGELOG.md is malformed.")

match_for_version = next((match for match in matches if match[1] == final_version), None)

if not match_for_version:
raise Exception(f"No change log entry found for version {final_version}.")

release_message = match_for_version[2].strip()

print("extract annotation: OK")

# create tag
subprocess.check_output(["git", "tag", "-a", final_version, "-m", release_message, "--cleanup=whitespace"], stdin=None, stderr=None, shell=False)

print(" create tag: OK")
print(" create tag: OK")

# push tag
subprocess.check_output(["git", "push", "--quiet", "origin", final_version], stdin=None, stderr=None, shell=False)
print(" push tag: OK")
print(" push tag: OK")
6 changes: 3 additions & 3 deletions build/version.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
from typing import Optional


def get_version(build: Optional[str], as_pypi_version: bool = False) -> str:
def get_version(build: Optional[str], version_type: str = "default") -> str:

with open("version.json", "r") as fh:
version_data = json.load(fh)

# version
version = version_data["version"]
suffix = version_data["suffix"]
Expand All @@ -17,7 +17,7 @@ def get_version(build: Optional[str], as_pypi_version: bool = False) -> str:
if build:

# PEP440 does not support SemVer versioning (https://semver.org/#spec-item-9)
if as_pypi_version:
if version_type == "pypi":
version = f"{version}{int(build):03d}"

else:
Expand Down
4 changes: 3 additions & 1 deletion src/Directory.Build.Props → src/Directory.Build.props
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project>

<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />

<Import Project="Directory.Build.props.overrides" Condition="exists('Directory.Build.props.overrides')" />

<PropertyGroup>
<DebugSymbols>true</DebugSymbols>
<DebugType>embedded</DebugType>
Expand All @@ -10,6 +11,7 @@
</PropertyGroup>

<PropertyGroup Condition="$(VERSION) != ''">
<InformationalVersion>$(VERSION)+$(GITHUB_SHA)</InformationalVersion>
<AssemblyVersion>$(VERSION.Split('.')[0]).0.0.0</AssemblyVersion>
<FileVersion>$(VERSION.Split('.')[0]).$(VERSION.Split('.')[1]).$(VERSION.Split('.')[2].Split('-')[0]).0</FileVersion>
</PropertyGroup>
Expand Down
10 changes: 0 additions & 10 deletions src/Minimail/App.razor

This file was deleted.

21 changes: 21 additions & 0 deletions src/Minimail/Components/App.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base href="/" />
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" />
<link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" />
<link rel="stylesheet" href="Minimail.styles.css" />
<script src="https://cdn.tailwindcss.com"></script>
<HeadOutlet />
</head>

<body>
<Routes />
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
<script src="_framework/blazor.web.js"></script>
</body>

</html>
13 changes: 13 additions & 0 deletions src/Minimail/Components/Layout/MainLayout.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@inherits LayoutComponentBase

<MudThemeProvider/>
<MudDialogProvider/>
<MudSnackbarProvider/>

@Body

<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
Loading

0 comments on commit 40aad90

Please sign in to comment.