Optimize csprojs and STD plugin publishing

thanks to @Vital7 for the idea
This commit is contained in:
JustArchi
2020-11-21 18:09:05 +01:00
parent d896f16cbf
commit d9e3496e5e
8 changed files with 36 additions and 34 deletions

View File

@@ -133,9 +133,9 @@ jobs:
fi fi
# If we're including SteamTokenDumper plugin for this framework, copy it to output directory # If we're including SteamTokenDumper plugin for this framework, copy it to output directory
if [ -f "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}/${STEAM_TOKEN_DUMPER_NAME}.dll" ]; then if [ -d "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}" ]; then
mkdir -p "out/${1}/plugins/${STEAM_TOKEN_DUMPER_NAME}" mkdir -p "out/${1}/plugins"
cp "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}/${STEAM_TOKEN_DUMPER_NAME}.dll" "out/${1}/plugins/${STEAM_TOKEN_DUMPER_NAME}" cp -pRT "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}" "out/${1}/plugins/${STEAM_TOKEN_DUMPER_NAME}"
fi fi
# Include .ico file for all platforms, since only Windows script can bundle it inside the exe # Include .ico file for all platforms, since only Windows script can bundle it inside the exe
@@ -208,12 +208,12 @@ jobs:
} }
# If we're including SteamTokenDumper plugin for this framework, copy it to output directory # If we're including SteamTokenDumper plugin for this framework, copy it to output directory
if (Test-Path "out\$env:STEAM_TOKEN_DUMPER_NAME\$targetFramework\$env:STEAM_TOKEN_DUMPER_NAME.dll" -PathType Leaf) { if (Test-Path "out\$env:STEAM_TOKEN_DUMPER_NAME\$targetFramework" -PathType Container) {
if (!(Test-Path "out\$variant\plugins\$env:STEAM_TOKEN_DUMPER_NAME" -PathType Container)) { if (!(Test-Path "out\$variant\plugins\$env:STEAM_TOKEN_DUMPER_NAME" -PathType Container)) {
New-Item -ItemType Directory -Path "out\$variant\plugins\$env:STEAM_TOKEN_DUMPER_NAME" > $null New-Item -ItemType Directory -Path "out\$variant\plugins\$env:STEAM_TOKEN_DUMPER_NAME" > $null
} }
Copy-Item "out\$env:STEAM_TOKEN_DUMPER_NAME\$targetFramework\$env:STEAM_TOKEN_DUMPER_NAME.dll" "out\$variant\plugins\$env:STEAM_TOKEN_DUMPER_NAME" Copy-Item "out\$env:STEAM_TOKEN_DUMPER_NAME\$targetFramework\*" "out\$variant\plugins\$env:STEAM_TOKEN_DUMPER_NAME"
} }
# Icon is available only in .NET Framework and .NET Core Windows build, we'll bundle the .ico file for other flavours # Icon is available only in .NET Framework and .NET Core Windows build, we'll bundle the .ico file for other flavours

View File

@@ -66,9 +66,9 @@ script:
fi fi
# If we're including SteamTokenDumper plugin for this framework, copy it to output directory # If we're including SteamTokenDumper plugin for this framework, copy it to output directory
if [ -f "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}/${STEAM_TOKEN_DUMPER_NAME}.dll" ]; then if [ -d "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}" ]; then
mkdir -p "out/${1}/plugins/${STEAM_TOKEN_DUMPER_NAME}" mkdir -p "out/${1}/plugins"
cp "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}/${STEAM_TOKEN_DUMPER_NAME}.dll" "out/${1}/plugins/${STEAM_TOKEN_DUMPER_NAME}" cp -pRT "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}" "out/${1}/plugins/${STEAM_TOKEN_DUMPER_NAME}"
fi fi
# Include .ico file for all platforms, since only Windows script can bundle it inside the exe # Include .ico file for all platforms, since only Windows script can bundle it inside the exe

View File

