Class: Doubleshot::CLI::Commands::Build

Inherits:
Doubleshot::CLI show all
Defined in:
lib/doubleshot/commands/build.rb

Constant Summary

Constants inherited from Doubleshot::CLI

USAGE

Class Method Summary collapse

Methods inherited from Doubleshot::CLI

commands, detect, inherited, task_name, usage

Class Method Details

.optionsObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/doubleshot/commands/build.rb', line 13

def self.options
  Options.new do |options|
    options.banner = "Usage: doubleshot build"
    options.separator ""
    options.separator "Options"

    options.classpath = []
    options.on "--classpath CLASSPATH", "Manually set the CLASSPATH the compiler should use." do |classpath|
      options.classpath = classpath.to_s.split(":")
    end

    options.conditional = false
    options.on "--conditional", "Perform a conditional build (determine if there are pending files)." do
      options.conditional = true
    end

    options.separator ""
    options.separator "Summary: #{summary}"
  end
end

.start(args) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/doubleshot/commands/build.rb', line 34

def self.start(args)
  options = self.options.parse!(args)
  doubleshot = Doubleshot::current

  if doubleshot.config.project == "doubleshot"
    puts "Bootstrapping Doubleshot build with Maven..."
    doubleshot.bootstrap!
  else
    puts "Performing Doubleshot setup to resolve dependencies..."
    doubleshot.setup!
  end

  doubleshot.build! options.conditional
  return 0
end

.summaryObject



2
3
4
5
6
7
8
9
10
11
# File 'lib/doubleshot/commands/build.rb', line 2

def self.summary
  <<-EOS.margin
    Download all dependencies and compile sources so that you
    can use the project directly without installation, such
    as with IRB.

    NOTE: Packaging and testing have a dependency on this
    command. You don't need to build as a prerequisite.
  EOS
end