Skip to content
Permalink
Browse files

[Build] Fix .usrdoc generation and copy (fixes #377)

  • Loading branch information
xen2 committed Feb 21, 2019
1 parent cb233fe commit 2c3f881b0008fb63dede4664b7b8ba810af3390d
Showing with 33 additions and 2 deletions.
  1. +1 −1 build/Xenko.build
  2. +32 −1 sources/targets/Xenko.Core.PostSettings.targets
@@ -94,7 +94,7 @@ Example of use:
<!-- Package -->
<Target Name="PreparePackageBuild">
<PropertyGroup>
<BuildProperties>$(BuildProperties);XenkoGenerateDoc=true;XenkoPackageBuild=true;XenkoSignTool=true</BuildProperties>
<BuildProperties>$(BuildProperties);XenkoPublicApi=true;XenkoPackageBuild=true;XenkoSignTool=true</BuildProperties>
</PropertyGroup>

<ItemGroup>
@@ -60,9 +60,25 @@
<!-- On Android, everything is library (even Exe) -->
<OutputType Condition=" '$(XenkoPlatform)' == 'Android' ">Library</OutputType>

<GenerateDocumentationFile Condition="'$(XenkoPublicApi)' == 'true'">true</GenerateDocumentationFile>
</PropertyGroup>

<!-- User Documentation (.usrdoc) -->
<PropertyGroup Condition="'$(XenkoPublicApi)' == 'true'">
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.usrdoc</AllowedOutputExtensionsInPackageBuildOutputFolder>
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);_XenkoRegisterUserDocOutputs</TargetsForTfmSpecificBuildOutput>
</PropertyGroup>
<Target Name="_XenkoRegisterUserDocOutputs">
<ItemGroup Condition="Exists('$(OutputPath)$(AssemblyName).usrdoc')">
<BuildOutputInPackage Include="$(OutputPath)$(AssemblyName).usrdoc"/>
</ItemGroup>
</Target>
<Target Name="_XenkoRegisterUserDocReferenceRelatedFileExtensions" Condition="'$(XenkoPublicApi)' == 'true'" BeforeTargets="ResolveAssemblyReferences">
<PropertyGroup>
<AllowedReferenceRelatedFileExtensions>$(AllowedReferenceRelatedFileExtensions);.usrdoc</AllowedReferenceRelatedFileExtensions>
</PropertyGroup>
</Target>

<PropertyGroup>
<XenkoCompilerTargetsEnable Condition=" '$(XenkoPlatform)' != 'Windows' and $(XenkoWindowsOnly) == 'true'">false</XenkoCompilerTargetsEnable>

@@ -101,6 +117,21 @@
<AssemblyProcessorTask Condition=" '$(XenkoAssemblyProcessorDev)' != 'true' " Arguments="$(XenkoAssemblyProcessorOptions)"/>
<!-- Dev mode: don't use task to avoid locking the file -->
<Exec Condition=" '$(XenkoAssemblyProcessorDev)' == 'true' " Command="&quot;$(XenkoAssemblyProcessorPath)&quot; $(XenkoAssemblyProcessorOptions)"/>

<!-- Copy User Documentation (.usrdoc) file to output -->
<Copy
Condition="'$(XenkoPublicApi)' == 'true' And Exists('%(RelativeDir)%(Filename).usrdoc')"
SourceFiles="@(DocFileItem->'%(RelativeDir)%(Filename).usrdoc')"
DestinationFolder="$(OutDir)"
SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
Retries="$(CopyRetryCount)"
RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)"
UseSymboliclinksIfPossible="$(CreateSymbolicLinksForCopyFilesToOutputDirectoryIfPossible)"
>
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
</Copy>
</Target>

<Import Project="$(MSBuildThisFileDirectory)Xenko.Core.Sign.targets" />

0 comments on commit 2c3f881

Please sign in to comment.
You can’t perform that action at this time.