teapot 2.0.0.pre.rc1 → 2.0.0.pre.rc2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c6945788efc0d75eb38df802faf17617bc67116f
4
- data.tar.gz: bf5dd81a7bc4cf1bef005d5e584f5fbb54ba9fdd
3
+ metadata.gz: 24912ef656102df52a040fe466fe1a9309b28272
4
+ data.tar.gz: af550a07ad4b0e6a8f95c56931df06912c38b5e7
5
5
  SHA512:
6
- metadata.gz: 034e5b25acb19d9b75589c347d5f281147bed403ab73cc750640ad79c5fb8f3d267d273b6d96d024dcbdd0ba4a31447aaf80734d5a2bb8d383d288120bac0c6c
7
- data.tar.gz: 9da112ffe2f501735ec6590ad2ddbce6afbab287b5ff058ac46a8b51517de237cb94e3644a047780cd90e7ec4bfed4a5a11397e848d90eecd87e951c60e25de3
6
+ metadata.gz: 637f5057b544d7e48c0bcb65c3357498f1f9a688fbff2fdfc02343a7c9d9513c7e36303a577ce68052af5494e50f799b48ca6deaa165de6edc7b9d05b7bc376d
7
+ data.tar.gz: 99b568ab22dfb5e7185b48d6f6b1a6d96c5fc17bf8da80feccff1bd4d206bc07983c963c47f0aa14635d22d04f6d3d88812321983fadfe5f95f4d3caefa5c9a9
data/.travis.yml CHANGED
@@ -14,11 +14,10 @@ rvm:
14
14
  - jruby-head
15
15
  - ruby-head
16
16
  matrix:
17
- global:
18
- env: CC=clang-4.0 CXX=clang++-4.0
19
17
  allow_failures:
20
18
  - rvm: ruby-head
21
19
  - rvm: jruby-head
20
+ env: CC=clang-4.0 CXX=clang++-4.0
22
21
  addons:
23
22
  apt:
24
23
  sources: ["llvm-toolchain-trusty-4.0"]
@@ -83,10 +83,12 @@ module Teapot
83
83
  def generate_project(root, project_name, source, packages)
84
84
  name = ::Build::Name.new(project_name)
85
85
 
86
+ # Otherwise the initial commit will try to include teapot/
86
87
  File.open(root + ".gitignore", "w") do |output|
87
88
  output.puts "teapot/"
88
89
  end
89
90
 
91
+ # A very basic teapot file to pull in the initial dependencies.
90
92
  File.open(root + TEAPOT_FILE, "w") do |output|
91
93
  output.puts "\# Teapot v#{VERSION} configuration generated at #{Time.now.to_s}", ''
92
94
 
@@ -36,6 +36,8 @@ module Teapot
36
36
  option '--local', "Don't update from source, assume updated local packages."
37
37
  end
38
38
 
39
+ many :packages, "Only update the specified packages, or all packages if none specified."
40
+
39
41
  def invoke(parent)
40
42
  logger = parent.logger
41
43
  context = parent.context
@@ -47,9 +49,12 @@ module Teapot
47
49
  while true
48
50
  configuration.packages.each do |package|
49
51
  next if resolved.include? package
50
-
51
- fetch_package(context, configuration, package, logger, **@options)
52
-
52
+
53
+ # If specific packages were listed, limit updates to them.
54
+ if @packages.empty? || @packages.include?(package.name)
55
+ fetch_package(context, configuration, package, logger, **@options)
56
+ end
57
+
53
58
  # We are done with this package, don't try to process it again:
54
59
  resolved << package
55
60
  end
@@ -104,7 +109,7 @@ module Teapot
104
109
  end
105
110
 
106
111
  def clone_or_pull_package(context, configuration, package, package_lock, logger)
107
- logger.info "Fetching #{package}...".color(:cyan)
112
+ logger.info "Processing #{package}...".color(:cyan)
108
113
 
109
114
  # Where we are going to put the package:
110
115
  destination_path = package.path
@@ -125,26 +130,17 @@ module Teapot
125
130
 
126
131
  commit = package_lock ? package_lock[:commit] : nil
127
132
 
128
- unless destination_path.exist?
129
- logger.info "Cloning package at path #{destination_path} ...".color(:cyan)
130
-
131
- begin
132
- external_url = package.external_url(context.root)
133
-
134
- repository = Rugged::Repository.clone_at(external_url.to_s, destination_path.to_s, checkout_branch: branch)
135
- repository.checkout(commit) if commit
136
- # Repository.new().clone!(external_url, branch, commit)
137
- rescue
138
- logger.info "Failed to clone #{external_url}...".color(:red)
133
+ if destination_path.exist?
134
+ logger.info "Updating package at path #{destination_path}...".color(:cyan)
139
135
 
