Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ Carthage
#
Pods/
Example/Pods/
.build
29 changes: 29 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Repository Guidelines

## Project Structure & Module Organization
`Package.swift` defines four library targets:

- `DBC-swift/`: core Swift API such as `require`, `check`, and `ensure`
- `DBC-objc/`: Objective-C implementation and public headers
- `DBC-bridged/`: bridge layer that combines Swift and Objective-C targets
- `DBC-testing/`: test helpers such as custom XCTest assertions

SwiftPM tests live under `Example/Tests/swift` and `Example/Tests/objc`. The `Example/` directory also contains legacy iOS, tvOS, and macOS sample app targets plus the Xcode project/workspace used for manual verification.

## Build, Test, and Development Commands
- `swift build`: builds all SwiftPM library targets.
- `swift test`: runs the Swift and Objective-C package test targets.
- `swift test --filter SwiftDBCTests`: runs a single XCTest class while iterating.
- `xcodebuild -project Example/DBC.xcodeproj -scheme DBC-Example test`: exercises the example project test flow when SwiftPM coverage is not enough.
- `cd Example && pod install`: refreshes CocoaPods dependencies for the example workspace if you need to open it in Xcode.

Run commands from the repository root unless the command says otherwise.

## Coding Style & Naming Conventions
Match the surrounding file before “cleaning up” style. Existing Swift and Objective-C sources use tabs in many files, `UpperCamelCase` for types, and descriptive `lowerCamelCase` for functions and variables. Keep assertion API names aligned with the library vocabulary (`require`, `check`, `ensure`, `inform`). There is no configured formatter or linter in this repo, so avoid unrelated whitespace churn.

## Testing Guidelines
Tests use `XCTest` plus helpers from `DBC-testing`. Name new tests with the `test...` prefix and group them by behavior, as in `SwiftDBCTests`. Add regression tests for any assertion semantics, intensity handling, or bridging behavior you change. Prefer `swift test` first, then fall back to `xcodebuild` only for example-app-specific coverage.

## Commit & Pull Request Guidelines
Recent history uses short, imperative commit subjects such as `Support Swift Package manager` and `Swift 5 update`. Keep commits focused and scoped to one concern. PRs should include a brief behavior summary, the test command(s) you ran, and links to any relevant issue. Include screenshots only when touching the sample apps’ UI.
4 changes: 1 addition & 3 deletions DBC-bridged/DBCIntensityBridged.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ import DBC_objc
@objc static public var intensityLevel: Int = 0 {
didSet {
dbcIntensityLevel = intensityLevel
#if DEBUG
DBC_SetDebugIntensityLevel(intensityLevel);
#endif
DBC_SetDebugIntensityLevel(intensityLevel)
}
}
}
14 changes: 5 additions & 9 deletions DBC-objc/DBCIntensityLevel.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,18 @@
#define __DBCINTENSITYLEVEL__

/**
Set "DBC_DebugIntensityLevel" to some value to execute intense debugging/messaging code.
Allows you to enter intense debugging/messaging code at some level greater then zero.
Set "DBC_DebugIntensityLevel" to some value to execute intensity-gated messaging.
Allows you to enter intensity-gated messaging code at some level greater than zero.
When you back off the intensity level, you can leave the code in place without
execution until that intensity level is required again.

"DBC_DebugIntensityLevel" defaults to zero. If a higher intensity level is required,
it should be changed to the higher level in the debugger at runtime.

Setting "DBC_DebugIntensityLevel to a value less then zero effectively turns debugging/messaging off
for these calls
Setting "DBC_DebugIntensityLevel" to a value less than zero effectively turns intensity-gated messaging off
for these calls.
*/

#ifdef DEBUG

@import Foundation;

#ifdef __cplusplus
Expand All @@ -34,7 +32,7 @@ extern "C" {
extern NSInteger DBC_DebugIntensityLevel(void);
extern void DBC_SetDebugIntensityLevel(NSInteger intensityLevel);

/// Utility function to perform a provided closure `block` if `DBC_DebugIntensityLevel` is at or greater then the target `intensity` level.
/// Utility function to perform a provided closure `block` if `DBC_DebugIntensityLevel` is at or greater than the target `intensity` level.
/// See `DBC_DebugIntensityLevel`.
extern void DBC_performIfDBCIntensity(NSInteger intensity, void (^ _Nonnull block)(void));

Expand All @@ -43,5 +41,3 @@ extern "C" {
#endif

#endif

#endif
4 changes: 0 additions & 4 deletions DBC-objc/DBCIntensityLevel.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

#import "DBCIntensityLevel.h"

#ifdef DEBUG

#ifndef vIntenseDebugging
#define vIntenseDebugging 0
#endif
Expand Down Expand Up @@ -37,5 +35,3 @@ void DBC_performIfDBCIntensity(NSInteger intensity, void (^ _Nonnull block)(void
block();
}
}

#endif
Loading