-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
111 additions
and
129 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -288,3 +288,5 @@ __pycache__/ | |
*.xsd.cs | ||
|
||
*.binlog | ||
|
||
.DS_Store |
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 was deleted.
Oops, something went wrong.
32 changes: 20 additions & 12 deletions
32
src/IgnoresAccessChecksToGenerator.Tasks/IgnoresAccessChecksToGenerator.Tasks.csproj
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,25 +1,33 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>netstandard2.0;net46</TargetFrameworks> | ||
<RestoreProjectStyle>PackageReference</RestoreProjectStyle> | ||
<NuspecFile>IgnoresAccessChecksToGenerator.nuspec</NuspecFile> | ||
<TargetFrameworks>netstandard2.0;net462</TargetFrameworks> | ||
<PackageId>IgnoresAccessChecksToGenerator</PackageId> | ||
<Version>0.7.0</Version> | ||
<DevelopmentDependency>true</DevelopmentDependency> | ||
<Authors>Eli Arbel</Authors> | ||
<RepositoryUrl>https://github.com/aelij/IgnoresAccessChecksToGenerator</RepositoryUrl> | ||
<PackageLicenseExpression>MIT</PackageLicenseExpression> | ||
<Description>Generates IgnoresAccessChecksTo attributes and reference assemblies to allow compile-time access to internals</Description> | ||
<PackageTags>IgnoresAccessChecksToGenerator IgnoresAccessChecksTo IgnoresAccessChecksToAttribute internals</PackageTags> | ||
<BuildOutputTargetFolder>tools/$(TargetFramework)</BuildOutputTargetFolder> | ||
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking> | ||
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);IncludePackageDependencies</TargetsForTfmSpecificBuildOutput> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Mono.Cecil" Version="0.11.3" /> | ||
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="15.1.1012" /> | ||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> | ||
</PackageReference> | ||
<Content Include="build\*" PackagePath="build" /> | ||
</ItemGroup> | ||
|
||
<Target Name="CopyRefsTarget" AfterTargets="AfterBuild"> | ||
<ItemGroup> | ||
<PackageReference Include="Mono.Cecil" Version="0.11.5" /> | ||
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="17.8.3" /> | ||
</ItemGroup> | ||
|
||
<Target Name="IncludePackageDependencies"> | ||
<ItemGroup> | ||
<CopyRefs Include="@(ReferencePath)" Condition=" '%(Filename)' == 'Mono.Cecil' " /> | ||
<BuildOutputInPackage Include="@(ReferencePath)" Condition=" '%(Filename)' == 'Mono.Cecil' " /> | ||
</ItemGroup> | ||
<Copy SourceFiles="@(CopyRefs)" DestinationFolder="$(OutDir)" /> | ||
</Target> | ||
|
||
</Project> |
21 changes: 0 additions & 21 deletions
21
src/IgnoresAccessChecksToGenerator.Tasks/IgnoresAccessChecksToGenerator.nuspec
This file was deleted.
Oops, something went wrong.
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
63 changes: 63 additions & 0 deletions
63
src/IgnoresAccessChecksToGenerator.Tasks/build/IgnoresAccessChecksToGenerator.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,63 @@ | ||
<Project> | ||
|
||
<PropertyGroup> | ||
<_IACTG_TargetFramework Condition="'$(MSBuildRuntimeType)' == 'Core'">netstandard2.0</_IACTG_TargetFramework> | ||
<_IACTG_TargetFramework Condition="'$(MSBuildRuntimeType)' != 'Core'">net462</_IACTG_TargetFramework> | ||
<_IACTG_TaskAssembly>$(MSBuildThisFileDirectory)../tools/$(_IACTG_TargetFramework)/IgnoresAccessChecksToGenerator.Tasks.dll</_IACTG_TaskAssembly> | ||
<_IACTG_IntermediatePath>$(IntermediateOutputPath)/IgnoresAccessChecksToGenerator</_IACTG_IntermediatePath> | ||
<_IACTG_CodeFilePath>$(_IACTG_IntermediatePath)/IgnoresAccessChecksTo.cs</_IACTG_CodeFilePath> | ||
<_IACTG_ManifestFilePath>$(_IACTG_IntermediatePath)/IgnoresAccessChecksToGenerator.manifest</_IACTG_ManifestFilePath> | ||
</PropertyGroup> | ||
|
||
<UsingTask AssemblyFile="$(_IACTG_TaskAssembly)" TaskName="IgnoresAccessChecksToGenerator.Tasks.PublicizeInternals" /> | ||
|
||
<!-- | ||
MSBuild incremental build tracking only supports files, so we create a manifest that contains all the items we use as inputs. | ||
This target has MSBuildAllProjects as input which means it will be invalidated on any project file change. | ||
--> | ||
<Target Name="GetIgnoresAccessChecksToGeneratorReferencePaths" | ||
Inputs="$(MSBuildAllProjects)" | ||
Outputs="$(_IACTG_ManifestFilePath)" | ||
Returns="@(_IACTG_InputReferencePath);@(_IACTG_OutputReferencePath)"> | ||
<ItemGroup> | ||
<InternalsAssemblyName Include="$(InternalsAssemblyNames.Split(;))" /> | ||
<InternalsAssemblyExcludeTypeName Include="$(InternalsAssemblyExcludeTypeNames.Split(;))" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<_IACTG_ReferencePathJoin Include="@(ReferencePath)" InternalsAssemblyName="%(InternalsAssemblyName.Identity)" /> | ||
<_IACTG_InputReferencePath Include="@(_IACTG_ReferencePathJoin)" Condition=" '%(Filename)' == '%(InternalsAssemblyName)' " /> | ||
<_IACTG_ReferencePathJoin Remove="@(_IACTG_ReferencePathJoin)" /> | ||
<_IACTG_OutputReferencePath Include="@(_IACTG_InputReferencePath->'$(_IACTG_IntermediatePath)/%(Filename)%(Extension)')" OriginalItemSpec="%(Identity)" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<_IACTG_Manifest Include="@(InternalsAssemblyExcludeTypeName)" /> | ||
</ItemGroup> | ||
<WriteLinesToFile File="$(_IACTG_ManifestFilePath)" Lines="@(_IACTG_Manifest)" WriteOnlyWhenDifferent="true" Overwrite="true" /> | ||
</Target> | ||
|
||
<Target Name="IgnoresAccessChecksToGenerator" | ||
DependsOnTargets="GetIgnoresAccessChecksToGeneratorReferencePaths" | ||
AfterTargets="AfterResolveReferences" | ||
Inputs="@(_IACTG_InputReferencePath);$(_IACTG_ManifestFilePath)" | ||
Outputs="@(_IACTG_OutputReferencePath);$(_IACTG_CodeFilePath)" | ||
Returns="@(ReferencePath);@(Compile)"> | ||
<PublicizeInternals SourceReferences="@(ReferencePath)" | ||
AssemblyNames="@(InternalsAssemblyName)" | ||
ExcludeTypeNames="@(InternalsAssemblyExcludeTypeName)" | ||
IntermediateOutputPath="$(_IACTG_IntermediatePath)" | ||
GeneratedCodeFilePath="$(_IACTG_CodeFilePath)" /> | ||
<ItemGroup> | ||
<ReferencePath Include="@(_IACTG_OutputReferencePath)" /> | ||
<ReferencePath Remove="@(_IACTG_OutputReferencePath->'%(OriginalItemSpec)')" /> | ||
<Compile Include="$(_IACTG_CodeFilePath)" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<Target Name="IgnoresAccessChecksToGeneratorClean" AfterTargets="Clean"> | ||
<ItemGroup> | ||
<_IACTG_Directory Include="$(_IACTG_IntermediatePath)" /> | ||
</ItemGroup> | ||
<RemoveDir Directories="@(_IACTG_Directory)" /> | ||
</Target> | ||
|
||
</Project> |
9 changes: 5 additions & 4 deletions
9
test/IgnoresAccessChecksToGenerator.Test/IgnoresAccessChecksToGenerator.Test.csproj
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,19 +1,20 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<OutputType>Exe</OutputType> | ||
<InternalsAssemblyUseEmptyMethodBodies>false</InternalsAssemblyUseEmptyMethodBodies> | ||
<Axxx>true</Axxx> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<InternalsAssemblyName Include="Microsoft.CodeAnalysis" /> | ||
<InternalsAssemblyName Include="Microsoft.CodeAnalysis.CSharp" /> | ||
<InternalsAssemblyExcludeTypeName Include="Microsoft.CodeAnalysis.CSharp.AccessCheck" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="IgnoresAccessChecksToGenerator" Version="0.6.0" PrivateAssets="all" /> | ||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="2.3.1" /> | ||
<PackageReference Include="IgnoresAccessChecksToGenerator" Version="0.7.0" PrivateAssets="all" /> | ||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" /> | ||
</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,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<packageSources> | ||
<add key="LocalFeed" value="../src/IgnoresAccessChecksToGenerator.Tasks/bin/Release/" /> | ||
</packageSources> | ||
</configuration> |