@@ -4,12 +4,17 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="ConfigureAwaitChecker.Analyzer" Version="4.0.0"> <PackageReference Include="ConfigureAwaitChecker.Analyzer" PrivateAssets="all" Version="4.0.0" />
<PrivateAssets>all</PrivateAssets> <PackageReference Include="Newtonsoft.Json" IncludeAssets="compile" Version="*" />
</PackageReference> <PackageReference Include="SteamKit2" IncludeAssets="compile" Version="*" />
<PackageReference Include="System.Composition.AttributedModel" IncludeAssets="compile" Version="*" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net48'">
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" IncludeAssets="compile" Version="*" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ArchiSteamFarm\ArchiSteamFarm.csproj" /> <ProjectReference Include="..\ArchiSteamFarm\ArchiSteamFarm.csproj" ExcludeAssets="all" Private="false" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -4,12 +4,11 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="ConfigureAwaitChecker.Analyzer" Version="4.0.0"> <PackageReference Include="ConfigureAwaitChecker.Analyzer" PrivateAssets="all" Version="4.0.0" />
<PrivateAssets>all</PrivateAssets> <PackageReference Include="System.Composition.AttributedModel" IncludeAssets="compile" Version="*" />
</PackageReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ArchiSteamFarm\ArchiSteamFarm.csproj" /> <ProjectReference Include="..\ArchiSteamFarm\ArchiSteamFarm.csproj" ExcludeAssets="all" Private="false" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -4,12 +4,18 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="ConfigureAwaitChecker.Analyzer" Version="4.0.0"> <PackageReference Include="ConfigureAwaitChecker.Analyzer" PrivateAssets="all" Version="4.0.0" />
<PrivateAssets>all</PrivateAssets> <PackageReference Include="Newtonsoft.Json" IncludeAssets="compile" Version="*" />
</PackageReference> <PackageReference Include="SteamKit2" IncludeAssets="compile" Version="*" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" IncludeAssets="compile" Version="*" />
<PackageReference Include="System.Composition.AttributedModel" IncludeAssets="compile" Version="*" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net48'">
<PackageReference Include="System.Collections.Immutable" IncludeAssets="compile" Version="*" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ArchiSteamFarm\ArchiSteamFarm.csproj" /> <ProjectReference Include="..\ArchiSteamFarm\ArchiSteamFarm.csproj" ExcludeAssets="all" Private="false" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -4,9 +4,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="ConfigureAwaitChecker.Analyzer" Version="4.0.0"> <PackageReference Include="ConfigureAwaitChecker.Analyzer" PrivateAssets="all" Version="4.0.0" />
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" /> <PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" /> <PackageReference Include="MSTest.TestFramework" Version="2.1.2" />

View File

@@ -8,9 +8,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="AngleSharp.XPath" Version="1.1.7" /> <PackageReference Include="AngleSharp.XPath" Version="1.1.7" />
<PackageReference Include="ConfigureAwaitChecker.Analyzer" Version="4.0.0"> <PackageReference Include="ConfigureAwaitChecker.Analyzer" PrivateAssets="all" Version="4.0.0" />
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="CryptSharpStandard" Version="1.0.0" /> <PackageReference Include="CryptSharpStandard" Version="1.0.0" />
<PackageReference Include="Humanizer" Version="2.8.26" /> <PackageReference Include="Humanizer" Version="2.8.26" />
<PackageReference Include="JetBrains.Annotations" Version="2020.1.0" /> <PackageReference Include="JetBrains.Annotations" Version="2020.1.0" />
@@ -42,12 +40,8 @@
<PackageReference Include="Microsoft.AspNetCore.WebSockets" Version="2.2.1" /> <PackageReference Include="Microsoft.AspNetCore.WebSockets" Version="2.2.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="5.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="5.0.0" />
<Reference Include="System.Net.Http"> <Reference Include="System.Net.Http" HintPath="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Net.Http.dll" />
<HintPath>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Net.Http.dll</HintPath> <Reference Include="System.Security" HintPath="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Security.dll" />
</Reference>
<Reference Include="System.Security">
<HintPath>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Security.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -239,12 +239,12 @@ after_test:
} }
# If we're including SteamTokenDumper plugin for this framework, copy it to output directory # If we're including SteamTokenDumper plugin for this framework, copy it to output directory
if (Test-Path "out\$env:STEAM_TOKEN_DUMPER_NAME\$targetFramework\$env:STEAM_TOKEN_DUMPER_NAME.dll" -PathType Leaf) { if (Test-Path "out\$env:STEAM_TOKEN_DUMPER_NAME\$targetFramework" -PathType Container) {
if (!(Test-Path "out\$variant\plugins\$env:STEAM_TOKEN_DUMPER_NAME" -PathType Container)) { if (!(Test-Path "out\$variant\plugins\$env:STEAM_TOKEN_DUMPER_NAME" -PathType Container)) {
New-Item -ItemType Directory -Path "out\$variant\plugins\$env:STEAM_TOKEN_DUMPER_NAME" > $null New-Item -ItemType Directory -Path "out\$variant\plugins\$env:STEAM_TOKEN_DUMPER_NAME" > $null
} }
Copy-Item "out\$env:STEAM_TOKEN_DUMPER_NAME\$targetFramework\$env:STEAM_TOKEN_DUMPER_NAME.dll" "out\$variant\plugins\$env:STEAM_TOKEN_DUMPER_NAME" Copy-Item "out\$env:STEAM_TOKEN_DUMPER_NAME\$targetFramework\*" "out\$variant\plugins\$env:STEAM_TOKEN_DUMPER_NAME"
} }
# Icon is available only in .NET Framework and .NET Core Windows build, we'll bundle the .ico file for other flavours # Icon is available only in .NET Framework and .NET Core Windows build, we'll bundle the .ico file for other flavours