Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
Initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed Aug 5, 2021
1 parent 3f6829b commit 4c3b571
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<Project>
<PropertyGroup>
<Version>0.1.0.0</Version>
<Version>0.1.0</Version>
</PropertyGroup>

<PropertyGroup>
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
<ApplicationIcon>../resources/Madness.ico</ApplicationIcon>
<Authors>JustArchi</Authors>
<Company>JustArchiNET</Company>
<Copyright>Copyright © 202021-$([System.DateTime]::UtcNow.Year) JustArchiNET</Copyright>
<Description>TODO.</Description>
<Copyright>Copyright © 2021-$([System.DateTime]::UtcNow.Year) JustArchiNET</Copyright>
<Description>Madness embraces your project by including compatibility layer for selected APIs normally not available on .NET Framework target.</Description>
<Deterministic>true</Deterministic>
<ErrorReport>none</ErrorReport>
<LangVersion>latest</LangVersion>
Expand Down
2 changes: 2 additions & 0 deletions Madness/Madness.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PackageId>JustArchiNET.Madness</PackageId>
<Title>$(PackageId)</Title>
</PropertyGroup>

<ItemGroup>
Expand Down
63 changes: 63 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# ☠️ Madness

Madness embraces your project by including compatibility layer for selected APIs normally not available on .NET Framework target.

---

## How to use it

Add **[nuget package](https://www.nuget.org/packages/protobuf-net/)** to .NET Framework project of your choice. We support `netstandard2.0`, so .NET Framework 4.6.1 and newer.

Afterwards, in all files where you require assistance, include the reference:

```csharp
#if NETFRAMEWORK
using JustArchiNET.Madness;
#endif
```

Voila, madness has embraced your project.

---

## FAQ

### Do I need that `#if NETFRAMEWORK` clause?

If you're building only for .NET Framework exclusively, no, it's not required and actually useless for you.

However, if you're targetting multiple frameworks out of which only one is .NET Framework (e.g. `net5.0` and `net48`), then `#if` clause guarantees that madness won't embrace your other targets.

You don't want madness to embrace your other targets, do you?

### Including madness embraced stuff I didn't want to, like `File` or `Path`, what to do?

If you don't require madness in those aspects, tell C# compiler to use built-in classes in those places.

```csharp
using File = System.IO.File;
```

### And what if I do?

```csharp
using File = JustArchiNET.Madness.File;
```

### And if I need both?

Pick the one you use more often and ifdef the rest.

```csharp
using File = System.IO.File;

public static async Task Example() {
#if NETFRAMEWORK
await JustArchiNET.Madness.File.WriteAllTextAsync("example.txt", "example").ConfigureAwait(false);
#else
await File.WriteAllTextAsync("example.txt", "example").ConfigureAwait(false);
#endif
}
```

You **can** in theory call `Madness` parts exclusively, so the above is rather a "perfect" example for not affecting your other targets negatively. If you don't mind, you can call madness on both.
1 change: 1 addition & 0 deletions resources/ATTRIBUTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Skull icon made by **[Freepik](https://www.freepik.com)** from **[Flaticon](https://www.flaticon.com)**.
Binary file added resources/Madness.ico
Binary file not shown.
Binary file added resources/skull.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4c3b571

Please sign in to comment.