Skip to content

Feat(gradle-plugin): register emitTypedPythonC from pythonBindings DSL (#25) - #374

Merged
b-re-w merged 1 commit into
developfrom
feat/tp-emit-c-plugin-wiring
Nov 7, 2026
Merged

b-re-w merged 1 commit into
developfrom
feat/tp-emit-c-plugin-wiring

Conversation

@b-re-w

@b-re-w b-re-w commented Nov 7, 2026

Copy link
Copy Markdown
Member

Refs #25

Summary

  • Feature added:
    • PythonBindingsExtension (PythonBindingsPlugin.kt): added typedPythonSourceDir, typedPythonRootDir (defaults to typedPythonSourceDir), typedPythonExecutable (defaults to "python3"), and typedPythonPath.
    • PythonBindingsPlugin.configureTypedPythonEmitC (PythonBindingsPlugin.kt): registers emitTypedPythonC (TypedPythonEmitCTask) when typedPythonSourceDir is set, scanning **/*.py (excluding __pycache__, dotfiles, build) with outputs at build/typedpython/c-cache and build/typedpython/emit-c-manifest.json.
    • :python-multiplatform-ksp:fixtures:app (build.gradle.kts): configures pythonBindings { typedPythonSourceDir.set(file("src/desktopTest/typedpython")); ... } and wires emitTypedPythonC into desktopTest.
  • Test added:
    • TypedPythonEmitCTaskTest.kt: added pluginDoesNotRegisterEmitTypedPythonCWhenSourceDirIsUnset and pluginRegistersEmitTypedPythonCFromExtensionAndExecutesIt.
    • TypedPythonKotlinCallTest.kt: added emitTypedPythonCTaskWritesManifestForTpKotlinBridge verifying the end-to-end emitTypedPythonC manifest for tp_kotlin_bridge.py.
  • Documentation corrected:
    • docs/SPEC.md (N-10): documented the pythonBindings DSL properties and emitTypedPythonC registration.

Verification

  • Disabled configureTypedPythonEmitC call in PythonBindingsPlugin.apply (AGENTS.md §8): :python-multiplatform-ksp:fixtures:app:desktopTest failed with Task with path emitTypedPythonC not found in project :python-multiplatform-ksp:fixtures:app.
  • Restored registration:
    • ./gradlew :python-multiplatform-gradle-plugin:check --rerun: 49 suites, 360 tests, 0 failures.
    • ./gradlew :python-multiplatform-ksp:fixtures:app:desktopTest --rerun: 11 suites, 81 tests, 0 failures.
    • ./gradlew :python-multiplatform-gradle-plugin-fixtures:artifact:desktopTest --rerun: 11 suites, 50 tests, 0 failures.

@b-re-w
b-re-w merged commit a148c07 into develop Nov 7, 2026
@b-re-w
b-re-w deleted the feat/tp-emit-c-plugin-wiring branch November 7, 2026 01:27
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