-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# devlooped/oss - Rename sample assemblies for nicer display devlooped/oss@93df7c7 - Make sure Funding class is available to intellisense devlooped/oss@5813f21 - Add support and showcase determining install time devlooped/oss@717ddb1 - Introduce lazy-init of sponsoring status, simplify diagnostics devlooped/oss@5009784 - Fix path to jwk.ps1 alongside the SponsorLink.targets devlooped/oss@c4830fc - Add our implementation of JWT manifest reading and reporting devlooped/oss@a0ae727 - Minimal docs on consuming devlooped/oss@827a1d1 - Make sure we report only once per product for entire solution devlooped/oss@4b7f922 - Update to newest JsonWebTokens devlooped/oss@068140b - Improve versioning of sample package devlooped/oss@3b943f5 - Add nullable and generated code annotations devlooped/oss@b2a11fa - Remove dependency on ThisAssembly devlooped/oss@c879f25 - Dynamically fetch devlooped JWK from github devlooped/oss@55124bc - Whitespace and formatting devlooped/oss@d74f511 - Replace JWT package in tests targets too devlooped/oss@ba1310c - Simplify and unify manifest reading implementation devlooped/oss@4fca946 - Fix formatting/whitespace devlooped/oss@7febebc - Upload binlog artifact on debug runs devlooped/oss@a67ae78 - Remove unused tracing overloads devlooped/oss@08a8488 - Set env:gh_token if present as secret devlooped/oss@97ebd18 - Update to checkout@v4 devlooped/oss@5fb1723 - Cleanup build and publish to use VersionLabel devlooped/oss@14deaea - Update dotnet-file.yml with fix to create pull request action devlooped/oss@11a331d - Don't add random wait on manual dotnet-file runs devlooped/oss@7afe350 - Bump create-pr dependency to avoid error with existing PRs devlooped/oss@11a8757 - Only commit markdown files when resolving includes devlooped/oss@2c10a83 - Update sponsor.yml to use org-access token devlooped/oss@96ca2b1 - Only ignore App folder directly under the root devlooped/oss@02811fa - Add static usings to allow unprefixed ThrowXxxx devlooped/oss@6dfe21f - Add compatibility for non-SDK projects without InitializeSourceControlInformation target devlooped/oss@6e96c59 - Set Version from VersionLabel if it's a refs/tags/ devlooped/oss@57653a2
- Loading branch information
1 parent
f2dcabd
commit 7908d56
Showing
48 changed files
with
2,920 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
bin | ||
app | ||
obj | ||
artifacts | ||
pack | ||
TestResults | ||
results | ||
BenchmarkDotNet.Artifacts | ||
/app | ||
.vs | ||
.vscode | ||
.idea | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<AssemblyName>SponsorableLib.Analyzers</AssemblyName> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<IsRoslynComponent>true</IsRoslynComponent> | ||
<PackFolder>analyzers/dotnet/roslyn4.0</PackFolder> | ||
<PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
<CustomAfterMicrosoftCSharpTargets>$(MSBuildThisFileDirectory)..\SponsorLink.targets</CustomAfterMicrosoftCSharpTargets> | ||
<MergeAnalyzerAssemblies>true</MergeAnalyzerAssemblies> | ||
<ImplicitUsings>disable</ImplicitUsings> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="NuGetizer" Version="1.2.2" /> | ||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.3.1" Pack="false" /> | ||
<PackageReference Include="PolySharp" Version="1.14.1" PrivateAssets="all" /> | ||
<PackageReference Include="ThisAssembly.AssemblyInfo" Version="1.4.3" PrivateAssets="all" /> | ||
<PackageReference Include="ThisAssembly.Git" Version="1.4.3" PrivateAssets="all" /> | ||
<PackageReference Include="ThisAssembly.Constants" Version="1.4.3" PrivateAssets="all" /> | ||
<PackageReference Include="ThisAssembly.Strings" Version="1.4.3" PrivateAssets="all" /> | ||
<PackageReference Include="ThisAssembly.Project" Version="1.4.3" PrivateAssets="all" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<InternalsVisibleTo Include="Tests" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Update="buildTransitive\SponsorableLib.targets" Pack="true" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Remove="C:\Code\devlooped.oss\src\SponsorLink\SponsorLink\ThisAssembly.cs" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"profiles": { | ||
"SponsorableLib": { | ||
"commandName": "DebugRoslynComponent", | ||
"targetProject": "..\\Tests\\Tests.csproj", | ||
"environmentVariables": { | ||
"SPONSORLINK_TRACE": "true" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using System; | ||
using System.Collections.Immutable; | ||
using System.IO; | ||
using System.Linq; | ||
using Devlooped.Sponsors; | ||
using Humanizer; | ||
using Microsoft.CodeAnalysis; | ||
using Microsoft.CodeAnalysis.Diagnostics; | ||
using static Devlooped.Sponsors.SponsorLink; | ||
|
||
namespace Analyzer; | ||
|
||
[DiagnosticAnalyzer(LanguageNames.CSharp, LanguageNames.VisualBasic)] | ||
public class StatusReportingAnalyzer : DiagnosticAnalyzer | ||
{ | ||
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(new DiagnosticDescriptor( | ||
"SL001", "Report Sponsoring Status", "Reports sponsoring status determined by SponsorLink", "Sponsors", | ||
DiagnosticSeverity.Warning, true)); | ||
|
||
public override void Initialize(AnalysisContext context) | ||
{ | ||
context.EnableConcurrentExecution(); | ||
context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None); | ||
|
||
context.RegisterCompilationAction(c => | ||
{ | ||
var installed = c.Options.AdditionalFiles.Where(x => | ||
{ | ||
var options = c.Options.AnalyzerConfigOptionsProvider.GetOptions(x); | ||
// In release builds, we'll have a single such item, since we IL-merge the analyzer. | ||
return options.TryGetValue("build_metadata.Analyzer.ItemType", out var itemType) && | ||
options.TryGetValue("build_metadata.Analyzer.NuGetPackageId", out var packageId) && | ||
itemType == "Analyzer" && | ||
packageId == "SponsorableLib"; | ||
}).Select(x => File.GetLastWriteTime(x.Path)).OrderByDescending(x => x).FirstOrDefault(); | ||
var status = Diagnostics.GetOrSetStatus(() => c.Options); | ||
if (installed != default) | ||
Tracing.Trace($"Status: {status}, Installed: {(DateTime.Now - installed).Humanize()} ago"); | ||
else | ||
Tracing.Trace($"Status: {status}, unknown install time"); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Devlooped.Sponsors; | ||
using Microsoft.CodeAnalysis; | ||
using static Devlooped.Sponsors.SponsorLink; | ||
|
||
namespace Analyzer; | ||
|
||
[Generator] | ||
public class StatusReportingGenerator : IIncrementalGenerator | ||
{ | ||
public void Initialize(IncrementalGeneratorInitializationContext context) | ||
{ | ||
context.RegisterSourceOutput( | ||
context.GetSponsorManifests(), | ||
(spc, source) => | ||
{ | ||
var status = Diagnostics.GetOrSetStatus(source); | ||
spc.AddSource("StatusReporting.cs", $"// Status: {status}"); | ||
}); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/SponsorLink/Analyzer/buildTransitive/SponsorableLib.targets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="Devlooped.Sponsors.targets"/> | ||
<ItemGroup> | ||
<!-- Brings in the analyzer file to report installation time --> | ||
<SponsorablePackageId Include="SponsorableLib" /> | ||
</ItemGroup> | ||
</Project> |
Oops, something went wrong.