gaudi 0.2.4 → 0.3.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.
- checksums.yaml +4 -4
- data/History.txt +8 -2
- data/lib/gaudi/scaffolding.rb +66 -23
- data/lib/gaudi/templates/main.cfg.template +4 -1
- data/lib/gaudi/templates/platform.cfg.template +3 -1
- data/lib/gaudi/version.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93ca793760bc2eba8c9d779334f5169df4612d12
|
4
|
+
data.tar.gz: ebd25f3ff9f45fa48b03092a6210565c20f0f21e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e244dedee175f9e3f5ffefd47d68b364886a3b63f1c0f528dcab0ecabd9bf6cfb1ec03c5f9ba940cf891f52082761d0d97827af847771e6c6702d8f168104ef
|
7
|
+
data.tar.gz: 0c96b914d94518a01b6304ea197f5fb9d5092f64f908058a1aeca73ea2470ef821dfeb97bc3cf8b2721a8cc9527c87c09b345c5c166e48f64a32701cd6a5b817
|
data/History.txt
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
#0.3.0
|
2
|
+
* Added *deployments* and *common* subdirectories when scaffolding src
|
3
|
+
* Added an empty library configuration file and the platform config reference
|
4
|
+
* Added the *auto_rules* option in the system configuration
|
5
|
+
* Pull Gaudi "libraries" with -l
|
6
|
+
|
1
7
|
#0.2.4
|
2
8
|
* Fix bug when project root contains spaces
|
3
9
|
* DRYed the code
|
@@ -8,10 +14,10 @@
|
|
8
14
|
#0.2.2
|
9
15
|
* Added update functionality
|
10
16
|
#0.2.0
|
11
|
-
* Pulls HEAD of gaudi from GitHub in the scaffold
|
17
|
+
* Pulls HEAD of gaudi from GitHub in the scaffold
|
12
18
|
|
13
19
|
#0.1.0
|
14
20
|
* Scaffolding code for new projects
|
15
21
|
** Directory structure
|
16
|
-
** Example system configuration
|
22
|
+
** Example system configuration
|
17
23
|
** Example platform configuration
|
data/lib/gaudi/scaffolding.rb
CHANGED
@@ -6,7 +6,7 @@ require 'rubygems'
|
|
6
6
|
require 'archive/tar/minitar'
|
7
7
|
|
8
8
|
module Gaudi
|
9
|
-
class
|
9
|
+
class GemError <RuntimeError
|
10
10
|
end
|
11
11
|
class Gem
|
12
12
|
MAIN_CONFIG="system.cfg"
|
@@ -21,6 +21,7 @@ module Gaudi
|
|
21
21
|
options.verbose= false
|
22
22
|
options.scaffold= false
|
23
23
|
options.update= false
|
24
|
+
options.library= false
|
24
25
|
options.version= "HEAD"
|
25
26
|
|
26
27
|
opt_parser = OptionParser.new do |opts|
|
@@ -39,6 +40,19 @@ module Gaudi
|
|
39
40
|
options.update=true
|
40
41
|
options.scaffold=false
|
41
42
|
end
|
43
|
+
opts.on("-l", "--lib NAME URL PROJECT_PATH","Pull/Update Gaudi library from URL on project at PROJECT_PATH") do |name|
|
44
|
+
options.library=true
|
45
|
+
options.update=false
|
46
|
+
options.scaffold=false
|
47
|
+
options.lib=name
|
48
|
+
if ARGV.size<2
|
49
|
+
raise GemError, "Missing parameters!"
|
50
|
+
end
|
51
|
+
url=ARGV.shift
|
52
|
+
proot=ARGV.shift
|
53
|
+
options.url=url
|
54
|
+
options.project_root=File.expand_path(proot)
|
55
|
+
end
|
42
56
|
opts.separator ""
|
43
57
|
opts.separator "Common options:"
|
44
58
|
# Boolean switch.
|
@@ -54,7 +68,12 @@ module Gaudi
|
|
54
68
|
exit
|
55
69
|
end
|
56
70
|
end
|
57
|
-
|
71
|
+
begin
|
72
|
+
opt_parser.parse!(arguments)
|
73
|
+
rescue GemError
|
74
|
+
puts $!.message
|
75
|
+
exit 1
|
76
|
+
end
|
58
77
|
return options
|
59
78
|
end
|
60
79
|
#:nodoc:
|
@@ -65,8 +84,10 @@ module Gaudi
|
|
65
84
|
Gaudi::Gem.new(opts.project_root).project(opts.version)
|
66
85
|
elsif opts.update
|
67
86
|
Gaudi::Gem.new(opts.project_root).update(opts.version)
|
87
|
+
elsif opts.library
|
88
|
+
Gaudi::Gem.new(opts.project_root).library(opts.lib,opts.url,opts.version)
|
68
89
|
end
|
69
|
-
rescue Gaudi::
|
90
|
+
rescue Gaudi::GemError
|
70
91
|
puts $!.message
|
71
92
|
exit 1
|
72
93
|
end
|
@@ -78,35 +99,45 @@ module Gaudi
|
|
78
99
|
end
|
79
100
|
|
80
101
|
def project version
|
81
|
-
raise
|
102
|
+
raise GemError, "#{project_root} already exists!" if File.exists?(project_root) && project_root != Dir.pwd
|
82
103
|
check_for_git
|
83
104
|
directory_structure
|
84
105
|
rakefile
|
85
106
|
main_config
|
86
107
|
platform_config
|
87
|
-
|
108
|
+
lib_config
|
109
|
+
core("gaudi",REPO,version,"lib")
|
88
110
|
end
|
89
111
|
|
90
112
|
def update version
|
91
|
-
raise
|
113
|
+
raise GemError, "#{gaudi_home} is missing! Try creating a new Gaudi project first." unless File.exists?(gaudi_home)
|
92
114
|
check_for_git
|
93
115
|
puts "Removing old gaudi installation"
|
94
116
|
FileUtils.rm_rf(File.join(gaudi_home,"lib/gaudi"))
|
95
|
-
core(version,"lib/gaudi lib/gaudi.rb")
|
117
|
+
core(version,REPO,"lib/gaudi lib/gaudi.rb")
|
96
118
|
end
|
97
|
-
|
119
|
+
|
120
|
+
def library lib,source_url,version
|
121
|
+
raise GemError, "#{gaudi_home} is missing! Try creating a new Gaudi project first." unless File.exists?(gaudi_home)
|
122
|
+
#check_for_git
|
123
|
+
puts "Removing old #{lib} installation"
|
124
|
+
FileUtils.rm_rf(File.join(gaudi_home,"lib/#{lib}"))
|
125
|
+
puts "Pulling #{version} from #{source_url}"
|
126
|
+
core(lib,source_url,version,"lib/#{lib}")
|
127
|
+
end
|
128
|
+
#:stopdoc:
|
98
129
|
def check_for_git
|
99
|
-
raise
|
130
|
+
raise GemError, "Could not find git. Make sure it is in the PATH" unless system("git --version")
|
100
131
|
end
|
101
|
-
|
132
|
+
|
102
133
|
def directory_structure
|
103
134
|
puts "Creating Gaudi filesystem structure at #{project_root}"
|
104
|
-
structure=["doc","lib","src","test","tools/build","tools/templates"]
|
135
|
+
structure=["doc","lib","src/deployments","src/common","test","tools/build","tools/templates"]
|
105
136
|
structure.each do |dir|
|
106
137
|
FileUtils.mkdir_p File.join(project_root,dir),:verbose=>false
|
107
138
|
end
|
108
139
|
end
|
109
|
-
|
140
|
+
|
110
141
|
def rakefile
|
111
142
|
puts "Generating main Rakefile"
|
112
143
|
rakefile=File.join(project_root,"Rakefile")
|
@@ -121,7 +152,7 @@ require_relative 'tools/build/lib/gaudi/tasks'
|
|
121
152
|
File.open(rakefile, 'wb') {|f| f.write(rakefile_content) }
|
122
153
|
end
|
123
154
|
end
|
124
|
-
|
155
|
+
|
125
156
|
def main_config
|
126
157
|
puts "Generating initial configuration file"
|
127
158
|
config_file=File.join(project_root,"tools/build/#{MAIN_CONFIG}")
|
@@ -132,7 +163,7 @@ require_relative 'tools/build/lib/gaudi/tasks'
|
|
132
163
|
File.open(config_file, 'wb') {|f| f.write(configuration_content) }
|
133
164
|
end
|
134
165
|
end
|
135
|
-
|
166
|
+
|
136
167
|
def platform_config
|
137
168
|
puts "Generating example platform configuration file"
|
138
169
|
config_file=File.join(project_root,"tools/build/#{PLATFORM_CONFIG}")
|
@@ -143,23 +174,34 @@ require_relative 'tools/build/lib/gaudi/tasks'
|
|
143
174
|
File.open(config_file, 'wb') {|f| f.write(configuration_content) }
|
144
175
|
end
|
145
176
|
end
|
146
|
-
|
147
|
-
def
|
177
|
+
|
178
|
+
def lib_config
|
179
|
+
puts "Generating example library configuration file"
|
180
|
+
config_file=File.join(project_root,"tools/build/libs.yaml")
|
181
|
+
if File.exists?(config_file)
|
182
|
+
puts "libs.yaml exists, skipping generation"
|
183
|
+
else
|
184
|
+
configuration_content="---\n"
|
185
|
+
File.open(config_file, 'wb') {|f| f.write(configuration_content) }
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
def core(lib,url,version,lib_items)
|
148
190
|
Dir.mktmpdir do |tmp|
|
149
|
-
if pull_from_repo(tmp)
|
191
|
+
if pull_from_repo(url,tmp)
|
150
192
|
pkg=archive(version,File.join(tmp,"gaudi"),project_root,lib_items)
|
151
193
|
unpack(pkg,gaudi_home)
|
152
194
|
else
|
153
|
-
raise
|
195
|
+
raise GemError, "Cloning the Gaudi repo failed. Check that git is on the PATH and that #{REPO} is accessible"
|
154
196
|
end
|
155
197
|
end
|
156
198
|
end
|
157
|
-
|
158
|
-
def pull_from_repo tmp
|
199
|
+
|
200
|
+
def pull_from_repo repository,tmp
|
159
201
|
FileUtils.rm_rf('gaudi') if File.exists?('gaudi')
|
160
|
-
system "git clone #{
|
202
|
+
system "git clone #{repository} \"#{tmp}/gaudi\""
|
161
203
|
end
|
162
|
-
|
204
|
+
|
163
205
|
def archive version,clone_path,prj_root,lib_items
|
164
206
|
pkg=File.expand_path(File.join(prj_root,"gaudipkg.tar"))
|
165
207
|
Dir.chdir(clone_path) do |d|
|
@@ -169,7 +211,7 @@ require_relative 'tools/build/lib/gaudi/tasks'
|
|
169
211
|
end
|
170
212
|
return pkg
|
171
213
|
end
|
172
|
-
|
214
|
+
|
173
215
|
def unpack pkg,home
|
174
216
|
puts "Unpacking in #{home}"
|
175
217
|
Dir.chdir(home) do |d|
|
@@ -178,5 +220,6 @@ require_relative 'tools/build/lib/gaudi/tasks'
|
|
178
220
|
FileUtils.rm_rf(pkg)
|
179
221
|
FileUtils.rm_rf(File.join(home,'pax_global_header'))
|
180
222
|
end
|
223
|
+
#:startdoc:
|
181
224
|
end
|
182
225
|
end
|
@@ -9,4 +9,7 @@ sources=../../src/
|
|
9
9
|
#enumerate the platforms i.e. platforms=gcc,ms,arm
|
10
10
|
#platforms= foo
|
11
11
|
#add a platform=platform.cfg for each platform pointing to the platform configuration
|
12
|
-
#foo=./foo.cfg
|
12
|
+
#foo=./foo.cfg
|
13
|
+
#Instead of specifying build rules manually, uncomment this line
|
14
|
+
#and gaudi will create rake rules for objects and executables for each target platform
|
15
|
+
#auto_rules=true
|
data/lib/gaudi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gaudi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vassilis Rizopoulos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: archive-tar-minitar
|
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
98
|
version: '0'
|
99
99
|
requirements: []
|
100
100
|
rubyforge_project:
|
101
|
-
rubygems_version: 2.
|
101
|
+
rubygems_version: 2.5.1
|
102
102
|
signing_key:
|
103
103
|
specification_version: 4
|
104
104
|
summary: Scaffolding and version management for Gaudi
|