-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from Bytekeeper/linux
Improved Linux support; added JRE download support
- Loading branch information
Showing
11 changed files
with
325 additions
and
173 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
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,5 @@ | ||
mod game_table; | ||
|
||
pub use crate::game_table::{GameTable, GameTableAccess}; | ||
pub use crate::game_table::GameTable; | ||
#[cfg(target_os = "windows")] | ||
pub use crate::game_table::GameTableAccess; |
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,10 +1,12 @@ | ||
mod game_table; | ||
use crate::game_table::*; | ||
use std::io::Write; | ||
|
||
fn main() { | ||
#[cfg(target_os = "windows")] | ||
GameTableAccess::new() | ||
.get_game_table() | ||
.and_then(|out| serde_json::to_string(&out).ok()) | ||
.map(|out| println!("{out}")); | ||
GameTableAccess::new().get_game_table().map(|out| { | ||
std::io::stdout().write(unsafe { | ||
&std::mem::transmute::<GameTable, [u8; std::mem::size_of::<GameTable>()]>(out)[..] | ||
}) | ||
}); | ||
} |
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,24 @@ | ||
use crate::base_folder; | ||
use crate::setup::{ComponentConfig, ComponentInstallation}; | ||
use hex_literal::hex; | ||
use std::path::PathBuf; | ||
|
||
pub fn java_component(config: ComponentConfig) -> ComponentInstallation { | ||
ComponentInstallation { | ||
name: "Java 8 JRE", | ||
download_name: "jre.zip", | ||
download_url: "https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u362-b09/OpenJDK8U-jre_x86-32_windows_hotspot_8u362b09.zip", | ||
locator: || Ok(PathBuf::from("javaw.exe")), | ||
provider: |component| component.download_and_unzip(true).map(|_| component.internal_folder.join("bin").join("javaw.exe")), | ||
config, | ||
hashes: &[hex!("ab1c3756c0f94e982edf77e7048263d2c7fc1048c57dd1185e5f441f007e9653") ], | ||
internal_folder: base_folder().join("jre"), | ||
} | ||
} | ||
|
||
pub fn java_default_config() -> ComponentConfig { | ||
#[cfg(target_os = "windows")] | ||
return ComponentConfig::Locate; | ||
#[cfg(not(target_os = "windows"))] | ||
return ComponentConfig::Internal; | ||
} |
Oops, something went wrong.