-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change default OpenJDK version (#681)
- Loading branch information
Showing
11 changed files
with
163 additions
and
17 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub(crate) const JAVA_TOOL_OPTIONS_ENV_VAR_DELIMITER: &str = " "; | ||
pub(crate) const JAVA_TOOL_OPTIONS_ENV_VAR_NAME: &str = "JAVA_TOOL_OPTIONS"; | ||
pub(crate) const JDK_OVERLAY_DIR_NAME: &str = ".jdk_overlay"; | ||
pub(crate) const OPENJDK_LATEST_LTS_VERSION: u32 = 21; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use libcnb::read_toml_file; | ||
use std::path::Path; | ||
|
||
pub(crate) fn is_salesforce_function_app(app_dir: &Path) -> bool { | ||
read_toml_file::<toml::value::Value>(app_dir.join("project.toml")) | ||
.is_ok_and(|project_toml_table| matches!(value_at_path(&project_toml_table, &["com", "salesforce", "type"]), Some(toml::Value::String(salesforce_type)) if salesforce_type == "function")) | ||
} | ||
|
||
fn value_at_path<'a>(table: &'a toml::value::Value, path: &[&str]) -> Option<&'a toml::Value> { | ||
let mut value = table; | ||
|
||
for path_segment in path { | ||
if let toml::Value::Table(table) = value { | ||
match table.get(*path_segment) { | ||
Some(next_value) => value = next_value, | ||
None => return None, | ||
} | ||
} | ||
} | ||
|
||
Some(value) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<project> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>bogus</groupId> | ||
<artifactId>bogus</artifactId> | ||
<version>1.0.0</version> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<project> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>bogus</groupId> | ||
<artifactId>bogus</artifactId> | ||
<version>1.0.0</version> | ||
</project> |
2 changes: 2 additions & 0 deletions
2
buildpacks/jvm/test-apps/salesforce-functions-app/project.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[com.salesforce] | ||
type = "function" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
buildpacks/maven/test-apps/simple-http-service-groovy-polyglot/system.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
java.runtime.version = 8 |