build-tool 0.5.7 → 0.6.0.rc1
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.
- data/.gitignore +1 -0
- data/.rvmrc +1 -0
- data/.yardopts +1 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +56 -0
- data/History.txt +64 -0
- data/README.txt +0 -7
- data/Rakefile +8 -56
- data/bin/build-tool +4 -1
- data/build-tool.gemspec +62 -0
- data/db/migrations/20110703074000_add_command_logs.rb +17 -0
- data/db/migrations/20110703075000_add_module_logs.rb +20 -0
- data/db/migrations/20110815170000_add_features.rb +17 -0
- data/db/migrations/20120103204700_add_modules.rb +17 -0
- data/db/migrations/20120106181200_add_settings.rb +18 -0
- data/lib/build-tool.rb +3 -4
- data/lib/build-tool/application.rb +127 -37
- data/lib/build-tool/build-system/autoconf.rb +2 -8
- data/lib/build-tool/build-system/base.rb +12 -4
- data/lib/build-tool/build-system/cmake.rb +2 -0
- data/lib/build-tool/build-system/custom.rb +2 -0
- data/lib/build-tool/build-system/kdel10n.rb +2 -0
- data/lib/build-tool/build-system/make.rb +2 -0
- data/lib/build-tool/build-system/none.rb +2 -0
- data/lib/build-tool/build-system/qmake.rb +2 -0
- data/lib/build-tool/build-system/qt.rb +4 -0
- data/lib/build-tool/cfg/lexer.rex +40 -8
- data/lib/build-tool/cfg/lexer_base.rb +3 -1
- data/lib/build-tool/cfg/node.rb +17 -1
- data/lib/build-tool/cfg/parser.y +92 -10
- data/lib/build-tool/cfg/visitor.rb +202 -78
- data/lib/build-tool/command_actions.rb +26 -10
- data/lib/build-tool/commands.rb +289 -197
- data/lib/build-tool/commands/build.rb +13 -9
- data/lib/build-tool/commands/configuration.rb +25 -0
- data/lib/build-tool/commands/configuration/edit.rb +42 -0
- data/lib/build-tool/commands/configuration/list.rb +48 -0
- data/lib/build-tool/commands/configure.rb +9 -5
- data/lib/build-tool/commands/ctags.rb +8 -3
- data/lib/build-tool/commands/environments.rb +2 -4
- data/lib/build-tool/commands/environments/list.rb +13 -10
- data/lib/build-tool/commands/environments/set.rb +5 -1
- data/lib/build-tool/commands/features.rb +24 -0
- data/lib/build-tool/commands/features/disable.rb +70 -0
- data/lib/build-tool/commands/features/enable.rb +66 -0
- data/lib/build-tool/commands/features/list.rb +92 -0
- data/lib/build-tool/commands/fetch.rb +9 -3
- data/lib/build-tool/commands/files.rb +9 -5
- data/lib/build-tool/commands/gc.rb +48 -15
- data/lib/build-tool/commands/history.rb +21 -16
- data/lib/build-tool/commands/info.rb +16 -13
- data/lib/build-tool/commands/install.rb +8 -4
- data/lib/build-tool/commands/modules.rb +2 -4
- data/lib/build-tool/commands/modules/cleanup.rb +52 -0
- data/lib/build-tool/commands/modules/disable.rb +95 -0
- data/lib/build-tool/commands/modules/enable.rb +52 -0
- data/lib/build-tool/commands/modules/info.rb +44 -35
- data/lib/build-tool/commands/modules/list.rb +67 -15
- data/lib/build-tool/commands/modules/shell.rb +8 -2
- data/lib/build-tool/commands/rebase.rb +15 -7
- data/lib/build-tool/commands/recipes.rb +2 -4
- data/lib/build-tool/commands/recipes/add.rb +16 -2
- data/lib/build-tool/commands/recipes/edit.rb +72 -0
- data/lib/build-tool/commands/recipes/incoming.rb +11 -7
- data/lib/build-tool/commands/recipes/info.rb +12 -8
- data/lib/build-tool/commands/recipes/install.rb +37 -42
- data/lib/build-tool/commands/recipes/list.rb +6 -2
- data/lib/build-tool/configuration.rb +88 -3
- data/lib/build-tool/environment.rb +2 -0
- data/lib/build-tool/errors.rb +5 -0
- data/lib/build-tool/history.rb +3 -181
- data/lib/build-tool/model/command_log.rb +93 -0
- data/lib/build-tool/model/feature.rb +80 -0
- data/lib/build-tool/{module.rb → model/module.rb} +110 -29
- data/lib/build-tool/model/module_log.rb +64 -0
- data/lib/build-tool/model/setting.rb +84 -0
- data/lib/build-tool/recipe.rb +40 -18
- data/lib/build-tool/repository.rb +39 -33
- data/lib/build-tool/server.rb +27 -3
- data/lib/build-tool/singleton.rb +2 -0
- data/lib/build-tool/sshkey.rb +2 -0
- data/lib/build-tool/state_helper.rb +64 -0
- data/lib/build-tool/vcs/archive.rb +3 -1
- data/lib/build-tool/vcs/base.rb +13 -0
- data/lib/build-tool/vcs/git-svn.rb +36 -14
- data/lib/build-tool/vcs/git.rb +180 -44
- data/lib/build-tool/vcs/mercurial.rb +25 -13
- data/lib/build-tool/vcs/svn.rb +20 -15
- data/lib/build-tool/version.rb +30 -0
- data/lib/mj/error.rb +2 -0
- data/lib/mj/logging.rb +2 -0
- data/lib/mj/mixins/inherited_attributes.rb +73 -0
- data/lib/mj/tools/editor.rb +34 -0
- data/lib/mj/tools/ssh.rb +2 -0
- data/lib/mj/tools/subprocess.rb +2 -1
- data/lib/mj/vcs/git.rb +14 -2
- data/lib/mj/visitor.rb +22 -0
- data/tasks/db.rake +36 -0
- data/tasks/racc.rake +14 -0
- data/tasks/rdoc.rake +8 -0
- data/tasks/rexical.rake +14 -0
- data/tasks/test.rake +21 -0
- data/test/integration/history_test.rb +88 -0
- data/test/integration/parser_configuration.rb +36 -0
- data/test/integration/parser_environment_parser.rb +156 -0
- data/test/integration/parser_feature_test.rb +75 -0
- data/test/integration/parser_git-svn_test.rb +92 -0
- data/test/integration/parser_git_test.rb +97 -0
- data/test/integration/parser_mercurial_test.rb +77 -0
- data/test/integration/parser_module_test.rb +103 -0
- data/test/integration/parser_svn_test.rb +92 -0
- data/test/integration/parser_test.rb +73 -0
- data/test/test_helper.rb +61 -0
- data/test/unit/configuration_test.rb +36 -0
- data/test/unit/git_configuration_test.rb +163 -0
- data/test/unit/git_svn_configuration_test.rb +240 -0
- data/test/unit/mercurial_configuration_test.rb +64 -0
- data/test/unit/model/command_log_test.rb +103 -0
- data/test/unit/model/feature_test.rb +29 -0
- data/test/unit/model/module_log_test.rb +70 -0
- data/test/unit/model/module_test.rb +32 -0
- data/test/unit/repository_test.rb +110 -0
- data/test/unit/server_test.rb +66 -0
- data/test/unit/svn_configuration_test.rb +90 -0
- metadata +134 -93
- data/Manifest.txt +0 -80
- data/db/migrations/001_command_histories.rb +0 -20
- data/db/migrations/002_module_events.rb +0 -24
- data/db/migrations/003_command_histories_add_logfile.rb +0 -19
- data/lib/build-tool/GUI.rb +0 -360
- data/lib/build-tool/commands/help.rb +0 -22
- data/lib/build-tool/commands/lsfeatures.rb +0 -76
- data/lib/build-tool/feature.rb +0 -47
@@ -1,36 +1,21 @@
|
|
1
|
+
# -*- coding: UTF-8 -*-
|
2
|
+
|
3
|
+
require 'mj/visitor'
|
4
|
+
|
1
5
|
require 'build-tool/configuration'
|
2
6
|
require 'build-tool/environment'
|
3
|
-
require 'build-tool/feature'
|
7
|
+
require 'build-tool/model/feature'
|
4
8
|
require 'build-tool/repository'
|
5
|
-
require 'build-tool/module'
|
9
|
+
require 'build-tool/model/module'
|
6
10
|
require 'build-tool/sshkey'
|
7
11
|
require 'build-tool/server'
|
8
12
|
|
9
13
|
module BuildTool; module Cfg;
|
10
14
|
|
11
|
-
# Base class for all Visitors.
|
12
|
-
class VisitorBase
|
13
|
-
|
14
|
-
# The configuration object to fill with our parse results.
|
15
|
-
attr_reader :configuration
|
16
|
-
|
17
|
-
class ArgumentsError < StandardError
|
18
|
-
end
|
19
|
-
|
20
|
-
def initialize( configuration )
|
21
|
-
@configuration = configuration
|
22
|
-
end
|
23
|
-
|
24
|
-
def visit_Object( object )
|
25
|
-
raise "#{self.class}: Not a visitor for #{object.class}!"
|
26
|
-
end
|
27
|
-
|
28
|
-
end # class VisitorBase
|
29
|
-
|
30
15
|
|
31
16
|
# Base class for all Visitors which need to iterate over their child
|
32
17
|
# nodes.
|
33
|
-
class ListVisitor < VisitorBase
|
18
|
+
class ListVisitor < MJ::VisitorBase
|
34
19
|
|
35
20
|
# Visit one node.
|
36
21
|
def visit( node )
|
@@ -111,39 +96,19 @@ def visit_EnvironmentDeclarationNode( node )
|
|
111
96
|
end
|
112
97
|
|
113
98
|
def visit_EnableFeatureNode( node )
|
114
|
-
|
115
|
-
feat = configuration.feature( featureName )
|
116
|
-
if feat.nil?
|
117
|
-
raise ConfigurationError, "Attempt to enable unknown feature '%s'!" % featureName
|
118
|
-
end
|
119
|
-
feat.active = true
|
99
|
+
set_feature_status( node.value, true, node.options[:global] )
|
120
100
|
end
|
121
101
|
|
122
102
|
def visit_DisableFeatureNode( node )
|
123
|
-
|
124
|
-
feat = configuration.feature( featureName )
|
125
|
-
if feat.nil?
|
126
|
-
raise ConfigurationError, "Attempt to disable unknown feature '%s'!" % featureName
|
127
|
-
end
|
128
|
-
feat.active = false
|
103
|
+
set_feature_status( node.value, false, node.options[:global] )
|
129
104
|
end
|
130
105
|
|
131
106
|
def visit_EnableModuleNode( node )
|
132
|
-
|
133
|
-
mod = configuration.module( modName )
|
134
|
-
if mod.nil?
|
135
|
-
raise ConfigurationError, "Attempt to enable unknown module '%s'!" % modName
|
136
|
-
end
|
137
|
-
mod.active = true
|
107
|
+
set_module_status( node.value, true, node.options[:global] )
|
138
108
|
end
|
139
109
|
|
140
110
|
def visit_DisableModuleNode( node )
|
141
|
-
|
142
|
-
mod = configuration.module( modName )
|
143
|
-
if mod.nil?
|
144
|
-
raise ConfigurationError, "Attempt to disable unknown module '%s'!" % modName
|
145
|
-
end
|
146
|
-
mod.active = false
|
111
|
+
set_module_status( node.value, false, node.options[:global] )
|
147
112
|
end
|
148
113
|
|
149
114
|
def visit_FeatureNode( node )
|
@@ -151,6 +116,11 @@ def visit_FeatureNode( node )
|
|
151
116
|
node.accept( visitor )
|
152
117
|
end
|
153
118
|
|
119
|
+
def visit_GitOptionsDeclarationNode( node )
|
120
|
+
visitor = GitOptionsDeclarationNodeVisitor.new( configuration )
|
121
|
+
node.accept( visitor )
|
122
|
+
end
|
123
|
+
|
154
124
|
def visit_IncludeNode( node )
|
155
125
|
visitor = IncludeNodeVisitor.new( configuration )
|
156
126
|
node.accept( visitor )
|
@@ -176,6 +146,40 @@ def visit_SshKeyDeclarationNode( node )
|
|
176
146
|
node.accept(visitor)
|
177
147
|
end
|
178
148
|
|
149
|
+
protected
|
150
|
+
|
151
|
+
def set_feature_status( featureName, status, global )
|
152
|
+
feat = configuration.feature( featureName )
|
153
|
+
# Make sure the feature is known.
|
154
|
+
if feat.nil?
|
155
|
+
raise ConfigurationError, "Attempt to disable unknown feature '%s'!" % featureName
|
156
|
+
end
|
157
|
+
# Disable the feature.
|
158
|
+
if global
|
159
|
+
# We are still loading the recipe. OK
|
160
|
+
feat.default_active = status
|
161
|
+
else
|
162
|
+
# We are in the user recipe override file. Issue a warning.
|
163
|
+
feat.active = status
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
def set_module_status( moduleName, status, global )
|
168
|
+
mod = configuration.module( moduleName )
|
169
|
+
# Make sure the feature is known.
|
170
|
+
if mod.nil?
|
171
|
+
raise ConfigurationError, "Attempt to disable unknown module '%s'!" % moduleName
|
172
|
+
end
|
173
|
+
# Disable the feature.
|
174
|
+
if global
|
175
|
+
# We are still loading the recipe. OK
|
176
|
+
mod.default_active = status
|
177
|
+
else
|
178
|
+
# We are in the user recipe override file. Issue a warning.
|
179
|
+
mod.active = status
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
179
183
|
end # class StatementVisitor
|
180
184
|
|
181
185
|
|
@@ -290,7 +294,7 @@ def visit_FeatureNode( node )
|
|
290
294
|
end
|
291
295
|
# Create a new feature if needed
|
292
296
|
if @feature.nil?
|
293
|
-
@feature = BuildTool::Feature.
|
297
|
+
@feature = BuildTool::Feature.create( :name => name, :parent => configuration.active_feature )
|
294
298
|
configuration.add_feature( @feature )
|
295
299
|
end
|
296
300
|
# Set it as the current feature
|
@@ -359,11 +363,55 @@ def visit_GitRemotePushNode( node )
|
|
359
363
|
|
360
364
|
end # class GitRemoteDeclarationNodeVisitor
|
361
365
|
|
366
|
+
module GitOptionDeclarationMethods
|
367
|
+
|
368
|
+
def self.included( base )
|
369
|
+
base.class_eval do
|
370
|
+
extend ClassMethods
|
371
|
+
include InstanceMethods
|
372
|
+
end
|
373
|
+
end
|
374
|
+
|
375
|
+
module ClassMethods
|
376
|
+
end
|
377
|
+
|
378
|
+
module InstanceMethods
|
379
|
+
|
380
|
+
def visit_GitOptionsDeclarationNode( node )
|
381
|
+
visit_nodes( node.values )
|
382
|
+
end
|
383
|
+
|
384
|
+
def visit_GitOptionNode( node )
|
385
|
+
if ( node.args[0] == :GLOBAL )
|
386
|
+
@vcs.global_options[ node.values[0] ] = node.values[1]
|
387
|
+
else
|
388
|
+
@vcs.options[ node.values[0] ] = node.values[1]
|
389
|
+
end
|
390
|
+
end
|
391
|
+
end
|
392
|
+
|
393
|
+
end
|
394
|
+
|
395
|
+
class GitOptionsDeclarationNodeVisitor < ListVisitor
|
396
|
+
|
397
|
+
include GitOptionDeclarationMethods
|
398
|
+
|
399
|
+
def initialize( configuration )
|
400
|
+
super( configuration )
|
401
|
+
if BuildTool::VCS::GitConfiguration.global_config.nil?
|
402
|
+
BuildTool::VCS::GitConfiguration.global_config = BuildTool::VCS::GitConfiguration.new
|
403
|
+
end
|
404
|
+
@vcs = BuildTool::VCS::GitConfiguration.global_config
|
405
|
+
end
|
406
|
+
|
407
|
+
end
|
362
408
|
|
363
409
|
|
364
410
|
class GitDeclarationNodeVisitor < GitRemoteDeclarationNodeVisitor
|
365
411
|
|
366
|
-
|
412
|
+
include GitOptionDeclarationMethods
|
413
|
+
|
414
|
+
def initialize( configuration, vcs )
|
367
415
|
super( configuration )
|
368
416
|
@remote = BuildTool::VCS::GitRemote.new( "origin" )
|
369
417
|
@vcs = vcs
|
@@ -438,11 +486,33 @@ def visit_IncludeNode( node )
|
|
438
486
|
end
|
439
487
|
end
|
440
488
|
|
489
|
+
class MercurialDeclarationNodeVisitor < ListVisitor
|
490
|
+
|
491
|
+
def initialize( configuration, vcs )
|
492
|
+
super( configuration )
|
493
|
+
@vcs = vcs
|
494
|
+
end
|
495
|
+
|
496
|
+
def visit_MercurialDeclarationNode( node )
|
497
|
+
visit_nodes( node.values )
|
498
|
+
@vcs
|
499
|
+
end
|
500
|
+
|
501
|
+
def visit_MercurialTrackNode( node )
|
502
|
+
@vcs.track = node.values
|
503
|
+
end
|
504
|
+
|
505
|
+
def visit_MercurialUrlNode( node )
|
506
|
+
@vcs.url = node.values[0]
|
507
|
+
end
|
508
|
+
|
509
|
+
end
|
510
|
+
|
441
511
|
|
442
512
|
class ModuleDeclarationNodeVisitor < ListVisitor
|
443
513
|
|
444
514
|
def initialize( configuration )
|
445
|
-
super
|
515
|
+
super( configuration )
|
446
516
|
@module = nil
|
447
517
|
end
|
448
518
|
|
@@ -470,13 +540,13 @@ def visit_BuildSystemDeclarationNode( node )
|
|
470
540
|
# 3. The module has no parent and no build-system. Inherit from the build-system
|
471
541
|
# standard module.
|
472
542
|
if @module.our_build_system
|
473
|
-
#
|
543
|
+
# logger.debug2( "Inherit from previous build-system for #{@module.name}" )
|
474
544
|
build_system = configuration.build_system_adjust( name, @module.our_build_system )
|
475
545
|
elsif @module.parent
|
476
|
-
#
|
546
|
+
# logger.debug2( "Inherit without parent for #{@module.name}" )
|
477
547
|
build_system = configuration.build_system_adjust( name, nil )
|
478
548
|
else
|
479
|
-
#
|
549
|
+
# logger.debug2( "Inherit from #{name} for #{@module.name}" )
|
480
550
|
build_system = configuration.build_system_adjust( name, configuration.build_system_defaults( name ) )
|
481
551
|
end
|
482
552
|
visitor = BuildSystemDeclarationNodeVisitor.new( configuration, build_system )
|
@@ -499,9 +569,17 @@ def visit_EnvironmentDeclarationNode( node )
|
|
499
569
|
|
500
570
|
def visit_GitDeclarationNode( node )
|
501
571
|
vcs = BuildTool::VCS::GitConfiguration.new
|
502
|
-
|
503
|
-
|
504
|
-
|
572
|
+
if node.options[:inheritance]
|
573
|
+
if not @module.vcs_configuration
|
574
|
+
raise ConfigurationError,
|
575
|
+
"#{@module.name} has no previous git configuration!"
|
576
|
+
end
|
577
|
+
if @module.vcs_configuration.name != "git"
|
578
|
+
raise ConfigurationError,
|
579
|
+
"#{@module.name} has a #{@module.vcs_configuration.name} configuration!"
|
580
|
+
end
|
581
|
+
vcs.parent = @module.vcs_configuration
|
582
|
+
end
|
505
583
|
@module.vcs_configuration = vcs
|
506
584
|
visitor = GitDeclarationNodeVisitor.new( configuration, vcs )
|
507
585
|
node.accept( visitor )
|
@@ -509,14 +587,40 @@ def visit_GitDeclarationNode( node )
|
|
509
587
|
|
510
588
|
def visit_GitSvnDeclarationNode( node )
|
511
589
|
vcs = BuildTool::VCS::GitSvnConfiguration.new
|
512
|
-
|
513
|
-
|
514
|
-
|
590
|
+
if node.options[:inheritance]
|
591
|
+
if not @module.vcs_configuration
|
592
|
+
raise ConfigurationError,
|
593
|
+
"#{@module.name} has no previous git-svn configuration!"
|
594
|
+
end
|
595
|
+
if @module.vcs_configuration.name != "git-svn"
|
596
|
+
raise ConfigurationError,
|
597
|
+
"#{@module.name} has a #{@module.vcs_configuration.name} configuration!"
|
598
|
+
end
|
599
|
+
vcs.parent = @module.vcs_configuration
|
600
|
+
end
|
515
601
|
@module.vcs_configuration = vcs
|
516
602
|
visitor = GitSvnDeclarationNodeVisitor.new( configuration, vcs )
|
517
603
|
node.accept( visitor )
|
518
604
|
end
|
519
605
|
|
606
|
+
def visit_MercurialDeclarationNode( node )
|
607
|
+
vcs = BuildTool::VCS::MercurialConfiguration.new
|
608
|
+
if node.options[:inheritance]
|
609
|
+
if not @module.vcs_configuration
|
610
|
+
raise ConfigurationError,
|
611
|
+
"#{@module.name} has no previous mercurial configuration!"
|
612
|
+
end
|
613
|
+
if @module.vcs_configuration.name != "mercurial"
|
614
|
+
raise ConfigurationError,
|
615
|
+
"#{@module.name} has a #{@module.vcs_configuration.name} configuration!"
|
616
|
+
end
|
617
|
+
vcs.parent = @module.vcs_configuration
|
618
|
+
end
|
619
|
+
@module.vcs_configuration = vcs
|
620
|
+
visitor = MercurialDeclarationNodeVisitor.new( configuration, vcs )
|
621
|
+
node.accept( visitor )
|
622
|
+
end
|
623
|
+
|
520
624
|
def visit_ModuleBuildPrefixNode( node )
|
521
625
|
@module.build_prefix = node.value
|
522
626
|
end
|
@@ -524,36 +628,48 @@ def visit_ModuleBuildPrefixNode( node )
|
|
524
628
|
def visit_ModuleDeclarationNode( node )
|
525
629
|
name = node.values[0]
|
526
630
|
inheritance = node.values[1] == :INHERITANCE
|
631
|
+
|
527
632
|
if inheritance
|
528
633
|
stmts = node.values[3]
|
529
634
|
else
|
530
635
|
stmts = node.values[1]
|
531
636
|
end
|
637
|
+
|
532
638
|
# Check if the module is alread defined. If yes we reopen it.
|
533
639
|
@module = configuration.module( name )
|
534
|
-
if @module
|
535
|
-
|
536
|
-
|
640
|
+
if @module.nil?
|
641
|
+
@module = BuildTool::Module.create( { :name => name } )
|
642
|
+
configuration.add_module( @module )
|
643
|
+
end
|
644
|
+
|
645
|
+
if inheritance
|
646
|
+
|
647
|
+
if @module.found_in_recipe
|
648
|
+
raise ConfigurationError, "Attempt to change a module #{name} while specifying inheritance!"
|
537
649
|
end
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
"Module %s attempts to inherit from not existant module %s" %
|
546
|
-
[ name, parentName ]
|
547
|
-
end
|
650
|
+
|
651
|
+
parentName = node.values[2]
|
652
|
+
parent = configuration.module( parentName )
|
653
|
+
if parent.nil?
|
654
|
+
raise ConfigurationError,
|
655
|
+
"Module %s attempts to inherit from not existant module %s" %
|
656
|
+
[ name, parentName ]
|
548
657
|
end
|
549
|
-
@module =
|
550
|
-
|
551
|
-
|
658
|
+
@module.parent = parent
|
659
|
+
end
|
660
|
+
|
661
|
+
# Only add a module to a feature if it is the first time declared.
|
662
|
+
if !@module.found_in_recipe
|
552
663
|
if !configuration.active_feature.nil?
|
553
664
|
@module.feature = configuration.active_feature
|
554
665
|
configuration.active_feature.modules << @module
|
555
666
|
end
|
556
667
|
end
|
668
|
+
|
669
|
+
# Mark the module as found in the recipe
|
670
|
+
@module.found_in_recipe = true
|
671
|
+
|
672
|
+
# Work on the child nodes.
|
557
673
|
begin
|
558
674
|
self.visit_nodes( stmts )
|
559
675
|
rescue ConfigurationError => e
|
@@ -582,16 +698,24 @@ def visit_ShortDescriptionNode( node )
|
|
582
698
|
|
583
699
|
def visit_SvnDeclarationNode( node )
|
584
700
|
vcs = BuildTool::VCS::SvnConfiguration.new
|
585
|
-
|
586
|
-
|
587
|
-
|
701
|
+
if node.options[:inheritance]
|
702
|
+
if not @module.vcs_configuration
|
703
|
+
raise ConfigurationError,
|
704
|
+
"#{@module.name} has no previous svn configuration!"
|
705
|
+
end
|
706
|
+
if @module.vcs_configuration.name != "svn"
|
707
|
+
raise ConfigurationError,
|
708
|
+
"#{@module.name} has a #{@module.vcs_configuration.name} configuration!"
|
709
|
+
end
|
710
|
+
vcs.parent = @module.vcs_configuration
|
711
|
+
end
|
588
712
|
@module.vcs_configuration = vcs
|
589
713
|
visitor = SvnDeclarationNodeVisitor.new( configuration, vcs )
|
590
714
|
node.accept( visitor )
|
591
715
|
end
|
592
716
|
|
593
717
|
def visit_UseBuildSystemNode( node )
|
594
|
-
#
|
718
|
+
# logger.debug2( "Inherit from build-system #{node.value} for #{@module.name}" )
|
595
719
|
@module.build_system = configuration.build_system_adjust(
|
596
720
|
node.value,
|
597
721
|
configuration.build_system_defaults( node.value ) )
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# -*- coding: UTF-8 -*-
|
2
|
+
|
1
3
|
require 'ansi'
|
2
4
|
require 'logging'
|
3
5
|
require 'fileutils'
|
@@ -59,11 +61,10 @@ def while_logging( level = :trace, &block )
|
|
59
61
|
logentry = nil
|
60
62
|
state = History::ModuleLog::FINISHED_SUCCESSFUL
|
61
63
|
if @command.cmd
|
62
|
-
logentry =
|
63
|
-
:module => @module
|
64
|
+
logentry = @command.cmd.module_logs.build(
|
65
|
+
:module => @module,
|
64
66
|
:event => @type,
|
65
|
-
:logfile => @logfile)
|
66
|
-
@command.cmd.add_module_log(logentry)
|
67
|
+
:logfile => @logfile.to_s.encode( 'UTF-8' ) )
|
67
68
|
logentry.started
|
68
69
|
end
|
69
70
|
logger.debug "Opening logfile #{@logfile}"
|
@@ -132,38 +133,53 @@ def execute()
|
|
132
133
|
|
133
134
|
class Rebase < Base
|
134
135
|
|
135
|
-
def initialize( command, mod )
|
136
|
+
def initialize( command, mod, verbose )
|
136
137
|
super( command, 20, :rebase, mod )
|
138
|
+
@verbose = verbose
|
137
139
|
if !mod.vcs_required.fetching_supported?
|
138
140
|
logger.info "Fetching not supported by vcs #{mod.vcs.name}. Doing nothing."
|
139
|
-
return
|
140
141
|
end
|
141
142
|
end
|
142
143
|
|
143
144
|
def execute()
|
144
145
|
logger.info "Rebasing"
|
145
|
-
@module.rebase
|
146
|
+
@module.rebase( @verbose )
|
146
147
|
end
|
147
148
|
|
148
149
|
end
|
149
150
|
|
150
151
|
class RemoveBuildDirectory < Base
|
151
152
|
|
152
|
-
def initialize( command, mod )
|
153
|
+
def initialize( command, mod, force = false )
|
154
|
+
@force = force
|
153
155
|
super( command, 10, :clean, mod )
|
154
156
|
end
|
155
157
|
|
156
158
|
def execute()
|
157
|
-
if @module.build_system_required.out_of_source
|
159
|
+
if @module.build_system_required.out_of_source or @force
|
158
160
|
logger.info "Removing build directory"
|
159
161
|
@module.remove_build_directory
|
160
162
|
else
|
161
|
-
logger.warn "
|
163
|
+
logger.warn "In source build. Will not remove source directory!"
|
162
164
|
end
|
163
165
|
end
|
164
166
|
|
165
167
|
end
|
166
168
|
|
169
|
+
class RemoveSourceDirectory < Base
|
170
|
+
|
171
|
+
def initialize( command, mod, force = false )
|
172
|
+
@force = force
|
173
|
+
super( command, 10, :clean, mod )
|
174
|
+
end
|
175
|
+
|
176
|
+
def execute()
|
177
|
+
logger.info "Removing source directory"
|
178
|
+
@module.remove_source_directory
|
179
|
+
end
|
180
|
+
|
181
|
+
end
|
182
|
+
|
167
183
|
class Configure < Base
|
168
184
|
|
169
185
|
def initialize( command, mod )
|