build-tool 0.0.3 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -0,0 +1,33 @@
1
+ require 'pathname'
2
+ require Pathname.new( File.dirname(__FILE__)).join( 'test_helper' ).cleanpath
3
+
4
+ require 'build-tool/repository'
5
+ require 'build-tool/module'
6
+ require 'build-tool/server'
7
+ require 'build-tool/vcs/git-svn'
8
+
9
+ class TestVcs < Test::Unit::TestCase
10
+
11
+ def initialize( *args )
12
+ super
13
+ @server = BuildTool::Server.new( "anonsvn.kde.org" )
14
+ @server.protocol = "svn+ssh"
15
+ @server.path = "/home/kde"
16
+
17
+ @repo = BuildTool::Repository.new( 'kde' )
18
+ @repo.server = @server
19
+ @repo.user = "mjansen"
20
+ end
21
+
22
+ # *TODO* More tests
23
+ def test_git_svn
24
+ mod = BuildTool::Module.new( "test" )
25
+ mod.repository= @repo
26
+ mod.build_prefix = "~/build"
27
+ config = BuildTool::VCS::GitSvnConfiguration.new( mod )
28
+ config.add_external( "kwin/client/nitrogen", "http://some.svn.server/ddjdjd" )
29
+ gitsvn = BuildTool::VCS::GitSvn.new( config )
30
+ assert( !gitsvn.checkedout? )
31
+ end
32
+
33
+ end
metadata CHANGED
@@ -1,56 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: build-tool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Jansen
8
8
  autorequire:
9
9
  bindir: bin
10
- cert_chain: []
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDOjCCAiKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBDMQwwCgYDVQQDDANrZGUx
14
+ HjAcBgoJkiaJk/IsZAEZFg5taWNoYWVsLWphbnNlbjETMBEGCgmSJomT8ixkARkW
15
+ A2JpejAeFw0wOTA2MDkyMDI1MThaFw0xMDA2MDkyMDI1MThaMEMxDDAKBgNVBAMM
16
+ A2tkZTEeMBwGCgmSJomT8ixkARkWDm1pY2hhZWwtamFuc2VuMRMwEQYKCZImiZPy
17
+ LGQBGRYDYml6MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAurxaZL3l
18
+ DVi5wG2HKTLVjl9Wl9gJT5L8edAxHrNMQtT3WQlyo3QNhOgLfVP9zMg49Y8dBRAP
19
+ w9ez71UJfjI17+KEEI6rdMF+poljfpszboRNqkuhn8b+kPy9vyVz93lIhyCUi4dx
20
+ Nyc2BSGjoYqQkVNZymz4TTb2xoMjUWkCjBsr8sxjB74zFaYqzjNMhWZUZB4CH1J1
21
+ S2+rdybmeC3/Yt3ck9kPgUQNRL5pnH9eJrFYzocbFHjp28CJf0zNmn8aUS1R32hD
22
+ 5optxe9j6Jh0sXW2Qqw3swfVwaJIrDI4KNcWlJTAO++FHsV8Jh9Y1HMUgcSVpWVj
23
+ 2SdR6e6L30jpNwIDAQABozkwNzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNV
24
+ HQ4EFgQU5L+10wMUoKc2MaHICpfSJ+HCffgwDQYJKoZIhvcNAQEFBQADggEBABWy
25
+ Uio+50gcBdYsmWRVcS2W3BLGes7KwD9CAcVZGa7adH8EY+ZrPkbhB2Csk/UZnuo5
26
+ 2THemT8qy42gxgI1RRv9+PFDCXA+p2URzlhXhsO4JHdNeaGEwsOETx29xRO1QTnl
27
+ bOjSlG4mdCB9WMAD2w58JAefhObPKQMl2L8sc0S3pEIcFmbLAVT4W6AbUiiK9C4T
28
+ AjmSlxUk0RdTT1xL0QQ88HoNxLK8hJHAT8pNq36taixh0ORmmqocRvIL0YrHUPa3
29
+ bdM0RIoUSO1SXrHpXDdvfp9w4BsMZiAf87eeq974P8VuyKbHgxN9El1nwtFGEfwm
30
+ M3zOaQdtTmiQPBqNIsE=
31
+ -----END CERTIFICATE-----
11
32
 
