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

Commit

Permalink
Reorganized root directories
Browse files Browse the repository at this point in the history
- moved /local/bin to /lib/built
- moved /.build to /bin
- moved /msbuild-projects/Directory.Core.props to /Directory.Core.props
- deleted /msbuild-projects
- moved /.azure-pipelines to /.azure/pipelines
- fixed paths in nuke build project
- fixed paths in .msbuild
- /lib/README.md added
- fixed instructions in .azure\pipelines\README.MD
- rebuilt local binaries
- updated README.md's
  • Loading branch information
teneko committed Mar 26, 2021
1 parent 413c351 commit 3e95271
Show file tree
Hide file tree
Showing 23 changed files with 52 additions and 97 deletions.
2 changes: 1 addition & 1 deletion .azure-pipelines/README.MD → .azure/pipelines/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
You need to set the following environment variables ([Azure Artifacts Credential Provider](https://github.com/microsoft/artifacts-credprovider#environment-variables)) for being able to access local feeds in nuget, dotnet or msbuild:
```
NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED=true
# In Azure DevOps Variables UI you can left off the single quotes
# In Azure DevOps Variables UI you have to left off the single quotes
VSS_NUGET_EXTERNAL_FEED_ENDPOINTS='{"endpointCredentials":[{"endpoint":"https://pkgs.dev.azure.com/<username>/<project>/_packaging/<project_scope>/nuget/v3/index.json","username":"optional","password":"<private_access_token>"}]}'
```
You have to explicit set them in each task ([secrets](https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#secret-variables)) you are in need of the credentials:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:

- task: PowerShell@2
inputs:
filePath: '$(Build.SourcesDirectory)\.build\push-nuget-packages.ps1'
filePath: '$(Build.SourcesDirectory)\bin\push-nuget-packages.ps1'
arguments:
$(Build.StagingDirectory)\${{ variables.publishBuildArtifactsArtifactName }}\**\*.snupkg
-Arguments '$(nugetArguments) -ApiKey $Env:NUGET_ORG_APIKEY'
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:

- task: PowerShell@2
inputs:
filePath: '$(Build.SourcesDirectory)\.build\push-nuget-packages.ps1'
filePath: '$(Build.SourcesDirectory)\bin\push-nuget-packages.ps1'
arguments:
$(Build.StagingDirectory)\${{ variables.publishBuildArtifactsArtifactName }}\**\*.snupkg
-Arguments '$(nugetArguments)'
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ x64/
x86/
bld/
[Bb]in/
!/local/bin
!/bin
[Oo]bj/
[Ll]og/

Expand Down
4 changes: 2 additions & 2 deletions .msbuild
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ Licensed under the MIT license. See LICENSE file in the project root for full li
<RootBuildTargetsPath Condition="'$(RootBuildTargetsPath)' == ''">$(RootDirectory)\Directory.Build.targets</RootBuildTargetsPath>

<!-- /.msbuild-projects/ -->
<RootCorePropsPath Condition="'$(RootCorePropsPath)' == ''">$(RootDirectory)\.msbuild-projects\Directory.Core.props</RootCorePropsPath>
<RootCorePropsPath Condition="'$(RootCorePropsPath)' == ''">$(RootDirectory)\Directory.Core.props</RootCorePropsPath>

<!-- Teronis.NetStandard.Core -->
<TeronisNetStandardCoreDirectory Condition="'$(TeronisNetStandardCoreDirectory)' == ''">$(RootDirectory)\src\NetStandard\Core\Core\</TeronisNetStandardCoreDirectory>

<!-- Teronis.MSBuild.BuildTasks -->
<MSBuildBuildTasksAssemblyFile>$(RootDirectory)local\bin\Teronis.MSBuild.BuildTasks\Teronis.MSBuild.BuildTasks.dll</MSBuildBuildTasksAssemblyFile>
<MSBuildBuildTasksAssemblyFile>$(RootDirectory)lib\built\Teronis.MSBuild.BuildTasks\Teronis.MSBuild.BuildTasks.dll</MSBuildBuildTasksAssemblyFile>
<TeronisMSBuildBuildTasksTargetTasksTargetsFile>$(RootDirectory)src\MSBuild\BuildTasks\src\build\TargetTasks.targets</TeronisMSBuildBuildTasksTargetTasksTargetsFile>

<!-- Teronis.MSBuild.BuildTasks -->
Expand Down
13 changes: 0 additions & 13 deletions .msbuild-projects/IgnoresAccessChecksToAttribute.cs

This file was deleted.

File renamed without changes.
64 changes: 13 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,66 +2,28 @@
[![Custom badge](https://buildstats.info/nuget/Teronis.MSBuild.Packaging.ProjectBuildInPackage?includePreReleases=true)](https://www.nuget.org/packages?q=Teroneko+Teronis)
![Custom badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fteroneko%2Fa807e920ca2ee8d3e5749366d3528486%2Fraw%2F05805ebd5a26fb58cabb26a42bd6baf467822fd7%2Fpreview-badge.json)

# About
# Teronis.DotNet

Teronis.DotNet is a collection of some of my projects I've come up since 2018.
Teronis.DotNet consists of many projects. These are projects to solve common problems you may appear in daily programming.

## Packages
## Resources

All my projects are uploaded to [NuGet](https://www.nuget.org/packages?q=Teronis).
:package: [NuGet Packages](https://www.nuget.org/packages?q=Teronis)
<br />:briefcase: Projects

# Documentation
- [Teronis.Nullable](/src/Nullable) &nbsp; | &nbsp; :package: [NuGet Package](https://www.nuget.org/packages/Teronis.Nullable)
- ... (TBD)

:book: [Source Documentation](https://teroneko.de/docs/Teronis.DotNet/Microsoft.Extensions.DependencyInjection.html)
<br/>:1234: [Project Structure](/docs/ProjectStructure.md)

You can view the documentation of the projects at [https://teroneko.de/docs/Teronis.DotNet/](https://teroneko.de/docs/Teronis.DotNet/Microsoft.Extensions.DependencyInjection.html)
## Building

## Build Script

The build script `./build.cmd`|`./build.ps1`|`./build.sh` is a small application to assist in restoring, compiling, testing and packing all projects that can be found in this repository.

```
$ ./build.cmd --help
PowerShell Desktop version 5.1.18362.1171
Microsoft (R) .NET Core SDK version 5.0.103
███╗   ██╗██╗   ██╗██╗  ██╗███████╗
████╗  ██║██║   ██║██║ ██╔╝██╔════╝
██╔██╗ ██║██║   ██║█████╔╝ █████╗
██║╚██╗██║██║   ██║██╔═██╗ ██╔══╝
██║ ╚████║╚██████╔╝██║  ██╗███████╗
╚═╝  ╚═══╝ ╚═════╝ ╚═╝  ╚═╝╚══════╝
NUKE Execution Engine version 5.0.2 (Windows,.NETCoreApp,Version=v2.1)
Targets (with their direct dependencies):
Clean
Restore
Compile (default) -> Restore
Test -> Compile
Pack -> Compile
Parameters:
--configuration Configuration to build - Default is 'Debug' (local) or
'Release' (server).
--continue Indicates to continue a previously failed build attempt.
--help Shows the help text for this build assembly.
--host Host for execution. Default is 'automatic'.
--target List of targets to be executed. Default is 'Compile'.
--no-logo Disables displaying the NUKE logo.
--plan Shows the execution plan (HTML).
--root Root directory during build execution.
--skip List of targets to be skipped. Empty list skips all
dependencies.
--verbosity Logging verbosity during build execution. Default is
'Normal'.
```
*The build project has been created with [Nuke](https://github.com/nuke-build/nuke). Please visit and stare their awesome project. 🧡
The build script `./build.(cmd|ps1|sh)` is a small application to assist in restoring, compiling, testing and packing all projects that can be found in this repository.

## Contributing

Feel free to open an issue if you encounter any problems. Pull requests should be only applied if they are well described. I will do my best to answer as fast as I can. 🙂
Feel free to open an issue if you encounter any problems. Pull requests should be only applied if they are well described. I will do my best to answer as fast as I can. :slightly_smiling_face:

## Versioning

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
###########################################################################

$BuildProjectFile = "$PSScriptRoot\nukebuild\Teronis.Build.csproj"
$TempDirectory = "$PSScriptRoot\\.tmp"
$TempDirectory = "$PSScriptRoot\nukebuild\obj\.tmp"

$DotNetGlobalFile = "$PSScriptRoot\\global.json"
$DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1"
Expand Down
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
###########################################################################

BUILD_PROJECT_FILE="$SCRIPT_DIR/nukebuild/Teronis.Build.csproj"
TEMP_DIRECTORY="$SCRIPT_DIR//.tmp"
TEMP_DIRECTORY="$SCRIPT_DIR/nukebuild/obj/.tmp"

DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json"
DOTNET_GLOBAL_FILE="$SCRIPT_DIR/global.json"
DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh"
DOTNET_CHANNEL="Current"

Expand Down
11 changes: 11 additions & 0 deletions docs/ProjectStructure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Project Structure

- **/Teronis.DotNet.sln** covers all projects in this project.
- **/Teronis.DotNet~Publish.sln** covers projects that are candidates to be published to NuGet. When calling `./build.(cmd|ps1|sh) pack` you can find packages in **/obj/packages/**.
- **/lib/**
- **/lib/built/**: [/lib/README.md](/lib/README.md)
- **/nukebuild/** represents the build project. It has been created with [Nuke](https://github.com/nuke-build/nuke). Please visit and stare their awesome project. :heart:
- **/bin/**
- **/bin/git-clean-everything.sh** is a **destructive** helper script that **erases everything** that is affected by [.gitignore](/.gitignore).
- **/bin/push-nuget-packages.ps1** is a helper script invoked in Azure pipeline. Does what is says.
- **/src/** contains all source projects.
5 changes: 5 additions & 0 deletions lib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Folder **built/**

The folder **built/** contains binaries compiled once. They are needed in process of building the projects. You can rebuild them by `/build.(cmd|ps1|sh) cleanbinary compilebinary` where the target `cleanbinary` cleans the built-folder and the target `compilebinary` compiles them.

This approach is better than the approach to implement an incremental build safe process for creating these binaries dynamically before building projects in Visual Studio or aquivalent.
Binary file not shown.
1 change: 0 additions & 1 deletion nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="nuget.azure" value="https://pkgs.dev.azure.com/teroneko/Teronis.DotNet/_packaging/nuget.local/nuget/v3/index.json" />
<add key="nuget.github" value="https://nuget.pkg.github.com/teroneko/index.json" />
</packageSources>
<disabledPackageSources>
<clear />
Expand Down
11 changes: 5 additions & 6 deletions nukebuild/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class Build : NukeBuild
[Solution("Teronis.DotNet~Publish.sln")]
readonly Solution PublishSolution;


//[GitRepository] readonly GitRepository GitRepository;

// GITVERSION... Forces "... process is used by another process"...
Expand All @@ -46,8 +45,7 @@ class Build : NukeBuild

AbsolutePath SourceDirectory => RootDirectory / "src";
AbsolutePath PackagesDirectory => RootDirectory / "obj" / "packages";
AbsolutePath LocalDirectory => RootDirectory / "local";
AbsolutePath LocalBinDirectory => LocalDirectory / "bin";
AbsolutePath LibBuiltDirectory => RootDirectory / "lib/built";

Target Clean => _ => _
.Before(Restore)
Expand All @@ -70,8 +68,9 @@ class Build : NukeBuild
});

Target CleanBinary => _ => _
.Before(CompileBinary)
.Executes(() => {
DeleteDirectory(LocalDirectory);
DeleteDirectory(LibBuiltDirectory);
});

Target CompileBinary => _ => _
Expand All @@ -84,13 +83,13 @@ class Build : NukeBuild
return;
}

var binaryDirectory = LocalBinDirectory / project.Name;
var binaryDirectory = LibBuiltDirectory / project.Name;

DotNetPublish(s => s
.SetProject(project)
.SetConfiguration(Configuration.Release)
.SetOutput(binaryDirectory)
// We assume that every local binary project supports net5.0.
// We assume that every local binary project supports net472.
.SetFramework("net472")
.EnableNoRestore());
});
Expand Down
12 changes: 0 additions & 12 deletions src/NetStandard/Core/Core/src/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,3 @@
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("Teronis.NetStandard.Collections")]
[assembly: IgnoresAccessChecksTo("Teronis.Nullable")]

[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
AssemblyName = assemblyName;
}

public string AssemblyName { get; }
}
14 changes: 9 additions & 5 deletions src/Nullable/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# Teronis.Nullable [![Nuget](https://img.shields.io/nuget/v/Teronis.Nullable)](https://www.nuget.org/packages/Teronis.Nullable)

> :warning: The project Teronis.Nullable is a fork of [Nullable][Nullable]. In fact the project Nullable is in the SDK format but the package creation is not in the SDK format and uses nuget.exe directly. This fork has just moved the NuGet part to the new SDK format. Morover is the the unattractive and separate build process obsolete now. The project Teronis.Nullable is in such a way designed to be includable by ProjectReference and is heavily used by Teronis.Dotnet.
>
> **When you face any issues with Teronis.Nullable please do not open an issue in [Nullable][Nullable] but open an issue here.**
_Use .NET Core 3.0's new nullable attributes in older target frameworks._

[:running: Quickstart](#quickstart) &nbsp; | &nbsp; [:books: Guides](https://github.com/manuelroemer/Nullable/wiki) &nbsp; | &nbsp; [:package: NuGet](https://www.nuget.org/packages/nullable)

## Prologue

This project (Teronis.Nullable) is a fork of [Nullable][Nullable]. In fact the project Nullable is in the SDK format but the package creation is not in the SDK format and uses nuget.exe directly. This fork has just moved the NuGet part to the new SDK format. Morover is the the unattractive and separate build process obsolete now. The project Teronis.Nullable is in such a way designed to be includable by ProjectReference and is heavily used by Teronis.Dotnet.

**When you face any issues with Teronis.Nullable please do not open an issue in the repository of Nullable but open an issue [here](https://github.com/teroneko/Teronis.DotNet/issues).**

## About Teronis.Nullable

With the release of C# 8.0, support for [nullable reference types](https://docs.microsoft.com/en-us/dotnet/csharp/tutorials/nullable-reference-types)
has been added to the language.
Futhermore, .NET Core 3.0 added [new nullable attributes](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis?view=netcore-3.0)
Expand Down Expand Up @@ -39,7 +43,7 @@ code.

| .NET Standard 2.0 | .NET Standard 2.1 |
| ----------------- | ----------------- |
| ![.NET Standard 2.0](.github/CompiledNetStandard2.0.png) | ![.NET Standard 2.1](.github/CompiledNetStandard2.1.png) |
| ![.NET Standard 2.0](img/CompiledNetStandard2.0.png) | ![.NET Standard 2.1](img/CompiledNetStandard2.1.png) |


## Compatibility
Expand Down
Binary file added src/Nullable/img/CompiledNetStandard2.0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Nullable/img/CompiledNetStandard2.1.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 3e95271

Please sign in to comment.