build-tool 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. data.tar.gz.sig +0 -0
  2. data/History.txt +28 -1
  3. data/Manifest.txt +91 -52
  4. data/README.txt +63 -0
  5. data/Rakefile +20 -23
  6. data/bin/build-tool +53 -0
  7. data/lib/build-tool.rb +7 -0
  8. data/lib/build-tool/GUI.rb +360 -0
  9. data/lib/build-tool/application.rb +84 -0
  10. data/lib/build-tool/build-system/autoconf.rb +60 -0
  11. data/lib/build-tool/build-system/base.rb +142 -0
  12. data/lib/build-tool/build-system/cmake.rb +119 -0
  13. data/lib/build-tool/build-system/custom.rb +115 -0
  14. data/lib/build-tool/build-system/qt.rb +113 -0
  15. data/lib/build-tool/cfg/lexer.rb +558 -0
  16. data/lib/build-tool/cfg/lexer.rex +248 -0
  17. data/lib/build-tool/cfg/lexer_base.rb +82 -0
  18. data/lib/build-tool/cfg/node.rb +94 -0
  19. data/lib/build-tool/cfg/parser.rb +871 -0
  20. data/lib/build-tool/cfg/parser.y +279 -0
  21. data/lib/build-tool/cfg/visitor.rb +471 -0
  22. data/lib/build-tool/commands.rb +639 -0
  23. data/lib/build-tool/commands/build.rb +120 -0
  24. data/lib/build-tool/commands/configure.rb +73 -0
  25. data/lib/build-tool/commands/ctags.rb +46 -0
  26. data/lib/build-tool/commands/environments.rb +29 -0
  27. data/lib/build-tool/commands/environments/list.rb +37 -0
  28. data/lib/build-tool/commands/environments/set.rb +33 -0
  29. data/lib/build-tool/commands/fetch.rb +50 -0
  30. data/lib/build-tool/commands/files.rb +73 -0
  31. data/lib/build-tool/commands/help.rb +22 -0
  32. data/lib/build-tool/commands/info.rb +48 -0
  33. data/lib/build-tool/commands/install.rb +56 -0
  34. data/lib/build-tool/commands/modules.rb +29 -0
  35. data/lib/build-tool/commands/modules/info.rb +75 -0
  36. data/lib/build-tool/commands/modules/list.rb +49 -0
  37. data/lib/build-tool/commands/modules/shell.rb +40 -0
  38. data/lib/build-tool/commands/rebase.rb +46 -0
  39. data/lib/build-tool/commands/recipes.rb +32 -0
  40. data/lib/build-tool/commands/recipes/info.rb +46 -0
  41. data/lib/build-tool/commands/recipes/install.rb +184 -0
  42. data/lib/build-tool/commands/recipes/list.rb +33 -0
  43. data/lib/build-tool/configuration.rb +115 -0
  44. data/lib/build-tool/environment.rb +119 -0
  45. data/lib/build-tool/errors.rb +9 -0
  46. data/lib/build-tool/module.rb +366 -0
  47. data/lib/build-tool/pluginbase.rb +43 -0
  48. data/lib/build-tool/recipe.rb +180 -0
  49. data/lib/build-tool/repository.rb +59 -0
  50. data/lib/build-tool/server.rb +43 -0
  51. data/lib/build-tool/singleton.rb +50 -0
  52. data/lib/build-tool/sshkey.rb +22 -0
  53. data/lib/build-tool/vcs/base.rb +105 -0
  54. data/lib/build-tool/vcs/git-svn.rb +154 -0
  55. data/lib/build-tool/vcs/git.rb +187 -0
  56. data/lib/build-tool/vcs/svn.rb +136 -0
  57. data/lib/mj/logging.rb +31 -0
  58. data/lib/mj/tools/ssh.rb +64 -0
  59. data/lib/{kde-build → mj/tools}/subprocess.rb +21 -16
  60. data/lib/mj/visitor.rb +21 -0
  61. data/recipes/kde/files/finish_installation.sh +16 -0
  62. data/recipes/kde/files/kde4.desktop +22 -0
  63. data/recipes/kde/files/xsession +89 -0
  64. data/recipes/kde/info.yaml +10 -0
  65. data/recipes/kde/recipe +585 -0
  66. data/recipes/kde/recipe-local +90 -0
  67. data/recipes/kde/settings.yaml +52 -0
  68. data/recipes/kde43/info.yaml +10 -0
  69. data/recipes/kde43/recipe +256 -0
  70. data/recipes/kde43/recipe-local +90 -0
  71. data/recipes/kde43/settings.yaml +32 -0
  72. data/recipes/kdeqt4.6/custom/qt/qtscriptgenerator/compile.sh +77 -0
  73. data/recipes/kdeqt4.6/custom/qt/qtscriptgenerator/configure.sh +70 -0
  74. data/recipes/kdeqt4.6/custom/qt/qtscriptgenerator/install.sh +39 -0
  75. data/recipes/kdeqt4.6/info.yaml +7 -0
  76. data/recipes/kdeqt4.6/recipe +155 -0
  77. data/recipes/kdeqt4.6/recipe-local +30 -0
  78. data/recipes/kdeqt4.6/settings.yaml +27 -0
  79. data/tags +745 -0
  80. data/tasks/genfiles.rake +28 -0
  81. data/tasks/rdoc.rake +34 -0
  82. data/tasks/rspec.rake +21 -0
  83. data/test.rb +28 -0
  84. data/test/commands/test_build.rb +29 -0
  85. data/test/test_build_system.rb +98 -0
  86. data/test/test_cli.rb +61 -0
  87. data/test/test_command.rb +175 -0
  88. data/test/test_configuration_parser.rb +542 -0
  89. data/test/test_environment.rb +82 -0
  90. data/test/test_helper.rb +39 -7
  91. data/test/test_module.rb +158 -0
  92. data/test/test_repository.rb +75 -0
  93. data/test/test_singleton.rb +51 -0
  94. data/test/test_ssh_key.rb +14 -0
  95. data/test/test_svn_parser.rb +28 -0
  96. data/test/test_vcs.rb +33 -0
  97. metadata +139 -90
  98. metadata.gz.sig +0 -0
  99. data/PostInstall.txt +0 -3
  100. data/TODO +0 -2
  101. data/bin/kde-build.rb +0 -21
  102. data/config/website.yml +0 -2
  103. data/config/website.yml.sample +0 -2
  104. data/lib/kde-build.rb +0 -18
  105. data/lib/kde-build/application.rb +0 -270
  106. data/lib/kde-build/build_system.rb +0 -28
  107. data/lib/kde-build/build_system/autoconf.rb +0 -108
  108. data/lib/kde-build/build_system/base.rb +0 -139
  109. data/lib/kde-build/build_system/cmake.rb +0 -94
  110. data/lib/kde-build/build_system/qtcopy.rb +0 -127
  111. data/lib/kde-build/command.rb +0 -42
  112. data/lib/kde-build/command/build.rb +0 -106
  113. data/lib/kde-build/command/compile.rb +0 -39
  114. data/lib/kde-build/command/configure.rb +0 -48
  115. data/lib/kde-build/command/ctags.rb +0 -41
  116. data/lib/kde-build/command/fetch.rb +0 -33
  117. data/lib/kde-build/command/help.rb +0 -71
  118. data/lib/kde-build/command/info.rb +0 -45
  119. data/lib/kde-build/command/install.rb +0 -39
  120. data/lib/kde-build/command/module_based.rb +0 -44
  121. data/lib/kde-build/command/rebase.rb +0 -50
  122. data/lib/kde-build/command/version.rb +0 -43
  123. data/lib/kde-build/configuration.rb +0 -209
  124. data/lib/kde-build/exception.rb +0 -6
  125. data/lib/kde-build/metaaid.rb +0 -18
  126. data/lib/kde-build/module.rb +0 -227
  127. data/lib/kde-build/module_configuration.rb +0 -107
  128. data/lib/kde-build/moduleregistry.rb +0 -85
  129. data/lib/kde-build/tools/ctags.rb +0 -59
  130. data/lib/kde-build/tools/logging.rb +0 -49
  131. data/lib/kde-build/tools/make.rb +0 -58
  132. data/lib/kde-build/tools/ssh.rb +0 -47
  133. data/lib/kde-build/vcs.rb +0 -28
  134. data/lib/kde-build/vcs/base.rb +0 -85
  135. data/lib/kde-build/vcs/git-svn.rb +0 -139
  136. data/lib/kde-build/vcs/git.rb +0 -121
  137. data/lib/kde-build/vcs/svn.rb +0 -102
  138. data/script/console +0 -10
  139. data/script/destroy +0 -14
  140. data/script/generate +0 -14
  141. data/script/txt2html +0 -71
  142. data/test.yaml.tmpl +0 -632
  143. data/test/test_kde-build.rb +0 -11
  144. data/test/test_vcs_svn.rb +0 -44
  145. data/website/index.html +0 -84
  146. data/website/index.txt +0 -59
  147. data/website/javascripts/rounded_corners_lite.inc.js +0 -285
  148. data/website/stylesheets/screen.css +0 -159
  149. data/website/template.html.erb +0 -50
