Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Schema Extension Attributes #913

Draft
wants to merge 7 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions NewHorizons.Serialization/NewHorizons.Serialization.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<LangVersion>default</LangVersion>
<Copyright>Copyright © 2021-2023 New Horizons Team</Copyright>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
<NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugType>none</DebugType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NJsonSchema.Annotations" Version="11.0.1" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
</ItemGroup>
</Project>
35 changes: 35 additions & 0 deletions NewHorizons.Serialization/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("NewHorizons.Serialization")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NewHorizons.Serialization")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("9A68BD43-1C0D-431B-A5D5-76CE955E5971")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
4 changes: 3 additions & 1 deletion NewHorizons/External/Modules/ShipLogModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.ComponentModel;
using NewHorizons.External.SerializableData;
using Newtonsoft.Json;
using NJsonSchema.Annotations;

namespace NewHorizons.External.Modules
{
Expand Down Expand Up @@ -30,7 +31,8 @@ public class ShipLogModule
/// <summary>
/// The relative path to the xml file to load ship log entries from.
/// </summary>
public string xmlFile;
[JsonSchemaExtensionData("x-filePath", "true")]
public string xmlFile { get; set; }

[JsonObject]
public class MapModeInfo
Expand Down
1 change: 1 addition & 0 deletions NewHorizons/NewHorizons.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<DebugType>none</DebugType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NJsonSchema" Version="10.9.0" />
<PackageReference Include="OuterWildsGameLibs" Version="1.1.15.1018" />
<PackageReference Include="OWML" Version="2.12.1" />
<Reference Include="../Lib/System.ComponentModel.Annotations.dll" />
Expand Down
9 changes: 6 additions & 3 deletions NewHorizons/NewHorizons.csproj.user
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<Project>
<PropertyGroup>
<OutputPath>$(AppData)\OuterWildsModManager\OWML\Mods\xen.NewHorizons</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
<OutputPath>$(AppData)/OuterWildsModManager/OWML/Mods/xen.NewHorizons</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(OS)' == 'Unix'">
<OutputPath>$(HOME)/.local/share/OuterWildsModManager/OWML/Mods/xen.NewHorizons</OutputPath>
</PropertyGroup>
</Project>
3 changes: 2 additions & 1 deletion NewHorizons/Schemas/body_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3426,7 +3426,8 @@
},
"xmlFile": {
"type": "string",
"description": "The relative path to the xml file to load ship log entries from."
"description": "The relative path to the xml file to load ship log entries from.",
"x-filePath": "true"
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions SchemaExporter/SchemaExporter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
<DebugType>none</DebugType>
</PropertyGroup>
<ItemGroup>
<None Include="System.Runtime.Serialization.dll">
<None Include="System*.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="UnityEngine.CoreModule.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NJsonSchema" Version="10.9.0" />
<PackageReference Include="OuterWildsGameLibs" Version="1.1.15.1018" IncludeAssets="compile" />
<PackageReference Include="OuterWildsGameLibs" Version="1.1.15.1018" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
Expand Down
Binary file added SchemaExporter/System.Core.dll
Binary file not shown.
Binary file added SchemaExporter/System.dll
Binary file not shown.