Skip to content

Commit

Permalink
VP-94 Fix build scripts (#569)
Browse files Browse the repository at this point in the history
Update SDK version to 1.45.1
Use the latest Rust version (1.76.0)
Pass targets to build scripts
  • Loading branch information
AtomXY authored Feb 22, 2024
1 parent 4eb5631 commit 04d946e
Show file tree
Hide file tree
Showing 21 changed files with 60 additions and 39 deletions.
4 changes: 4 additions & 0 deletions build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ impl Build {
}
}

pub fn set_platform(&mut self, platform: &str) {
self.platform = platform.into();
}

pub fn read_lib_file(&self, path: &str) -> String {
fs::read_to_string(self.package_dir.join("lib").join(path)).unwrap()
}
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"packages": [
"packages/*"
],
"version": "1.45.0",
"version": "1.45.1",
"command": {
"version": {
"message": "Release"
Expand Down
16 changes: 8 additions & 8 deletions packages/cli/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eversdk/cli",
"version": "1.45.0",
"version": "1.45.1",
"description": "Evercloud CLI",
"homepage": "https://everx.dev/",
"repository": {
Expand Down Expand Up @@ -53,8 +53,8 @@
],
"dependencies": {
"@eversdk/appkit": "^0.3.8",
"@eversdk/core": "^1.45.0",
"@eversdk/lib-node": "^1.45.0",
"@eversdk/core": "^1.45.1",
"@eversdk/lib-node": "^1.45.1",
"commander": "^10.0.0",
"dotenv": "^16.0.3",
"everdev": "^1.7.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eversdk/core",
"version": "1.45.0",
"version": "1.45.1",
"description": "TON Client for Java Script",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const packageVersion = "1.45.0";
export const packageVersion = "1.45.1";
28 changes: 22 additions & 6 deletions packages/lib-node/build/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,36 @@
*
*/

use ton_client_build::{exec, Build};
use std::env;
use ton_client_build::{exec, check_targets, Build};

fn main() {
let builder = Build::new();
assert!(exec("cargo", &["build", "--release"]).success());

let mut build_args: Vec<&str> = vec!["build", "--release"];
let target = env::args().nth(1).unwrap_or("".to_string());
let rust_target: &str = match target.as_str() {
"arm64-darwin" => "aarch64-apple-darwin",
"x64-darwin" => "x86_64-apple-darwin",
_ => ""
};
let mut builder = Build::new();
if !rust_target.is_empty() {
build_args.append(&mut vec!["--target", rust_target]);
check_targets(&vec![rust_target]);
builder.set_platform(target.as_str());
}
assert!(exec("cargo", &build_args).success());
#[cfg(target_os = "windows")]
let (lib, gyp, gyp_args) = ("eversdk.lib", "cmd", ["/c", "node-gyp", "rebuild"]);
#[cfg(not(target_os = "windows"))]
let (lib, gyp, gyp_args) = ("libeversdk.a", "npm", ["run", "build"]);

builder.add_package_file(
&format!("lib/{}", lib),
builder.target_dir.join("release").join(lib),
if !rust_target.is_empty() {
builder.target_dir.join(rust_target).join("release").join(lib)
} else {
builder.target_dir.join("release").join(lib)
}
);

assert!(exec(gyp, &gyp_args).success());
Expand Down
4 changes: 2 additions & 2 deletions packages/lib-node/lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = 'ever_sdk_node_addon'
version = '1.44.0'
version = '1.45.1'
authors = [ 'TON Labs' ]
license = 'Apache-2.0'

Expand All @@ -10,7 +10,7 @@ crate-type = [ 'staticlib' ]

[dependencies]
libc = '0.2'
ton_client = { git = 'https://github.com/tonlabs/ever-sdk.git', tag = '1.45.0', default-features = false, features = [ 'std', 'rustls-tls-webpki-roots' ] }
ton_client = { git = 'https://github.com/tonlabs/ever-sdk.git', tag = '1.45.1', default-features = false, features = [ 'std', 'rustls-tls-webpki-roots' ] }

[profile.release]
lto = true
2 changes: 1 addition & 1 deletion packages/lib-node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eversdk/lib-node",
"version": "1.45.0",
"version": "1.45.1",
"description": "TON Client NodeJs AddOn",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/lib-react-native-jsi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eversdk/lib-react-native-jsi",
"version": "1.45.0",
"version": "1.45.1",
"description": "TON Client React Native JSI Module",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down
4 changes: 2 additions & 2 deletions packages/lib-react-native/android/build/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const ARCHS: [Arch; 4] = [
];

const LIB: &str = "libeversdk.so";
const NDK_URL: &str = "http://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip";
const NDK_URL: &str = "http://dl.google.com/android/repository/android-ndk-r26c-linux.zip";

fn main() {
let target_arg = env::args().nth(1).unwrap_or("".to_string());
Expand All @@ -63,7 +63,7 @@ fn main() {
&builder.lib_dir.join("NDK").join(arch.ndk).join("bin"),
));
std::env::set_var("PATH", path);
assert!(exec("cargo", &["+1.67.0-x86_64-unknown-linux-gnu", "build", "--target", arch.target, "--release"]).success());
assert!(exec("cargo", &["build", "--target", arch.target, "--release"]).success());
}

let out_dir = builder.package_dir.join("src/main/jniLibs");
Expand Down
5 changes: 3 additions & 2 deletions packages/lib-react-native/android/lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = 'ever_sdk_react_native_android'
version = '1.41.0'
version = '1.45.1'
authors = [ 'TON Labs' ]
license = 'Apache-2.0'

Expand All @@ -9,9 +9,10 @@ name = 'eversdk'
crate-type = [ 'cdylib' ]

[dependencies]
openssl-sys = { version = "0.9.97", features = [ "vendored" ] }
lazy_static = '1.4.0'
jni = { default-features = false, version = '0.12.0' }
ton_client = { git = 'https://github.com/tonlabs/ever-sdk.git', tag = '1.45.0' }
ton_client = { git = 'https://github.com/tonlabs/ever-sdk.git', tag = '1.45.1' }

[profile.release]
lto = true
4 changes: 2 additions & 2 deletions packages/lib-react-native/ios/lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = 'ever_sdk_react_native_ios'
version = '1.41.0'
version = '1.45.1'
authors = [ 'TON Labs' ]
license = 'Apache-2.0'

Expand All @@ -10,7 +10,7 @@ crate-type = [ 'staticlib' ]

[dependencies]
libc = '0.2'
ton_client = { git = 'https://github.com/tonlabs/ever-sdk.git', tag = '1.45.0', default-features = false, features = [ 'std', 'rustls-tls-webpki-roots' ] }
ton_client = { git = 'https://github.com/tonlabs/ever-sdk.git', tag = '1.45.1', default-features = false, features = [ 'std', 'rustls-tls-webpki-roots' ] }

[profile.release]
lto = true
2 changes: 1 addition & 1 deletion packages/lib-react-native/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eversdk/lib-react-native",
"version": "1.45.0",
"version": "1.45.1",
"description": "TON Client React Native Module",
"main": "index.js",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions packages/lib-web/lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = 'ever_sdk_wasm_module'
version = '1.41.0'
version = '1.45.1'
edition = '2018'
description = 'TON Client WASM binding'
license = 'Apache-2.0'
Expand Down Expand Up @@ -28,7 +28,7 @@ lazy_static = '1.4.0'
# just to fix building of rand for WASM:
getrandom = { default-features = false, features = [ 'js' ], version = '0.2.2' }

ton_client = { default-features = false, features = [ 'wasm' ], git = 'https://github.com/tonlabs/ever-sdk.git', tag = '1.45.0' }
ton_client = { default-features = false, features = [ 'wasm' ], git = 'https://github.com/tonlabs/ever-sdk.git', tag = '1.45.1' }

[dependencies.web-sys]
version = '0.3.57'
Expand Down
2 changes: 1 addition & 1 deletion packages/lib-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eversdk/lib-web",
"version": "1.45.0",
"version": "1.45.1",
"description": "TON Client WASM module for browsers",
"main": "index.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/tests-node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eversdk/tests-node",
"version": "1.45.0",
"version": "1.45.1",
"private": true,
"description": "TON Client Tests runner on NodeJs",
"main": "index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/tests-react-native-jsi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eversdk/tests-react-native-jsi",
"version": "1.45.0",
"version": "1.45.1",
"private": true,
"main": "index.js",
"browser": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/tests-react-native/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eversdk/tests-react-native",
"version": "1.45.0",
"version": "1.45.1",
"private": true,
"main": "index.js",
"browser": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/tests-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eversdk/tests-web",
"version": "1.45.0",
"version": "1.45.1",
"private": true,
"description": "TON Client WASM module tests runner",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eversdk/tests",
"version": "1.45.0",
"version": "1.45.1",
"private": true,
"description": "TON Client Tests",
"main": "dist/index.js",
Expand Down

0 comments on commit 04d946e

Please sign in to comment.