Skip to content
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

Simplify generated scripts to static script #68

Merged
merged 11 commits into from
Jul 12, 2019
Prev Previous commit
Next Next commit
Simplify ScriptBuilderTask
  • Loading branch information
bording committed Jul 11, 2019
commit 3395185438289a94e0e7d80fd61ea46f80be9226
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Target Name="MetricsPerformanceCountersMsBuildPackageRemovalWarning" BeforeTargets="Build">
<Error Text="The NServiceBus.Metrics.PerformanceCounters.MsBuild package is deprecated and should be removed from the project. The Powershell script to create performance counter objects is now included in the NServiceBus.Metrics.PerformanceCounters package." />
Expand Down
53 changes: 6 additions & 47 deletions src/ScriptBuilderTask/ScriptBuilderTask.csproj
Original file line number Diff line number Diff line change
@@ -1,63 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net452;netstandard1.5</TargetFrameworks>
<SignAssembly>true</SignAssembly>
<AssemblyName>NServiceBus.Metrics.PerformanceCounters.Task</AssemblyName>
<AssemblyOriginatorKeyFile>$(SolutionDir)NServiceBus.snk</AssemblyOriginatorKeyFile>
<OutputPath>..\..\binaries\</OutputPath>
<NoWarn>$(NoWarn);CS1591</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ILRepack" Version="2.0.13" PrivateAssets="All" />
<PackageReference Include="Particular.Packaging" Version="0.2.1" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
<Reference Include="Microsoft.Build" />
<Reference Include="Microsoft.Build.Framework" />
<Reference Include="Microsoft.Build.Tasks.v4.0" />
<Reference Include="Microsoft.Build.Utilities.v4.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' ">
<PackageReference Include="Microsoft.Build" Version="15.3.409" PrivateAssets="All" />
<PackageReference Include="Microsoft.Build.Framework" Version="15.3.409" PrivateAssets="All" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="15.3.409" PrivateAssets="All" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.3.409" PrivateAssets="All" />
</ItemGroup>

<PropertyGroup>
<TargetFramework>net452</TargetFramework>
<PackageId>NServiceBus.Metrics.PerformanceCounters.MsBuild</PackageId>
<Description>This package is deprecated and should no longer be referenced. The functionality was merged into the NServiceBus.Metrics.PerformanceCounters package.</Description>
<NuSpecFile>$(MSBuildThisFileDirectory)$(PackageId).nuspec</NuSpecFile>
<NoPackageAnalysis>true</NoPackageAnalysis>
<IncludeBuildOutput>false</IncludeBuildOutput>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Particular.Packaging" Version="0.2.1" PrivateAssets="All" />
</ItemGroup>

<Target Name="SetPackageDependencies" BeforeTargets="GenerateNuspec">
<PropertyGroup>
<NuspecProperties>id=$(PackageId);version=$(PackageVersion);authors=$(Authors);owners=$(Authors);licenseUrl=$(PackageLicenseUrl);requireLicenseAcceptance=$(PackageRequireLicenseAcceptance);iconUrl=$(PackageIconUrl);projectUrl=$(PackageProjectUrl);description=$(Description);copyright=$(Copyright);tags=$(PackageTags)</NuspecProperties>
</PropertyGroup>
</Target>

<!--Required to ensure that Mono.Cecil is available in the binaries directory and, thus, the ILRepack step will succeed-->
<PropertyGroup>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>

<Target Name="MergeDependencies" AfterTargets="CopyFilesToOutputDirectory" Condition="'$(Configuration)' == 'Release'">
<PropertyGroup>
<TempFolder>$(ProjectDir)$(OutputPath)temp</TempFolder>
</PropertyGroup>
<MakeDir Directories="$(TempFolder)" />
<Exec Command="$(ILRepack) /out:&quot;$(TempFolder)\$(AssemblyName).dll&quot; &quot;$(ProjectDir)$(OutputPath)$(AssemblyName).dll&quot; &quot;$(ProjectDir)$(OutputPath)Mono.Cecil.dll&quot; /targetplatform:v4 /internalize /keyfile:$(AssemblyOriginatorKeyFile)" />
<ItemGroup>
<TempFiles Include="$(TempFolder)\*.*" />
</ItemGroup>
<Copy SourceFiles="@(TempFiles)" DestinationFolder="$(OutputPath)" OverwriteReadOnlyFiles="true" />
<Delete Files="@(TempFiles)" />
<RemoveDir Directories="$(TempFolder)" />
</Target>

</Project>