This document covers requirements and guidelines to give hints about developing the tools you find here.
.NET Framework Versions
Libraries must be compatible with netstandard2.0 framework. Even though it is rather old, we keep support for that so that the Unity client system can use the libraries here.
Tools and services are implemented to support net6.0.
NuGet Package Versions
All NuGet packages here share a standard version number that is defined in Version.props.
Local Development Scripts
To develop and debug toolchain changes locally, you must set up a local NuGet repository and maintain the libraries that are being compiled there. There are many different ways to achieve that.
A straight-forward approach is listed below for both Windows and Mac users. These simple batch files allow you to quickly clear existing local packages, re-build everything and install the locally generated Ajuna.DotNet.Template.
Windows
set AJUNA_ROOT=D:\Ajuna.SDKset LOCAL_NUGET_ROOT=D:\NuGetset LOCAL_NUGET_CACHE=%SYSTEMDRIVE%\Users\%USERNAME%\.nuget\packagesset LOCAL_NUGET_BINARY=nuget.exeset AJUNA_VERSION=0.1.25cd %AJUNA_ROOT%dotnet build -p:Version=$AJUNA_VERSION --configuration Releasecd %AJUNA_ROOT%\Tools\Ajuna.DotNetdotnet pack -p:Version=$AJUNA_VERSIONrem Clear local NuGet cachermdir /S /Q "%LOCAL_NUGET_CACHE%\ajuna.dotnet"rmdir /S /Q "%LOCAL_NUGET_CACHE%\ajuna.dotnet.template"rmdir /S /Q "%LOCAL_NUGET_CACHE%\ajuna.servicelayer"rmdir /S /Q "%LOCAL_NUGET_CACHE%\ajuna.servicelayer.model"rmdir /S /Q "%LOCAL_NUGET_CACHE%\ajuna.aspnetcore"rmdir /S /Q "%LOCAL_NUGET_CACHE%\ajuna.dotnet.template"rem Clear NuGet packages from local feedrmdir /S /Q "%LOCAL_NUGET_ROOT%\ajuna.dotnet"rmdir /S /Q "%LOCAL_NUGET_ROOT%\ajuna.dotnet.template"rmdir /S /Q "%LOCAL_NUGET_ROOT%\ajuna.servicelayer"rmdir /S /Q "%LOCAL_NUGET_ROOT%\ajuna.servicelayer.model"rmdir /S /Q "%LOCAL_NUGET_ROOT%\ajuna.aspnetcore"rmdir /S /Q "%LOCAL_NUGET_ROOT%\ajuna.dotnet.template"rem Add Ajuna.DotNet, Ajuna.DotNet.Template to NuGet%LOCAL_NUGET_BINARY% add %AJUNA_ROOT%\Tools\Ajuna.DotNet\nupkg\Ajuna.DotNet.%AJUNA_VERSION%.nupkg -Source %LOCAL_NUGET_ROOT%
%LOCAL_NUGET_BINARY% add %AJUNA_ROOT%\Tools\Ajuna.DotNet.Template\bin\Release\Ajuna.DotNet.Template.%AJUNA_VERSION%.nupkg -Source %LOCAL_NUGET_ROOT%
rem Add Ajuna.ServiceLayer, Ajuna.ServiceLayer.Model to NuGet%LOCAL_NUGET_BINARY% add %AJUNA_ROOT%\Ajuna.ServiceLayer\bin\Release\Ajuna.ServiceLayer.%AJUNA_VERSION%.nupkg -Source %LOCAL_NUGET_ROOT%
%LOCAL_NUGET_BINARY% add %AJUNA_ROOT%\Ajuna.ServiceLayer.Model\bin\Release\Ajuna.ServiceLayer.Model.%AJUNA_VERSION%.nupkg -Source %LOCAL_NUGET_ROOT%
rem Add Ajuna.AspNetCore to NuGet%LOCAL_NUGET_BINARY% add %AJUNA_ROOT%\Ajuna.AspNetCore\bin\Release\Ajuna.AspNetCore.%AJUNA_VERSION%.nupkg -Source %LOCAL_NUGET_ROOT%
rem Install .NET new templatedotnet new --install Ajuna.DotNet.Template
Mac
export AJUNA_ROOT="/Documents/Development/Ajuna.SDK"export LOCAL_NUGET_ROOT="/Documents/Development/_LocalNugetPackages"export LOCAL_NUGET_CACHE="/Users/{yourUserName}/.nuget/packages"export LOCAL_NUGET_BINARY=nugetexport AJUNA_VERSION="0.1.25"# Using this variable, you override the one set in the project/solution settingsset -mcd $AJUNA_ROOTdotnet build -p:Version=$AJUNA_VERSION --configuration Release cd $AJUNA_ROOT/Tools/Ajuna.DotNetdotnet pack -p:Version=$AJUNA_VERSION echo 'Clear local NuGet cache'rm -rf $LOCAL_NUGET_CACHE/ajuna.dotnetrm -rf $LOCAL_NUGET_CACHE/ajuna.dotnet.templaterm -rf $LOCAL_NUGET_CACHE/ajuna.servicelayerrm -rf $LOCAL_NUGET_CACHE/ajuna.servicelayer.modelrm -rf $LOCAL_NUGET_CACHE/ajuna.aspnetcorerm -rf $LOCAL_NUGET_CACHE/ajuna.dotnet.templateecho "Clear NuGet packages from local feed"rm -rf $LOCAL_NUGET_ROOT/ajuna.dotnetrm -rf $LOCAL_NUGET_ROOT%/ajuna.dotnet.templaterm -rf $LOCAL_NUGET_ROOT/ajuna.servicelayerrm -rf $LOCAL_NUGET_ROOT/ajuna.servicelayer.modelrm -rf $LOCAL_NUGET_ROOT/ajuna.aspnetcorerm -rf $LOCAL_NUGET_ROOT/ajuna.dotnet.templateecho "Add Ajuna.DotNet, Ajuna.DotNet.Template to NuGet"$LOCAL_NUGET_BINARY add $AJUNA_ROOT/Tools/Ajuna.DotNet/nupkg/Ajuna.DotNet.$AJUNA_VERSION.nupkg -Source $LOCAL_NUGET_ROOT
$LOCAL_NUGET_BINARY add $AJUNA_ROOT/Tools/Ajuna.DotNet.Template/bin/Release/Ajuna.DotNet.Template.$AJUNA_VERSION.nupkg -Source $LOCAL_NUGET_ROOT
echo "Add Ajuna.ServiceLayer, Ajuna.ServiceLayer.Model to NuGet"$LOCAL_NUGET_BINARY add $AJUNA_ROOT/Ajuna.ServiceLayer/bin/Release/Ajuna.ServiceLayer.$AJUNA_VERSION.nupkg -Source $LOCAL_NUGET_ROOT
$LOCAL_NUGET_BINARY add $AJUNA_ROOT/Ajuna.ServiceLayer.Model/bin/Release/Ajuna.ServiceLayer.Model.$AJUNA_VERSION.nupkg -Source $LOCAL_NUGET_ROOT
echo "Add Ajuna.AspNetCore to NuGet"$LOCAL_NUGET_BINARY add $AJUNA_ROOT/Ajuna.AspNetCore/bin/Release/Ajuna.AspNetCore.$AJUNA_VERSION.nupkg -Source $LOCAL_NUGET_ROOT
echo "Install .NET new template"dotnet new --install Ajuna.DotNet.Template
Once you have created the sh file, do not forget to set the permissions accordingly in order to allow it to be executed.
chmod 755 file.sh
Using these scripts should get you started on both platforms on how to maintain the local NuGet packages.
Having this installed, you can scaffold a new project as documented in the Project Generation section.
Debugging & Testing
Debugging
Since the new .NET template provides the absolute minimum to scaffold the projects, you can debug and inspect the actual code generators. Debug Ajuna.DotNet, like any other project.
Testing
First, set the environment variable AJUNA_USE_MOCKUP_PROVIDER
set AJUNA_USE_MOCKUP_PROVIDER=true
Check if set with this command which should return true
echo %AJUNA_USE_MOCKUP_PROVIDER%
If it is the first time, you will be asked for certificate, when running the rest client