Class: Raven::JarTask

Inherits:
Rake::Task
  • Object
show all
Defined in:
lib/raven/java_tasks.rb

Overview

Builds a jar file from your compiled sources. The jarfile produced will have the same name as your jar task.

Instance Method Summary collapse

Instance Method Details

#executeObject



127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/raven/java_tasks.rb', line 127

def execute
  super
  latest = Raven.latest_file('target/classes')

  # Manifest inclusion
  mfest_param = @manifest ? "-m #{@manifest}" : ""

  if !File.exist?("target/#{name}") || File.stat("target/#{name}").mtime < latest
    `jar -cf target/#{name} #{mfest_param} -C target/classes .`
    puts "Built jar file #{name}." if RakeFileUtils.verbose_flag
  else
    puts 'Nothing to do, jar is fresh enough.' if RakeFileUtils.verbose_flag
  end
end

#manifest=(f) ⇒ Object



142
143
144
# File 'lib/raven/java_tasks.rb', line 142

def manifest=(f)
  @manifest = f
end