Skip to content

Add version 0.5.0 improvements: build scripts and codesigning#3

Open
jteich7 wants to merge 22 commits intobinghe:masterfrom
jteich7:master
Open

Add version 0.5.0 improvements: build scripts and codesigning#3
jteich7 wants to merge 22 commits intobinghe:masterfrom
jteich7:master

Conversation

@jteich7
Copy link

@jteich7 jteich7 commented Feb 6, 2026

  • Build script improvements for macOS 64-bit
  • Codesigning integration
  • New build-and-increment.sh script

jteich7 and others added 22 commits September 4, 2025 10:22
New plugin supporting X-Rechnung compliant invoices and PDF/A documents:
- PDF/A-3b conversion for FileMaker PDFs
- X-Rechnung/ZUGFeRD XML generation
- ZUGFeRD/Factur-X hybrid document creation
- Invoice data validation functions

Plugin structure follows regex-plugin pattern with complete
scaffold ready for PDF and XML library integration.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Changed element-type from lw:simple-char to character for portability
- Added #+:lispworks conditionals for LispWorks-specific functions
- Added SBCL stub for get-backtrace function
- Conditionalized top-level-hook, interface geometry, and IDE helpers

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Core functionality implemented:
- PDF/A-3b conversion using Ghostscript
  * ConvertToPDFA for binary data input
  * ConvertToPDFAFromFile for file input
  * Basic PDF/A validation
- ZUGFeRD/Factur-X support using QPDF
  * CreateZUGFeRD to embed XML in PDF/A
  * ExtractXMLFromZUGFeRD to extract embedded XML
- Tool management and detection
  * CheckTools function for availability verification
  * Cross-platform executable detection (Windows/macOS/Linux)
  * Automatic path resolution
- Utility infrastructure
  * External command execution with error handling
  * Shell argument quoting for security
  * Temporary file management
  * Binary data file writing

Updated documentation:
- Comprehensive README with usage examples
- External tool installation instructions
- FileMaker script examples for common workflows
- Updated changelog with implementation status

Next steps: X-Rechnung XML generation and validation

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Complete implementation of X-Rechnung/ZUGFeRD XML generation:

XML Generation (xml-generation.lisp):
- Full CII (Cross Industry Invoice) format support
- EN 16931 compliant structure with proper namespaces
- ExchangedDocumentContext with guideline specification
- ExchangedDocument with invoice metadata and notes
- SupplyChainTradeTransaction with complete trade details
- Automatic tax calculations and monetary summations
- Support for multiple VAT rates
- Party information (seller/buyer) with addresses and contacts
- Line items with quantities, prices, and tax rates
- Payment terms and due dates

JSON Integration:
- Added com.inuoe.jzon dependency for robust JSON parsing
- Hash table based data structures for invoice data
- parse-json-string function for JSON deserialization

Enhanced Validation:
- ValidateInvoiceData with comprehensive field checking
- Required fields validation (invoice number, dates, parties, items)
- Line item validation (descriptions, quantities, prices, VAT)
- Detailed error reporting in JSON format

Documentation:
- Complete JSON field reference with required/optional indicators
- example-invoice.json with realistic invoice data
- FileMaker script examples for XML generation workflow
- Updated usage examples for complete ZUGFeRD workflow
- Comprehensive field documentation for seller/buyer/items

Updated system definition to include xml-generation.lisp module

This completes the core X-Rechnung functionality pipeline:
PDF → PDF/A → XML → ZUGFeRD hybrid document

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fixed error "RUN-SHELL-COMMAND cannot wait when streams are being created"
by removing :wait t parameter when using :output :stream.

In LispWorks, sys:run-shell-command with :output :stream returns
immediately and runs asynchronously. The exit status is available
after the stream is closed via sys:pipe-exit-status.

Changes:
- find-executable: Remove :wait t, check exit status after reading
- run-external-command: Remove :wait t, get exit status after stream closes

This fixes ghostscript-available-p and qpdf-available-p tool detection.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The define-plugin-function macro doesn't create named blocks that match
the function names, so return-from was causing compilation errors.

Replaced all return-from with proper conditional logic:
- ConvertToPDFAFromFile: use cond
- ConvertToPDFA: use if
- ValidatePDFA: use cond
- GenerateXRechnungXML: use if
- ValidateXRechnungXML: use or with gethash
- CreateZUGFeRD: use cond
- ExtractXMLFromZUGFeRD: use cond
- ValidateInvoiceData: use nested if

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The correct type specifier for binary container data is :binary-data
not :binary, as used in other plugin examples.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The #+:lispworks conditionals on critical accessor functions
(extn-version, which-call, parm1, etc.) prevented plugins from
loading in FileMaker. These functions use foreign-slot-value
which is LispWorks-specific anyway.

This reversion fixes both XRechnungPlugin and RegexPlugin loading.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
At delivery level 5, LispWorks aggressively removes unused code.
The jzon parser was being removed because it's not called during
build time, causing the plugin to fail initialization in FileMaker.

Added jzon:parse, jzon:stringify, and jzon::parser to *symbols-to-keep*
to ensure JSON functionality remains available at runtime.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Major features:
- PDF/A-3b conversion using Ghostscript (ConvertToPDFAFromFile, ConvertToPDFA)
- X-Rechnung XML generation in CII format (GenerateXRechnungXML)
- ZUGFeRD/Factur-X hybrid document creation (CreateZUGFeRD)
- Tool availability checking (CheckTools)
- Configuration management with preferences

