Repository Public
1// swift-tools-version: 6.02// =============================================================================3// SP BOUCHER | SOFTWARE & RESEARCH4// ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5// =============================================================================6//7// PROJECT METADATA8// -----------------------------------------------------------------------------9// Project : ORIX Sheet10// File : Packages/SheetTemplates/Package.swift11// Module : Packages12// Repository : https://git.spboucher.ai/orix-sheet13// Created : 2026-11-2114// Last Modified : 2026-11-2115//16// =============================================================================17// AUTHOR & PROFESSIONAL AFFILIATION18// =============================================================================19//20// Author : Simon-Pierre Boucher21// Position : Professor of Finance22// Institution : Université du Québec en Outaouais (UQO)23// Department : Département des sciences administratives24// Organization : SP Boucher25//26// Website : https://spboucher.ai27// Git : https://git.spboucher.ai28//29// =============================================================================30// OFFICIAL CONTACT DIRECTORY31// =============================================================================32//33// General : info@spboucher.ai34// Professional : contact@spboucher.ai35// Direct : simon@spboucher.ai36// Research : research@spboucher.ai37// Development : dev@spboucher.ai38// Support : support@spboucher.ai39// Security/Admin : admin@spboucher.ai40// Notifications : notifications@spboucher.ai41//42// Preferred Contact: support@spboucher.ai43//44// =============================================================================45// COPYRIGHT & INTELLECTUAL PROPERTY46// =============================================================================47//48// Copyright (c) 202649// Simon-Pierre Boucher50//51// All rights reserved where applicable.52//53// This file is governed by the applicable project license,54// copyright notices, institutional agreements and relevant law.55//56// Unless expressly authorized by the applicable license or57// rights holder, copying, redistribution, sublicensing,58// publication and commercial exploitation are not permitted.59//60// Existing third-party rights and notices remain unaffected.61//62// =============================================================================63// CONFIDENTIALITY & SECURITY64// =============================================================================65//66// Classification : Public67// Distribution : Public repository; use is governed by the project license68// Security Contact : admin@spboucher.ai69//70// Access to this source does not independently grant permission71// to redistribute or disclose confidential materials.72//73// Do not embed credentials, private keys, access tokens,74// certificates or confidential personal information.75//76// =============================================================================77// LICENSE & MAINTENANCE78// =============================================================================79//80// License : None specified (no license file in this repository)81// Maintainer : Simon-Pierre Boucher82// Technical Contact: dev@spboucher.ai83//84// =============================================================================85// END OF SP BOUCHER SOURCE HEADER86// =============================================================================8788import PackageDescription89import Foundation9091// SheetTemplates — the template library of ORIX Sheet: fifteen functional workbooks built in code92// (English and Canadian French), plus a preview harness that renders each of them in a WorkbookView.93//94// The preview links the sibling feature packages that draw embedded charts (FeatureCharts) and conditional95// formatting (FeatureAudit) when they are present; without them the grid shows chart placeholders and no96// conditional fills. Set ORIX_TEMPLATES_NO_FEATURES=1 to build the harness without them.97let here = URL(fileURLWithPath: #filePath).deletingLastPathComponent()98func sibling(_ name: String) -> Bool {99 ProcessInfo.processInfo.environment["ORIX_TEMPLATES_NO_FEATURES"] == nil100 && FileManager.default.fileExists(atPath: here.appendingPathComponent("../\(name)/Package.swift").path)101}102let withPreview = ProcessInfo.processInfo.environment["ORIX_TEMPLATES_NO_PREVIEW"] == nil103let hasCharts = withPreview && sibling("FeatureCharts")104let hasAudit = withPreview && sibling("FeatureAudit")105106var dependencies: [Package.Dependency] = [107 .package(path: "../SheetCore"), .package(path: "../SheetEngine"), .package(path: "../SheetCharts"),108 .package(path: "../SheetFormat"), .package(path: "../SheetIO"),109]110if withPreview { dependencies.append(.package(path: "../SheetUI")) }111var previewDependencies: [Target.Dependency] = [112 "SheetTemplates", .product(name: "SheetCore", package: "SheetCore"), .product(name: "SheetEngine", package: "SheetEngine"),113 .product(name: "SheetUI", package: "SheetUI"), .product(name: "SheetFormat", package: "SheetFormat"),114]115var previewSettings: [SwiftSetting] = []116if hasCharts {117 dependencies.append(.package(path: "../FeatureCharts"))118 previewDependencies.append(.product(name: "FeatureCharts", package: "FeatureCharts"))119 previewSettings.append(.define("HAS_FEATURE_CHARTS"))120}121if hasAudit {122 dependencies.append(.package(path: "../FeatureAudit"))123 previewDependencies.append(.product(name: "FeatureAudit", package: "FeatureAudit"))124 previewSettings.append(.define("HAS_FEATURE_AUDIT"))125}126127var products: [Product] = [.library(name: "SheetTemplates", targets: ["SheetTemplates"])]128var targets: [Target] = [129 .target(130 name: "SheetTemplates",131 dependencies: [132 .product(name: "SheetCore", package: "SheetCore"), .product(name: "SheetEngine", package: "SheetEngine"),133 .product(name: "SheetCharts", package: "SheetCharts"), .product(name: "SheetFormat", package: "SheetFormat"),134 ],135 linkerSettings: [.linkedFramework("CoreGraphics"), .linkedFramework("CoreText"), .linkedFramework("ImageIO")]136 ),137 .testTarget(138 name: "SheetTemplatesTests",139 dependencies: [140 "SheetTemplates", .product(name: "SheetCore", package: "SheetCore"), .product(name: "SheetEngine", package: "SheetEngine"),141 .product(name: "SheetCharts", package: "SheetCharts"), .product(name: "SheetIO", package: "SheetIO"),142 ],143 exclude: ["Generators"],144 resources: [.copy("Fixtures")]145 ),146]147if withPreview {148 products.append(.executable(name: "templates-preview", targets: ["templates-preview"]))149 targets.append(.executableTarget(name: "templates-preview", dependencies: previewDependencies, swiftSettings: previewSettings))150}151152let package = Package(153 name: "SheetTemplates",154 platforms: [.macOS(.v14)],155 products: products,156 dependencies: dependencies,157 targets: targets158)159