Skip to content

Commit

Permalink
Fix docs CI build (#48)
Browse files Browse the repository at this point in the history
* Add analyzers

* Add analyzers

* Added more advanced event cancellation.

* Fix

* Added manual handling of preauth event

* Update API

* Fix registering events and add missing parameters

* Add nuget package to analyzers project

* Update csproj

* Fix event not accepting null parameters

* Fixes in code, add commands, add support for hostings.

* Update template plugin event response.

* Update to latest 12.0.0 changes.

* Update, add new events, give item

* Fix spelling

* Docs

* Update docs

* Update

* Update event manager

* Add option to get handler of plugin, add debug mode, change most logs into debug ones

* Multiple configs support

* Add IsDisarmed, DisarmedBy to Player.cs

* Update docs

* Fix template plugin

* Update NwPluginAPI.sln

* Update NwPluginAPI.sln

* Add dependencies check after loading plugin assembly

* Update analyzers

* Update

* Fix

Co-authored-by: Łukasz Jurczyk <[email protected]>
  • Loading branch information
Killers0992 and zabszk authored Nov 24, 2022
1 parent 0f58d1f commit 6255c66
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 151 deletions.
103 changes: 16 additions & 87 deletions NwPluginAPI.Docs/NwPluginAPI.Docs.csproj
Original file line number Diff line number Diff line change
@@ -1,89 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3D50BC79-9168-47F3-9805-E0D7502916DF}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NwPluginAPI.Docs</RootNamespace>
<AssemblyName>NwPluginAPI.Docs</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="api\index.md" />
<None Include="articles\intro.md" />
<None Include="articles\toc.md" />
<None Include="docfx.json" />
<None Include="index.md" />
<None Include="packages.config" />
<None Include="templates\singulinkfx\layout\_master.tmpl" />
<None Include="templates\singulinkfx\partials\footer.tmpl.partial" />
<None Include="templates\singulinkfx\partials\head.tmpl.partial" />
<None Include="templates\singulinkfx\partials\li.tmpl.partial" />
<None Include="templates\singulinkfx\partials\logo.tmpl.partial" />
<None Include="templates\singulinkfx\partials\namespace.tmpl.partial" />
<None Include="templates\singulinkfx\partials\navbar.tmpl.partial" />
<None Include="templates\singulinkfx\partials\scripts.tmpl.partial" />
<None Include="templates\singulinkfx\partials\searchResults.tmpl.partial" />
<None Include="templates\singulinkfx\partials\toc.tmpl.partial" />
<None Include="templates\singulinkfx\toc.html.tmpl" />
<None Include="toc.yml" />
</ItemGroup>
<ItemGroup>
<Content Include="images\favicon.ico" />
<Content Include="images\logo.jpg" />
<Content Include="templates\singulinkfx\styles\config.css" />
<Content Include="templates\singulinkfx\styles\discord.css" />
<Content Include="templates\singulinkfx\styles\down-arrow.svg" />
<Content Include="templates\singulinkfx\styles\jquery.twbsPagination.js" />
<Content Include="templates\singulinkfx\styles\main.css" />
<Content Include="templates\singulinkfx\styles\main.js" />
<Content Include="templates\singulinkfx\styles\singulink.css" />
<Content Include="templates\singulinkfx\styles\singulink.js" />
<Content Include="templates\singulinkfx\styles\url.min.js" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\docfx.console.2.59.4\build\docfx.console.targets" Condition="Exists('..\packages\docfx.console.2.59.4\build\docfx.console.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>Ten projekt zawiera odwołania do pakietów NuGet, których nie ma na tym komputerze. Użyj przywracania pakietów NuGet, aby je pobrać. Aby uzyskać więcej informacji, zobacz http://go.microsoft.com/fwlink/?LinkID=322105. Brakujący plik: {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\docfx.console.2.59.4\build\docfx.console.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\docfx.console.2.59.4\build\docfx.console.targets'))" />
</Target>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<PlatformTarget>x64</PlatformTarget>
<OutputType>Library</OutputType>

<Configurations>Release</Configurations>
<Platforms>AnyCPU</Platforms>

