Indigo Goes Native: Laying the Foundations#66
Conversation
4321227 to
34019ec
Compare
There was a problem hiding this comment.
Pull request overview
This PR lays groundwork for Scala Native support across the Indigo monorepo by introducing Native module variants/stubs and adjusting module wiring so Native targets compile.
Changes:
- Adds/extends
nativeMill modules across Indigo libraries (and updates the dependency diagram accordingly). - Introduces initial Scala Native stubs/placeholders (e.g., platform/engine scaffolding and a placeholder launcher).
- Adds shader and matrix tests for additional platforms (Native/JVM/JS), while several existing shared tests are temporarily disabled.
Reviewed changes
Copilot reviewed 53 out of 60 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| ultraviolet/test/src-native/ultraviolet/acceptance/IndigoTests.scala | Adds a Native test suite placeholder for Ultraviolet/Indigo acceptance tests. |
| ultraviolet/package.mill | Adjusts Ultraviolet build imports for Native support (contains a duplicate import). |
| indigoengine-shared/package.mill | Enables publishing for the JVM shared module and adds publishing for Native. |
| indigo/test/src/indigo/scenes/SceneManagerTests.scala | Temporarily disables a shared SceneManager test suite (commented out). |
| indigo/test/src/indigo/scenes/SceneFinderTests.scala | Temporarily disables a shared SceneFinder test suite (commented out). |
| indigo/src/indigo/frameprocessors/GameFrameProcessor.scala | Removes an unused import to keep compilation clean. |
| indigo/src-native/indigo/PlaceholderGameLauncher.scala | Adds a Native placeholder launcher type. |
| indigo/package.mill | Rewires Indigo top-level module to provide a Native target. |
| indigo-shaders/test/src-native/indigo/shaders/ToUniformBlockTests.scala | Adds Native coverage for ToUniformBlock derivation. |
| indigo-shaders/test/src-native/indigo/shaders/StandardShadersTests.scala | Adds Native “smoke” tests to ensure standard shaders compile/emit code. |
| indigo-shaders/test/src-native/indigo/shaders/ShaderPrimitiveTests.scala | Adds Native tests for shader primitive packing behavior. |
| indigo-shaders/test/src-jvm/indigo/shaders/ToUniformBlockTests.scala | Adds JVM coverage for ToUniformBlock derivation. |
| indigo-shaders/test/src-jvm/indigo/shaders/StandardShadersTests.scala | Adds JVM “smoke” tests for standard shaders. |
| indigo-shaders/test/src-jvm/indigo/shaders/ShaderPrimitiveTests.scala | Adds JVM tests for shader primitive packing behavior. |
| indigo-shaders/test/src-js/indigo/shaders/ToUniformBlockTests.scala | Adds JS coverage for ToUniformBlock derivation. |
| indigo-shaders/test/src-js/indigo/shaders/StandardShadersTests.scala | Adds JS “smoke” tests for standard shaders. |
| indigo-shaders/test/src-js/indigo/shaders/ShaderPrimitiveTests.scala | Adds JS tests for shader primitive packing behavior. |
| indigo-shaders/src/indigo/shaders/library/BaseEntityShader.scala | Adjusts fragment template placeholder emission to compile cleanly under stricter warnings. |
| indigo-shaders/package.mill | Introduces Native module; current JVM module wiring appears incorrect (see comments). |
| indigo-scenegraph/package.mill | Introduces Native module wiring for scenegraph. |
| indigo-render/package.mill | Introduces Native module wiring for renderer. |
| indigo-render-pipeline/package.mill | Introduces Native module wiring for render pipeline. |
| indigo-platform/src-native/indigo/platform/gameengine/GameEngine.scala | Adds a Native GameEngine placeholder scaffold (mostly stubbed). |
| indigo-platform/src-native/indigo/platform/assets/AssetCollection.scala | Adds a Native AssetCollection placeholder implementation. |
| indigo-platform/src-native/indigo/platform/NativePlatform.scala | Renames the stub platform class for Native (comment still references JVM). |
| indigo-platform/src-js/indigo/platform/JsPlatform.scala | Cleans up redundant imports. |
| indigo-platform/package.mill | Introduces Native module wiring for platform module. |
| indigo-physics/package.mill | Introduces Native module wiring for physics module. |
| indigo-json-circe/package.mill | Introduces Native module wiring for JSON module. |
| indigo-extras/test/src/indigoextras/waypoints/WaypointPathTests.scala | Temporarily disables a shared test suite (commented out). |
| indigo-extras/test/src/indigoextras/utils/BresenhamTests.scala | Temporarily disables a shared test suite (commented out). |
| indigo-extras/test/src/indigoextras/ui/window/WindowManagerModelTests.scala | Temporarily disables a shared test suite (commented out). |
| indigo-extras/test/src/indigoextras/ui/datatypes/UIContextTests.scala | Temporarily disables a shared test suite (commented out). |
| indigo-extras/test/src/indigoextras/ui/components/datatypes/ContainerLikeFunctionsTests.scala | Temporarily disables a shared test suite (commented out). |
| indigo-extras/test/src/indigoextras/ui/components/InputTests.scala | Temporarily disables a shared test suite (commented out). |
| indigo-extras/test/src/indigoextras/ui/components/ComponentGroupTests.scala | Temporarily disables a shared test suite (commented out). |
| indigo-extras/test/src/indigoextras/ui/Helper.scala | Temporarily disables shared test helper extensions (commented out). |
| indigo-extras/test/src/indigoextras/subsystems/FakeSubSystemFrameContext.scala | Temporarily disables shared test helper (commented out). |
| indigo-extras/test/src/indigoextras/subsystems/AutomataTests.scala | Temporarily disables a shared test suite (commented out). |
| indigo-extras/test/src/indigoextras/performers/StageManagerTests.scala | Temporarily disables a shared test suite (commented out). |
| indigo-extras/test/src/indigoextras/mesh/BowyerWatsonTests.scala | Temporarily disables a shared test suite (commented out). |
| indigo-extras/test/src/indigoextras/jobs/WorkerTests.scala | Temporarily disables a shared test suite (commented out). |
| indigo-extras/test/src/indigoextras/jobs/WorkScheduleTests.scala | Temporarily disables a shared test suite (commented out). |
| indigo-extras/test/src/indigoextras/jobs/SampleJobs.scala | Temporarily disables shared test fixtures (commented out). |
| indigo-extras/test/src/indigoextras/jobs/JobMarketTests.scala | Temporarily disables a shared test suite (commented out). |
| indigo-extras/test/src/indigoextras/effectmaterials/shaders/LegacyEffectsShadersTests.scala | Temporarily disables a shader output test. |
| indigo-extras/test/src/indigoextras/datatypes/UpdateListTests.scala | Temporarily disables a shared test suite (commented out). |
| indigo-extras/test/src/indigoextras/datatypes/TimeVaryingValueTests.scala | Temporarily disables a shared test suite (commented out). |
| indigo-extras/test/src/indigoextras/actors/ActorPoolTests.scala | Temporarily disables a shared test suite (commented out). |
| indigo-extras/package.mill | Introduces Native module wiring for indigo-extras. |
| indigo-core/test/src-native/indigo/core/datatypes/mutable/CheapMatrix4Tests.scala | Adds Native tests for CheapMatrix4. |
| indigo-core/src-native/indigo/core/datatypes/mutable/CheapMatrix4.scala | Adds Native implementation of CheapMatrix4. |
| indigo-core/package.mill | Adds Native module wiring and enables publishing for the JVM module. |
| diagrams/indigoengine.dot | Updates module dependency diagram for Native targets. |
| build.mill | Adds Scala Native build configuration details (incremental compilation, debug release mode, LTO config). |
Comments suppressed due to low confidence (1)
indigo-platform/src-native/indigo/platform/NativePlatform.scala:11
- The doc comment still says "No-op JVM Platform implementation stub" but the class/file are now
NativePlatform. Update the comment to refer to Scala Native to avoid confusion about which platform this stub targets.
There was a problem hiding this comment.
Pull request overview
Lays groundwork for building Indigo (and key dependencies) on Scala Native by adding Native Mill modules, introducing Native-side stubs/placeholders, and ensuring core shader/math functionality is exercised via tests.
Changes:
- Add/enable
nativeplatform modules (and publishing) across Indigo’s module graph. - Introduce Scala Native stubs/placeholders for platform/runtime pieces and add Native test suites.
- Update shader generation code paths and dependency diagrams to reflect new targets.
Reviewed changes
Copilot reviewed 28 out of 35 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| ultraviolet/test/src-native/ultraviolet/acceptance/IndigoTests.scala | Adds Scala Native acceptance tests for Indigo example shaders. |
| tyrian/src-js/tyrian/ui/UIElement.scala | Removes large TODO comment block from UIElement. |
| indigoengine-shared/package.mill | Enables publishing for the JVM variant alongside JS/Native. |
| indigo/src/indigo/syntax.scala | Removes obsolete commented Scala.js toUVArray extension. |
| indigo/src/indigo/frameprocessors/GameFrameProcessor.scala | Removes unused import. |
| indigo/src-native/indigo/PlaceholderGameLauncher.scala | Adds Native placeholder launcher class. |
| indigo/package.mill | Adds native module and dependencies for Indigo top-level module. |
| indigo-shaders/test/src-native/indigo/shaders/ToUniformBlockTests.scala | Adds Native tests for ToUniformBlock derivation. |
| indigo-shaders/test/src-native/indigo/shaders/StandardShadersTests.scala | Adds Native tests to validate standard shader compilation outputs. |
| indigo-shaders/test/src-native/indigo/shaders/ShaderPrimitiveTests.scala | Adds Native tests for ShaderPrimitive packing behavior. |
| indigo-shaders/test/src-jvm/indigo/shaders/ToUniformBlockTests.scala | Adds JVM tests for ToUniformBlock derivation. |
| indigo-shaders/test/src-jvm/indigo/shaders/StandardShadersTests.scala | Adds JVM tests to validate standard shader compilation outputs. |
| indigo-shaders/test/src-jvm/indigo/shaders/ShaderPrimitiveTests.scala | Adds JVM tests for ShaderPrimitive packing behavior. |
| indigo-shaders/test/src-js/indigo/shaders/ToUniformBlockTests.scala | Adds Scala.js tests for ToUniformBlock derivation. |
| indigo-shaders/test/src-js/indigo/shaders/StandardShadersTests.scala | Adds Scala.js tests to validate standard shader compilation outputs. |
| indigo-shaders/test/src-js/indigo/shaders/ShaderPrimitiveTests.scala | Adds Scala.js tests for ShaderPrimitive packing behavior. |
| indigo-shaders/src/indigo/shaders/library/BaseEntityShader.scala | Adjusts fragment template placeholder generation and warning suppression. |
| indigo-shaders/package.mill | Adds Native module and configures published variants for indigo-shaders. |
| indigo-scenegraph/package.mill | Switches scenegraph’s non-JS target to Native and enables publishing. |
| indigo-render/package.mill | Switches render’s non-JS target to Native and trims JS deps. |
| indigo-render-pipeline/package.mill | Switches render-pipeline’s non-JS target to Native. |
| indigo-platform/src-native/indigo/platform/gameengine/GameEngine.scala | Adds Native placeholder GameEngine scaffolding (mostly commented). |
| indigo-platform/src-native/indigo/platform/assets/AssetCollection.scala | Adds Native placeholder asset collection types. |
| indigo-platform/src-native/indigo/platform/NativePlatform.scala | Renames platform stub to NativePlatform for Native target. |
| indigo-platform/src-js/indigo/platform/JsPlatform.scala | Removes redundant imports after refactor. |
| indigo-platform/package.mill | Switches platform’s non-JS target to Native and adjusts JS deps. |
| indigo-physics/package.mill | Switches physics’s non-JS target to Native and enables publishing. |
| indigo-json-circe/package.mill | Switches json-circe’s non-JS target to Native and updates deps. |
| indigo-extras/package.mill | Switches extras’s non-JS target to Native and updates deps. |
| indigo-core/test/src-native/indigo/core/datatypes/mutable/CheapMatrix4Tests.scala | Adds Native tests for CheapMatrix4 behavior. |
| indigo-core/src-native/indigo/core/datatypes/mutable/CheapMatrix4.scala | Adds Native CheapMatrix4 implementation (mutable/opaque Array[Float]). |
| indigo-core/package.mill | Enables publishing for JVM and adds new Native module. |
| diagrams/indigoengine.dot | Updates module dependency diagram for JS/JVM/Native layout. |
| build.mill | Adds Scala Native API imports and config tweaks for Native compilation. |
Comments suppressed due to low confidence (1)
indigo-platform/src-native/indigo/platform/NativePlatform.scala:10
- The Scaladoc still refers to this as a JVM platform stub, but the class/file are for Scala Native (
NativePlatforminsrc-native). Please update the comment to avoid confusion about the target/runtime.
The purpose of this PR is to lay the foundations for Indigo to go cross platform with Scala Native. You won't be able to play an Indigo game using Scala Native at the end of this, but all the modules will compile against native platforms, ready for the real work to begin.