Package Building Guide

A modern, high-performance lexical analysis and parsing system with comprehensive PCRE2 support and CognitiveGraph integration

Package Building Guide

Overview

This repository contains two NuGet packages:

Development vs Package Workflow

Development Mode (Default)

Package Mode (Release)

Building Packages Locally

Quick Package Build

# Build packages using the included script
./build-packages.sh

# Or build manually
dotnet build --configuration Release

Manual Package Build

# Clean previous builds
dotnet clean --configuration Release

# Build Release (auto-generates packages)
dotnet build --configuration Release

# Find generated packages
find . -name "*.nupkg"

Copy Packages to Output Directory

# Build and copy to specific directory
./build-packages.sh --output-dir ./packages

Testing Packages Locally

Install from Local Source

# Add packages from local build output
dotnet add package DevelApp.StepLexer --source ./src/DevelApp.StepLexer/bin/Release
dotnet add package DevelApp.StepParser --source ./src/DevelApp.StepParser/bin/Release

Create Local NuGet Source

# Create and configure local package source
mkdir -p ~/my-nuget-packages
dotnet nuget add source ~/my-nuget-packages --name "Local"

# Copy packages to local source
cp ./src/DevelApp.StepLexer/bin/Release/*.nupkg ~/my-nuget-packages/
cp ./src/DevelApp.StepParser/bin/Release/*.nupkg ~/my-nuget-packages/

# Install from local source
dotnet add package DevelApp.StepLexer --source "Local"
dotnet add package DevelApp.StepParser --source "Local"

Package Dependencies

DevelApp.StepLexer

DevelApp.StepParser

CI/CD Integration

The repository uses a split CI/CD pipeline approach to ensure clean release package naming:

CI Pipeline (.github/workflows/ci.yml)

CD Pipeline (.github/workflows/cd.yml)

Version Management

GitVersion Configuration

How Automatic Versioning Works

GitVersion automatically calculates versions based on:

  1. Latest git tag (e.g., v1.0.1)
  2. Commits since tag (counts commits to determine if version needs increment)
  3. Branch increment strategy (defined in GitVersion.yml)

No manual version updates needed! Just merge to main and GitVersion handles the rest.

Version Increment Behavior

With increment: Minor on main branch:

To change increment behavior, edit GitVersion.yml:

branches:
  main:
    increment: Minor  # Options: Major, Minor, Patch, None

For Major Version Changes

Create a new tag manually:

git tag v2.0.0
git push --tags

Then GitVersion will base future versions on this tag.

Version Types in CI/CD

Pipeline Separation Benefits

Project Structure

src/
├── DevelApp.StepLexer/          # Core lexer package
│   ├── bin/Release/             # Generated packages here
│   └── DevelApp.StepLexer.csproj
├── DevelApp.StepParser/         # Core parser package  
│   ├── bin/Release/             # Generated packages here
│   └── DevelApp.StepParser.csproj
├── DevelApp.StepLexer.Tests/    # Lexer tests
├── DevelApp.StepParser.Tests/   # Parser tests
└── ENFAStepLexer.Demo/          # Demo application

Troubleshooting

Packages Not Generated

Missing Dependencies

Demo Application Issues