squared 0.6.2 → 0.6.3
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/CHANGELOG.md +40 -0
- data/README.md +23 -13
- data/lib/squared/common/base.rb +2 -2
- data/lib/squared/common/format.rb +39 -32
- data/lib/squared/common/prompt.rb +6 -4
- data/lib/squared/common/shell.rb +4 -4
- data/lib/squared/config.rb +6 -7
- data/lib/squared/version.rb +1 -1
- data/lib/squared/workspace/application.rb +72 -23
- data/lib/squared/workspace/project/base.rb +145 -83
- data/lib/squared/workspace/project/docker.rb +15 -15
- data/lib/squared/workspace/project/git.rb +74 -27
- data/lib/squared/workspace/project/node.rb +211 -109
- data/lib/squared/workspace/project/python.rb +9 -9
- data/lib/squared/workspace/project/ruby.rb +29 -34
- data/lib/squared/workspace/project/support/class.rb +36 -652
- data/lib/squared/workspace/project/support/optionpartition.rb +641 -0
- data/lib/squared/workspace/project.rb +0 -1
- data/lib/squared/workspace/repo.rb +23 -14
- data/lib/squared/workspace/series.rb +10 -8
- data/squared.gemspec +2 -2
- metadata +3 -3
- data/lib/squared/workspace/project/support.rb +0 -3
|
@@ -128,20 +128,20 @@ module Squared
|
|
|
128
128
|
task 'all' do |_, args|
|
|
129
129
|
stage ||= 'all'
|
|
130
130
|
ns['sync'].invoke(*args.to_a)
|
|
131
|
-
next if (
|
|
131
|
+
next if (n = env('REPO_STAGE')) == '1'
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
select do |proj|
|
|
134
134
|
next unless proj.enabled?(proj.workspace.baseref) && proj.global
|
|
135
135
|
|
|
136
136
|
proj.depend(sync: true) if proj.depend?
|
|
137
|
-
next if
|
|
137
|
+
next if n == '2'
|
|
138
138
|
|
|
139
139
|
proj.build?
|
|
140
140
|
end
|
|
141
|
-
.
|
|
141
|
+
.each do |proj|
|
|
142
142
|
proj.build(sync: true)
|
|
143
|
-
next if
|
|
144
|
-
next unless proj.copy? && (proj.dev? ||
|
|
143
|
+
next if n == '3'
|
|
144
|
+
next unless proj.copy? && (proj.dev? || n == '4')
|
|
145
145
|
|
|
146
146
|
if (ws = proj.workspace).task_defined?(target = task_join(proj.name, 'copy'))
|
|
147
147
|
task_invoke(target, **ws.invokeargs)
|
|
@@ -221,7 +221,7 @@ module Squared
|
|
|
221
221
|
end
|
|
222
222
|
|
|
223
223
|
def repo_manifest(path = root)
|
|
224
|
-
return unless (file = path
|
|
224
|
+
return unless (file = Pathname.new(path).join('.repo/manifest.xml')).exist?
|
|
225
225
|
|
|
226
226
|
require 'rexml/document'
|
|
227
227
|
doc = REXML::Document.new(file.read)
|
|
@@ -231,12 +231,19 @@ module Squared
|
|
|
231
231
|
def repo_confirm
|
|
232
232
|
return false unless root.directory?
|
|
233
233
|
|
|
234
|
-
path = sub_style
|
|
235
|
-
@repo_override = env('REPO_Y'
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
234
|
+
path = sub_style root, theme[:inline]
|
|
235
|
+
@repo_override = case env('REPO_Y')
|
|
236
|
+
when '0', 'false'
|
|
237
|
+
false
|
|
238
|
+
when '1', 'true'
|
|
239
|
+
true
|
|
240
|
+
else
|
|
241
|
+
Common::Prompt.confirm(
|
|
242
|
+
"#{log_title(:warn)} \"#{path}\" is not empty. Continue with installation?",
|
|
243
|
+
'N',
|
|
244
|
+
force: true, timeout: env('REPO_TIMEOUT', 15, ignore: '0')
|
|
245
|
+
)
|
|
246
|
+
end
|
|
240
247
|
end
|
|
241
248
|
|
|
242
249
|
def repo_run(cmd, exception: false)
|
|
@@ -255,7 +262,9 @@ module Squared
|
|
|
255
262
|
end
|
|
256
263
|
|
|
257
264
|
def repo?
|
|
258
|
-
|
|
265
|
+
return false unless manifest_url
|
|
266
|
+
|
|
267
|
+
repo_install? || @repo_override == true
|
|
259
268
|
end
|
|
260
269
|
|
|
261
270
|
def repo_submodules?(val = false)
|
|
@@ -79,14 +79,12 @@ module Squared
|
|
|
79
79
|
parent: Support.hashlist,
|
|
80
80
|
id: []
|
|
81
81
|
}
|
|
82
|
-
@data = {}
|
|
83
|
-
(TASK_BASE + TASK_KEYS).each { |key| @data[key] = [] }
|
|
84
82
|
end
|
|
85
83
|
|
|
86
84
|
def populate(proj, **)
|
|
87
85
|
group, parent, id = @session.values
|
|
88
86
|
ws = proj.workspace
|
|
89
|
-
|
|
87
|
+
each do |key, items|
|
|
90
88
|
next if exclude?(key) || (tasks = ws.task_resolve(proj, key)).empty?
|
|
91
89
|
|
|
92
90
|
if (g = proj.group)
|
|
@@ -108,9 +106,9 @@ module Squared
|
|
|
108
106
|
|
|
109
107
|
def build(parallel: [], pattern: [], **)
|
|
110
108
|
subcheck = ->(val) { (ns = task_namespace(val)) && parallel.include?(ns) }
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
109
|
+
update @session[:parent] if @session[:id].uniq.size > 1
|
|
110
|
+
update @session[:group]
|
|
111
|
+
each do |key, items|
|
|
114
112
|
next if exclude?(key, true) || @workspace.task_exclude?(t = name_get(key))
|
|
115
113
|
|
|
116
114
|
key = task_name t
|
|
@@ -156,6 +154,10 @@ module Squared
|
|
|
156
154
|
task key => prereqs
|
|
157
155
|
end
|
|
158
156
|
|
|
157
|
+
def reset
|
|
158
|
+
@data = {}.tap { |data| (TASK_BASE + TASK_KEYS).each { |key| data[key] = [] } }
|
|
159
|
+
end
|
|
160
|
+
|
|
159
161
|
def name_get(key)
|
|
160
162
|
(TASK_NAME[key] || key).to_s
|
|
161
163
|
end
|
|
@@ -169,7 +171,7 @@ module Squared
|
|
|
169
171
|
end
|
|
170
172
|
|
|
171
173
|
def some?(key)
|
|
172
|
-
return
|
|
174
|
+
return key?(key) && !self[key].empty? unless (batch = batch_get(key))
|
|
173
175
|
|
|
174
176
|
batch.each_value do |items|
|
|
175
177
|
return true if items.all? { |val| some?(val) || alias_get(val)&.any? { |_, alt| some?(alt) } }
|
|
@@ -226,7 +228,7 @@ module Squared
|
|
|
226
228
|
end
|
|
227
229
|
|
|
228
230
|
def exclude?(key, empty = false)
|
|
229
|
-
@exclude.include?(key) || (empty &&
|
|
231
|
+
@exclude.include?(key) || (empty && self[key].empty?)
|
|
230
232
|
end
|
|
231
233
|
|
|
232
234
|
private
|
data/squared.gemspec
CHANGED
|
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
|
8
8
|
spec.authors = ["An Pham"]
|
|
9
9
|
spec.email = ["anpham6@gmail.com"]
|
|
10
10
|
|
|
11
|
-
spec.summary =
|
|
12
|
-
spec.description =
|
|
11
|
+
spec.summary = "Rake task generator for managing multi-language workspaces."
|
|
12
|
+
spec.description = "Rake task generator for managing multi-language workspaces."
|
|
13
13
|
spec.homepage = "https://github.com/anpham6/squared-ruby"
|
|
14
14
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
|
|
15
15
|
spec.licenses = ["BSD-3-Clause"]
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: squared
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- An Pham
|
|
@@ -95,8 +95,8 @@ files:
|
|
|
95
95
|
- lib/squared/workspace/project/node.rb
|
|
96
96
|
- lib/squared/workspace/project/python.rb
|
|
97
97
|
- lib/squared/workspace/project/ruby.rb
|
|
98
|
-
- lib/squared/workspace/project/support.rb
|
|
99
98
|
- lib/squared/workspace/project/support/class.rb
|
|
99
|
+
- lib/squared/workspace/project/support/optionpartition.rb
|
|
100
100
|
- lib/squared/workspace/repo.rb
|
|
101
101
|
- lib/squared/workspace/series.rb
|
|
102
102
|
- lib/squared/workspace/support.rb
|
|
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
124
124
|
- !ruby/object:Gem::Version
|
|
125
125
|
version: '0'
|
|
126
126
|
requirements: []
|
|
127
|
-
rubygems_version: 3.
|
|
127
|
+
rubygems_version: 3.7.2
|
|
128
128
|
specification_version: 4
|
|
129
129
|
summary: Rake task generator for managing multi-language workspaces.
|
|
130
130
|
test_files: []
|