Skip to content

Commit

Permalink
Major buildtime/runtime refactoring wip
Browse files Browse the repository at this point in the history
  • Loading branch information
pamidur committed Sep 25, 2024
1 parent f32c163 commit 810a194
Show file tree
Hide file tree
Showing 78 changed files with 617 additions and 783 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
fetch-depth: 0
- uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
dotnet-version: 6.0.x
- uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x
- name: Get version
run: echo "app_version=`git describe --tags`" >> $GITHUB_ENV
- name: Get release status
Expand All @@ -35,17 +35,11 @@ jobs:
run: dotnet build -c $app_conf -p:Version=$app_version -p:InformationalVersion="$app_version:$GITHUB_SHA"
- name: Test net6
run: dotnet test -c $app_conf --no-build -f net6.0
- name: Test netcore3
run: dotnet test -c $app_conf --no-build -f netcoreapp3.1
- name: Test net8
run: dotnet test -c $app_conf --no-build -f net8.0
- name: Pack
env:
CODESIGN_CERT: ${{ secrets.CODESIGN_PEM }}
working-directory: nuget
run: |
echo "$CODESIGN_CERT" > cert.pem
chmod +x ./rcodesign
dotnet pack -c $app_conf --no-build -o `pwd`/artifacts -p:Version=$app_version -p:CommitSHA=$GITHUB_SHA -p:OSXCertPath=cert.pem
rm cert.pem
run: dotnet pack -c $app_conf --no-build -o `pwd`/artifacts -p:Version=$app_version -p:CommitSHA=$GITHUB_SHA
- uses: actions/upload-artifact@v1
with:
name: artifacts
Expand All @@ -55,4 +49,4 @@ jobs:
env:
NUGETKEY: ${{ secrets.NUGET_KEY }}
working-directory: nuget/artifacts
run: dotnet nuget push ./AspectInjector.$app_version.nupkg -s $nuget_url -k $NUGETKEY
run: dotnet nuget push ./*.nupkg -s $nuget_url -k $NUGETKEY
40 changes: 0 additions & 40 deletions .github/workflows/samples.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*.sln.docstates

# Build results
[Aa]rtifacts/
_assemblycache/
packagebuildplace/
[Dd]ebug/
Expand Down
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
},
"search.exclude": {
"**/obj": true
},
"dotnet-test-explorer.testProjectPath":"tests/**/*.Tests.*.csproj",
}
}
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"${workspaceFolder}/tests/AspectInjector.Tests.Runtime/AspectInjector.Tests.Runtime.csproj",
"/property:GenerateFullPaths=true",
"/p:AspectInjector_Debug=true",
"/p:_ASI_Verbose=true",
"/p:AspectInjector_Verbose=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile",
Expand Down
File renamed without changes.
270 changes: 175 additions & 95 deletions AspectInjector.sln

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<Project>
<PropertyGroup>
<Product>Aspect Injector</Product>
<Authors>Aspect Injector Contributors</Authors>
<Company>Aspect Injector Contributors</Company>
<LangVersion>12.0</LangVersion>
<PackageIcon>package.png</PackageIcon>
<PackageProjectUrl>https://github.com/pamidur/aspect-injector</PackageProjectUrl>
<RepositoryUrl>https://github.com/pamidur/aspect-injector</RepositoryUrl>
<PackageIconUrl>https://raw.githubusercontent.com/pamidur/aspect-injector/master/package.png</PackageIconUrl>
<RepositoryType>git</RepositoryType>
<RepositoryCommit>$(CommitSHA)</RepositoryCommit>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<Version>0.0.0</Version>
<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)AspectInjector-Key.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ErrorProne.NET.Structs" Version="0.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="IsExternalInit" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Required" Version="1.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)package.png" Pack="true" PackagePath="\" Visible="false"/>
</ItemGroup>
</Project>
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>2.0.4</Version>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<PackageTags>aspect cache memorycache method methodcache</PackageTags>
<Description>
This package provides cache aspect for your methods. Put [MemoryCache(seconds)] attribure on your methods. And enjoy hassle-free memory cache for your methods.
Expand All @@ -13,9 +11,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="3.1.22" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="3.1.22" />
<PackageReference Include="System.Text.Json" Version="4.7.2" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="3.1.32" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="3.1.32" />
<PackageReference Include="System.Text.Json" Version="6.0.9" />
</ItemGroup>

</Project>
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions aspects/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project>
<PropertyGroup>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<IsPackable>true</IsPackable>
</PropertyGroup>

<PropertyGroup>
<AspectInjector_Location>$(MSBuildThisFileDirectory)../src/AspectInjector/bin/$(Configuration)/netstandard2.0/AspectInjector.dll</AspectInjector_Location>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)../src/AspectInjector/build/AspectInjector.targets" />

<ItemGroup>
<ProjectReference Include="$(MSBuildThisFileDirectory)..\src\AspectInjector\AspectInjector.csproj" PrivateAssets="None"/>
<ProjectReference Include="$(MSBuildThisFileDirectory)..\src\AspectInjector.Broker\AspectInjector.Broker.csproj" PrivateAssets="All"/>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>1.0.3</Version>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageTags>aspect freezable pattern attribute</PackageTags>
<Description>This package provides simple freezable pattern implementation. Put [Freezable] attribure on your properties or a whole class. Then cast your objects to IFreezable when needed.
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>1.0.1</Version>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageTags>aspect lazy attribute</PackageTags>
<Description>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>1.0.1</Version>
<LangVersion>8.0</LangVersion>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageTags>aspect lazy attribute</PackageTags>
<Description>
Expand All @@ -10,7 +8,7 @@
<PackageProjectUrl>https://github.com/pamidur/aspect-injector/tree/master/samples/src/Logging</PackageProjectUrl>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.22" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="3.1.22" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.32" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="3.1.32" />
</ItemGroup>
</Project>
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>1.0.3</Version>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageTags>aspect notify notifypropertychanged INPC pattern attribute</PackageTags>
<Description>This package provides simple INotifyPropertyChanged aspect. Put [Notify] attribure on your properties or a whole class. You can use [NotifyAlso] attributes to notify other dependant properties.
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>1.0.2</Version>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageTags>aspect proxy wrapper universal</PackageTags>
<Description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ protected internal sealed override T WrapSync<T>(Func<object[], T> target, objec

protected internal sealed override async Task<T> WrapAsync<T>(Func<object[], Task<T>> target, object[] args, AspectEventArgs eventArgs)
{
OnBefore(eventArgs);
await OnBeforeAsync(eventArgs);

try
{
var result = await target(args);
OnAfter(eventArgs);
await OnAfterAsync(eventArgs);

return result;
}
catch (Exception exception)
{
return OnException<T>(eventArgs, exception);
return await OnExceptionAsync<T>(eventArgs, exception);
}
}

Expand All @@ -52,5 +52,22 @@ protected virtual T OnException<T>(AspectEventArgs eventArgs, Exception exceptio
{
throw exception;
}

protected virtual Task OnBeforeAsync(AspectEventArgs eventArgs)
{
OnBefore(eventArgs);
return Task.CompletedTask;
}

protected virtual Task OnAfterAsync(AspectEventArgs eventArgs)
{
OnAfter(eventArgs);
return Task.CompletedTask;
}

protected virtual Task<T> OnExceptionAsync<T>(AspectEventArgs eventArgs, Exception exception)
{
return Task.FromResult(OnException<T>(eventArgs, exception));
}
}
}
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.0",
"version": "8.0.0",
"rollForward": "latestMinor"
}
}
Loading

0 comments on commit 810a194

Please sign in to comment.