Skip to content

Instantly share code, notes, and snippets.

@jaydonnell
Created January 5, 2011 19:00
Show Gist options
  • Select an option

  • Save jaydonnell/766799 to your computer and use it in GitHub Desktop.

Select an option

Save jaydonnell/766799 to your computer and use it in GitHub Desktop.
# an example for setting the classpath in a custom buildr task
task :threadingtest => [:compile, :test] do
# this will give us the project dependencies
specs = (project.compile.dependencies + project.test.compile.dependencies).flatten
# this turns them into the proper string representation
cp = Buildr.artifacts(specs).each(&:invoke).map(&:name).join(File::PATH_SEPARATOR)
# last we need to add our compiled classes
cp = cp + ":" + path_to('target', 'classes') + ":" + path_to('target', 'test', 'classes')
cmd = "java -cp #{cp} org.junit.runner.JUnitCore com.jaydonnell.javautils.MultiThreadedIT"
system cmd
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment