[PR #1081] [MERGED] Gradle adjustments for libpkl #877

Closed
opened 2025-12-30 01:27:27 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/apple/pkl/pull/1081
Author: @bioball
Created: 5/29/2025
Status: Merged
Merged: 5/30/2025
Merged by: @bioball

Base: c-libraryHead: libpkl-gradle


📝 Commits (10+)

📊 Changes

16 files changed (+1364 additions, -566 deletions)

View changed files

📝 .circleci/config.pkl (+5 -2)
📝 .circleci/config.yml (+878 -60)
📝 .circleci/jobs/BuildNativeJob.pkl (+13 -1)
📝 buildSrc/src/main/kotlin/BuildInfo.kt (+26 -16)
📝 buildSrc/src/main/kotlin/NativeImageBuild.kt (+56 -16)
buildSrc/src/main/kotlin/Target.kt (+82 -0)
📝 buildSrc/src/main/kotlin/pklNativeExecutable.gradle.kts (+67 -136)
📝 buildSrc/src/main/kotlin/pklNativeLifecycle.gradle.kts (+19 -50)
📝 gradle/libs.versions.toml (+3 -0)
📝 libpkl/gradle.lockfile (+58 -57)
📝 libpkl/libpkl.gradle.kts (+156 -214)
📝 libpkl/src/main/java/org/pkl/libpkl/LibPkl.java (+0 -14)
📝 libpkl/src/nativeTest/kotlin/org/pkl/libpkl/JNATestClient.kt (+0 -0)
📝 libpkl/src/nativeTest/kotlin/org/pkl/libpkl/LibPklLibrary.kt (+1 -0)
📝 libpkl/src/nativeTest/kotlin/org/pkl/libpkl/MessagePackDebugRenderer.kt (+0 -0)
📝 libpkl/src/nativeTest/kotlin/org/pkl/libpkl/NativeTest.kt (+0 -0)

📄 Description

  • Move native tests into nativeTest source set; they are now run with ./gradlew testNative and skipped in ./gradlew test.
  • Fix native tests to be platform independent
  • In NativeImageBuild: Add abstract val sharedLibrary: Property<Boolean> property to NativeImageBuild
  • In NativeImageBuild: Make mainClass optional
  • Introduce enum class Target, which enumerates over all the target machines that we support building
  • Simplify build logic (move common logic into configure() extension methods)
  • Remove LibPkl.main, which is no longer needed
  • Run libpkl tests in CircleCI (let's run these for now on this branch, but let's remove it prior to merging).

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/apple/pkl/pull/1081 **Author:** [@bioball](https://github.com/bioball) **Created:** 5/29/2025 **Status:** ✅ Merged **Merged:** 5/30/2025 **Merged by:** [@bioball](https://github.com/bioball) **Base:** `c-library` ← **Head:** `libpkl-gradle` --- ### 📝 Commits (10+) - [`132a11a`](https://github.com/apple/pkl/commit/132a11a5aae6d742d4afb8e007cdca81f5985167) Gradle adjustments for libpkl.gradle.kts - [`699ac9f`](https://github.com/apple/pkl/commit/699ac9f5144435ec83f64e31c3442700e16731b5) Temporarily add libpkl builds - [`d41fb72`](https://github.com/apple/pkl/commit/d41fb729b9172bf629dd5afb125e048b1292378e) Fixes - [`6de8f3c`](https://github.com/apple/pkl/commit/6de8f3c40e35cf9bc66c4ae8200464e9dc8ab4df) Add debug logging - [`d66a822`](https://github.com/apple/pkl/commit/d66a822ca540c8c52b0909de2059d03c705f4ab0) Also set java.library.path - [`bc903b0`](https://github.com/apple/pkl/commit/bc903b0ee52279ce0c92178b0a9c91c1f2ad7502) Also set LD_LIBRARY_PATH - [`9ef6074`](https://github.com/apple/pkl/commit/9ef6074412e6c2aec4bf3daea11e7195a2ea3830) Fix build dep - [`b986e47`](https://github.com/apple/pkl/commit/b986e47d19eae8a24d9ec801b5fe7089f5c6d253) Fixes - [`739ee79`](https://github.com/apple/pkl/commit/739ee799357979200b5eef937e6d135292bb3007) Add debug symbols, optimize build for release - [`6757d2f`](https://github.com/apple/pkl/commit/6757d2f582e92a04d33be2d9a2f24d6b9c0bbae0) Rename Machine -> Target, more build adjustments ### 📊 Changes **16 files changed** (+1364 additions, -566 deletions) <details> <summary>View changed files</summary> 📝 `.circleci/config.pkl` (+5 -2) 📝 `.circleci/config.yml` (+878 -60) 📝 `.circleci/jobs/BuildNativeJob.pkl` (+13 -1) 📝 `buildSrc/src/main/kotlin/BuildInfo.kt` (+26 -16) 📝 `buildSrc/src/main/kotlin/NativeImageBuild.kt` (+56 -16) ➕ `buildSrc/src/main/kotlin/Target.kt` (+82 -0) 📝 `buildSrc/src/main/kotlin/pklNativeExecutable.gradle.kts` (+67 -136) 📝 `buildSrc/src/main/kotlin/pklNativeLifecycle.gradle.kts` (+19 -50) 📝 `gradle/libs.versions.toml` (+3 -0) 📝 `libpkl/gradle.lockfile` (+58 -57) 📝 `libpkl/libpkl.gradle.kts` (+156 -214) 📝 `libpkl/src/main/java/org/pkl/libpkl/LibPkl.java` (+0 -14) 📝 `libpkl/src/nativeTest/kotlin/org/pkl/libpkl/JNATestClient.kt` (+0 -0) 📝 `libpkl/src/nativeTest/kotlin/org/pkl/libpkl/LibPklLibrary.kt` (+1 -0) 📝 `libpkl/src/nativeTest/kotlin/org/pkl/libpkl/MessagePackDebugRenderer.kt` (+0 -0) 📝 `libpkl/src/nativeTest/kotlin/org/pkl/libpkl/NativeTest.kt` (+0 -0) </details> ### 📄 Description * Move native tests into `nativeTest` source set; they are now run with `./gradlew testNative` and skipped in `./gradlew test`. * Fix native tests to be platform independent * In `NativeImageBuild`: Add `abstract val sharedLibrary: Property<Boolean>` property to `NativeImageBuild` * In `NativeImageBuild`: Make `mainClass` optional * Introduce enum class `Target`, which enumerates over all the target machines that we support building * Simplify build logic (move common logic into `configure()` extension methods) * Remove `LibPkl.main`, which is no longer needed * Run `libpkl` tests in CircleCI (let's run these for now on this branch, but let's remove it prior to merging). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 01:27:27 +01:00
adam closed this issue 2025-12-30 01:27:27 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#877