-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add package build
- Loading branch information
Showing
35 changed files
with
11,909 additions
and
631 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[package] | ||
name = "starcoin-cached-packages" | ||
description = "Builds framework packages for caching in builds and tests" | ||
version = "0.1.0" | ||
|
||
# Workspace inherited keys | ||
authors = { workspace = true } | ||
edition = { workspace = true } | ||
homepage = { workspace = true } | ||
license = { workspace = true } | ||
publish = { workspace = true } | ||
repository = { workspace = true } | ||
rust-version = { workspace = true } | ||
|
||
[dependencies] | ||
starcoin-framework = { workspace = true } | ||
starcoin-package-builder = { workspace = true } | ||
starcoin-vm-types = { workspace = true } | ||
bcs = { workspace = true } | ||
move-core-types = { workspace = true } | ||
once_cell = { workspace = true } | ||
proptest = { workspace = true, optional = true } | ||
proptest-derive = { workspace = true, optional = true } | ||
|
||
[build-dependencies] | ||
anyhow = { workspace = true } | ||
starcoin-framework = { workspace = true } | ||
|
||
[features] | ||
default = [] | ||
fuzzing = ["proptest", "proptest-derive"] | ||
|
||
[package.metadata.cargo-machete] | ||
ignored = ["proptest"] |
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,86 @@ | ||
// Copyright © Aptos Foundation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use anyhow::{Context, Result}; | ||
use aptos_framework::ReleaseTarget; | ||
use std::{env::current_dir, path::PathBuf}; | ||
|
||
fn main() -> Result<()> { | ||
// Set the below variable to skip the building step. This might be useful if the build | ||
// is broken so it can be debugged with the old outdated artifacts. | ||
if std::env::var("SKIP_FRAMEWORK_BUILD").is_err() { | ||
let current_dir = current_dir().expect("Should be able to get current dir"); | ||
// Get the previous directory | ||
let mut prev_dir = current_dir; | ||
prev_dir.pop(); | ||
println!( | ||
"cargo:rerun-if-changed={}", | ||
prev_dir | ||
.join("aptos-token-objects") | ||
.join("Move.toml") | ||
.display() | ||
); | ||
println!( | ||
"cargo:rerun-if-changed={}", | ||
prev_dir | ||
.join("aptos-token-objects") | ||
.join("sources") | ||
.display() | ||
); | ||
println!( | ||
"cargo:rerun-if-changed={}", | ||
prev_dir.join("aptos-token").join("sources").display() | ||
); | ||
println!( | ||
"cargo:rerun-if-changed={}", | ||
prev_dir.join("aptos-token").join("Move.toml").display() | ||
); | ||
println!( | ||
"cargo:rerun-if-changed={}", | ||
prev_dir | ||
.join("aptos-token-objects") | ||
.join("sources") | ||
.display() | ||
); | ||
println!( | ||
"cargo:rerun-if-changed={}", | ||
prev_dir | ||
.join("aptos-token-objects") | ||
.join("Move.toml") | ||
.display() | ||
); | ||
println!( | ||
"cargo:rerun-if-changed={}", | ||
prev_dir.join("aptos-framework").join("sources").display() | ||
); | ||
println!( | ||
"cargo:rerun-if-changed={}", | ||
prev_dir.join("aptos-framework").join("Move.toml").display() | ||
); | ||
println!( | ||
"cargo:rerun-if-changed={}", | ||
prev_dir.join("aptos-stdlib").join("sources").display() | ||
); | ||
println!( | ||
"cargo:rerun-if-changed={}", | ||
prev_dir.join("aptos-stdlib").join("Move.toml").display() | ||
); | ||
println!( | ||
"cargo:rerun-if-changed={}", | ||
prev_dir.join("move-stdlib").join("sources").display() | ||
); | ||
println!( | ||
"cargo:rerun-if-changed={}", | ||
prev_dir.join("move-stdlib").join("Move.toml").display() | ||
); | ||
|
||
let path = | ||
PathBuf::from(std::env::var("OUT_DIR").expect("OUT_DIR defined")).join("head.mrb"); | ||
|
||
ReleaseTarget::Head | ||
.create_release(true, Some(path)) | ||
.context("Failed to create release")?; | ||
} | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright © Aptos Foundation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use starcoin_framework::ReleaseBundle; | ||
use once_cell::sync::Lazy; | ||
|
||
pub mod starcoin_framework_sdk_builder; | ||
pub mod starcoin_stdlib; | ||
pub mod starcoin_token_objects_sdk_builder; | ||
pub mod starcoin_token_sdk_builder; | ||
|
||
#[cfg(unix)] | ||
const HEAD_RELEASE_BUNDLE_BYTES: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/head.mrb")); | ||
#[cfg(windows)] | ||
const HEAD_RELEASE_BUNDLE_BYTES: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "\\head.mrb")); | ||
|
||
static HEAD_RELEASE_BUNDLE: Lazy<ReleaseBundle> = Lazy::new(|| { | ||
bcs::from_bytes::<ReleaseBundle>(HEAD_RELEASE_BUNDLE_BYTES).expect("bcs succeeds") | ||
}); | ||
|
||
/// Returns the release bundle for the current code. | ||
pub fn head_release_bundle() -> &'static ReleaseBundle { | ||
&HEAD_RELEASE_BUNDLE | ||
} |
Oops, something went wrong.