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 0baf995e04
commit 151b7ac68f
1 changed files with 4 additions and 1 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