Skip to content

Instantly share code, notes, and snippets.

@aboisvert
Created December 1, 2011 18:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aboisvert/1418828 to your computer and use it in GitHub Desktop.
Save aboisvert/1418828 to your computer and use it in GitHub Desktop.
Buidlr plugin for the ScalaCL plugin
#
# Buildr plugin to compile Scala code with the ScalaCL plugin.
# http://code.google.com/p/scalacl/wiki/ScalaCLPlugin
#
# To use,
# 1) add "require 'scala_cl'" to your buildfile
# 2) add "extend Buildr::ScalaCL" to your project definition
#
# Copyright (C) 2011 by Alex Boisvert
#
# Licensed under the Apache Software License v2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
repositories.remote << "http://nativelibs4java.sourceforge.net/maven/"
module Buildr
module ScalaCL
include Extension
VERSION = Buildr.settings.build['scalacl.version'] || "0.2"
LIB = "com.nativelibs4java:scalacl:jar:#{VERSION}"
PLUGIN = "com.nativelibs4java:scalacl-compiler-plugin:jar:#{VERSION}"
after_define(:scalacl => :compile) do |project|
project.compile.enhance Buildr.artifacts(LIB, PLUGIN)
project.compile.using :other => Array(project.compile.options[:other]) +
["-Xplugin:#{Buildr.artifact(PLUGIN)}"]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment