gaudi 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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a24b96d9b611a1f03f01bac6ecf8cb143b999c3c
4
+ data.tar.gz: 74b44603584ba06cc746bef651337e09ea7b559b
5
+ SHA512:
6
+ metadata.gz: d87272b95529129c6cff54571734523f2d12fd211ab16b7da81ddc2091eea5f04dace30b70b2505b12f90c095612634823805d9caf8117290a7e552ecb0ef1b5
7
+ data.tar.gz: c5fb1bbe106fa3ce9db987eba49c5f01f2731560daa67f29db609e61621a02fafe79da3b523fac351a47781cb086ab6d8bd4082e9540d7de14251d31d1e91afa
data/History.txt ADDED
@@ -0,0 +1,5 @@
1
+ # 0.1.0
2
+ * Scaffolding code for new projects
3
+ ** Directory structure
4
+ ** Example system configuration
5
+ ** Example platform configuration
data/Manifest.txt ADDED
@@ -0,0 +1,9 @@
1
+ History.txt
2
+ Manifest.txt
3
+ README.txt
4
+ bin/gaudi
5
+ lib/gaudi/templates/main.cfg.template
6
+ lib/gaudi/templates/platform.cfg.template
7
+ lib/gaudi/scaffolding.rb
8
+ lib/gaudi/version.rb
9
+ lib/gaudi.rb
data/README.txt ADDED
@@ -0,0 +1,38 @@
1
+ # Gaudi - A Builder [http://github.com/damphyr/gaudi](http://github.com/damphyr/gaudi)
2
+
3
+ ## DESCRIPTION:
4
+
5
+ This gem provides setup, scaffolding and maintenance functions for [gaudi](http://github.com/damphyr/gaudi) installations.
6
+
7
+ ## USAGE
8
+
9
+ gaudi -s project/root to create a directory structure for a Gaudi based project
10
+
11
+ ## INSTALL:
12
+
13
+ * (sudo) gem install gaudi
14
+
15
+ ## LICENSE:
16
+
17
+ (The MIT License)
18
+
19
+ Copyright (c) 2014 FIX
20
+
21
+ Permission is hereby granted, free of charge, to any person obtaining
22
+ a copy of this software and associated documentation files (the
23
+ 'Software'), to deal in the Software without restriction, including
24
+ without limitation the rights to use, copy, modify, merge, publish,
25
+ distribute, sublicense, and/or sell copies of the Software, and to
26
+ permit persons to whom the Software is furnished to do so, subject to
27
+ the following conditions:
28
+
29
+ The above copyright notice and this permission notice shall be
30
+ included in all copies or substantial portions of the Software.
31
+
32
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
33
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
34
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
35
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
36
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
37
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
38
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/bin/gaudi ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require 'gaudi'
3
+ Gaudi::Gem.run(ARGV)
@@ -0,0 +1,109 @@
1
+ require 'ostruct'
2
+ require 'optparse'
3
+ require 'fileutils'
4
+
5
+ module Gaudi
6
+ class Gem
7
+ MAIN_CONFIG="system.cfg"
8
+ PLATFORM_CONFIG="foo.cfg"
9
+ attr_reader :project_root
10
+ #:nodoc:
11
+ def self.options arguments
12
+ options = OpenStruct.new
13
+ options.project_root = Dir.pwd
14
+ options.verbose = false
15
+ options.scaffold=false
16
+
17
+ opt_parser = OptionParser.new do |opts|
18
+ opts.banner = "Usage: gaudi [options]"
19
+ opts.separator ""
20
+ opts.separator "Commands:"
21
+
22
+ opts.on("-s", "--scaffold PATH","Create a Gaudi scaffold in PATH") do |proot|
23
+ options.project_root=File.expand_path(proot)
24
+ options.scaffold=true
25
+ end
26
+ opts.separator ""
27
+ opts.separator "Common options:"
28
+ # Boolean switch.
29
+ opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
30
+ options.verbose = v
31
+ end
32
+ opts.on_tail("-h", "--help", "Show this message") do
33
+ puts opts
34
+ exit
35
+ end
36
+ opts.on_tail("--version", "Show version") do
37
+ puts "Gaudi Gem v#{Gaudi::Gem::Version::STRING}"
38
+ exit
39
+ end
40
+ end
41
+ opt_parser.parse!(arguments)
42
+ return options
43
+ end
44
+ #:nodoc:
45
+ def self.run args
46
+ opts=options(args)
47
+ if opts.scaffold
48
+ Gaudi::Gem.new(opts.project_root).project
49
+ end
50
+ end
51
+
52
+ def initialize project_root
53
+ @project_root=project_root
54
+ end
55
+
56
+ def project
57
+ raise "#{project_root} already exists!" if File.exists?(project_root) && project_root != Dir.pwd
58
+ directory_structure
59
+ rakefile
60
+ main_config
61
+ #platform_config
62
+ end
63
+ #:nodoc:
64
+ def directory_structure
65
+ puts "Creating Gaudi filesystem structure at #{project_root}"
66
+ structure=["doc","lib","src","test","tools/build","tools/templates"]
67
+ structure.each do |dir|
68
+ FileUtils.mkdir_p File.join(project_root,dir),:verbose=>false
69
+ end
70
+ end
71
+ #:nodoc:
72
+ def rakefile
73
+ puts "Generating main Rakefile"
74
+ rakefile=File.join(project_root,"Rakefile")
75
+ if File.exists?(rakefile)
76
+ puts "Rakefile exists, skipping generation"
77
+ else
78
+ rakefile_content=<<-EOT
79
+ require_relative 'tools/build/lib/gaudi'
80
+ env_setup(File.dirname(__FILE__))
81
+ require_relative 'tools/build/lib/gaudi/tasks'
82
+ EOT
83
+ File.open(rakefile, 'wb') {|f| f.write(rakefile_content) }
84
+ end
85
+ end
86
+ #:nodoc:
87
+ def main_config
88
+ puts "Generating initial configuration file"
89
+ config_file=File.join(project_root,"tools/build/#{MAIN_CONFIG}")
90
+ if File.exists?(config_file)
91
+ puts "#{MAIN_CONFIG} exists, skipping generation"
92
+ else
93
+ configuration_content=File.read(File.join(File.dirname(__FILE__),'templates/main.cfg.template'))
94
+ File.open(config_file, 'wb') {|f| f.write(configuration_content) }
95
+ end
96
+ end
97
+ #:nodoc:
98
+ def platform_config
99
+ puts "Generating example platform configuration file"
100
+ config_file=File.join(project_root,"tools/build/#{PLATFORM_CONFIG}")
101
+ if File.exists?(config_file)
102
+ puts "#{PLATFORM_CONFIG} exists, skipping generation"
103
+ else
104
+ configuration_content=File.read(File.join(File.dirname(__FILE__),'templates/platform.cfg.template'))
105
+ File.open(config_file, 'wb') {|f| f.write(configuration_content) }
106
+ end
107
+ end
108
+ end
109
+ end
@@ -0,0 +1,12 @@
1
+ ##Relative paths are relative to the configuration file
2
+
3
+ #the project root directory
4
+ base=../../
5
+ #the build output directory
6
+ out=../../out
7
+ #Comma separated list of directory to search for source files
8
+ sources=../../src/
9
+ #enumerate the platforms i.e. platforms=gcc,ms,arm
10
+ #platforms= foo
11
+ #add a platform=platform.cfg for each platform pointing to the platform configuration
12
+ #foo=./foo.cfg
@@ -0,0 +1,40 @@
1
+ ##### Source file settings
2
+ #all extension parameters are mandatory
3
+ source_extensions= .c,.asm #comma separated list of file extensions
4
+ header_extensions= .h #comma separated list of file extensions
5
+ object_extension= .o #single entry
6
+ library_extension= .so #single entry
7
+ executable_extension= .e #single entry
8
+ ######Compiler settings
9
+ #Compiler executable (gcc etc.)
10
+ compiler=
11
+ #command line options for the compiler (-o2 etc.)
12
+ compiler_options=
13
+ #Output flag
14
+ compiler_out=
15
+ #Command file flag (to make the compiler read the prameters from a file)
16
+ compiler_commandfile_prefix=
17
+ #Include path flag
18
+ compiler_include=
19
+ #### Basically the set above is repeated the for the linker (libraries and executables) and the assembler
20
+ #####Assembler settings
21
+ assembler=
22
+ assembler_options=
23
+ assembler_commandfile_prefix=
24
+ assembler_out=
25
+ assembler_include=
26
+ #####Settings for linking libraries
27
+ librarian=
28
+ library_options=
29
+ library_in=
30
+ library_out=
31
+ library_commandfile_prefix=
32
+ #####Settings for linking executables
33
+ linker=
34
+ linker_options=
35
+ #input files flag (some linkers do have it. You prefix every object file with it, yes you do)
36
+ linker_in=
37
+ linker_out=
38
+ #Flag for linked libraries (shared or dynamic)
39
+ linker_lib=
40
+ linker_commandfile_prefix=
@@ -0,0 +1,15 @@
1
+ module Gaudi
2
+ #Gaudi follows SemVer even so does it's gem, but the're two separate things
3
+ class Gem
4
+ module Version
5
+ #Major version
6
+ MAJOR=0
7
+ #Minor version
8
+ MINOR=1
9
+ #Tiny version
10
+ TINY=0
11
+ #All-in-one
12
+ STRING=[MAJOR,MINOR,TINY].join('.')
13
+ end
14
+ end
15
+ end
data/lib/gaudi.rb ADDED
@@ -0,0 +1,2 @@
1
+ require_relative "gaudi/version"
2
+ require_relative "gaudi/scaffolding"
metadata ADDED
@@ -0,0 +1,90 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gaudi
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Vassilis Rizopoulos
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-08-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rdoc
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '4.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '4.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: hoe
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '3.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '3.7'
41
+ description: "## DESCRIPTION:\n\nThis gem provides setup, scaffolding and maintenance
42
+ functions for [gaudi](http://github.com/damphyr/gaudi) installations.\n\n## USAGE\n\ngaudi
43
+ -s project/root to create a directory structure for a Gaudi based project \n\n##
44
+ INSTALL:"
45
+ email:
46
+ - vassilisrizopoulos@gmail.com
47
+ executables:
48
+ - gaudi
49
+ extensions: []
50
+ extra_rdoc_files:
51
+ - History.txt
52
+ - Manifest.txt
53
+ - README.txt
54
+ files:
55
+ - History.txt
56
+ - Manifest.txt
57
+ - README.txt
58
+ - bin/gaudi
59
+ - lib/gaudi/templates/main.cfg.template
60
+ - lib/gaudi/templates/platform.cfg.template
61
+ - lib/gaudi/scaffolding.rb
62
+ - lib/gaudi/version.rb
63
+ - lib/gaudi.rb
64
+ homepage: http://github.com/damphyr/gaudi
65
+ licenses:
66
+ - MIT
67
+ metadata: {}
68
+ post_install_message:
69
+ rdoc_options:
70
+ - --main
71
+ - README.txt
72
+ require_paths:
73
+ - lib
74
+ required_ruby_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ required_rubygems_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - '>='
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ requirements: []
85
+ rubyforge_project: gaudi
86
+ rubygems_version: 2.0.14
87
+ signing_key:
88
+ specification_version: 4
89
+ summary: Scaffolding and version management for Gaudi
90
+ test_files: []