-
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.
- Loading branch information
Showing
7 changed files
with
127 additions
and
31 deletions.
There are no files selected for viewing
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,6 +1,37 @@ | ||
use super::resolve::Package; | ||
use std::{error, result}; | ||
|
||
/// Prepare | ||
pub fn prepare(package: &Package) { | ||
use crate::backend::{context::ProjectContext, lock::StateLockFileDependency, toolchain::{self, ToolchainContext}}; | ||
|
||
/// Helper function to extract the specified dependency | ||
/// | ||
/// # Arguments | ||
/// * `p_ctx`: Reference to a `ProjectContext` struct | ||
/// * `tc_ctx`: Reference to a `ToolChainContext` struct | ||
/// * `dependency`: Reference to a `StateLockFileDependency`, representing the local dependency to extract. | ||
/// | ||
/// # Returns | ||
/// Propagated errors | ||
pub fn extract( | ||
p_ctx: &ProjectContext, | ||
tc_ctx: &ToolchainContext, | ||
dependency: &StateLockFileDependency, | ||
) -> result::Result<(), Box<dyn error::Error>> { | ||
toolchain::extract_jar(p_ctx, tc_ctx, &(dependency.checksum.clone() + ".jar")) | ||
} | ||
|
||
/// Sync a dependency into the projcets class | ||
/// | ||
/// # Arguments | ||
/// * `p_ctx`: Reference to a `ProjectContext` struct | ||
/// * `tc_ctx`: Reference to a `ToolChainContext` struct | ||
/// * `dependency`: Reference to a `StateLockFileDependency`, representing the local dependency to extract. | ||
/// | ||
/// # Returns | ||
/// Propagated errors | ||
pub fn sync( | ||
p_ctx: &ProjectContext, | ||
tc_ctx: &ToolchainContext, | ||
dependency: &StateLockFileDependency | ||
) -> result::Result<(), Box<dyn error::Error>>{ | ||
Ok(()) | ||
} |
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