@@ -1,42 +0,0 @@
1
- # encoding: utf-8
2
- #
3
- require 'cmdparse'
4
-
5
- module BuildTool
6
-
7
-
8
- class Command < CmdParse::Command
9
-
10
-
11
- def show_help
12
- puts usage
13
- puts
14
- if description
15
- puts description
16
- puts
17
- else
18
- puts short_desc
19
- puts
20
- end
21
- if has_commands?
22
- list_commands
23
- puts
24
- end
25
- unless (summary = options.summarize).empty?
26
- puts summary
27
- puts
28
- end
29
- end
30
-
31
- def complete( args )
32
- if options.instance
33
- puts options.instance.complete( :long, "-v", true )
34
- return ["#{name} Yeah"]
35
- else
36
- return []
37
- end
38
- end
39
-
40
- end
41
-
42
- end
@@ -1,106 +0,0 @@
1
- # encoding: utf-8
2
- #
3
-
4
- require 'kde-build/command/module_based'
5
-
6
- module BuildTool
7
-
8
-
9
- class BuildCommand < ModuleBasedCommand
10
-
11
- def initialize
12
- super( 'build', false )
13
- self.short_desc = "Do a complete build (fetch, rebase, compile, install)."
14
- self.description = <<-"EOS"
15
- Do a complete build.
16
- * Fetch changes from the remote repository,
17
- * Rebase the local repository,
18
- * Compile,
19
- * Install
20
- EOS
21
- @update = true
22
- @configure = false
23
- @clean = false
24
- @reconfigure = false
25
- @install = true
26
- @from_scratch = false
27
- self.options = CmdParse::OptionParserWrapper.new do |opt|
28
- opt.separator "Options:"
29
- opt.on( "--no-update", "Do not update from the repository" ) { |t|
30
- @update = false
31
- }
32
- opt.on( "-c", "--configure", "Run the configuration step again" ) { |t|
33
- @configure = true
34
- }
35
- opt.on( "--[no-]clean", "Make clean before building." ) { |t|
36
- @clean = t
37
- }
38
- opt.on( "--reconfigure", "Remove old configuration then run configuration again" ) { |t|
39
- @reconfigure = true
40
- }
41
- opt.on( "--no-install", "Do not install" ) { |t|
42
- @install = false
43
- }
44
- opt.on( "--from-scratch", "Remove build dir" ) { |t|
45
- @from_scratch = true
46
- }
47
- opt.on( "--help", "Show this help" ) { |t|
48
- }
49
- end
50
- end
51
-
52
- def is_module_ready( mod )
53
- skip = false
54
- if @update
55
- mod.activate_ssh_key
56
- else
57
- if !mod.checkedout?
58
- $log.error("Module #{mod.name} is not checkedout and will be skipped!")
59
- skip = true
60
- end
61
- end
62
- !skip
63
- end
64
-
65
- def execute_for_module( mod )
66
-
67
- $log.info( "###############################################################" )
68
- $log.info( "### Building module #{mod.name}" )
69
- $log.info( "###############################################################" )
70
-
71
- if @from_scratch
72
- mod.remove_build_directory
73
- end
74
-
75
- if @update
76
-
77
- if mod.checkedout?
78
- mod.fetch
79
- mod.rebase
80
- else
81
- mod.init
82
- end
83
-
84
- end
85
-
86
- if @reconfigure
87
- mod.reconfigure( @clean.nil? ? true : @clean )
88
-
89
- elsif @configure
90
- if mod.configured?
91
- mod.reconfigure
92
- else
93
- mod.configure
94
- end
95
-
96
- elsif !mod.configured?
97
- mod.configure
98
- end
99
-
100
- mod.build( @install, @clean )
101
-
102
- end
103
-
104
- end
105
-
106
- end
@@ -1,39 +0,0 @@
1
- require 'kde-build/command/module_based'
2
-
3
- module BuildTool
4
-
5
- class CompileCommand < ModuleBasedCommand
6
-
7
- def initialize
8
- super( 'compile', false )
9
- self.short_desc = "Compile the modules."
10
- self.description = <<-"EOS"
11
- Compile the given modules.
12
- EOS
13
- #@update = true
14
- # self.options = CmdParse::OptionParserWrapper.new do |opt|
15
- # opt.separator "Options:"
16
- # opt.on( "--no-update", "Do not update from the repository" ) { |t|
17
- # @update = false
18
- # }
19
- # end
20
- end
21
-
22
- def is_module_ready( mod )
23
- true
24
- end
25
-
26
- def execute_for_module( mod )
27
-
28
- $log.info( "###############################################################" )
29
- $log.info( "### Compiling module #{mod.name}" )
30
- $log.info( "###############################################################" )
31
-
32
- mod.build( false )
33
- end
34
-
35
- end
36
-
37
-
38
- end
39
-
@@ -1,48 +0,0 @@
1
- require 'kde-build/command/module_based'
2
-
3
- module BuildTool
4
-
5
- class ConfigureCommand < ModuleBasedCommand
6
-
7
- def initialize
8
- super( 'configure', false )
9
- self.short_desc = "Configure the modules."
10
- self.description = <<-"EOS"
11
- Install the given modules.
12
- EOS
13
- #@update = true
14
- # self.options = CmdParse::OptionParserWrapper.new do |opt|
15
- # opt.separator "Options:"
16
- # opt.on( "--no-update", "Do not update from the repository" ) { |t|
17
- # @update = false
18
- # }
19
- # end
20
- end
21
-
22
- def is_module_ready( mod )
23
- skip = false
24
- if !mod.checkedout?
25
- $log.error("Module #{mod.name} is not checkedout and will be skipped!")
26
- skip = true
27
- end
28
- !skip
29
- end
30
-
31
- def execute_for_module( mod )
32
-
33
- $log.info( "###############################################################" )
34
- $log.info( "### Configure the module #{mod.name}" )
35
- $log.info( "###############################################################" )
36
-
37
- if mod.configured?
38
- mod.reconfigure
39
- else
40
- mod.configure
41
- end
42
- end
43
-
44
- end
45
-
46
-
47
- end
48
-
@@ -1,41 +0,0 @@
1
- require 'kde-build/command/module_based'
2
- require 'kde-build/tools/ctags.rb'
3
-
4
- module BuildTool
5
-
6
- class CTagsCommand < ModuleBasedCommand
7
-
8
- def initialize
9
- super( 'ctags', false )
10
- self.short_desc = "Run ctags for the given modules."
11
- self.description = <<-"EOS"
12
- Runs the ctags command in the source directories of the given modules. The
13
- place to put the resulting tags file is taken from the config file.
14
- EOS
15
- #@update = true
16
- # self.options = CmdParse::OptionParserWrapper.new do |opt|
17
- # opt.separator "Options:"
18
- # opt.on( "--no-update", "Do not update from the repository" ) { |t|
19
- # @update = false
20
- # }
21
- # end
22
- end
23
-
24
- def is_module_ready( mod )
25
- true
26
- end
27
-
28
- def execute_for_module( mod )
29
-
30
- $log.info( "###############################################################" )
31
- $log.info( "### Creating tags file for module #{mod.name}" )
32
- $log.info( "###############################################################" )
33
-
34
- CTags::run( mod.source_directory, "#{mod.name}.tags" )
35
- end
36
-
37
- end
38
-
39
-
40
- end
41
-
@@ -1,33 +0,0 @@
1
- require 'kde-build/command/module_based'
2
-
3
- module BuildTool
4
-
5
- class FetchCommand < ModuleBasedCommand
6
-
7
- def initialize
8
- super( 'fetch', false )
9
- self.short_desc = "Fetch changes from the remote repository."
10
- self.description = <<-"EOS"
11
- Fetch changes from the remote repository without rebasing if the used vcs
12
- supports it. If the vcs doesn't the module is skipped.
13
- EOS
14
- end
15
-
16
- def is_module_ready( mod )
17
- mod.activate_ssh_key
18
- true
19
- end
20
-
21
- def execute_for_module( mod )
22
-
23
- $log.info( "###############################################################" )
24
- $log.info( "### Fetching module #{mod.name}" )
25
- $log.info( "###############################################################" )
26
-
27
- mod.fetch
28
- end
29
-
30
- end
31
-
32
-
33
- end
@@ -1,71 +0,0 @@
1
- # encoding: utf-8
2
- #
3
- require 'kde-build/command'
4
-
5
- module BuildTool
6
-
7
-
8
- # The default help command. It adds the options "-h" and "--help" to the global options of the
9
- # associated +CommandParser+. When the command is specified on the command line, it can show the
10
- # main help or individual command help.
11
- class HelpCommand < Command
12
-
13
- def initialize
14
- super( 'help', false )
15
- self.short_desc = 'Provide help for individual commands'
16
- self.description = 'This command prints the program help if no arguments are given. ' \
17
- 'If one or more command names are given as arguments, these arguments are interpreted ' \
18
- 'as a hierachy of commands and the help for the right most command is show.'
19
- end
20
-
21
- def init
22
- case commandparser.main_command.options
23
- when CmdParse::OptionParserWrapper
24
- commandparser.main_command.options.instance do |opt|
25
- opt.on_tail( "-h", "--help", "Show help" ) do
26
- execute( [] )
27
- end
28
- end
29
- end
30
- end
31
-
32
- def usage
33
- "Usage: #{commandparser.program_name} help [COMMAND SUBCOMMAND ...]"
34
- end
35
-
36
- def execute( args )
37
- if args.length > 0
38
- cmd = commandparser.main_command
39
- arg = args.shift
40
- while !arg.nil? && cmd.commands[ arg ]
41
- cmd = cmd.commands[arg]
42
- arg = args.shift
43
- end
44
- if arg.nil?
45
- cmd.show_help
46
- else
47
- raise InvalidArgumentError, args.unshift( arg ).join(' ')
48
- end
49
- else
50
- show_program_help
51
- end
52
- end
53
-
54
- #######
55
- private
56
- #######
57
-
58
- def show_program_help
59
- puts commandparser.banner + "\n" if commandparser.banner
60
- puts "Usage: #{commandparser.program_name} [options] COMMAND [options] [COMMAND [options] ...] [args]"
61
- puts ""
62
- list_commands( 1, commandparser.main_command )
63
- puts ""
64
- puts commandparser.main_command.options.summarize
65
- puts
66
- end
67
-
68
- end
69
-
70
-
71
- end
@@ -1,45 +0,0 @@
1
- # encoding: utf-8
2
- #
3
- require 'kde-build/command'
4
-
5
- module BuildTool
6
-
7
-
8
- class InfoCommand < Command
9
-
10
- def initialize
11
- super( 'info', false )
12
- self.short_desc = "Information about a module."
13
- self.description = "Retrieve detailed information about module(s)."
14
- end
15
-
16
- def usage
17
- "Usage: #{commandparser.program_name} info [module]..."
18
- end
19
-
20
- def execute( args )
21
-
22
- if args.length == 0
23
- show_help
24
- return
25
- end
26
-
27
- args.each do |modname|
28
- mod = ModuleRegistry.get_modules( modname ) do |mod|
29
- if mod == nil
30
- puts "#{modname} is unknown"
31
- return
32
- end
33
-
34
- mod.info
35
- puts ""
36
-
37
- end
38
- end
39
- end
40
-
41
- end
42
-
43
-
44
- end
45
-
@@ -1,39 +0,0 @@
1
- require 'kde-build/command/module_based'
2
-
3
- module BuildTool
4
-
5
- class InstallCommand < ModuleBasedCommand
6
-
7
- def initialize
8
- super( 'install', false )
9
- self.short_desc = "Install the modules."
10
- self.description = <<-"EOS"
11
- Install the given modules.
12
- EOS
13
- #@update = true
14
- # self.options = CmdParse::OptionParserWrapper.new do |opt|
15
- # opt.separator "Options:"
16
- # opt.on( "--no-update", "Do not update from the repository" ) { |t|
17
- # @update = false
18
- # }
19
- # end
20
- end
21
-
22
- def is_module_ready( mod )
23
- true
24
- end
25
-
26
- def execute_for_module( mod )
27
-
28
- $log.info( "###############################################################" )
29
- $log.info( "### Installing module #{mod.name}" )
30
- $log.info( "###############################################################" )
31
-
32
- mod.build( true )
33
- end
34
-
35
- end
36
-
37
-
38
- end
39
-