Skip to content

Commit

Permalink
[cached-framework] commit sdk builder files
Browse files Browse the repository at this point in the history
SDK files are useful for ides and general code readability. This stores
them in the repo. They will automatically be rebuilt each time the user
builds cached-framework to make it easier to keep them up to date
without the user needing to explicitly figure this out.
  • Loading branch information
davidiw committed Jul 23, 2022
1 parent 9260ecd commit 662f078
Show file tree
Hide file tree
Showing 7 changed files with 5,427 additions and 11 deletions.
9 changes: 3 additions & 6 deletions aptos-move/aptos-sdk-builder/src/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ pub fn output(out: &mut dyn Write, abis: &[ScriptABI], local_types: bool) -> Res
};

emitter.output_preamble()?;
writeln!(emitter.out, "#![allow(unused_imports)]")?;

emitter.output_script_call_enum_with_imports(abis)?;

let txn_script_abis = common::transaction_script_abis(abis);
Expand Down Expand Up @@ -257,12 +259,7 @@ impl ScriptFunctionCall {
("move_deps::move_core_types", vec!["ident_str"]),
(
"aptos_types::transaction",
vec![
"Script",
"TransactionArgument",
"TransactionPayload",
"ScriptFunction",
],
vec!["TransactionPayload", "ScriptFunction"],
),
("aptos_types::account_address", vec!["AccountAddress"]),
]
Expand Down
24 changes: 23 additions & 1 deletion aptos-move/framework/cached-packages/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,23 @@ fn main() {
};
release.create_release();

std::fs::copy(
PathBuf::from(std::env::var("OUT_DIR").unwrap())
.join("framework")
.join("aptos_sdk_builder.rs"),
std::env::current_dir()
.unwrap()
.join("src")
.join("aptos_framework_sdk_builder.rs"),
)
.unwrap();

println!("cargo:rerun-if-changed=../aptos-token/sources");
let token_release = framework::release::ReleaseOptions {
no_check_layout_compatibility: false,
no_build_docs: true,
with_diagram: true,
no_script_builder: true,
no_script_builder: false,
no_script_abis: false,
no_errmap: false,
package: PathBuf::from("aptos-token"),
Expand All @@ -42,4 +53,15 @@ fn main() {
)),
};
token_release.create_release();

std::fs::copy(
PathBuf::from(std::env::var("OUT_DIR").unwrap())
.join("token")
.join("aptos_sdk_builder.rs"),
std::env::current_dir()
.unwrap()
.join("src")
.join("aptos_token_sdk_builder.rs"),
)
.unwrap();
}
Loading

0 comments on commit 662f078

Please sign in to comment.