12
- date: 2009-07-07 00:00:00 +02:00
33
+ date: 2009-11-19 00:00:00 +01:00
13
34
  default_executable:
14
35
  dependencies:
15
36
  - !ruby/object:Gem::Dependency
16
- name: cmdparse
37
+ name: logging
17
38
  type: :runtime
18
39
  version_requirement:
19
40
  version_requirements: !ruby/object:Gem::Requirement
20
41
  requirements:
21
42
  - - ">="
22
43
  - !ruby/object:Gem::Version
23
- version: 2.0.2
24
- version:
25
- - !ruby/object:Gem::Dependency
26
- name: log4r
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 1.0.5
34
- version:
35
- - !ruby/object:Gem::Dependency
36
- name: newgem
37
- type: :development
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- version: 1.5.0
44
+ version: 1.2.2
44
45
  version:
45
46
  - !ruby/object:Gem::Dependency
46
47
  name: hoe
47
- type: :development
48
+ type: :runtime
48
49
  version_requirement:
49
50
  version_requirements: !ruby/object:Gem::Requirement
50
51
  requirements:
51
52
  - - ">="
52
53
  - !ruby/object:Gem::Version
53
- version: 2.3.0
54
+ version: 2.3.3
54
55
  version:
55
56
  - !ruby/object:Gem::Dependency
56
57
  name: hoe
@@ -60,80 +61,118 @@ dependencies:
60
61
  requirements:
61
62
  - - ">="
62
63
  - !ruby/object:Gem::Version
63
- version: 2.3.2
64
+ version: 2.3.3
64
65
  version:
