How to build from source
February 26, 2023 ยท View on GitHub
Nostrid consists of several projects:
Nostrid.Core: Library that contains most of the logic. This project is used by all the other projects.Nostrid: MAUI application for running Nostrid in Windows x64, Android, MacOS (MacCatalyst) and iOSNostrid.Web: Web version of NostridNostrid.Photino: Cross-platform desktop version of Nostrid that works in Windows (including Arm platform), Linux and MacOS
For Windows it's recommended to install Visual Studio 2022. For other platforms you can use .NET CLI (how to install .NET SDK 7.0).
MAUI: Building for Windows
- Make sure Visual Studio is installed with option
.NET Multi-platform App UI development, otherwise you will have rundotnet workload restorein the command line in the directory of projectNostrid - Make sure Git is installed and added to your
PATH
From Visual Studio:
- Open solution
- Right click on project
Nostrid - To run: select
Debug>Start new instance - To generate installer: select
Publish...and follow the instructions
MAUI: Building for MacOS, Android and iOS
- You can build for Android in Windows. For iOS and MacOS you need a Mac.
- You may be prompted to install workloads by running
dotnet workload restore - Make sure Git is installed and added to your
PATH - MacOS requires the project to run in Debug mode or else the WebView element doesn't appear to work
- In the command line go to project
Nostrid - For Android: run
dotnet publish -c Release -f net7.0-android - For MacOS: run
dotnet publish -c Debug -f net7.0-maccatalyst - For iOS: run
dotnet publish -c Release -f net7.0-ios(refer to this article for details on how to setup your environment)
Photino: Building for Linux, Windows Arm and other desktop platforms
- For these platforms we use Photino
- Make sure Git is installed and added to your
PATH
From Visual Studio:
- Open solution
- Right click on project
Nostrid.Photino - To run: select
Debug>Start new instance - To generate binaries: select
Publish...and follow the instructions
From CLI:
- In the command line go to project
Nostrid.Photino - Create file
.\Properties\PublishProfiles\FolderProfile.pubxml - Add this content (adjust
RuntimeIdentifieras needed according to desired platform):
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net7.0\publish\linux-x64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
<TargetFramework>net7.0</TargetFramework>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
<PublishSingleFile>true</PublishSingleFile>
<PublishTrimmed>false</PublishTrimmed>
</PropertyGroup>
</Project>
- Run
dotnet publish -p:PublishProfile=FolderProfile
Building for Web
- Make sure Visual Studio is installed with component
.NET Webassembly Build Tools - Make sure Git is installed and added to your
PATH
From Visual Studio:
- Open solution
- Right click on project
Nostrid.Web - Select
Publish...and follow the instructions