-
Notifications
You must be signed in to change notification settings - Fork 150
AspectsGenerator refactor #5078
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
50e8032
Initial implementation
daniel-romano-DD 0f9af1c
New definition fixes
daniel-romano-DD a2c2117
Fixes to arrays generation
daniel-romano-DD 0db6c52
Made "Default" the default aspect type if none specified, to delegate…
daniel-romano-DD cb41312
Adopted Net 8 array syntax
daniel-romano-DD aaf8ea4
Used explicit declaration
daniel-romano-DD File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
364 changes: 206 additions & 158 deletions
364
tracer/src/Datadog.Trace.SourceGenerators/AspectsDefinitions/AspectsDefinitionsGenerator.cs
Large diffs are not rendered by default.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
tracer/src/Datadog.Trace.SourceGenerators/AspectsDefinitions/Constants.cs
This file was deleted.
Oops, something went wrong.
67 changes: 0 additions & 67 deletions
67
tracer/src/Datadog.Trace.SourceGenerators/AspectsDefinitions/Helpers.cs
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
30 changes: 30 additions & 0 deletions
30
tracer/src/Datadog.Trace.SourceGenerators/EmbeddedSources.cs
This file contains hidden or 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,30 @@ | ||
// <copyright file="EmbeddedSources.cs" company="Datadog"> | ||
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc. | ||
// </copyright> | ||
|
||
using System; | ||
using System.IO; | ||
using System.Reflection; | ||
using System.Text; | ||
|
||
namespace Datadog.Trace.SourceGenerators; | ||
|
||
internal static partial class EmbeddedSources | ||
{ | ||
private static readonly Assembly ThisAssembly = typeof(EmbeddedSources).Assembly; | ||
|
||
internal static string LoadEmbeddedResource(string resourceName) | ||
{ | ||
var resourceStream = ThisAssembly.GetManifestResourceStream(resourceName); | ||
if (resourceStream is null) | ||
{ | ||
var existingResources = ThisAssembly.GetManifestResourceNames(); | ||
throw new ArgumentException($"Could not find embedded resource {resourceName}. Available names: {string.Join(", ", existingResources)}"); | ||
} | ||
|
||
using var reader = new StreamReader(resourceStream, Encoding.UTF8); | ||
|
||
return reader.ReadToEnd(); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't needed I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is If I want to add the sources to compilation on the fly. Something left for next improvement