Skip to content

Compiling from Source

Kotz edited this page Dec 24, 2023 · 1 revision

Prerequisites

Steps

Compiling the CLI application

  • Download this repository.
    • git clone https://github.com/Kaoticz/Json2Sharp
  • Navigate to Json2Sharp/Json2SharpApp
    • cd Json2Sharp/Json2SharpApp
  • Execute dotnet publish. Tweak the build with any compilation flags you want.
    • Adding -c Release to your build is strongly encouraged as this will include compiler optimizations into your final binary.
    • For reference, this is the command used to generate the official builds in this repository, where <rid> is the Runtime Identifier.
      • dotnet publish --self-contained -c Release -r <rid> -o ~/build/Json2Sharp_<rid>

Compiling the NuGet package

  • Download this repository.
    • git clone https://github.com/Kaoticz/Json2Sharp
  • Navigate to Json2Sharp/Json2SharpLib
    • cd Json2Sharp/Json2SharpLib
  • Execute dotnet build. Tweak the build with any compilation flags you want.
    • Reference: dotnet build -p:PackageId=Json2Sharp -p:AssemblyName=Json2Sharp -c Release
  • Execute dotnet pack. Tweak the package with any packaging flag you want.
    • Reference: dotnet pack --include-symbols -p:SymbolPackageFormat=snupkg -p:PackageId=Json2Sharp -p:AssemblyName=Json2Sharp -c Release -o ~/build

Clone this wiki locally