65
- description: A ruby based alternative to kdesvn-build.
66
+ description: This project is inspired by kdesvn-build[http://kdesvn-build.kde.org/]. It help in building and maintaining a development environment. It downloads and configures sources and updates them later.
66
67
  email:
67
- - kde@michael-jansen.biz
68
+ - info@michael-jansen.biz
68
69
  executables:
69
- - kde-build.rb
70
+ - build-tool
70
71
  extensions: []
71
72
 
72
73
  extra_rdoc_files:
73
74
  - History.txt
74
75
  - Manifest.txt
75
- - PostInstall.txt
76
- - website/index.txt
76
+ - README.txt
77
77
  files:
78
78
  - History.txt
79
79
  - Manifest.txt
80
- - PostInstall.txt
80
+ - README.txt
81
81
  - Rakefile
82
- - TODO
83
- - bin/kde-build.rb
84
- - config/website.yml
85
- - config/website.yml.sample
86
- - lib/kde-build.rb
87
- - lib/kde-build/application.rb
88
- - lib/kde-build/build_system.rb
89
- - lib/kde-build/build_system/autoconf.rb
90
- - lib/kde-build/build_system/base.rb
91
- - lib/kde-build/build_system/cmake.rb
92
- - lib/kde-build/build_system/qtcopy.rb
93
- - lib/kde-build/command.rb
94
- - lib/kde-build/command/build.rb
95
- - lib/kde-build/command/compile.rb
96
- - lib/kde-build/command/configure.rb
97
- - lib/kde-build/command/ctags.rb
98
- - lib/kde-build/command/fetch.rb
99
- - lib/kde-build/command/help.rb
100
- - lib/kde-build/command/info.rb
101
- - lib/kde-build/command/install.rb
102
- - lib/kde-build/command/module_based.rb
103
- - lib/kde-build/command/rebase.rb
104
- - lib/kde-build/command/version.rb
105
- - lib/kde-build/configuration.rb
106
- - lib/kde-build/exception.rb
107
- - lib/kde-build/metaaid.rb
108
- - lib/kde-build/module.rb
109
- - lib/kde-build/module_configuration.rb
110
- - lib/kde-build/moduleregistry.rb
111
- - lib/kde-build/subprocess.rb
112
- - lib/kde-build/tools/ctags.rb
113
- - lib/kde-build/tools/logging.rb
114
- - lib/kde-build/tools/make.rb
115
- - lib/kde-build/tools/ssh.rb
116
- - lib/kde-build/vcs.rb
117
- - lib/kde-build/vcs/base.rb
118
- - lib/kde-build/vcs/git-svn.rb
119
- - lib/kde-build/vcs/git.rb
120
- - lib/kde-build/vcs/svn.rb
121
- - script/console
122
- - script/destroy
123
- - script/generate
124
- - script/txt2html
125
- - test.yaml.tmpl
82
+ - bin/build-tool
83
+ - lib/build-tool.rb
84
+ - lib/build-tool/GUI.rb
85
+ - lib/build-tool/application.rb
86
+ - lib/build-tool/build-system/autoconf.rb
87
+ - lib/build-tool/build-system/base.rb
88
+ - lib/build-tool/build-system/cmake.rb
89
+ - lib/build-tool/build-system/custom.rb
90
+ - lib/build-tool/build-system/qt.rb
91
+ - lib/build-tool/cfg/lexer.rb
92
+ - lib/build-tool/cfg/lexer.rex
93
+ - lib/build-tool/cfg/lexer_base.rb
94
+ - lib/build-tool/cfg/node.rb
95
+ - lib/build-tool/cfg/parser.rb
96
+ - lib/build-tool/cfg/parser.y
97
+ - lib/build-tool/cfg/visitor.rb
98
+ - lib/build-tool/commands.rb
99
+ - lib/build-tool/commands/build.rb
100
+ - lib/build-tool/commands/configure.rb
101
+ - lib/build-tool/commands/ctags.rb
102
+ - lib/build-tool/commands/environments.rb
103
+ - lib/build-tool/commands/environments/list.rb
104
+ - lib/build-tool/commands/environments/set.rb
105
+ - lib/build-tool/commands/fetch.rb
106
+ - lib/build-tool/commands/files.rb
107
+ - lib/build-tool/commands/help.rb
108
+ - lib/build-tool/commands/info.rb
109
+ - lib/build-tool/commands/install.rb
110
+ - lib/build-tool/commands/modules.rb
111
+ - lib/build-tool/commands/modules/info.rb
112
+ - lib/build-tool/commands/modules/list.rb
113
+ - lib/build-tool/commands/modules/shell.rb
114
+ - lib/build-tool/commands/rebase.rb
115
+ - lib/build-tool/commands/recipes.rb
116
+ - lib/build-tool/commands/recipes/info.rb
117
+ - lib/build-tool/commands/recipes/install.rb
118
+ - lib/build-tool/commands/recipes/list.rb
119
+ - lib/build-tool/configuration.rb
120
+ - lib/build-tool/environment.rb
121
+ - lib/build-tool/errors.rb
122
+ - lib/build-tool/module.rb
123
+ - lib/build-tool/pluginbase.rb
124
+ - lib/build-tool/recipe.rb
125
+ - lib/build-tool/repository.rb
126
+ - lib/build-tool/server.rb
127
+ - lib/build-tool/singleton.rb
128
+ - lib/build-tool/sshkey.rb
129
+ - lib/build-tool/vcs/base.rb
130
+ - lib/build-tool/vcs/git-svn.rb
131
+ - lib/build-tool/vcs/git.rb
132
+ - lib/build-tool/vcs/svn.rb
133
+ - lib/mj/logging.rb
134
+ - lib/mj/tools/ssh.rb
135
+ - lib/mj/tools/subprocess.rb
136
+ - lib/mj/visitor.rb
137
+ - recipes/kde/files/finish_installation.sh
138
+ - recipes/kde/files/kde4.desktop
139
+ - recipes/kde/files/xsession
140
+ - recipes/kde/info.yaml
141
+ - recipes/kde/recipe
142
+ - recipes/kde/recipe-local
143
+ - recipes/kde/settings.yaml
144
+ - recipes/kde43/info.yaml
145
+ - recipes/kde43/recipe
146
+ - recipes/kde43/recipe-local
147
+ - recipes/kde43/settings.yaml
148
+ - recipes/kdeqt4.6/custom/qt/qtscriptgenerator/compile.sh
149
+ - recipes/kdeqt4.6/custom/qt/qtscriptgenerator/configure.sh
150
+ - recipes/kdeqt4.6/custom/qt/qtscriptgenerator/install.sh
151
+ - recipes/kdeqt4.6/info.yaml
152
+ - recipes/kdeqt4.6/recipe
153
+ - recipes/kdeqt4.6/recipe-local
154
+ - recipes/kdeqt4.6/settings.yaml
155
+ - tags
156
+ - tasks/genfiles.rake
157
+ - tasks/rdoc.rake
158
+ - tasks/rspec.rake
159
+ - test.rb
160
+ - test/commands/test_build.rb
161
+ - test/test_build_system.rb
162
+ - test/test_cli.rb
163
+ - test/test_command.rb
164
+ - test/test_configuration_parser.rb
165
+ - test/test_environment.rb
126
166
  - test/test_helper.rb
127
- - test/test_kde-build.rb
128
- - test/test_vcs_svn.rb
129
- - website/index.html
130
- - website/index.txt
131
- - website/javascripts/rounded_corners_lite.inc.js
132
- - website/stylesheets/screen.css
133
- - website/template.html.erb
167
+ - test/test_module.rb
168
+ - test/test_repository.rb
169
+ - test/test_singleton.rb
170
+ - test/test_ssh_key.rb
171
+ - test/test_svn_parser.rb
172
+ - test/test_vcs.rb
134
173
  has_rdoc: true
135
- homepage: http://build-tool.rubyforge.org/git?p=build-tool.git;a=tree
136
- post_install_message: PostInstall.txt
174
+ homepage: http://build-tool.rubyforge.org
175
+ post_install_message: " To start with build-tool try the following commands:\n > build-tool recipe list\n > build-tool recipe install <recipe>\n"
137
176
  rdoc_options:
138
177
  - --main
139
178
  - README.txt
@@ -157,8 +196,18 @@ rubyforge_project: build-tool
157
196
  rubygems_version: 1.3.1
158
197
  signing_key:
159
198
  specification_version: 2
160
- summary: A ruby based alternative to kdesvn-build.
199
+ summary: This project is inspired by kdesvn-build[http://kdesvn-build.kde.org/]
161
200
  test_files:
201
+ - test/test_environment.rb
162
202
  - test/test_helper.rb
163
- - test/test_vcs_svn.rb
164
- - test/test_kde-build.rb
203
+ - test/test_svn_parser.rb
204
+ - test/test_vcs.rb
205
+ - test/test_repository.rb
206
+ - test/test_singleton.rb
207
+ - test/test_command.rb
208
+ - test/test_ssh_key.rb
209
+ - test/commands/test_build.rb
210
+ - test/test_cli.rb
211
+ - test/test_module.rb
212
+ - test/test_build_system.rb
213
+ - test/test_configuration_parser.rb
Binary file
@@ -1,3 +0,0 @@
1
-
2
- For more information on build-tool, see http://build-tool.rubyforge.org
3
-
data/TODO DELETED
@@ -1,2 +0,0 @@
1
- TODOS:
2
- - Use a default target
@@ -1,21 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # -*- coding:utf-8 -*-
3
-
4
- require 'rubygems'
5
-
6
- require File.dirname(__FILE__) + '/../lib/kde-build'
7
-
8
- require 'kde-build/application'
9
-
10
- app = BuildTool::Application.instance
11
-
12
- # Set the root directory. Its where we find the config template
13
- app.root_directory= Pathname.new( File.dirname(__FILE__) ).join( '..' ).cleanpath
14
-
15
- # Read the configuration file. The configuration file to load depends on the
16
- # scriptname used to invoke us. This makes it possible to have more than one
17
- # configuration using symlinks
18
- if app.read_configuration( "#{Pathname.new($0).basename}.yaml" )
19
- app.main(ARGV)
20
- end
21
-
@@ -1,2 +0,0 @@
1
- host: mjansen@rubyforge.org
2
- remote_dir: /var/www/gforge-projects/build-tool
@@ -1,2 +0,0 @@
1
- host: mjansen@rubyforge.org
2
- remote_dir: /var/www/gforge-projects/build-tool
@@ -1,18 +0,0 @@
1
- $:.unshift(File.dirname(__FILE__)) unless
2
- $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
-
4
- module KdeBuild
5
- VERSION = '0.0.3'
6
- end
7
-
8
- module Kernel
9
- # Suppresses warnings within a given block.
10
- def with_warnings_suppressed
11
- saved_verbosity = $-v
12
- $-v = nil
13
- yield
14
- ensure
15
- $-v = saved_verbosity
16
- end
17
- end
18
-
@@ -1,270 +0,0 @@
1
- # encoding: utf-8
2
- #
3
- require 'kde-build/vcs/git-svn'
4
- require 'kde-build/command/build'
5
- require 'kde-build/command/compile'
6
- require 'kde-build/command/configure'
7
- require 'kde-build/command/ctags'
8
- require 'kde-build/command/fetch'
9
- require 'kde-build/command/help'
10
- require 'kde-build/command/install'
11
- require 'kde-build/command/info'
12
- require 'kde-build/command/rebase'
13
- require 'kde-build/command/version'
14
-
15
- require 'kde-build/configuration'
16
-
17
- require 'kde-build/tools/ctags.rb'
18
- require 'kde-build/tools/logging.rb'
19
-
20
- require 'kde-build/moduleregistry'
21
- require 'kde-build/module_configuration'
22
-
23
- require 'cmdparse'
24
- require 'erb'
25
- require 'singleton'
26
- require 'yaml'
27
- require 'fileutils'
28
-
29
- # log4r produces nasty warnings
30
- # (eval):1: warning: redefine off?
31
- # (eval):2: warning: redefine debug
32
- # (eval):2: warning: redefine info
33
- with_warnings_suppressed do
34
- require 'log4r'
35
- include Log4r
36
- Log4r.define_levels('DEBUG','CMDOUT', 'CMD', 'INFO', 'WARN', 'ERROR', 'FATAL')
37
- $log = Logger.new('default')
38
- $log.outputters = StdoutOutputter.new( "log_stdout", :level => INFO )
39
- Outputter["log_stdout"].formatter = BuildTool::PlainFormatter.new
40
- end
41
-
42
- module BuildTool
43
-
44
-
45
- class Application
46
-
47
- include Singleton
48
-
49
- include MJ::Configuration::Configurable
50
-
51
- # This is where the script is installed.
52
- attr_accessor :root_directory
53
-
54
- option( "workdir", "Working directory" ).
55
- required.on_write{
56
- |val|
57
- File.expand_path( val )
58
- }
59
-
60
- def initialize
61
- $noop = false
62
- $verbose = false
63
- with_warnings_suppressed do
64
- @outputter = Outputter["log_stdout"]
65
- end
66
-
67
- @command = CmdParse::CommandParser.new(
68
- false, # handle exceptions
69
- true # Allow partial command matching
70
- )
71
- @command.program_name = "kde4svn-build"
72
- @command.program_version = KdeBuild::VERSION
73
- @command.options = CmdParse::OptionParserWrapper.new do |opt|
74
- opt.separator "Global Options"
75
- opt.on( "--verbose", "Verbose output" ) { |t|
76
- $verbose = true
77
- with_warnings_suppressed do
78
- @outputter.level = DEBUG
79
- end
80
- }
81
- opt.on( "--dry-run", "Verbose output" ) { |t|
82
- $noop = true
83
- }
84
- end
85
-
86
- YAML.add_domain_type(
87
- "michael-jansen.biz,2009", "ApplicationConfiguration" ) {
88
- |type, val|
89
- mc = Application::instance
90
- MJ::Configuration::flatten_values val do
91
- |k, v|
92
- mc.set( k, v )
93
- end
94
- mc
95
- }
96
-
97
- @command.add_command( BuildCommand.new )
98
- @command.add_command( CompileCommand.new )
99
- @command.add_command( ConfigureCommand.new )
100
- @command.add_command( CTagsCommand.new )
101
- @command.add_command( FetchCommand.new )
102
- @command.add_command( InfoCommand.new )
103
- @command.add_command( InstallCommand.new )
104
- @command.add_command( RebaseCommand.new )
105
-
106
- @command.add_command( HelpCommand.new )
107
- @command.add_command( VersionCommand.new )
108
-
109
- end
110
-
111
- # Read the configuration file. If we can't find a configuration file
112
- # provide a template file
113
- def read_configuration( name )
114
-
115
- configdir = Pathname.new("~").expand_path.join('.build_tool')
116
- # Make sure out configuration directory exists
117
- if !configdir.exist?
118
- # Create it
119
- FileUtils.mkdir_p( configdir )
120
- else
121
- # It's there. Make sure it's a directory
122
- if !configdir.directory?
123
- puts "Failed to create configuration directory #{configdir}. There is a file with this name!"
124
- return false
125
- end
126
- end
127
-
128
- # Check if the configuration file exists
129
- configfile = configdir.join( name )
130
- if !configfile.exist?
131
- # Copy our template file (if we find it)
132
- templatefile = root_directory.join( 'test.yaml.tmpl' )
133
- if !templatefile.exist?
134
- $log.error( "Could not find our template file at #{templatefile}!" )
135
- return false
136
- end
137
- FileUtils.copy( templatefile, configfile )
138
- $log.info( "I copied a template configuration file to '#{configfile}'. Please review it and adapt it to your needs." )
139
- return false
140
- end
141
-
142
- # The config file exists. Go on and read it
143
- config_string = File.read(configfile)
144
- config = ERB.new( config_string )
145
- @configuration = YAML.load( config.result )
146
- return true
147
-
148
- end
149
-
150
- def cli
151
- require 'readline'
152
- require 'shellwords'
153
-
154
- Readline.completion_proc = method(:completion)
155
- Readline.completer_word_break_characters = "\x00"
156
-
157
- begin
158
-
159
- while line = Readline.readline('> ', true)
160
-
161
- return nil if line.nil?
162
-
163
- # Remove duplicate or empty lines from history
164
- if line =~ /^\s*$/ or Readline::HISTORY.to_a[-2] == line
165
- Readline::HISTORY.pop
166
- end
167
-
168
- # Split the line like bash would do it
169
- execute Shellwords.shellwords( line )
170
-
171
- end
172
-
173
- rescue Interrupt => e
174
- exit
175
-
176
- end
177
- end
178
-
179
-
180
- def completion( string )
181
- args = Shellwords.shellwords(string)
182
-
183
- # Check if we are able to resolve to a command
184
- cmd = @command.main_command.commands[args[0]]
185
-
186
- if cmd
187
- # We are still on the first shellword
188
- if args.length == 1 and args[0] != cmd.name
189
- return [ cmd.name ]
190
- else
191
- return cmd.complete args[1..-1]
192
- end
193
- else
194
- # No command. Try to give some possible expansions
195
- args[0] = "" if args[0] === nil
196
- cmds = []
197
- @command.main_command.commands.each do |name, cmd|
198
- if name.start_with? args[0]
199
- cmds.push cmd.name
200
- end
201
- end
202
- cmds
203
- end
204
- end
205
-
206
-
207
- def execute(args)
208
- begin
209
-
210
- @command.parse( args )
211
-
212
- rescue CmdParse::InvalidCommandError => e
213
- puts e.message
214
- @command.main_command.commands.sort.each do |name, cmd|
215
- print name.ljust( 15 ) + cmd.short_desc.to_s
216
- print " (=default command)" if name == cmd.default_command
217
- print "\n"
218
- end
219
-
220
- rescue CmdParse::InvalidOptionError => e
221
- puts e.message
222
- cmd = @command.main_command.commands[args[0]]
223
- cmd.show_help
224
-
225
- rescue Exception => e
226
- puts e.message
227
- puts e.backtrace if $verbose
228
- end
229
- end
230
-
231
- def log_directory
232
- @log_directory
233
- end
234
-
235
- def initialize_logging
236
- # Ensure the base log directory exists
237
- if !File.exist? "#{workdir}/log"
238
- FileUtils.mkdir_p "#{workdir}/log"
239
- end
240
-
241
- i = -1
242
-
243
- begin
244
- @log_directory = "#{workdir}/log/#{Date.today.to_s}-%02d" % i+=1
245
- end until !File.exist?( @log_directory )
246
-
247
- FileUtils.mkdir_p( @log_directory )
248
-
249
- with_warnings_suppressed do
250
- $log.add( FileOutputter.new(
251
- "status",
252
- :filename => "#{@log_directory}/build-status",
253
- :level => INFO ) )
254
- end
255
- end
256
-
257
-
258
- def main(args)
259
- if args.length > 0
260
- initialize_logging
261
- execute(args)
262
- else
263
- cli
264
- end
265
- end
266
-
267
-
268
- end
269
-
270
- end