-
-
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 - Add support and showcase determining install time devlooped/oss@717ddb1 - Add our implementation of JWT manifest reading and reporting devlooped/oss@a0ae727 - Rename sample assemblies for nicer display devlooped/oss@93df7c7 - Fix path to jwk.ps1 alongside the SponsorLink.targets devlooped/oss@c4830fc - Minor code simplification devlooped/oss@cf154d5 - Improve versioning of sample package devlooped/oss@3b943f5 - Update to newest JsonWebTokens devlooped/oss@068140b - Remove dependency on ThisAssembly devlooped/oss@c879f25 - Add nullable and generated code annotations devlooped/oss@b2a11fa - Minimal docs on consuming devlooped/oss@827a1d1 - Dynamically fetch devlooped JWK from github devlooped/oss@55124bc - Add targets for inclusion from tests devlooped/oss@81ba912 - Whitespace and formatting devlooped/oss@d74f511 - Switch to built-in item metadata for manifest analyzer files devlooped/oss@49c9a38 - Simplify and unify manifest reading implementation devlooped/oss@4fca946 - Change debug traces location to the well-known location of .sponsorlink devlooped/oss@1019e2a - Upload binlog artifact on debug runs devlooped/oss@a67ae78 - 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 - 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 b14a716
Showing
47 changed files
with
2,783 additions
and
22 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,44 @@ | ||
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.GetStatus(Funding.Product); | ||
if (installed != default) | ||
Tracing.Trace($"Status: {status}, Installed: {(DateTime.Now - installed).Humanize()} ago"); | ||
else | ||
Tracing.Trace($"Status: {status}, unknown install time"); | ||
}); | ||
} | ||
} |
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.