diff --git a/lib/rscons/util.rb b/lib/rscons/util.rb index c199e1c..20c4434 100644 --- a/lib/rscons/util.rb +++ b/lib/rscons/util.rb @@ -16,6 +16,20 @@ module Rscons end end + # Return the absolute path for a given target if not a phony target. + # + # @param path [String, Symbol] + # Given target name. + # + # @return Absolute path of given target. + def absolute_path(path) + if Rscons.phony_target?(path) + path + else + File.expand_path(path) + end + end + # Colorize a builder run message. # # @param message [String]