|
9 | 9 | <Description>OPC UA Core Class Library</Description>
|
10 | 10 | <IsPackable>true</IsPackable>
|
11 | 11 | <GenerateDocumentationFile>true</GenerateDocumentationFile>
|
| 12 | + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
12 | 13 | </PropertyGroup>
|
13 | 14 |
|
14 | 15 | <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
|
|
88 | 89 |
|
89 | 90 | <Target Name="GetPackagingOutputs" />
|
90 | 91 |
|
91 |
| - <!-- Produces a zipped version of the Nodeset 2 to reduce assembly size by 2.7MB ! --> |
92 |
| - <ItemGroup> |
93 |
| - <EmbeddedResource Include="Schema\Opc.Ua.NodeSet2.xml.zip" /> |
94 |
| - </ItemGroup> |
95 |
| - |
| 92 | + <!-- Produces a zipped version of the Nodeset 2 to reduce assembly size! --> |
96 | 93 | <PropertyGroup>
|
97 |
| - <ZipTmp>$(BaseIntermediateOutputPath)/zipnodeset2</ZipTmp> |
98 |
| - <ZipNodeSet2XML>Schema/Opc.Ua.NodeSet2.xml</ZipNodeSet2XML> |
99 |
| - <AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
| 94 | + <ZipTmp>$(BaseIntermediateOutputPath)$(Configuration)/$(TargetFramework)/zipnodeset2</ZipTmp> |
| 95 | + <NodeSet2XML>Schema/Opc.Ua.NodeSet2.xml</NodeSet2XML> |
| 96 | + <ZipNodeSet2XML>$(BaseIntermediateOutputPath)$(Configuration)/$(TargetFramework)/Opc.Ua.NodeSet2.xml.zip</ZipNodeSet2XML> |
100 | 97 | </PropertyGroup>
|
101 | 98 |
|
102 |
| - <Target Name="ZipNodeSet2" BeforeTargets="PrepareForBuild" Inputs="$(ZipNodeSet2XML)" Outputs="$(ZipNodeSet2XML).zip"> |
103 |
| - <Message Text="Zip $(ZipNodeSet2XML) in $(ZipTmp)." Importance="high" /> |
104 |
| - <Copy SourceFiles="$(ZipNodeSet2XML)" DestinationFolder="$(ZipTmp)" /> |
105 |
| - <ZipDirectory SourceDirectory="$(ZipTmp)" DestinationFile="$(ZipNodeSet2XML).zip" Overwrite="true" /> |
| 99 | + <!-- Embed the zipped Nodeset2 file --> |
| 100 | + <ItemGroup> |
| 101 | + <EmbeddedResource Include="$(ZipNodeSet2XML)" Link="$(NodeSet2XML).zip" /> |
| 102 | + </ItemGroup> |
| 103 | + |
| 104 | + <!-- Zip the NodeSet2 file --> |
| 105 | + <Target Name="ZipNodeSet2" BeforeTargets="PrepareForBuild" Inputs="$(NodeSet2XML)" Outputs="$(ZipNodeSet2XML)"> |
| 106 | + <Message Text="Zip $(NodeSet2XML) in $(ZipNodeSet2XML)." Importance="high" /> |
| 107 | + <Copy SourceFiles="$(NodeSet2XML)" DestinationFolder="$(ZipTmp)" /> |
| 108 | + <ZipDirectory SourceDirectory="$(ZipTmp)" DestinationFile="$(ZipNodeSet2XML)" Overwrite="true" /> |
106 | 109 | <RemoveDir Directories="$(ZipTmp)" />
|
107 | 110 | <Message Text="Zip NodeSet2 completed, $(ZipTmp) removed." Importance="high" />
|
108 | 111 | </Target>
|
109 |
| - |
| 112 | + |
| 113 | + <!-- Clean up the zip file --> |
| 114 | + <Target Name="RemoveZipNodeset2" AfterTargets="Clean" Condition="Exists('$(ZipNodeSet2XML)')"> |
| 115 | + <Message Text="Delete Zip $(ZipNodeSet2XML)" Importance="high"></Message> |
| 116 | + <Delete Files="$(ZipNodeSet2XML)"></Delete> |
| 117 | + </Target> |
| 118 | + |
110 | 119 | </Project>
|
0 commit comments