gaudi 0.2.4 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b9572100013a2fd71a8731d6a867551d32870517
4
- data.tar.gz: 76f8b77cd00878adeb57286b25473c8a8ae8abd7
3
+ metadata.gz: 93ca793760bc2eba8c9d779334f5169df4612d12
4
+ data.tar.gz: ebd25f3ff9f45fa48b03092a6210565c20f0f21e
5
5
  SHA512:
6
- metadata.gz: 883e81256e3fad544f558c17ce629f26aa5dbfa745883101a6a3065c067cc08e09014359604df846ae0775b24e53eb9a1ab8c6bb079fa6f67ec01c406d8c79c0
7
- data.tar.gz: bed2868f0897ef1efa8716501a01e90e24eaa181e9e408fbf28dc37e9af6fc19c565daf57e484a7ffce911dc4c1d0a75e466da5b4276317ee3ebd6a4bbd67283
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
@@ -6,7 +6,7 @@ require 'rubygems'
6
6
  require 'archive/tar/minitar'
7
7
 
8
8
  module Gaudi
9
- class Error <RuntimeError
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
- opt_parser.parse!(arguments)
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::Error
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 Error, "#{project_root} already exists!" if File.exists?(project_root) && project_root != Dir.pwd
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
- core(version,"lib")
108
+ lib_config
109
+ core("gaudi",REPO,version,"lib")
88
110
  end
89
111
 
90
112
  def update version
91
- raise Error, "#{gaudi_home} is missing! Try creating a new Gaudi project first." unless File.exists?(gaudi_home)
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
- #:nodoc:
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 Error, "Could not find git. Make sure it is in the PATH" unless system("git --version")
130
+ raise GemError, "Could not find git. Make sure it is in the PATH" unless system("git --version")
100
131
  end
101
- #:nodoc:
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
- #:nodoc:
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
- #:nodoc:
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
- #:nodoc:
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
- #:nodoc:
147
- def core(version,lib_items)
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 Error, "Cloning the Gaudi repo failed. Check that git is on the PATH and that #{REPO} is accessible"
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
- #:nodoc:
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 #{REPO} \"#{tmp}/gaudi\""
202
+ system "git clone #{repository} \"#{tmp}/gaudi\""
161
203
  end
162
- #:nodoc:
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
- #:nodoc:
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
@@ -37,4 +37,6 @@ linker_in=
37
37
  linker_out=
38
38
  #Flag for linked libraries (shared or dynamic)
39
39
  linker_lib=
40
- linker_commandfile_prefix=
40
+ linker_commandfile_prefix=
41
+ #The library configuration file
42
+ lib_cfg=libs.yaml
data/lib/gaudi/version.rb CHANGED
@@ -5,9 +5,9 @@ module Gaudi
5
5
  #Major version
6
6
  MAJOR=0
7
7
  #Minor version
8
- MINOR=2
8
+ MINOR=3
9
9
  #Tiny version
10
- TINY=4
10
+ TINY=0
11
11
  #All-in-one
12
12
  STRING=[MAJOR,MINOR,TINY].join('.')
13
13
  end
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.2.4
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: 2015-12-05 00:00:00.000000000 Z
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.2.5
101
+ rubygems_version: 2.5.1
102
102
  signing_key:
103
103
  specification_version: 4
104
104
  summary: Scaffolding and version management for Gaudi