Skip to content

Native modules: one build module for Bazel, Gradle, Maven, CMake, Meson and Make (#364) - #373

Draft
raiseCatError wants to merge 2 commits into
feature/runtimes-elixir-dartfrom
feature/project-build-module
Draft

raiseCatError wants to merge 2 commits into
feature/runtimes-elixir-dartfrom
feature/project-build-module

Conversation

@raiseCatError

Copy link
Copy Markdown
Owner

The "single build module" candidate from the #364 coverage matrix, instead of one module per tool. Stacked on #372 (which is stacked on #370) because all three edit the nmsh.project pack; retarget as the stack lands.

project.build reports the build system of the nearest directory with a build file (up to the repository root) and the version the project pins for it:

Tool Detected from Version from
Bazel MODULE.bazel, WORKSPACE(.bazel), .bazelversion .bazelversion (as Bazelisk reads it)
Gradle settings.gradle(.kts), build.gradle(.kts), gradlew gradle/wrapper/gradle-wrapper.properties distributionUrl
Maven pom.xml, mvnw .mvn/wrapper/maven-wrapper.properties distributionUrl
CMake CMakeLists.txt cmake_minimum_required(VERSION x…), shown as ≥x; a subproject uses the nearest file that declares it
Meson meson.build meson_version: '>=x', shown as ≥x
Make Makefile, GNUmakefile, makefile —

No wrapper (gradlew, mvnw), Bazelisk or build file is run or evaluated; URLs are never fetched; declarations are matched as text, line-bounded. Versions are read only when demanded. The build module is show-on-command (gradle, mvn, cmake, meson, ninja, bazel, make…), starts hidden like other non-cloud pack modules, and is recommended from build files. One segment, because the pack schema bounds a module to four segments and widening a third-party contract for icons was not worth it.

Tests: wrapper sentinels that fail if run, subproject lookups, case-insensitive filesystems (Makefile reported as such on APFS), control payloads in properties, symlinked metadata, whitespace-run CMakeLists.txt in bounded time.

…on and Make

project.build reports the build system of the nearest directory with a build
file (up to the repository root) and the version the project pins for it:

- Gradle and Maven: the wrapper properties' distributionUrl (never fetched).
- Bazel: .bazelversion, as Bazelisk reads it.
- CMake and Meson: cmake_minimum_required / meson_version, matched as text
  and shown as a minimum (≥); a subproject without a declaration uses the
  nearest CMakeLists.txt that has one.
- Make: presence only.

No wrapper (gradlew, mvnw), Bazelisk or build file is run or evaluated.
Versions are read only when demanded. The `build` pack module is
show-on-command (gradle, mvn, cmake, meson, ninja, bazel, make...) and is
recommended from the build files; one module instead of one per tool.

Tests: wrapper sentinels that fail if run, subproject lookups, the
case-insensitive Makefile spelling, control payloads in properties,
symlinked metadata and a whitespace-run CMakeLists.txt.

This branch has not been deployed

No deployments
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