140
- raise
141
- end
136
+ repository = Rugged::Repository.new(destination_path.to_s)
137
+ repository.checkout(commit || 'origin/master')
142
138
  else
143
- logger.info "Updating package at path #{destination_path} ...".color(:cyan)
144
-
145
- commit = package_lock ? package_lock[:commit] : nil
146
- Rugged::Repository.new(destination_path.to_s).checkout(commit)
147
- # Repository.new(destination_path).update(branch, commit)
139
+ logger.info "Cloning package at path #{destination_path}...".color(:cyan)
140
+
141
+ external_url = package.external_url(context.root)
142
+ repository = Rugged::Repository.clone_at(external_url.to_s, destination_path.to_s, checkout_branch: branch)
143
+ repository.checkout(commit) if commit
148
144
  end
149
145
  end
150
146
 
@@ -50,7 +50,7 @@ module Teapot
50
50
 
51
51
  options do
52
52
  option '-c/--configuration <name>', "Specify a specific build configuration.", default: ENV['TEAPOT_CONFIGURATION']
53
- option '--root <path>', "Work in the given root directory.", default: Dir.getwd
53
+ option '--root <path>', "Work in the given root directory."
54
54
  option '--verbose | --quiet', "Verbosity of output for debugging.", key: :logging
55
55
  option '-h/--help', "Print out help information."
56
56
  option '-v/--version', "Print out the application version."
@@ -67,7 +67,7 @@ module Teapot
67
67
  default: 'build'
68
68
 
69
69
  def root
70
- ::Build::Files::Path.expand(@options[:root])
70
+ ::Build::Files::Path.expand(@options[:root] || Dir.getwd)
71
71
  end
72
72
 
73
73
  def verbose?
@@ -92,20 +92,32 @@ module Teapot
92
92
 
93
93
  def substitutions
94
94
  substitutions = Build::Text::Substitutions.new
95
-
95
+
96
+ substitutions['TEAPOT_VERSION'] = Teapot::VERSION
97
+
96
98
  if @project
97
- substitutions['PROJECT_NAME'] = @project.name
99
+ name = Build::Name.new(@project.name)
100
+
101
+ # e.g. Foo Bar, typically used as a title, directory, etc.
102
+ substitutions['PROJECT_NAME'] = name.text
103
+
104
+ # e.g. FooBar, typically used as a namespace
105
+ substitutions['PROJECT_IDENTIFIER'] = name.identifier
106
+
107
+ # e.g. foo-bar, typically used for targets, executables
108
+ substitutions['PROJECT_TARGET_NAME'] = name.target
109
+
98
110
  substitutions['LICENSE'] = @project.license
99
111
  end
100
-
112
+
101
113
  # The user's current name:
102
114
  substitutions['AUTHOR_NAME'] = repository.config['user.name']
103
115
  substitutions['AUTHOR_EMAIL'] = repository.config['user.email']
104
-
116
+
105
117
  current_date = Time.new
106
118
  substitutions['DATE'] = current_date.strftime("%-d/%-m/%Y")
107
119
  substitutions['YEAR'] = current_date.strftime("%Y")
108
-
120
+
109
121
  return substitutions
110
122
  end
111
123
 
data/lib/teapot/target.rb CHANGED
@@ -58,9 +58,6 @@ module Teapot
58
58
  Build::Environment.new(&provision.value)
59
59
  end
60
60
 
61
- # Per-configuration package package environment:
62
- environments << @package.options[:environment]
63
-
64
61
  # Merge all the environments together:
65
62
  environment = Build::Environment.combine(*environments)
66
63
 
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Teapot
22
- VERSION = "2.0.0-rc1"
22
+ VERSION = "2.0.0-rc2"
23
23
  end
data/teapot.gemspec CHANGED
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
33
33
  spec.add_dependency "rugged"
34
34
 
35
35
  spec.add_dependency "build", "~> 1.1"
36
- spec.add_dependency "build-files", "~> 1.0"
36
+ spec.add_dependency "build-files", "~> 1.3"
37
37
  spec.add_dependency "build-dependency", "~> 1.1"
38
38
  spec.add_dependency "build-uri", "~> 1.0"
39
39
  spec.add_dependency "build-text", "~> 1.0"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teapot
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre.rc1
4
+ version: 2.0.0.pre.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '1.0'
75
+ version: '1.3'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '1.0'
82
+ version: '1.3'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: build-dependency
85
85
  requirement: !ruby/object:Gem::Requirement