Skip to content

Commit 237e213

Browse files
committed
Make fixes for full obfuscation tests
If we have specific configuration failing, we can add more tests now. It require create new folder with project setup for building. Closes #36
1 parent 1ec538e commit 237e213

4 files changed

Lines changed: 20 additions & 9 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ gh-pages/
4242
artifacts/
4343
/Confuser.Protections/runtime
4444
/Confuser.Protections/runtime
45+
*.binlog

Confuser.MSBuild.Tasks/Confuser.MSBuild.Tasks.csproj

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@
1919
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
2020
<NoPackageAnalysis>true</NoPackageAnalysis>
2121
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);IncludeConfuserDependencyFiles</TargetsForTfmSpecificContentInPackage>
22-
<IncludeBuildOutput>false</IncludeBuildOutput>
2322
</PropertyGroup>
2423

2524
<ItemGroup Label="Nuget Dependencies">
2625
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="17.11.48" PrivateAssets="all" />
26+
<PackageReference Include="dnlib" Version="4.5.0" GeneratePathProperty="true" />
2727
</ItemGroup>
2828

2929
<ItemGroup Label="Project Dependencies">
3030
<ProjectReference Include="..\Confuser.Core\Confuser.Core.csproj" PrivateAssets="all" />
3131
<ProjectReference Include="..\Confuser.Protections\Confuser.Protections.csproj" PrivateAssets="all" />
3232
<ProjectReference Include="..\Confuser.Renamer\Confuser.Renamer.csproj" PrivateAssets="all" />
33-
<ProjectReference Include="..\Confuser.Runtime\Confuser.Runtime.csproj" Condition="'$(TargetFramework)' == 'net472'" PrivateAssets="all" />
33+
<ProjectReference Include="..\Confuser.Runtime\Confuser.Runtime.csproj" PrivateAssets="all" />
3434
</ItemGroup>
3535

3636
<ItemGroup>
@@ -44,12 +44,20 @@
4444
</IncludeConfuserDependencyFilesDependsOn>
4545
</PropertyGroup>
4646

47+
<ItemGroup>
48+
<None Include="$(Pkgdnlib)\lib/net6.0/dnlib.dll" CopyToOutputDirectory="PreserveNewest" />
49+
</ItemGroup>
50+
4751
<Target Name="IncludeConfuserDependencyFiles" DependsOnTargets="$(IncludeConfuserDependencyFilesDependsOn)" />
4852

4953
<Target Name="IncludeConfuserDependencyFilesFramework" Condition="'$(TargetFramework)' == 'net472'">
54+
<PropertyGroup>
55+
<PTEST_11>$(BaseOutputPath)$(ArtifactsPivots)</PTEST_11>
56+
</PropertyGroup>
5057
<ItemGroup>
51-
<ConfuserNetFrameworkDependencies Include="$(BaseOutputPath)\$(Configuration)\net472\*.dll" />
52-
<ConfuserNetFrameworkDependencies Include="$(BaseOutputPath)\$(Configuration)\net472\*.pdb" />
58+
<ConfuserNetFrameworkDependencies Include="$(BaseOutputPath)$(ArtifactsPivots)\*.dll" />
59+
<ConfuserNetFrameworkDependencies Include="$(BaseOutputPath)$(ArtifactsPivots)\*.pdb" />
60+
<ConfuserNetFrameworkDependencies Include="$(BaseOutputPath)$(ArtifactsPivots)\runtime\*\*.dll" />
5361
</ItemGroup>
5462
<CreateItem Include="@(ConfuserNetFrameworkDependencies)" AdditionalMetadata="PackagePath=netframework">
5563
<Output TaskParameter="Include" ItemName="TfmSpecificPackageFile" />
@@ -58,10 +66,11 @@
5866

5967
<Target Name="IncludeConfuserDependencyFilesStandard" Condition="'$(TargetFramework)' == 'net8.0'">
6068
<ItemGroup>
61-
<ConfuserNetDependencies Include="$(BaseOutputPath)\$(Configuration)\net8.0\*.dll" />
62-
<ConfuserNetDependencies Include="$(BaseOutputPath)\$(Configuration)\net8.0\*.pdb" />
69+
<ConfuserNetDependencies Include="$(BaseOutputPath)$(ArtifactsPivots)\*.dll" />
70+
<ConfuserNetDependencies Include="$(BaseOutputPath)$(ArtifactsPivots)\*.pdb" />
71+
<ConfuserNetDependencies Include="$(BaseOutputPath)$(ArtifactsPivots)\runtime\*\*.dll" />
6372
</ItemGroup>
64-
<CreateItem Include="@(ConfuserNetStandardDependencies)" AdditionalMetadata="PackagePath=net">
73+
<CreateItem Include="@(ConfuserNetDependencies)" AdditionalMetadata="PackagePath=net">
6574
<Output TaskParameter="Include" ItemName="TfmSpecificPackageFile" />
6675
</CreateItem>
6776
</Target>

Confuser.MSBuild.Tasks/build/Confuser.MSBuild.Tasks.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<PropertyGroup>
88
<ConfuserAssemblyPath Condition="'$(MSBuildRuntimeType)' == 'Full'">$(MSBuildThisFileDirectory)\..\netframework\</ConfuserAssemblyPath>
9-
<ConfuserAssemblyPath Condition="'$(ConfuserAssemblyPath)' == ''">$(MSBuildThisFileDirectory)\..\netstandard\</ConfuserAssemblyPath>
9+
<ConfuserAssemblyPath Condition="'$(ConfuserAssemblyPath)' == ''">$(MSBuildThisFileDirectory)\..\net\</ConfuserAssemblyPath>
1010
</PropertyGroup>
1111

1212
<UsingTask TaskName="Confuser.MSBuild.Tasks.CreateProjectTask"

Tests/Confuser.MSBuild.Tasks.Tests/TestProjects/HelloWorld/HelloWorld.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
<TargetFramework>net8.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
8+
<Obfuscate>true</Obfuscate>
89
</PropertyGroup>
910

1011
<ItemGroup>
11-
<PackageReference Include="Confuser.MSBuild" Version="*" />
12+
<PackageReference Include="Confuser.MSBuild" Version="1.7.0-*" />
1213
</ItemGroup>
1314

1415
</Project>

0 commit comments

Comments
 (0)