-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #297 from stride3d/master
Initiating deployment of latest docs updates to staging
- Loading branch information
Showing
24 changed files
with
222 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ changelog: | |
exclude: | ||
labels: | ||
- ignore-for-release | ||
- deployment | ||
authors: | ||
- dependabot | ||
categories: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,11 @@ | |
|
||
name: Build Stride Docs for GitHub Staging | ||
|
||
env: | ||
COMMON_SETTINGS_PATH: en/docfx.json | ||
VERSION: "2.0.0.${{ github.run_number }}" | ||
DOCS_PATH: stride-docs | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
|
@@ -10,8 +15,7 @@ jobs: | |
runs-on: windows-2022 | ||
|
||
steps: | ||
# Setup .NET SDK | ||
- name: Dotnet Setup | ||
- name: .NET SDK Setup | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 8.x | ||
|
@@ -20,9 +24,16 @@ jobs: | |
- name: Checkout Stride Docs | ||
uses: actions/checkout@v4 | ||
with: | ||
path: stride-docs | ||
path: ${{ env.DOCS_PATH }} | ||
lfs: true | ||
|
||
- name: Set Version in docfx.json | ||
run: | | ||
$settingsContent = Get-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Raw | ||
$updatedDocFxJsonContent = $settingsContent -replace '2.0.0.x', "${{ env.VERSION }}" | ||
Set-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Value $updatedDocFxJsonContent | ||
shell: pwsh | ||
|
||
# Checkout the Stride repository from the default branch | ||
- name: Checkout Stride (note the LFS) | ||
uses: actions/checkout@v4 | ||
|
@@ -40,11 +51,11 @@ jobs: | |
|
||
- name: Build documentation | ||
run: ./build-all.bat | ||
working-directory: stride-docs | ||
working-directory: ${{ env.DOCS_PATH }} | ||
|
||
- name: Deploy | ||
uses: peaceiris/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: stride-docs/_site | ||
publish_dir: ${{ env.DOCS_PATH }}/_site | ||
publish_branch: gh-pages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Diagnostics Warning STRDIAG010 | ||
|
||
> The Type '{0}' doesn't have a public parameterless constructor, which is needed for Serialization. | ||
## Explanation | ||
|
||
By default, Stride serializers only support types that have a parameterless constructor. If no constructor is defined then the default constructor counts as parameterless constructor. Primary Constructors with parameters count as non parameterless constructor. Structs have per default a parameterless constructor so this warning will never appear on a struct. | ||
|
||
## Example | ||
|
||
The following example generates STRDIAG010: | ||
|
||
```csharp | ||
using Stride.Core; | ||
|
||
[DataContract] | ||
public class InvalidSTRDIAG010 | ||
{ | ||
// no parameterless constructor available so it will throw STRDIAG010 | ||
public InvalidSTRDIAG010(int x, int y) | ||
{ | ||
|
||
} | ||
} | ||
``` | ||
|
||
The following example doesn't generate STRDIAG010: | ||
|
||
```csharp | ||
public class ValidSTRDIAG010 | ||
{ | ||
// will be ignored by the serializers | ||
public ValidSTRDIAG010(int x, int y) | ||
{ | ||
} | ||
// this parameterless constructor will be used by the serializers | ||
public ValidSTRDIAG010() | ||
{ | ||
|
||
} | ||
} | ||
``` | ||
|
||
## Solution | ||
|
||
To resolve the warning, add a parameterless constructor that can be used by the serializers. Or remove the @Stride.Core.DataContractAttribute so the class gets entirely ignored by the serialization system. | ||
|
||
## References | ||
|
||
- [Serialisation](../manual/scripts/serialization.md) |
Oops, something went wrong.