Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer libherokubuildpack inventory module #737

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 133 additions & 46 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions buildpacks/jvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@ workspace = true
buildpacks-jvm-shared.workspace = true
fs_extra = "1"
indoc = "2"
libcnb = "=0.23.0"
libherokubuildpack = { version = "=0.23.0", default-features = false, features = ["digest", "download", "error", "log", "tar"] }
libcnb = "=0.24.0"
libherokubuildpack = { version = "=0.24.0", default-features = false, features = ["digest", "download", "error", "inventory", "inventory-sha2", "log", "tar"] }
serde = { version = "1", features = ["derive"] }
tempfile = "3"
url = "2"
nom = "7"
inventory = { git = "https://github.com/Malax/inventory", features = ["sha2"] }
thiserror = "1"
sha2 = "0.10"
hex = "0.4"
toml = "0.8"

[dev-dependencies]
buildpacks-jvm-shared-test.workspace = true
libcnb-test = "=0.23.0"
libcnb-test = "=0.24.0"
2 changes: 1 addition & 1 deletion buildpacks/jvm/src/layers/openjdk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ use crate::{
JAVA_TOOL_OPTIONS_ENV_VAR_NAME, JDK_OVERLAY_DIR_NAME,
};
use fs_extra::dir::CopyOptions;
use inventory::artifact::Artifact;
use libcnb::additional_buildpack_binary_path;
use libcnb::build::BuildContext;
use libcnb::data::layer_name;
use libcnb::layer::{
CachedLayerDefinition, InvalidMetadataAction, LayerState, RestoredLayerAction,
};
use libcnb::layer_env::{LayerEnv, ModificationBehavior, Scope};
use libherokubuildpack::inventory::artifact::Artifact;
use serde::Deserialize;
use serde::Serialize;
use sha2::Sha256;
Expand Down
4 changes: 2 additions & 2 deletions buildpacks/jvm/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ pub(crate) use constants::{
JAVA_TOOL_OPTIONS_ENV_VAR_DELIMITER, JAVA_TOOL_OPTIONS_ENV_VAR_NAME, JDK_OVERLAY_DIR_NAME,
};
use indoc::formatdoc;
use inventory::artifact::{Arch, Os};
use inventory::inventory::{Inventory, ParseInventoryError};
use libcnb::build::{BuildContext, BuildResult, BuildResultBuilder};
use libcnb::buildpack_main;
use libcnb::data::build_plan::BuildPlanBuilder;
Expand All @@ -34,6 +32,8 @@ use libcnb::Buildpack;
#[cfg(test)]
use libcnb_test as _;
use libherokubuildpack::download::DownloadError;
use libherokubuildpack::inventory::artifact::{Arch, Os};
use libherokubuildpack::inventory::{Inventory, ParseInventoryError};
use libherokubuildpack::log::log_warning;
use sha2::Sha256;
use std::env::consts;
Expand Down
2 changes: 1 addition & 1 deletion buildpacks/jvm/src/openjdk_artifact.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::openjdk_version::OpenJdkVersion;
use inventory::version::{ArtifactRequirement, VersionRequirement};
use libherokubuildpack::inventory::version::{ArtifactRequirement, VersionRequirement};
use serde::{Deserialize, Serialize};
use std::str::FromStr;

Expand Down