Support java_args being specified by both a string and an array.
authorPeter Donald <peter@realityforge.org>
Sat, 19 Mar 2016 09:26:58 +0000 (20:26 +1100)
committerPeter Donald <peter@realityforge.org>
Sat, 19 Mar 2016 09:27:20 +0000 (20:27 +1100)
This patch restores support for arrays that was lost after change 4e24616239d8c455f51e1b2058c3e83060731511

addon/buildr/jacoco.rb

index fbb0b0a..8bddf81 100644 (file)
@@ -138,7 +138,8 @@ module Buildr
             options << "excludes=#{project.jacoco.excludes.join(':')}" unless project.jacoco.excludes.empty?
 
             agent_config = "-javaagent:#{agent_jar}=#{options.join(',')}"
-            project.test.options[:java_args] = ([project.test.options[:java_args]] || []) + [agent_config]
+            existing = project.test.options[:java_args] || []
+            project.test.options[:java_args] = (existing.is_a?(Array)? existing : [existing]) + [agent_config]
           end
           namespace 'jacoco' do
             if project.jacoco.generate_xml?