ol.vips.codegen

Generate the introspected wrapper namespaces for ol.vips.

This namespace queries the live libvips runtime through ol.vips and ol.vips.impl.introspect, then writes the generated public wrapper files:

  • src/ol/vips/enums.clj

  • src/ol/vips/operations.clj

The generated files are derived from the currently loaded libvips build, so run this from a development environment where ol.vips can initialize its native libraries.

Usage:

(require '[ol.vips.codegen :as codegen])

(codegen/generate!)
;;=> {:enum-count 42
;;    :operation-count 233
;;    :skipped-count 57
;;    :paths ["src/ol/vips/enums.clj"
;;            "src/ol/vips/operations.clj"]}

In the ol.vips code repo the babashka task bb codegen is the normal project entry point for this namespace.

generate!

(generate!)

Generates ol.vips.enums and ol.vips.operations from live libvips introspection.

Initializes the runtime if needed, discovers the supported operations and enums from the current libvips build, writes the generated source files, and returns a summary map describing what was emitted.

Example:

(generate!)
;;=> {:enum-count ...
;;    :operation-count ...
;;    :skipped-count ...
;;    :paths ["src/ol/vips/enums.clj" "src/ol/vips/operations.clj"]}

-main

(-main & _args)

Runs generate! and prints a short CLI summary.