Module: Buildrake

Defined in:
lib/buildrake.rb,
lib/buildrake/rush.rb,
lib/buildrake/config.rb,
lib/buildrake/github.rb,
lib/buildrake/comment.rb,
lib/buildrake/version.rb

Defined Under Namespace

Modules: Comment, Rush Classes: Config, Github

Constant Summary collapse

VERSION =
"0.0.8"

Class Method Summary collapse

Class Method Details

.generate_gitignoreObject



75
76
77
78
79
80
81
82
83
84
# File 'lib/buildrake.rb', line 75

def self.generate_gitignore
  return if Rush.file?( ".gitignore" )
  
  open( ".gitignore", "wb" ){|f|
    f.puts <<EOS
/build
/lib
EOS
  }
end

.generate_rakefileObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/buildrake.rb', line 13

def self.generate_rakefile
  return if Rush.file?( "Rakefile" )
  
  open( "Rakefile", "wb" ){|f|
    f.puts <<EOS
require "buildrake"

class Config < Buildrake::Config
method_accessor :srcs

def initialize( *args )
  super( "", Buildrake::Rush.full_dir_path( Buildrake::Rush.dir_path( __FILE__ ) ) )
  
  inc_dirs [ "\#{@root_path}/inc" ]
  
  # Library
  @srcs = [  ]
  library( project_name, @srcs )
  
  @platforms.each{|platform|
    @configs.each{|config|
      case platform
      when :android
        lib_dirs = [ "\#{@root_path}/lib/android/$(ANDROID_NDK_VERSION)_$(CONFIG)" ]
      else
        lib_dirs = [ "\#{@root_path}/lib/$(PLATFORM_PATH)" ]
      end
      lib_dir( platform, config, lib_dirs )
    }
  }
  
  # Execute
  if Buildrake::Rush.windows?
    libs = [  ]
  else
    libs = [  ]
  end
  execute( "", [  ], libs )
end
end

desc "Setup"
task :setup do
Config.run( [ "setup" ] )
exit( 0 )
end

desc "Show help message"
task :help do
Config.run( [ "help" ] )
exit( 0 )
end

desc "Build"
task :build do
Config.run( [ "build" ] )
exit( 0 )
end
EOS
  }
end

.setupObject



8
9
10
11
# File 'lib/buildrake.rb', line 8

def self.setup
  generate_rakefile
  generate_gitignore
end