Key fixes:
- Fixed LispWorks sys:run-shell-command stream issues by using sys:call-system
- Fixed find-executable to use probe-file instead of shell commands
- Fixed plugin initialization errors (get-temp-directory naming, plugin-preference usage)
- Fixed code signing: plugins must be signed twice (lwheap first, then bundle)
- Fixed build scripts to handle .fmplugin instead of .app
- Fixed ConvertToPDFAFromFile to correctly pass output path to Ghostscript

Build improvements:
- Added build-and-increment.sh for auto-incrementing patch version during development
- Updated build-plugin64.command to include automatic code signing
- Template Info.plist and PkgInfo for proper bundle structure

Documentation:
- Added CERT.md with code signing instructions
- Updated README with plugin functionality and requirements
- Version incremented to 0.1.1

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Return JSON responses from ConvertToPDFA for structured error handling
  Format: {"success": true/false, "result": path, "error": message}
- Fix notes handling to support vectors from jzon JSON arrays
- Bump version to 0.1.8 in .asd and Info.plist
- Set production delivery level (5) for optimized builds
- Reorganize test data into example_data/ directory

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…onse

- Fix ConvertToPDFA to return JSON format (consistency with FromFile version)
  Both functions now return: {"success": true/false, "result": path, "error": msg}

- Add FileMaker clipboard XML scripts for easy import:
  * Test1_Success_Case.xml - Valid PDF conversion test
  * Test2_Empty_Container.xml - Error handling test
  * Run_All_Tests.xml - Master test runner
  * Clear_Test_Results.xml - Reset utility
  * HOW_TO_IMPORT.txt - Simple copy-paste import guide

Usage: Copy XML content, paste into FileMaker Script Workspace

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add 4 remaining test scripts (importable XML format):
  * Test3_Invalid_Path.xml - Invalid output path error handling
  * Test4_File_Not_Found.xml - Missing input file error handling
  * Test5_File_Path.xml - File-based conversion test
  * Test6_With_Metadata.xml - Metadata parameter test

- Add CHEAT_SHEET.txt - One-page quick reference guide

Complete suite: 8 scripts (6 tests + 1 runner + 1 utility)
Total: 1,301 lines of FileMaker script steps
Import time: ~5 minutes for full suite

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Revolutionary! Generates FileMaker script steps and copies to clipboard
for instant pasting into FileMaker Script Workspace.

Features:
- Generates proper fmxmlsnippet XML format
- Uses correct pasteboard type (dyn.ah62d4rv4gk8zuxnxnq)
- No more manual script creation!

Available scripts:
- test1: Success Case - Valid PDF conversion test
- test2: Error - Empty Container test
- clear: Clear Test Results utility
- runall: Run All Tests master script

Usage:
  swift build -c release
  .build/release/fmscriptgen test1
  # Paste in FileMaker (Cmd+V)

Install:
  ./install.sh

Technical Achievement:
Reverse-engineered FileMaker clipboard format by analyzing
pasteboard types and XML structure. Tool generates exact format
FileMaker expects, enabling programmatic script generation.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Explains how to use FMScriptGen tool
- Lists required fields
- Documents test workflow
- Includes troubleshooting guide
- References all relevant documentation

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…mands

Major improvement: Tool now reads simple text files instead of having
hardcoded scripts. Much more flexible and maintainable!

Changes:
- Add ScriptParser.swift - parses simple text format
- Add script-definitions/ folder for predefined scripts
- Accept filepath as argument: fmscriptgen /path/to/script.txt
- Keep shortcuts: fmscriptgen test1 (uses script-definitions/test1.txt)
- Remove hardcoded script generators
- Add SCRIPT_FORMAT.md documentation

Script format:
  SetVariable: $name = value
  SetField: table::field = calc
  If: condition
  ShowDialog: "title" "message"
  # Comments supported

Benefits:
- No need to modify Swift code to add scripts
- Users can create their own script definitions
- Much simpler to maintain
- Text files can be version controlled easily

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Complete set of test scripts in simple text format:
- test2.txt: Error handling - empty container
- test3.txt: Error handling - invalid output path
- test4.txt: Error handling - file not found
- test5.txt: Success - file path conversion
- test6.txt: Success - with metadata parameter
- clear.txt: Clear test results utility
- runall.txt: Master test runner

All scripts use simple readable format that anyone can modify.

Usage:
  fmscriptgen test2
  fmscriptgen clear
  fmscriptgen runall

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Complete overview of the tool with:
- Quick start guide
- All available scripts listed
- How to create custom scripts
- Format reference
- Examples
- Troubleshooting
- Architecture overview

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The xrechnung-plugin has been moved out of this repository to become
its own standalone project. This commit removes all xrechnung-plugin
files and updates the main project configuration.

Changes:
- Remove entire xrechnung-plugin/ directory
- Remove CERT.md (codesigning notes)
- Update CHANGELOG.txt with version 0.5.0 notes
- Change deliver-level to 0 for development in deliver.lisp

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
New build script that automatically increments the patch version number
during the build process, improving version management for macOS 64-bit
plugin builds.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant