Skip to content

Commit 8810021

Browse files
Housekeeping: Stop distributing unneeded deps.json with pkgs (#643)
* Stop distributing unneeded deps.json with GenexusClasses package id replaced. Clear unnecessary messages at Directory.Build.targets. * Moving configuration from veracode.yml to Directory.Build.targets to allow setting different values on each branch.
1 parent dacff2e commit 8810021

File tree

10 files changed

+14
-74
lines changed

10 files changed

+14
-74
lines changed

.github/workflows/veracode.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,10 @@ jobs:
6262

6363
- name: Build
6464
run: |
65-
$configuration = "Release"
6665
$veracodesolution = "VeracodeSolution"
67-
$veracodesolutionFileName = "VeracodeSolution.sln"
68-
$veracodetargetframework = "net4"
6966
dotnet new sln --name $veracodesolution --output dotnet --force
70-
dotnet msbuild dotnet\DotNetStandardClasses.sln /t:DumpProjects -p:DumpSolutionName=$veracodesolutionFileName -p:DumpSolutionTargetFramework=$veracodetargetframework /m:1
71-
dotnet publish dotnet\$veracodesolutionFileName --configuration $Env:BuildConfiguration -o .out -p:Publishing=true -p:SignAssembly=false
67+
dotnet msbuild dotnet\DotNetStandardClasses.sln /t:DumpProjects -p:DumpSolutionName=$veracodesolution /m:1
68+
dotnet msbuild dotnet\Directory.Build.targets /t:PublishForAnalyzer -p:DumpSolutionName=$veracodesolution
7269
7370
- name: Create package for Veracode scan
7471
shell: powershell

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,3 +363,4 @@ build
363363
/dotnet/src/dotnetcore/Reor/net6.0/Reor.deps.json
364364
.out
365365
/dotnet/Veracode.sln
366+
/dotnet/VeracodeSolution.sln

dotnet/Directory.Build.targets

Lines changed: 8 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
</PropertyGroup>
1414

1515
<PropertyGroup>
16-
<DumpSolutionName>TempSolution.sln</DumpSolutionName>
17-
<DumpSolutionTargetFramework>net4</DumpSolutionTargetFramework>
16+
<DumpSolutionName>TempSolution</DumpSolutionName>
17+
<DumpSolutionTargetFrameworkDefault>net6</DumpSolutionTargetFrameworkDefault>
1818
</PropertyGroup>
1919

2020
<PropertyGroup>
@@ -29,55 +29,17 @@
2929
</PackageReference>
3030
</ItemGroup>
3131

32-
<UsingTask
33-
TaskName="ReplaceFileText"
34-
TaskFactory="RoslynCodeTaskFactory"
35-
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
36-
<ParameterGroup>
37-
<InputFilename ParameterType="System.String" Required="true" />
38-
<OutputFilename ParameterType="System.String" Required="true" />
39-
<MatchExpression ParameterType="System.String" Required="true" />
40-
<ReplacementText ParameterType="System.String" Required="true" />
41-
</ParameterGroup>
42-
<Task>
43-
<Using Namespace="System"/>
44-
<Using Namespace="System.IO"/>
45-
<Using Namespace="System.Text.RegularExpressions" />
46-
<Code Type="Fragment" Language="cs">
47-
<![CDATA[
48-
File.WriteAllText(
49-
OutputFilename,
50-
Regex.Replace(File.ReadAllText(InputFilename), MatchExpression, ReplacementText)
51-
);
52-
]]>
53-
</Code>
54-
</Task>
55-
</UsingTask>
56-
57-
58-
<Target Name="PostBuild" AfterTargets="Build" Condition="'$(GxGenerateDepsFile)'=='true' AND ('$(TargetFramework)'=='net6.0')">
59-
<MakeDir Directories="$(TargetFramework)"/>
60-
<Exec Command="copy $(OutDir)$(ProjectName).deps.json $(TargetFramework)\$(ProjectName).deps.json" />
61-
<ReplaceFileText
62-
InputFilename="$(TargetFramework)\$(ProjectName).deps.json"
63-
OutputFilename="$(TargetFramework)\$(ProjectName).deps.json"
64-
MatchExpression="GeneXus\.Classes\.Core"
65-
ReplacementText="GxClasses" />
66-
<ReplaceFileText
67-
InputFilename="$(TargetFramework)\$(ProjectName).deps.json"
68-
OutputFilename="$(TargetFramework)\$(ProjectName).deps.json"
69-
MatchExpression="GeneXus\.Classes\.Web\.Core"
70-
ReplacementText="GxClasses.Web"/>
71-
</Target>
72-
7332
<Target Name="CopyAssemblies" Condition="'$(ProjectName)'!='' AND Exists('$(ProjectDir)$(OutDir)$(TargetFileName)')">
7433
<Message Importance="high" Text="Copying $(ProjectDir)$(OutDir)$(TargetFileName) to $(DeployDirectory)"></Message>
7534
<Copy SourceFiles="$(ProjectDir)$(OutDir)$(TargetFileName)" DestinationFolder="$(DeployDirectory)" />
7635
</Target>
7736

78-
<Target Name="DumpProjects" Condition="($(TargetFramework.StartsWith($(DumpSolutionTargetFramework))) OR $(TargetFrameworks.Contains($(DumpSolutionTargetFramework))) ) AND !$(MSBuildProjectFullPath.Contains('\test\'))">
79-
<Message Importance="high" Text="Adding $(MSBuildProjectFullPath) to $(MSBuildThisFileDirectory)$(DumpSolutionName)"></Message>
80-
<Exec Command="dotnet sln $(MSBuildThisFileDirectory)$(DumpSolutionName) add $(MSBuildProjectFullPath)"></Exec>
37+
<Target Name="DumpProjects" Condition="($(TargetFramework.StartsWith($(DumpSolutionTargetFrameworkDefault))) OR $(TargetFrameworks.Contains($(DumpSolutionTargetFrameworkDefault))) ) AND !$(MSBuildProjectFullPath.Contains('\test\')) AND ('$(IsPublishable)'=='true' OR '$(IsPublishable)'=='')">
38+
<Exec Command="dotnet sln $(MSBuildThisFileDirectory)$(DumpSolutionName).sln add $(MSBuildProjectFullPath)"></Exec>
39+
</Target>
40+
41+
<Target Name="PublishForAnalyzer">
42+
<Exec Command="dotnet publish $(MSBuildThisFileDirectory)$(DumpSolutionName).sln --configuration Debug -o $(MSBuildThisFileDirectory)..\.out -p:Publishing=true -p:SignAssembly=false --framework net6.0"></Exec>
8143
</Target>
8244

8345
</Project>

dotnet/src/dotnetcommon/GxCryptography/GxCryptography.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>net462;net6.0</TargetFrameworks>
4-
<TargetFramework Condition="'$(Publishing)' == 'true'">net462</TargetFramework>
54
<RootNamespace>GxCryptography</RootNamespace>
65
<NoWarn>618;1607;1698;SYSLIB0021;SYSLIB0027;SYSLIB0028;SYSLIB0023</NoWarn>
76
<AssemblyName>GxCryptography</AssemblyName>

dotnet/src/dotnetcommon/GxCryptographyCommon/GxCryptographyCommon.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>net462;net6.0</TargetFrameworks>
4-
<TargetFramework Condition="'$(Publishing)' == 'true'">net462</TargetFramework>
54
<RootNamespace>GxCryptographyCommon</RootNamespace>
65
<NoWarn>618;1607;1698</NoWarn>
76
<AssemblyName>GxCryptographyCommon</AssemblyName>

dotnet/src/dotnetcommon/GxEncrypt/GxEncrypt.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>net462;net6.0</TargetFrameworks>
4-
<TargetFramework Condition="'$(Publishing)' == 'true'">net462</TargetFramework>
54
<RootNamespace>GeneXus.Encryption</RootNamespace>
65
<AssemblyName>GxEncrypt</AssemblyName>
76
<PackageTags>Encrypt64 Decrypt64</PackageTags>

dotnet/src/dotnetcore/GxDataInitialization/GXDataInitialization.csproj

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@
1616
<ProjectReference Include="..\GxClasses\GxClasses.csproj"/>
1717
</ItemGroup>
1818

19-
<ItemGroup>
20-
<Content Include="net6.0\$(MSBuildProjectName).deps.json">
21-
<Pack>true</Pack>
22-
<PackagePath>\content\net6.0\</PackagePath>
23-
</Content>
24-
</ItemGroup>
2519
<Target Name="CustomContentTarget">
2620
<ItemGroup>
2721
<TfmSpecificPackageFile Include="$(OutputPath)\$(MSBuildProjectName).deps.json">

dotnet/src/dotnetcore/GxNetCoreStartup/GxNetCoreStartup.csproj

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@
2828
</Reference>
2929
</ItemGroup>
3030

31-
<ItemGroup>
32-
<Content Include="net6.0\$(MSBuildProjectName).deps.json">
33-
<Pack>true</Pack>
34-
<PackagePath>\content\net6.0\</PackagePath>
35-
</Content>
36-
</ItemGroup>
3731
<Target Name="CustomContentTarget">
3832
<ItemGroup>
3933
<TfmSpecificPackageFile Include="$(OutputPath)\$(MSBuildProjectName).deps.json">

dotnet/src/dotnetcore/Reor/Reor.csproj

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>net6.0</TargetFrameworks>
44
<OutputType>Exe</OutputType>
@@ -28,10 +28,4 @@
2828
</TfmSpecificPackageFile>
2929
</ItemGroup>
3030
</Target>
31-
<ItemGroup>
32-
<Content Include="net6.0\$(MSBuildProjectName).deps.json">
33-
<Pack>true</Pack>
34-
<PackagePath>\content\net6.0\</PackagePath>
35-
</Content>
36-
</ItemGroup>
3731
</Project>

dotnet/src/extensions/Azure/Handlers/GeneXus.Deploy.AzureFunctions.Handlers.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<TargetFrameworks>net6.0</TargetFrameworks>
44
<OutputType>Exe</OutputType>
55
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
6+
<IsPublishable>false</IsPublishable>
67
</PropertyGroup>
78
<ItemGroup>
89
<PackageReference Include="log4net" Version="2.0.11" />

0 commit comments

Comments
 (0)