Skip to content

Add NativeBuildResolver in buildSrc as Kotlin replacement for NativiBuildInfo#1477

Open
prbprbprb wants to merge 1 commit intogoogle:masterfrom
prbprbprb:native_build_kotlin
Open

Add NativeBuildResolver in buildSrc as Kotlin replacement for NativiBuildInfo#1477
prbprbprb wants to merge 1 commit intogoogle:masterfrom
prbprbprb:native_build_kotlin

Conversation

@prbprbprb
Copy link
Contributor

Extracts the native build platform/architecture configuration from the Groovy NativeBuildInfo enum in openjdk/build.gradle into well-tested Kotlin in buildSrc/. This is a no-op change -- nothing references these classes yet. The intent is to land and iterate on the API before wiring it into the build in a follow-up PR.

Deliberate differences from the Groovy NativeBuildInfo:

  • findAll(os, arch) takes both os and arch, where the Groovy version takes only os. This is equivalent for all current variants (macOS crossCompile=true always returns both archs; Linux returns one) but allows for future expansion.

  • buildDir is an immutable Provider passed at construction time, replacing the mutable static "String buildDir = FIXME" that was set later by the build script. This uses Gradle lazy configuration properly and eliminates shared mutable state.

  • crossCompile is an explicit boolean field on the enum rather than being implicit in the macOS libDir() override pattern.

This is a no-op subset of #1388 with improved testing and docs which will help with #1475, #1034 etc

…uildInfo

Extracts the native build platform/architecture configuration from the
Groovy NativeBuildInfo enum in openjdk/build.gradle into well-tested
Kotlin in buildSrc/. This is a no-op change -- nothing references these
classes yet. The intent is to land and iterate on the API before wiring
it into the build in a follow-up PR.

Deliberate differences from the Groovy NativeBuildInfo:

- findAll(os, arch) takes both os and arch, where the Groovy version
  takes only os. This is equivalent for all current variants (macOS
  crossCompile=true always returns both archs; Linux returns one) but
  allows for future expansion.

- buildDir is an immutable Provider<Directory> passed at construction
  time, replacing the mutable static "String buildDir = FIXME" that was
  set later by the build script. This uses Gradle lazy configuration
  properly and eliminates shared mutable state.

- crossCompile is an explicit boolean field on the enum rather than
  being implicit in the macOS libDir() override pattern.
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