Skip to content

ForNeVeR/PascalABC.NET.SDK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PascalABC.NET SDK Status Enfer

This is an MSBuild SDK for PascalABC.NET programming language.

NuGet

  • FVNever.PascalABC.NET.Compiler: NuGet package version badge
  • FVNever.PascalABC.NET.SDK: NuGet package version badge

Usage

Prerequisites

  1. For now, only Windows is supported as the target platform.
  2. Download .NET 6 SDK or later.

Quick Start

Prepare the following project file, MyProject.pasproj:

<Project Sdk="FVNever.PascalABC.NET.SDK/2.0.1">

   <PropertyGroup>
       <TargetFramework>net472</TargetFramework>
   </PropertyGroup>

   <ItemGroup>
       <MainCompile Include="Hello.pas" />
   </ItemGroup>

</Project>

where Hello.pas is your main Pascal module, for example:

uses References_Generated; // to use SDK-generated assembly references
begin
    writeln('Hello, world!');
end.

After that, dotnet build should build the PascalABC.NET project; see the output in the bin directory.

dotnet run may be used to run the project.

See the PascalABC.NET.SDK.Demo project for details.

Items

In a project, there should be exactly one <MainCompile> item, which will be the main module passed to the compiler.

Other (non-main) .pas files may be added as <Compile> items, which are only used to track incremental compilation dependencies.

References

All the assembly references are resolved during build and written to a generated module References_Generated by default. This means that your main module should add uses References_Generated to access the referenced assemblies.

Properties

You can change the following properties in your project file to customize the SDK behavior.

  • PascalABCNETCompilerPackageName: the name of the compiler package that will be downloaded from NuGet, FVNever.PascalABC.NET.Compiler by default.
  • PascalABCNETCompilerPackageVersion: the version of the compiler package to use; may be updated if a new version of the SDK is published.
  • SkipPascalABCNETCompilerInstallation: set to true to skip the compiler installation by the SDK (if you want to get the compiler yourself via other means).
  • DebugMode: if true, then the compiler will generate debug information and disable the optimizations. Enabled by default for the Debug configuration.
  • PascalAbcCompilerCommand: command to run the compiler; just the path to the packaged compiler executable by default.
  • SkipGenerateReferenceFile: if you don't want the SDK to generate the reference module.

Common MSBuild properties are supported as well.

Development

Before opening the solution or running the unit testing suite, first publish the development packages using this shell command (PowerShell is required):

$ pwsh ./scripts/build-packages.ps1

To execute the tests, run the following shell commands:

$ dotnet test PascalABC.NET.UnitTests
$ dotnet test PascalABC.NET.IntegrationTests

Documentation