mirror of
https://github.com/elastic/logstash.git
synced 2025-04-23 22:27:21 -04:00
29 lines
800 B
Ruby
29 lines
800 B
Ruby
|
|
rule ".rb" => ".treetop" do |task, args|
|
|
require "treetop"
|
|
compiler = Treetop::Compiler::GrammarCompiler.new
|
|
compiler.compile(task.source, task.name)
|
|
puts "Compiling #{task.source}"
|
|
end
|
|
|
|
namespace "compile" do
|
|
desc "Compile the config grammar"
|
|
task "grammar" => "logstash-core/lib/logstash/config/grammar.rb"
|
|
|
|
def safe_system(*args)
|
|
if !system(*args)
|
|
status = $?
|
|
raise "Got exit status #{status.exitstatus} attempting to execute #{args.inspect}!"
|
|
end
|
|
end
|
|
|
|
task "logstash-core-java" do
|
|
unless File.exists?(File.join("logstash-core", "lib", "jars", "logstash-core.jar"))
|
|
puts("Building logstash-core using gradle")
|
|
safe_system("./gradlew", "assemble")
|
|
end
|
|
end
|
|
|
|
desc "Build everything"
|
|
task "all" => ["grammar", "logstash-core-java"]
|
|
end
|