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.
- data.tar.gz.sig +0 -0
- data/History.txt +28 -1
- data/Manifest.txt +91 -52
- data/README.txt +63 -0
- data/Rakefile +20 -23
- data/bin/build-tool +53 -0
- data/lib/build-tool.rb +7 -0
- data/lib/build-tool/GUI.rb +360 -0
- data/lib/build-tool/application.rb +84 -0
- data/lib/build-tool/build-system/autoconf.rb +60 -0
- data/lib/build-tool/build-system/base.rb +142 -0
- data/lib/build-tool/build-system/cmake.rb +119 -0
- data/lib/build-tool/build-system/custom.rb +115 -0
- data/lib/build-tool/build-system/qt.rb +113 -0
- data/lib/build-tool/cfg/lexer.rb +558 -0
- data/lib/build-tool/cfg/lexer.rex +248 -0
- data/lib/build-tool/cfg/lexer_base.rb +82 -0
- data/lib/build-tool/cfg/node.rb +94 -0
- data/lib/build-tool/cfg/parser.rb +871 -0
- data/lib/build-tool/cfg/parser.y +279 -0
- data/lib/build-tool/cfg/visitor.rb +471 -0
- data/lib/build-tool/commands.rb +639 -0
- data/lib/build-tool/commands/build.rb +120 -0
- data/lib/build-tool/commands/configure.rb +73 -0
- data/lib/build-tool/commands/ctags.rb +46 -0
- data/lib/build-tool/commands/environments.rb +29 -0
- data/lib/build-tool/commands/environments/list.rb +37 -0
- data/lib/build-tool/commands/environments/set.rb +33 -0
- data/lib/build-tool/commands/fetch.rb +50 -0
- data/lib/build-tool/commands/files.rb +73 -0
- data/lib/build-tool/commands/help.rb +22 -0
- data/lib/build-tool/commands/info.rb +48 -0
- data/lib/build-tool/commands/install.rb +56 -0
- data/lib/build-tool/commands/modules.rb +29 -0
- data/lib/build-tool/commands/modules/info.rb +75 -0
- data/lib/build-tool/commands/modules/list.rb +49 -0
- data/lib/build-tool/commands/modules/shell.rb +40 -0
- data/lib/build-tool/commands/rebase.rb +46 -0
- data/lib/build-tool/commands/recipes.rb +32 -0
- data/lib/build-tool/commands/recipes/info.rb +46 -0
- data/lib/build-tool/commands/recipes/install.rb +184 -0
- data/lib/build-tool/commands/recipes/list.rb +33 -0
- data/lib/build-tool/configuration.rb +115 -0
- data/lib/build-tool/environment.rb +119 -0
- data/lib/build-tool/errors.rb +9 -0
- data/lib/build-tool/module.rb +366 -0
- data/lib/build-tool/pluginbase.rb +43 -0
- data/lib/build-tool/recipe.rb +180 -0
- data/lib/build-tool/repository.rb +59 -0
- data/lib/build-tool/server.rb +43 -0
- data/lib/build-tool/singleton.rb +50 -0
- data/lib/build-tool/sshkey.rb +22 -0
- data/lib/build-tool/vcs/base.rb +105 -0
- data/lib/build-tool/vcs/git-svn.rb +154 -0
- data/lib/build-tool/vcs/git.rb +187 -0
- data/lib/build-tool/vcs/svn.rb +136 -0
- data/lib/mj/logging.rb +31 -0
- data/lib/mj/tools/ssh.rb +64 -0
- data/lib/{kde-build → mj/tools}/subprocess.rb +21 -16
- data/lib/mj/visitor.rb +21 -0
- data/recipes/kde/files/finish_installation.sh +16 -0
- data/recipes/kde/files/kde4.desktop +22 -0
- data/recipes/kde/files/xsession +89 -0
- data/recipes/kde/info.yaml +10 -0
- data/recipes/kde/recipe +585 -0
- data/recipes/kde/recipe-local +90 -0
- data/recipes/kde/settings.yaml +52 -0
- data/recipes/kde43/info.yaml +10 -0
- data/recipes/kde43/recipe +256 -0
- data/recipes/kde43/recipe-local +90 -0
- data/recipes/kde43/settings.yaml +32 -0
- data/recipes/kdeqt4.6/custom/qt/qtscriptgenerator/compile.sh +77 -0
- data/recipes/kdeqt4.6/custom/qt/qtscriptgenerator/configure.sh +70 -0
- data/recipes/kdeqt4.6/custom/qt/qtscriptgenerator/install.sh +39 -0
- data/recipes/kdeqt4.6/info.yaml +7 -0
- data/recipes/kdeqt4.6/recipe +155 -0
- data/recipes/kdeqt4.6/recipe-local +30 -0
- data/recipes/kdeqt4.6/settings.yaml +27 -0
- data/tags +745 -0
- data/tasks/genfiles.rake +28 -0
- data/tasks/rdoc.rake +34 -0
- data/tasks/rspec.rake +21 -0
- data/test.rb +28 -0
- data/test/commands/test_build.rb +29 -0
- data/test/test_build_system.rb +98 -0
- data/test/test_cli.rb +61 -0
- data/test/test_command.rb +175 -0
- data/test/test_configuration_parser.rb +542 -0
- data/test/test_environment.rb +82 -0
- data/test/test_helper.rb +39 -7
- data/test/test_module.rb +158 -0
- data/test/test_repository.rb +75 -0
- data/test/test_singleton.rb +51 -0
- data/test/test_ssh_key.rb +14 -0
- data/test/test_svn_parser.rb +28 -0
- data/test/test_vcs.rb +33 -0
- metadata +139 -90
- metadata.gz.sig +0 -0
- data/PostInstall.txt +0 -3
- data/TODO +0 -2
- data/bin/kde-build.rb +0 -21
- data/config/website.yml +0 -2
- data/config/website.yml.sample +0 -2
- data/lib/kde-build.rb +0 -18
- data/lib/kde-build/application.rb +0 -270
- data/lib/kde-build/build_system.rb +0 -28
- data/lib/kde-build/build_system/autoconf.rb +0 -108
- data/lib/kde-build/build_system/base.rb +0 -139
- data/lib/kde-build/build_system/cmake.rb +0 -94
- data/lib/kde-build/build_system/qtcopy.rb +0 -127
- data/lib/kde-build/command.rb +0 -42
- data/lib/kde-build/command/build.rb +0 -106
- data/lib/kde-build/command/compile.rb +0 -39
- data/lib/kde-build/command/configure.rb +0 -48
- data/lib/kde-build/command/ctags.rb +0 -41
- data/lib/kde-build/command/fetch.rb +0 -33
- data/lib/kde-build/command/help.rb +0 -71
- data/lib/kde-build/command/info.rb +0 -45
- data/lib/kde-build/command/install.rb +0 -39
- data/lib/kde-build/command/module_based.rb +0 -44
- data/lib/kde-build/command/rebase.rb +0 -50
- data/lib/kde-build/command/version.rb +0 -43
- data/lib/kde-build/configuration.rb +0 -209
- data/lib/kde-build/exception.rb +0 -6
- data/lib/kde-build/metaaid.rb +0 -18
- data/lib/kde-build/module.rb +0 -227
- data/lib/kde-build/module_configuration.rb +0 -107
- data/lib/kde-build/moduleregistry.rb +0 -85
- data/lib/kde-build/tools/ctags.rb +0 -59
- data/lib/kde-build/tools/logging.rb +0 -49
- data/lib/kde-build/tools/make.rb +0 -58
- data/lib/kde-build/tools/ssh.rb +0 -47
- data/lib/kde-build/vcs.rb +0 -28
- data/lib/kde-build/vcs/base.rb +0 -85
- data/lib/kde-build/vcs/git-svn.rb +0 -139
- data/lib/kde-build/vcs/git.rb +0 -121
- data/lib/kde-build/vcs/svn.rb +0 -102
- data/script/console +0 -10
- data/script/destroy +0 -14
- data/script/generate +0 -14
- data/script/txt2html +0 -71
- data/test.yaml.tmpl +0 -632
- data/test/test_kde-build.rb +0 -11
- data/test/test_vcs_svn.rb +0 -44
- data/website/index.html +0 -84
- data/website/index.txt +0 -59
- data/website/javascripts/rounded_corners_lite.inc.js +0 -285
- data/website/stylesheets/screen.css +0 -159
- data/website/template.html.erb +0 -50
@@ -0,0 +1,113 @@
|
|
1
|
+
module BuildTool; module BuildSystem
|
2
|
+
|
3
|
+
|
4
|
+
#
|
5
|
+
#
|
6
|
+
#
|
7
|
+
class Qt < Base
|
8
|
+
|
9
|
+
include MJ::Tools::SubProcess
|
10
|
+
|
11
|
+
class MakeError < BuildTool::Error; end
|
12
|
+
class QMakeError < BuildTool::Error; end
|
13
|
+
|
14
|
+
def intitialize( *args )
|
15
|
+
super( *args )
|
16
|
+
end
|
17
|
+
|
18
|
+
#
|
19
|
+
### ATTRIBUTES
|
20
|
+
#
|
21
|
+
|
22
|
+
# Check if the module is configured
|
23
|
+
def configured?
|
24
|
+
Pathname.new( build_directory ).join( 'Makefile' ).exist?
|
25
|
+
end
|
26
|
+
|
27
|
+
def name
|
28
|
+
"qt"
|
29
|
+
end
|
30
|
+
|
31
|
+
#
|
32
|
+
### METHODS
|
33
|
+
#
|
34
|
+
|
35
|
+
def[]( var )
|
36
|
+
if @options.has_key? var
|
37
|
+
return @options[var]
|
38
|
+
end
|
39
|
+
|
40
|
+
case var
|
41
|
+
|
42
|
+
when 'flags'
|
43
|
+
return @options[var]
|
44
|
+
|
45
|
+
else
|
46
|
+
# *TODO* raise correct exception
|
47
|
+
raise NotImplementedError
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def[]=( var, val )
|
52
|
+
case var
|
53
|
+
|
54
|
+
when 'flags'
|
55
|
+
@options[var] = val
|
56
|
+
|
57
|
+
else
|
58
|
+
# *TODO* raise correct exception
|
59
|
+
raise NotImplementedError
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
|
64
|
+
# Execute a cmake command in the context of the build directory
|
65
|
+
def _configure( command, wd = build_directory )
|
66
|
+
rc = self.class.execute "#{source_directory}/configure #{command}", wd, env
|
67
|
+
if rc != 0
|
68
|
+
raise QMakeError, "configure failed with error #{rc}!"
|
69
|
+
end
|
70
|
+
rc
|
71
|
+
end
|
72
|
+
|
73
|
+
def configure
|
74
|
+
check_build_directory( true )
|
75
|
+
opt = ""
|
76
|
+
opt += " -prefix #{install_prefix.to_s} " if install_prefix
|
77
|
+
opt += @options['flags']
|
78
|
+
rc = _configure opt
|
79
|
+
rc
|
80
|
+
end
|
81
|
+
|
82
|
+
def do_make( target = nil )
|
83
|
+
rc = self.class.execute( "make #{target ? target : "" }", build_directory, self.module.environment.values )
|
84
|
+
if rc != 0
|
85
|
+
raise MakeError, "make #{target || "" } failed with error code #{rc}";
|
86
|
+
end
|
87
|
+
rc
|
88
|
+
end
|
89
|
+
|
90
|
+
def install( fast )
|
91
|
+
make( "install" )
|
92
|
+
end
|
93
|
+
|
94
|
+
def install_fast_supported?
|
95
|
+
true
|
96
|
+
end
|
97
|
+
|
98
|
+
def make( target = nil )
|
99
|
+
do_make( target )
|
100
|
+
end
|
101
|
+
|
102
|
+
# Configure the module
|
103
|
+
def reconfigure()
|
104
|
+
if File.exist?( "#{build_directory}/.qmake.cache" )
|
105
|
+
return false if self.class.execute( "rm -f #{build_directory}/.qmake.cache" ) != 0
|
106
|
+
end
|
107
|
+
configure
|
108
|
+
end
|
109
|
+
|
110
|
+
end # class Autoconf
|
111
|
+
|
112
|
+
end; end # module BuildTool::BuildSystem
|
113
|
+
|
@@ -0,0 +1,558 @@
|
|
1
|
+
#--
|
2
|
+
# DO NOT MODIFY!!!!
|
3
|
+
# This file is automatically generated by rex 1.0.4
|
4
|
+
# from lexical definition file "lib/build-tool/cfg/lexer.rex".
|
5
|
+
#++
|
6
|
+
|
7
|
+
require 'racc/parser'
|
8
|
+
# vim:ft=ruby
|
9
|
+
|
10
|
+
#
|
11
|
+
### HEADER
|
12
|
+
#
|
13
|
+
require 'build-tool/cfg/lexer_base.rb'
|
14
|
+
|
15
|
+
module BuildTool::Cfg
|
16
|
+
class Lexer < Racc::Parser
|
17
|
+
require 'strscan'
|
18
|
+
|
19
|
+
class ScanError < StandardError ; end
|
20
|
+
|
21
|
+
attr_reader :lineno
|
22
|
+
attr_reader :filename
|
23
|
+
attr_accessor :state
|
24
|
+
|
25
|
+
def scan_setup(str)
|
26
|
+
@ss = StringScanner.new(str)
|
27
|
+
@lineno = 1
|
28
|
+
@state = nil
|
29
|
+
end
|
30
|
+
|
31
|
+
def action(&block)
|
32
|
+
yield
|
33
|
+
end
|
34
|
+
|
35
|
+
def scan_str(str)
|
36
|
+
scan_setup(str)
|
37
|
+
do_parse
|
38
|
+
end
|
39
|
+
|
40
|
+
def load_file( filename )
|
41
|
+
@filename = filename
|
42
|
+
open(filename, "r") do |f|
|
43
|
+
scan_setup(f.read)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def scan_file( filename )
|
48
|
+
load_file(filename)
|
49
|
+
do_parse
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
def next_token
|
54
|
+
return if @ss.eos?
|
55
|
+
|
56
|
+
text = @ss.peek(1)
|
57
|
+
@lineno += 1 if text == "\n"
|
58
|
+
token = case @state
|
59
|
+
when nil
|
60
|
+
case
|
61
|
+
when (text = @ss.scan(/log-directory\b/))
|
62
|
+
action { [ :LOG_DIRECTORY, text ]; }
|
63
|
+
|
64
|
+
when (text = @ss.scan(/vcs\b/))
|
65
|
+
action { @states.push @state; @state = :VCS; [:VCS, text]; }
|
66
|
+
|
67
|
+
when (text = @ss.scan(/build-system\b/))
|
68
|
+
action { @states.push @state; @state = :BUILD_SYSTEM; [:BUILD_SYSTEM, text]; }
|
69
|
+
|
70
|
+
when (text = @ss.scan(/server\b/))
|
71
|
+
action { @states.push @state; @state = :SERVER; [:SERVER, text]; }
|
72
|
+
|
73
|
+
when (text = @ss.scan(/environment\b/))
|
74
|
+
action { @states.push @state; @state = :ENVIRONMENT; [:ENVIRONMENT, text]; }
|
75
|
+
|
76
|
+
when (text = @ss.scan(/module\b/))
|
77
|
+
action { @states.push @state; @state = :MODULE; [:MODULE, text]; }
|
78
|
+
|
79
|
+
when (text = @ss.scan(/repository\b/))
|
80
|
+
action { @states.push @state; @state = :REPOSITORY; [:REPOSITORY, text]; }
|
81
|
+
|
82
|
+
when (text = @ss.scan(/ssh-key\b/))
|
83
|
+
action { @states.push @state; @state = :SSH_KEY; [:SSH_KEY, text]; }
|
84
|
+
|
85
|
+
when (text = @ss.scan(/"([^\"\r\n]*)"/))
|
86
|
+
action { [:STRING, @ss[1]]; }
|
87
|
+
|
88
|
+
when (text = @ss.scan(/[a-zA-Z][A-Za-z_0-9-]*/))
|
89
|
+
action { [:TOKEN, text]; }
|
90
|
+
|
91
|
+
when (text = @ss.scan(/\#[^\r\n]*/))
|
92
|
+
action { [:COMMENT, text]; }
|
93
|
+
|
94
|
+
when (text = @ss.scan(/[ \t]+/))
|
95
|
+
action { [:IGNORE, text]; }
|
96
|
+
|
97
|
+
when (text = @ss.scan(/[\r\n]/))
|
98
|
+
action { [:IGNORE, text]; }
|
99
|
+
|
100
|
+
when (text = @ss.scan(/"([^\"\r\n]*)$/))
|
101
|
+
action { [:GARBAGE, text]; }
|
102
|
+
|
103
|
+
when (text = @ss.scan(/./))
|
104
|
+
action { [:GARBAGE, text]; }
|
105
|
+
|
106
|
+
else
|
107
|
+
text = @ss.string[@ss.pos .. -1]
|
108
|
+
raise ScanError, "can not match: '" + text + "'"
|
109
|
+
end # if
|
110
|
+
|
111
|
+
when :BUILD_SYSTEM
|
112
|
+
case
|
113
|
+
when (text = @ss.scan(/option/))
|
114
|
+
action { [:OPTION, text]; }
|
115
|
+
|
116
|
+
when (text = @ss.scan(/inplace/))
|
117
|
+
action { [:INPLACE, text]; }
|
118
|
+
|
119
|
+
when (text = @ss.scan(/end\b/))
|
120
|
+
action { @state = @states.pop; [ :END, text ]; }
|
121
|
+
|
122
|
+
when (text = @ss.scan(/"([^\"\r\n]*)"/))
|
123
|
+
action { [:STRING, @ss[1]]; }
|
124
|
+
|
125
|
+
when (text = @ss.scan(/[a-zA-Z][A-Za-z_0-9-]*/))
|
126
|
+
action { [:TOKEN, text]; }
|
127
|
+
|
128
|
+
when (text = @ss.scan(/\#[^\r\n]*/))
|
129
|
+
action { [:COMMENT, text]; }
|
130
|
+
|
131
|
+
when (text = @ss.scan(/[ \t]+/))
|
132
|
+
action { [:IGNORE, text]; }
|
133
|
+
|
134
|
+
when (text = @ss.scan(/[\r\n]/))
|
135
|
+
action { [:IGNORE, text]; }
|
136
|
+
|
137
|
+
when (text = @ss.scan(/"([^\"\r\n]*)$/))
|
138
|
+
action { [:GARBAGE, text]; }
|
139
|
+
|
140
|
+
when (text = @ss.scan(/./))
|
141
|
+
action { [:GARBAGE, text]; }
|
142
|
+
|
143
|
+
else
|
144
|
+
text = @ss.string[@ss.pos .. -1]
|
145
|
+
raise ScanError, "can not match: '" + text + "'"
|
146
|
+
end # if
|
147
|
+
|
148
|
+
when :ENVIRONMENT
|
149
|
+
case
|
150
|
+
when (text = @ss.scan(/var\b/))
|
151
|
+
action { [:VAR, text] }
|
152
|
+
|
153
|
+
when (text = @ss.scan(/prepend\b/))
|
154
|
+
action { [:PREPEND, text] }
|
155
|
+
|
156
|
+
when (text = @ss.scan(/append\b/))
|
157
|
+
action { [:APPEND, text] }
|
158
|
+
|
159
|
+
when (text = @ss.scan(/set\b/))
|
160
|
+
action { [:SET, text] }
|
161
|
+
|
162
|
+
when (text = @ss.scan(/</))
|
163
|
+
action { [:INHERITANCE, text] }
|
164
|
+
|
165
|
+
when (text = @ss.scan(/end\b/))
|
166
|
+
action { @state = @states.pop; [:END, text] }
|
167
|
+
|
168
|
+
when (text = @ss.scan(/"([^\"\r\n]*)"/))
|
169
|
+
action { [:STRING, @ss[1]]; }
|
170
|
+
|
171
|
+
when (text = @ss.scan(/[a-zA-Z][A-Za-z_0-9-]*/))
|
172
|
+
action { [:TOKEN, text]; }
|
173
|
+
|
174
|
+
when (text = @ss.scan(/\#[^\r\n]*/))
|
175
|
+
action { [:COMMENT, text]; }
|
176
|
+
|
177
|
+
when (text = @ss.scan(/[ \t]+/))
|
178
|
+
action { [:IGNORE, text]; }
|
179
|
+
|
180
|
+
when (text = @ss.scan(/[\r\n]/))
|
181
|
+
action { [:IGNORE, text]; }
|
182
|
+
|
183
|
+
when (text = @ss.scan(/"([^\"\r\n]*)$/))
|
184
|
+
action { [:GARBAGE, text]; }
|
185
|
+
|
186
|
+
when (text = @ss.scan(/./))
|
187
|
+
action { [:GARBAGE, text]; }
|
188
|
+
|
189
|
+
else
|
190
|
+
text = @ss.string[@ss.pos .. -1]
|
191
|
+
raise ScanError, "can not match: '" + text + "'"
|
192
|
+
end # if
|
193
|
+
|
194
|
+
when :GIT
|
195
|
+
case
|
196
|
+
when (text = @ss.scan(/external\b/))
|
197
|
+
action { [:EXTERNAL, text]; }
|
198
|
+
|
199
|
+
when (text = @ss.scan(/track-branch\b/))
|
200
|
+
action { [:TRACK_BRANCH, text]; }
|
201
|
+
|
202
|
+
when (text = @ss.scan(/remote\b/))
|
203
|
+
action { @states.push @state; @state = :REMOTE; [:REMOTE, text]; }
|
204
|
+
|
205
|
+
when (text = @ss.scan(/end\b/))
|
206
|
+
action { @state = @states.pop; [ :END, text ]; }
|
207
|
+
|
208
|
+
when (text = @ss.scan(/"([^\"\r\n]*)"/))
|
209
|
+
action { [:STRING, @ss[1]]; }
|
210
|
+
|
211
|
+
when (text = @ss.scan(/[a-zA-Z][A-Za-z_0-9-]*/))
|
212
|
+
action { [:TOKEN, text]; }
|
213
|
+
|
214
|
+
when (text = @ss.scan(/\#[^\r\n]*/))
|
215
|
+
action { [:COMMENT, text]; }
|
216
|
+
|
217
|
+
when (text = @ss.scan(/[ \t]+/))
|
218
|
+
action { [:IGNORE, text]; }
|
219
|
+
|
220
|
+
when (text = @ss.scan(/[\r\n]/))
|
221
|
+
action { [:IGNORE, text]; }
|
222
|
+
|
223
|
+
when (text = @ss.scan(/"([^\"\r\n]*)$/))
|
224
|
+
action { [:GARBAGE, text]; }
|
225
|
+
|
226
|
+
when (text = @ss.scan(/./))
|
227
|
+
action { [:GARBAGE, text]; }
|
228
|
+
|
229
|
+
else
|
230
|
+
text = @ss.string[@ss.pos .. -1]
|
231
|
+
raise ScanError, "can not match: '" + text + "'"
|
232
|
+
end # if
|
233
|
+
|
234
|
+
when :MODULE
|
235
|
+
case
|
236
|
+
when (text = @ss.scan(/build-prefix\b/))
|
237
|
+
action { [:BUILD_PREFIX, text]; }
|
238
|
+
|
239
|
+
when (text = @ss.scan(/</))
|
240
|
+
action { [:INHERITANCE, text]; }
|
241
|
+
|
242
|
+
when (text = @ss.scan(/install-prefix\b/))
|
243
|
+
action { [:INSTALL_PREFIX, text]; }
|
244
|
+
|
245
|
+
when (text = @ss.scan(/local-path\b/))
|
246
|
+
action { [:LOCAL_PATH, text]; }
|
247
|
+
|
248
|
+
when (text = @ss.scan(/remote-path\b/))
|
249
|
+
action { [:REMOTE_PATH, text]; }
|
250
|
+
|
251
|
+
when (text = @ss.scan(/TEMPLATE\b/))
|
252
|
+
action { [:TEMPLATE, text]; }
|
253
|
+
|
254
|
+
when (text = @ss.scan(/build-system\b/))
|
255
|
+
action { @states.push @state; @state = :BUILD_SYSTEM; [:BUILD_SYSTEM, text]; }
|
256
|
+
|
257
|
+
when (text = @ss.scan(/environment\b/))
|
258
|
+
action { @states.push @state; @state = :ENVIRONMENT; [:ENVIRONMENT, text]; }
|
259
|
+
|
260
|
+
when (text = @ss.scan(/repository\b/))
|
261
|
+
action { @states.push @state; @state = :REPOSITORY; [:REPOSITORY, text]; }
|
262
|
+
|
263
|
+
when (text = @ss.scan(/use\b/))
|
264
|
+
action { @states.push @state; @state = :USE; [:USE, text]; }
|
265
|
+
|
266
|
+
when (text = @ss.scan(/vcs\b/))
|
267
|
+
action { @states.push @state; @state = :VCS; [:VCS, text]; }
|
268
|
+
|
269
|
+
when (text = @ss.scan(/end\b/))
|
270
|
+
action { @state = @states.pop; [:END, text]; }
|
271
|
+
|
272
|
+
when (text = @ss.scan(/"([^\"\r\n]*)"/))
|
273
|
+
action { [:STRING, @ss[1]]; }
|
274
|
+
|
275
|
+
when (text = @ss.scan(/[a-zA-Z][A-Za-z_0-9-]*/))
|
276
|
+
action { [:TOKEN, text]; }
|
277
|
+
|
278
|
+
when (text = @ss.scan(/\#[^\r\n]*/))
|
279
|
+
action { [:COMMENT, text]; }
|
280
|
+
|
281
|
+
when (text = @ss.scan(/[ \t]+/))
|
282
|
+
action { [:IGNORE, text]; }
|
283
|
+
|
284
|
+
when (text = @ss.scan(/[\r\n]/))
|
285
|
+
action { [:IGNORE, text]; }
|
286
|
+
|
287
|
+
when (text = @ss.scan(/"([^\"\r\n]*)$/))
|
288
|
+
action { [:GARBAGE, text]; }
|
289
|
+
|
290
|
+
when (text = @ss.scan(/./))
|
291
|
+
action { [:GARBAGE, text]; }
|
292
|
+
|
293
|
+
else
|
294
|
+
text = @ss.string[@ss.pos .. -1]
|
295
|
+
raise ScanError, "can not match: '" + text + "'"
|
296
|
+
end # if
|
297
|
+
|
298
|
+
when :REMOTE
|
299
|
+
case
|
300
|
+
when (text = @ss.scan(/path\b/))
|
301
|
+
action { [:PATH, text]; }
|
302
|
+
|
303
|
+
when (text = @ss.scan(/server\b/))
|
304
|
+
action { @states.push @state; @state = :SERVER; [:SERVER, text]; }
|
305
|
+
|
306
|
+
when (text = @ss.scan(/use\b/))
|
307
|
+
action { @states.push @state; @state = :USE; [:USE, text]; }
|
308
|
+
|
309
|
+
when (text = @ss.scan(/end\b/))
|
310
|
+
action { @state = @states.pop; [ :END, text ]; }
|
311
|
+
|
312
|
+
when (text = @ss.scan(/"([^\"\r\n]*)"/))
|
313
|
+
action { [:STRING, @ss[1]]; }
|
314
|
+
|
315
|
+
when (text = @ss.scan(/[a-zA-Z][A-Za-z_0-9-]*/))
|
316
|
+
action { [:TOKEN, text]; }
|
317
|
+
|
318
|
+
when (text = @ss.scan(/\#[^\r\n]*/))
|
319
|
+
action { [:COMMENT, text]; }
|
320
|
+
|
321
|
+
when (text = @ss.scan(/[ \t]+/))
|
322
|
+
action { [:IGNORE, text]; }
|
323
|
+
|
324
|
+
when (text = @ss.scan(/[\r\n]/))
|
325
|
+
action { [:IGNORE, text]; }
|
326
|
+
|
327
|
+
when (text = @ss.scan(/"([^\"\r\n]*)$/))
|
328
|
+
action { [:GARBAGE, text]; }
|
329
|
+
|
330
|
+
when (text = @ss.scan(/./))
|
331
|
+
action { [:GARBAGE, text]; }
|
332
|
+
|
333
|
+
else
|
334
|
+
text = @ss.string[@ss.pos .. -1]
|
335
|
+
raise ScanError, "can not match: '" + text + "'"
|
336
|
+
end # if
|
337
|
+
|
338
|
+
when :REPOSITORY
|
339
|
+
case
|
340
|
+
when (text = @ss.scan(/server\b/))
|
341
|
+
action { [:SERVER, text]; }
|
342
|
+
|
343
|
+
when (text = @ss.scan(/path\b/))
|
344
|
+
action { [:PATH, text]; }
|
345
|
+
|
346
|
+
when (text = @ss.scan(/user\b/))
|
347
|
+
action { [:USER, text]; }
|
348
|
+
|
349
|
+
when (text = @ss.scan(/ssh-key/))
|
350
|
+
action { @states.push @state; @state = :SSH_KEY; [:SSH_KEY, text]; }
|
351
|
+
|
352
|
+
when (text = @ss.scan(/use\b/))
|
353
|
+
action { @states.push @state; @state = :USE; [:USE, text]; }
|
354
|
+
|
355
|
+
when (text = @ss.scan(/end/))
|
356
|
+
action { @state = @states.pop; [:END, text]; }
|
357
|
+
|
358
|
+
when (text = @ss.scan(/"([^\"\r\n]*)"/))
|
359
|
+
action { [:STRING, @ss[1]]; }
|
360
|
+
|
361
|
+
when (text = @ss.scan(/[a-zA-Z][A-Za-z_0-9-]*/))
|
362
|
+
action { [:TOKEN, text]; }
|
363
|
+
|
364
|
+
when (text = @ss.scan(/\#[^\r\n]*/))
|
365
|
+
action { [:COMMENT, text]; }
|
366
|
+
|
367
|
+
when (text = @ss.scan(/[ \t]+/))
|
368
|
+
action { [:IGNORE, text]; }
|
369
|
+
|
370
|
+
when (text = @ss.scan(/[\r\n]/))
|
371
|
+
action { [:IGNORE, text]; }
|
372
|
+
|
373
|
+
when (text = @ss.scan(/"([^\"\r\n]*)$/))
|
374
|
+
action { [:GARBAGE, text]; }
|
375
|
+
|
376
|
+
when (text = @ss.scan(/./))
|
377
|
+
action { [:GARBAGE, text]; }
|
378
|
+
|
379
|
+
else
|
380
|
+
text = @ss.string[@ss.pos .. -1]
|
381
|
+
raise ScanError, "can not match: '" + text + "'"
|
382
|
+
end # if
|
383
|
+
|
384
|
+
when :SERVER
|
385
|
+
case
|
386
|
+
when (text = @ss.scan(/protocol\b/))
|
387
|
+
action { [:PROTOCOL, text]; }
|
388
|
+
|
389
|
+
when (text = @ss.scan(/server\b/))
|
390
|
+
action { [:SERVER, text]; }
|
391
|
+
|
392
|
+
when (text = @ss.scan(/path\b/))
|
393
|
+
action { [:PATH, text]; }
|
394
|
+
|
395
|
+
when (text = @ss.scan(/host\b/))
|
396
|
+
action { [:HOST, text]; }
|
397
|
+
|
398
|
+
when (text = @ss.scan(/end\b/))
|
399
|
+
action { @state = @states.pop; [:END, text]; }
|
400
|
+
|
401
|
+
when (text = @ss.scan(/"([^\"\r\n]*)"/))
|
402
|
+
action { [:STRING, @ss[1]]; }
|
403
|
+
|
404
|
+
when (text = @ss.scan(/[a-zA-Z][A-Za-z_0-9-]*/))
|
405
|
+
action { [:TOKEN, text]; }
|
406
|
+
|
407
|
+
when (text = @ss.scan(/\#[^\r\n]*/))
|
408
|
+
action { [:COMMENT, text]; }
|
409
|
+
|
410
|
+
when (text = @ss.scan(/[ \t]+/))
|
411
|
+
action { [:IGNORE, text]; }
|
412
|
+
|
413
|
+
when (text = @ss.scan(/[\r\n]/))
|
414
|
+
action { [:IGNORE, text]; }
|
415
|
+
|
416
|
+
when (text = @ss.scan(/"([^\"\r\n]*)$/))
|
417
|
+
action { [:GARBAGE, text]; }
|
418
|
+
|
419
|
+
when (text = @ss.scan(/./))
|
420
|
+
action { [:GARBAGE, text]; }
|
421
|
+
|
422
|
+
else
|
423
|
+
text = @ss.string[@ss.pos .. -1]
|
424
|
+
raise ScanError, "can not match: '" + text + "'"
|
425
|
+
end # if
|
426
|
+
|
427
|
+
when :SSH_KEY
|
428
|
+
case
|
429
|
+
when (text = @ss.scan(/file\b/))
|
430
|
+
action { [:FILE, text]; }
|
431
|
+
|
432
|
+
when (text = @ss.scan(/end\b/))
|
433
|
+
action { @state = @states.pop; [:END, text]; }
|
434
|
+
|
435
|
+
when (text = @ss.scan(/"([^\"\r\n]*)"/))
|
436
|
+
action { [:STRING, @ss[1]]; }
|
437
|
+
|
438
|
+
when (text = @ss.scan(/[a-zA-Z][A-Za-z_0-9-]*/))
|
439
|
+
action { [:TOKEN, text]; }
|
440
|
+
|
441
|
+
when (text = @ss.scan(/\#[^\r\n]*/))
|
442
|
+
action { [:COMMENT, text]; }
|
443
|
+
|
444
|
+
when (text = @ss.scan(/[ \t]+/))
|
445
|
+
action { [:IGNORE, text]; }
|
446
|
+
|
447
|
+
when (text = @ss.scan(/[\r\n]/))
|
448
|
+
action { [:IGNORE, text]; }
|
449
|
+
|
450
|
+
when (text = @ss.scan(/"([^\"\r\n]*)$/))
|
451
|
+
action { [:GARBAGE, text]; }
|
452
|
+
|
453
|
+
when (text = @ss.scan(/./))
|
454
|
+
action { [:GARBAGE, text]; }
|
455
|
+
|
456
|
+
else
|
457
|
+
text = @ss.string[@ss.pos .. -1]
|
458
|
+
raise ScanError, "can not match: '" + text + "'"
|
459
|
+
end # if
|
460
|
+
|
461
|
+
when :USE
|
462
|
+
case
|
463
|
+
when (text = @ss.scan(/build-system\b/))
|
464
|
+
action { @state = @states.pop; [:BUILD_SYSTEM, text]; }
|
465
|
+
|
466
|
+
when (text = @ss.scan(/environment\b/))
|
467
|
+
action { @state = @states.pop; [:ENVIRONMENT, text]; }
|
468
|
+
|
469
|
+
when (text = @ss.scan(/repository\b/))
|
470
|
+
action { @state = @states.pop; [:REPOSITORY, text]; }
|
471
|
+
|
472
|
+
when (text = @ss.scan(/server\b/))
|
473
|
+
action { @state = @states.pop; [:SERVER, text]; }
|
474
|
+
|
475
|
+
when (text = @ss.scan(/ssh-key\b/))
|
476
|
+
action { @state = @states.pop; [:SSH_KEY, text]; }
|
477
|
+
|
478
|
+
when (text = @ss.scan(/vcs\b/))
|
479
|
+
action { @state = @states.pop; [:VCS, text]; }
|
480
|
+
|
481
|
+
when (text = @ss.scan(/"([^\"\r\n]*)"/))
|
482
|
+
action { [:STRING, @ss[1]]; }
|
483
|
+
|
484
|
+
when (text = @ss.scan(/[a-zA-Z][A-Za-z_0-9-]*/))
|
485
|
+
action { [:TOKEN, text]; }
|
486
|
+
|
487
|
+
when (text = @ss.scan(/\#[^\r\n]*/))
|
488
|
+
action { [:COMMENT, text]; }
|
489
|
+
|
490
|
+
when (text = @ss.scan(/[ \t]+/))
|
491
|
+
action { [:IGNORE, text]; }
|
492
|
+
|
493
|
+
when (text = @ss.scan(/[\r\n]/))
|
494
|
+
action { [:IGNORE, text]; }
|
495
|
+
|
496
|
+
when (text = @ss.scan(/"([^\"\r\n]*)$/))
|
497
|
+
action { [:GARBAGE, text]; }
|
498
|
+
|
499
|
+
when (text = @ss.scan(/./))
|
500
|
+
action { [:GARBAGE, text]; }
|
501
|
+
|
502
|
+
else
|
503
|
+
text = @ss.string[@ss.pos .. -1]
|
504
|
+
raise ScanError, "can not match: '" + text + "'"
|
505
|
+
end # if
|
506
|
+
|
507
|
+
when :VCS
|
508
|
+
case
|
509
|
+
when (text = @ss.scan(/git-svn\b/))
|
510
|
+
action { @state = :GIT; [:GIT_SVN, text]; }
|
511
|
+
|
512
|
+
when (text = @ss.scan(/git\b/))
|
513
|
+
action { @state = :GIT; [:GIT, text]; }
|
514
|
+
|
515
|
+
when (text = @ss.scan(/"([^\"\r\n]*)"/))
|
516
|
+
action { [:STRING, @ss[1]]; }
|
517
|
+
|
518
|
+
when (text = @ss.scan(/[a-zA-Z][A-Za-z_0-9-]*/))
|
519
|
+
action { [:TOKEN, text]; }
|
520
|
+
|
521
|
+
when (text = @ss.scan(/\#[^\r\n]*/))
|
522
|
+
action { [:COMMENT, text]; }
|
523
|
+
|
524
|
+
when (text = @ss.scan(/[ \t]+/))
|
525
|
+
action { [:IGNORE, text]; }
|
526
|
+
|
527
|
+
when (text = @ss.scan(/[\r\n]/))
|
528
|
+
action { [:IGNORE, text]; }
|
529
|
+
|
530
|
+
when (text = @ss.scan(/"([^\"\r\n]*)$/))
|
531
|
+
action { [:GARBAGE, text]; }
|
532
|
+
|
533
|
+
when (text = @ss.scan(/./))
|
534
|
+
action { [:GARBAGE, text]; }
|
535
|
+
|
536
|
+
else
|
537
|
+
text = @ss.string[@ss.pos .. -1]
|
538
|
+
raise ScanError, "can not match: '" + text + "'"
|
539
|
+
end # if
|
540
|
+
|
541
|
+
else
|
542
|
+
raise ScanError, "undefined state: '" + state.to_s + "'"
|
543
|
+
end # case state
|
544
|
+
token
|
545
|
+
end # def next_token
|
546
|
+
|
547
|
+
include LexerBase
|
548
|
+
def do_parse
|
549
|
+
@states = []
|
550
|
+
super
|
551
|
+
end
|
552
|
+
end # class
|
553
|
+
end # module
|
554
|
+
|
555
|
+
#
|
556
|
+
### FOOTER
|
557
|
+
#
|
558
|
+
|