Skip to content

Commit 4cfe69b

Browse files
Improve CopyAssemblies task (#635)
1 parent a8c9aae commit 4cfe69b

File tree

3 files changed

+16
-24
lines changed

3 files changed

+16
-24
lines changed

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,26 @@ For the following steps must be executed from inside ```dotnet``` directory:
8383
## How to test your changes with a GeneXus installation?
8484
- ```dotnet msbuild /t:build;CopyAssemblies DotNetStandardClasses.sln```
8585

86-
It compiles the solution and copies all the .NET Framework assemblies to the folder build/gxnet*/bin**. Then, you can copy those files to a GeneXus installation or to your web application directory.
86+
It compiles the solution and copies all the .NET Framework assemblies to the folder dotnet/build. Then, you can copy those files to a GeneXus installation or to your web application directory.
8787

8888
You can use the following parameters to customize the deploy:
8989
- TargetFramework: only the assemblies that are generated for this framework will be deployed. Valid values are: `net462` (for GeneXus NET Framework generator) and `net6` (for GeneXus NET generator).
90-
- DeployDirectory: specifies a GeneXus installation directory.
90+
- DeployDirectory: specifies the target directory to copy assemblies, by default it is dotnet\bin
9191

9292
Samples:
93-
- ```dotnet msbuild /t:build;CopyAssemblies /p:DeployDirectory=C:\Genexus /p:TargetFramework=net462 DotNetStandardClasses.sln```
9493

95-
It copies .NET framework assemblies to the folder C:\Genexus\gxnet\bin
94+
- ```dotnet msbuild /t:CopyAssemblies /p:TargetFramework=net6.0 DotNetStandardClasses.sln ```
9695

97-
- ```dotnet msbuild /t:CopyAssemblies /p:DeployDirectory=C:\Genexus /p:TargetFramework=net6.0 DotNetStandardClasses.sln ```
96+
It copies .NET 6 assemblies to the folder dotnet\bin
97+
98+
- ```dotnet msbuild /t:CopyAssemblies /p:DeployDirectory=C:\KB\NetModel\web\bin /p:TargetFramework=net6.0 DotNetStandardClasses.sln ```
99+
100+
It copies .NET 6 assemblies to the folder C:\KB\NetModel\web\bin
101+
102+
- ```dotnet msbuild /t:build;CopyAssemblies /p:DeployDirectory=C:\KB\CSharpModel\web\bin /p:TargetFramework=net462 DotNetStandardClasses.sln```
103+
104+
It builds the solution and copies .NET framework assemblies to the folder C:\KB\CSharpModel\web\bin
98105

99-
It copies .NET 6 assemblies to the folder C:\Genexus\gxnetcore\bin
100106

101107
## Advanced information
102108

dotnet/Directory.Build.props

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@
3232
<IsPackable>true</IsPackable>
3333
<DisableImplicitNamespaceImports>True</DisableImplicitNamespaceImports>
3434
</PropertyGroup>
35-
36-
<PropertyGroup Condition="!$(TargetFramework.StartsWith('net4'))">
37-
<DeployDirectoryPlatformBin>gxnetcore\bin</DeployDirectoryPlatformBin>
38-
</PropertyGroup>
39-
<PropertyGroup Condition="$(TargetFramework.StartsWith('net4'))">
40-
<DeployDirectoryPlatformBin>gxnet\bin</DeployDirectoryPlatformBin>
41-
</PropertyGroup>
4235

4336
<Target Name="GetFileVersionForPackage">
4437
<Message Importance="high" Text="FileVersion:$(FileVersionWithoutRevision)"></Message>

dotnet/Directory.Build.targets

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,11 @@
1212
<ApplicationIcon >$(MSBuildThisFileDirectory)\src\resources\Default_App.ico</ApplicationIcon>
1313
</PropertyGroup>
1414

15-
<PropertyGroup Condition="$(TargetFramework.StartsWith('net4'))">
16-
<DeployDirectory>$(MSBuildThisFileDirectory)build</DeployDirectory>
15+
<PropertyGroup>
16+
<DeployDirectory>$(MSBuildThisFileDirectory)bin\$(TargetFramework)</DeployDirectory>
1717
<!--Set a default deploy dir-->
1818
</PropertyGroup>
1919

20-
<PropertyGroup Condition="'$(DeployDirectory)'!=''">
21-
<DeployDirectoryWithSep>$(DeployDirectory)\</DeployDirectoryWithSep>
22-
</PropertyGroup>
23-
<PropertyGroup Condition="'$(DeployDirectory)'==''">
24-
<DeployDirectoryWithSep/>
25-
</PropertyGroup>
26-
2720
<ItemGroup Condition="$(TargetFramework.StartsWith('net4'))">
2821
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8">
2922
<PrivateAssets>all</PrivateAssets>
@@ -73,8 +66,8 @@
7366
</Target>
7467

7568
<Target Name="CopyAssemblies" Condition="'$(ProjectName)'!='' AND Exists('$(ProjectDir)$(OutDir)$(TargetFileName)')">
76-
<Message Importance="high" Text="Copying $(ProjectDir)$(OutDir)$(TargetFileName) to $(DeployDirectoryWithSep)$(DeployDirectoryPlatformBin)"></Message>
77-
<Copy SourceFiles="$(ProjectDir)$(OutDir)$(TargetFileName)" DestinationFolder="$(DeployDirectoryWithSep)$(DeployDirectoryPlatformBin)" />
69+
<Message Importance="high" Text="Copying $(ProjectDir)$(OutDir)$(TargetFileName) to $(DeployDirectory)"></Message>
70+
<Copy SourceFiles="$(ProjectDir)$(OutDir)$(TargetFileName)" DestinationFolder="$(DeployDirectory)" />
7871
</Target>
7972

8073
</Project>

0 commit comments

Comments
 (0)