</PropertyGroup>
<ItemGroup>
<PackageReference Include="docfx.console" Version="2.59.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
33 changes: 1 addition & 32 deletions NwPluginAPI.Docs/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,36 +1,5 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// Ogólne informacje o zestawie są kontrolowane poprzez następujący
// zestaw atrybutów. Zmień wartości tych atrybutów, aby zmodyfikować informacje
// powiązane z zestawem.
[assembly: AssemblyTitle("NwPluginAPI.Docs")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NwPluginAPI.Docs")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Ustawienie elementu ComVisible na wartość false sprawia, że typy w tym zestawie są niewidoczne
// dla składników COM. Jeśli potrzebny jest dostęp do typu w tym zestawie z
// COM, ustaw wartość true dla atrybutu ComVisible tego typu.
[assembly: ComVisible(false)]

// Następujący identyfikator GUID jest identyfikatorem biblioteki typów w przypadku udostępnienia tego projektu w modelu COM
[assembly: Guid("3d50bc79-9168-47f3-9805-e0d7502916df")]

// Informacje o wersji zestawu zawierają następujące cztery wartości:
//
// Wersja główna
// Wersja pomocnicza
// Numer kompilacji
// Poprawka
//
// Możesz określić wszystkie wartości lub użyć domyślnych numerów kompilacji i poprawki
// przy użyciu symbolu „*”, tak jak pokazano poniżej:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: Guid("3d50bc79-9168-47f3-9805-e0d7502916df")]
25 changes: 25 additions & 0 deletions NwPluginAPI.Docs/log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,28 @@
{"message":"Could not resolve base documentation for 'PluginAPI.Commands.ListCommand.Command'","source":"MetadataCommand.ExtractMetadata","file":"../NwPluginAPI/Commands/ListCommand.cs","line":"14","date_time":"2022-11-24T19:31:03.7292434Z","message_severity":"warning","correlation_id":"9CD02F4F-1F81-401B-B1BF-92AFEC3AD0DF.1.1.20"}
{"message":"Could not resolve base documentation for 'PluginAPI.Commands.ListCommand.Aliases'","source":"MetadataCommand.ExtractMetadata","file":"../NwPluginAPI/Commands/ListCommand.cs","line":"16","date_time":"2022-11-24T19:31:03.7297421Z","message_severity":"warning","correlation_id":"9CD02F4F-1F81-401B-B1BF-92AFEC3AD0DF.1.1.21"}
{"message":"Could not resolve base documentation for 'PluginAPI.Commands.ListCommand.Description'","source":"MetadataCommand.ExtractMetadata","file":"../NwPluginAPI/Commands/ListCommand.cs","line":"18","date_time":"2022-11-24T19:31:03.7297421Z","message_severity":"warning","correlation_id":"9CD02F4F-1F81-401B-B1BF-92AFEC3AD0DF.1.1.22"}
{"message":"Invalid cref value \"!:Generator\" found in triple-slash-comments for GeneratorActivated defined in ../NwPluginAPI/Enums/ServerEventType.cs Line 81, ignored.","source":"MetadataCommand.ExtractMetadata","date_time":"2022-11-24T20:34:59.9531593Z","message_severity":"warning","correlation_id":"B411543D-5F37-49E7-BA84-D313B050C6DE.1.1.177"}
{"message":"Invalid cref value \"!:Generator\" found in triple-slash-comments for PlayerActivateGenerator defined in ../NwPluginAPI/Enums/ServerEventType.cs Line 99, ignored.","source":"MetadataCommand.ExtractMetadata","date_time":"2022-11-24T20:34:59.956662Z","message_severity":"warning","correlation_id":"B411543D-5F37-49E7-BA84-D313B050C6DE.1.1.178"}
{"message":"Invalid triple slash comment is ignored: <!-- Badly formed XML comment ignored for member \"F:PluginAPI.Enums.ServerEventType.PlayerChangeRadioRange\" -->\r\n","source":"MetadataCommand.ExtractMetadata","date_time":"2022-11-24T20:34:59.9571624Z","message_severity":"warning","correlation_id":"B411543D-5F37-49E7-BA84-D313B050C6DE.1.1.179"}
{"message":"Invalid cref value \"!:Generator\" found in triple-slash-comments for PlayerCloseGenerator defined in ../NwPluginAPI/Enums/ServerEventType.cs Line 155, ignored.","source":"MetadataCommand.ExtractMetadata","date_time":"2022-11-24T20:34:59.9581632Z","message_severity":"warning","correlation_id":"B411543D-5F37-49E7-BA84-D313B050C6DE.1.1.180"}
{"message":"Invalid cref value \"!:Generator\" found in triple-slash-comments for PlayerDeactivatedGenerator defined in ../NwPluginAPI/Enums/ServerEventType.cs Line 179, ignored.","source":"MetadataCommand.ExtractMetadata","date_time":"2022-11-24T20:34:59.9596648Z","message_severity":"warning","correlation_id":"B411543D-5F37-49E7-BA84-D313B050C6DE.1.1.181"}
{"message":"Invalid cref value \"!:Generator\" found in triple-slash-comments for PlayerOpenGenerator defined in ../NwPluginAPI/Enums/ServerEventType.cs Line 291, ignored.","source":"MetadataCommand.ExtractMetadata","date_time":"2022-11-24T20:34:59.9646692Z","message_severity":"warning","correlation_id":"B411543D-5F37-49E7-BA84-D313B050C6DE.1.1.182"}
{"message":"Invalid cref value \"!:byte[]\" found in triple-slash-comments for PlayerPreauth defined in ../NwPluginAPI/Enums/ServerEventType.cs Line 323, ignored.","source":"MetadataCommand.ExtractMetadata","date_time":"2022-11-24T20:34:59.9691728Z","message_severity":"warning","correlation_id":"B411543D-5F37-49E7-BA84-D313B050C6DE.1.1.183"}
{"message":"Invalid cref value \"!:PlayerEffect\" found in triple-slash-comments for PlayerReceiveEffect defined in ../NwPluginAPI/Enums/ServerEventType.cs Line 331, ignored.","source":"MetadataCommand.ExtractMetadata","date_time":"2022-11-24T20:34:59.9696733Z","message_severity":"warning","correlation_id":"B411543D-5F37-49E7-BA84-D313B050C6DE.1.1.184"}
{"message":"Invalid cref value \"!:Generator\" found in triple-slash-comments for PlayerUnlockGenerator defined in ../NwPluginAPI/Enums/ServerEventType.cs Line 419, ignored.","source":"MetadataCommand.ExtractMetadata","date_time":"2022-11-24T20:34:59.9761789Z","message_severity":"warning","correlation_id":"B411543D-5F37-49E7-BA84-D313B050C6DE.1.1.185"}
{"message":"Could not resolve base documentation for 'PluginAPI.Commands.ListCommand.Command'","source":"MetadataCommand.ExtractMetadata","file":"../NwPluginAPI/Commands/ListCommand.cs","line":"14","date_time":"2022-11-24T20:35:01.22425Z","message_severity":"warning","correlation_id":"B411543D-5F37-49E7-BA84-D313B050C6DE.1.1.189"}
{"message":"Could not resolve base documentation for 'PluginAPI.Commands.ListCommand.Aliases'","source":"MetadataCommand.ExtractMetadata","file":"../NwPluginAPI/Commands/ListCommand.cs","line":"16","date_time":"2022-11-24T20:35:01.22425Z","message_severity":"warning","correlation_id":"B411543D-5F37-49E7-BA84-D313B050C6DE.1.1.190"}
{"message":"Could not resolve base documentation for 'PluginAPI.Commands.ListCommand.Description'","source":"MetadataCommand.ExtractMetadata","file":"../NwPluginAPI/Commands/ListCommand.cs","line":"18","date_time":"2022-11-24T20:35:01.22425Z","message_severity":"warning","correlation_id":"B411543D-5F37-49E7-BA84-D313B050C6DE.1.1.191"}
{"message":"Invalid cref value \"!:Generator\" found in triple-slash-comments for GeneratorActivated defined in ../NwPluginAPI/Enums/ServerEventType.cs Line 81, ignored.","source":"MetadataCommand.ExtractMetadata","date_time":"2022-11-24T20:38:07.8779265Z","message_severity":"warning","correlation_id":"5B3F616A-72A8-48FB-AE6F-A847D23DE7F9.1.1.8"}
{"message":"Invalid cref value \"!:Generator\" found in triple-slash-comments for PlayerActivateGenerator defined in ../NwPluginAPI/Enums/ServerEventType.cs Line 99, ignored.","source":"MetadataCommand.ExtractMetadata","date_time":"2022-11-24T20:38:07.8889361Z","message_severity":"warning","correlation_id":"5B3F616A-72A8-48FB-AE6F-A847D23DE7F9.1.1.9"}
{"message":"Invalid triple slash comment is ignored: <!-- Badly formed XML comment ignored for member \"F:PluginAPI.Enums.ServerEventType.PlayerChangeRadioRange\" -->\r\n","source":"MetadataCommand.ExtractMetadata","date_time":"2022-11-24T20:38:07.8889361Z","message_severity":"warning","correlation_id":"5B3F616A-72A8-48FB-AE6F-A847D23DE7F9.1.1.10"}
{"message":"Invalid cref value \"!:Generator\" found in triple-slash-comments for PlayerCloseGenerator defined in ../NwPluginAPI/Enums/ServerEventType.cs Line 155, ignored.","source":"MetadataCommand.ExtractMetadata","date_time":"2022-11-24T20:38:07.8894365Z","message_severity":"warning","correlation_id":"5B3F616A-72A8-48FB-AE6F-A847D23DE7F9.1.1.11"}
{"message":"Invalid cref value \"!:Generator\" found in triple-slash-comments for PlayerDeactivatedGenerator defined in ../NwPluginAPI/Enums/ServerEventType.cs Line 179, ignored.","source":"MetadataCommand.ExtractMetadata","date_time":"2022-11-24T20:38:07.8904373Z","message_severity":"warning","correlation_id":"5B3F616A-72A8-48FB-AE6F-A847D23DE7F9.1.1.12"}
{"message":"Invalid cref value \"!:Generator\" found in triple-slash-comments for PlayerOpenGenerator defined in ../NwPluginAPI/Enums/ServerEventType.cs Line 291, ignored.","source":"MetadataCommand.ExtractMetadata","date_time":"2022-11-24T20:38:07.8944403Z","message_severity":"warning","correlation_id":"5B3F616A-72A8-48FB-AE6F-A847D23DE7F9.1.1.13"}
{"message":"Invalid cref value \"!:byte[]\" found in triple-slash-comments for PlayerPreauth defined in ../NwPluginAPI/Enums/ServerEventType.cs Line 323, ignored.","source":"MetadataCommand.ExtractMetadata","date_time":"2022-11-24T20:38:07.8994455Z","message_severity":"warning","correlation_id":"5B3F616A-72A8-48FB-AE6F-A847D23DE7F9.1.1.14"}
{"message":"Invalid cref value \"!:PlayerEffect\" found in triple-slash-comments for PlayerReceiveEffect defined in ../NwPluginAPI/Enums/ServerEventType.cs Line 331, ignored.","source":"MetadataCommand.ExtractMetadata","date_time":"2022-11-24T20:38:07.8999448Z","message_severity":"warning","correlation_id":"5B3F616A-72A8-48FB-AE6F-A847D23DE7F9.1.1.15"}
{"message":"Invalid cref value \"!:Generator\" found in triple-slash-comments for PlayerUnlockGenerator defined in ../NwPluginAPI/Enums/ServerEventType.cs Line 419, ignored.","source":"MetadataCommand.ExtractMetadata","date_time":"2022-11-24T20:38:07.9054501Z","message_severity":"warning","correlation_id":"5B3F616A-72A8-48FB-AE6F-A847D23DE7F9.1.1.16"}
{"message":"Could not resolve base documentation for 'PluginAPI.Commands.ListCommand.Command'","source":"MetadataCommand.ExtractMetadata","file":"../NwPluginAPI/Commands/ListCommand.cs","line":"14","date_time":"2022-11-24T20:38:09.1860481Z","message_severity":"warning","correlation_id":"5B3F616A-72A8-48FB-AE6F-A847D23DE7F9.1.1.20"}
{"message":"Could not resolve base documentation for 'PluginAPI.Commands.ListCommand.Aliases'","source":"MetadataCommand.ExtractMetadata","file":"../NwPluginAPI/Commands/ListCommand.cs","line":"16","date_time":"2022-11-24T20:38:09.1860481Z","message_severity":"warning","correlation_id":"5B3F616A-72A8-48FB-AE6F-A847D23DE7F9.1.1.21"}
{"message":"Could not resolve base documentation for 'PluginAPI.Commands.ListCommand.Description'","source":"MetadataCommand.ExtractMetadata","file":"../NwPluginAPI/Commands/ListCommand.cs","line":"18","date_time":"2022-11-24T20:38:09.1860481Z","message_severity":"warning","correlation_id":"5B3F616A-72A8-48FB-AE6F-A847D23DE7F9.1.1.22"}
{"message":"Unable to find either toc.yml or toc.md inside articles/. Make sure the file is included in config file docfx.json!","source":"BuildCommand.BuildCore.Build Document.CompilePhaseHandlerWithIncremental.TocDocumentProcessor.Prebuild.BuildTocDocument","file":"toc.yml","date_time":"2022-11-24T20:38:12.7706244Z","message_severity":"warning","correlation_id":"5B3F616A-72A8-48FB-AE6F-A847D23DE7F9.2.196.1.31.9.3.2.1"}
5 changes: 0 additions & 5 deletions docs/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -494,11 +494,6 @@
"title": "Namespace PluginAPI.Loader | Nw Plugin API",
"keywords": "Namespace PluginAPI.Loader Classes AssemblyLoader Manages initialization of plugin system and loading of plugins."
},
"articles/intro.html": {
"href": "articles/intro.html",
"title": "Add your introductions here! | Nw Plugin API",
"keywords": "Add your introductions here!"
},
"index.html": {
"href": "index.html",
"title": "| Nw Plugin API",
Expand Down
28 changes: 2 additions & 26 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,6 @@
"is_incremental": false,
"version": ""
},
{
"type": "Conceptual",
"source_relative_path": "articles/intro.md",
"output": {
".html": {
"relative_path": "articles/intro.html",
"hash": "WNCVCnWbMioUmKoFB9o0Olgv8ExzeOfp55241Z/lAl4="
}
},
"is_incremental": false,
"version": ""
},
{
"type": "Toc",
"source_relative_path": "articles/toc.md",
"output": {
".html": {
"relative_path": "articles/toc.html",
"hash": "7bfDUG376XpZEzFofdGjOaPzgDkfE1oKGy2gZOIazeU="
}
},
"is_incremental": false,
"version": ""
},
{
"type": "Resource",
"source_relative_path": "images/favicon.ico",
Expand Down Expand Up @@ -1276,7 +1252,7 @@
"output": {
".html": {
"relative_path": "toc.html",
"hash": "HacBqlYVOn0psp5FEzbMldwE5xJDDmjh+DqDRZ2RHtM="
"hash": "ZL13DLCwwkUAwWApROyvBaL7gY/WWmChyfpw9r6VP/k="
}
},
"is_incremental": false,
Expand All @@ -1297,7 +1273,7 @@
"ConceptualDocumentProcessor": {
"can_incremental": false,
"incrementalPhase": "build",
"total_file_count": 3,
"total_file_count": 2,
"skipped_file_count": 0
},
"ManagedReferenceDocumentProcessor": {
Expand Down
2 changes: 1 addition & 1 deletion docs/toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<ul class="nav level1">
<li>
<a href="articles/intro.html" class="sidebar-item" name="articles/toc.html" title="Articles">Articles</a>
<a>Articles</a>

</li>
<li>
Expand Down

0 comments on commit 6255c66

Please sign in to comment.