Use cargo metadata to determine the target directory

The command otherwise failed when used with cargo workspaces
This commit is contained in:
konstin 2018-04-06 17:23:17 +02:00
parent f148ac0d62
commit 6733f74b0d
2 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,5 @@
require 'tomlrb'
require 'json'
module HelixRuntime
class Project
@ -33,7 +34,9 @@ module HelixRuntime
end
def build_path
File.expand_path(debug_rust? ? 'target/debug' : 'target/release', build_root)
metadata = %x[cargo metadata --format-version 1]
target_directory = JSON.parse(metadata)["target_directory"]
File.expand_path(debug_rust? ? 'debug' : 'release', target_directory)
end
def lib_path

View File

@ -252,4 +252,4 @@ macro_rules! codegen_extra_impls {
codegen_coercions!($class);
codegen_ruby_init!($class);
)
}
}