albacore 2.6.1 → 2.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/albacore/dsl.rb +6 -3
- data/lib/albacore/solution.rb +47 -0
- data/lib/albacore/task_types/build.rb +16 -3
- data/lib/albacore/task_types/nugets_pack.rb +25 -14
- data/lib/albacore/version.rb +1 -1
- data/spec/build_spec.rb +2 -2
- data/spec/solution_spec.rb +31 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 636b34273ba679dfc811c86b1208f0ff3e4813db
|
4
|
+
data.tar.gz: 1339fe8c9b9022e29f4eb13ee0c727f9d32ee7f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cb3b3b0c1f1faac2bbdf2bf7f00bbe865432ab2b26ae39fea051b2bfcf95c4583c52332094e8196ca4a86575dc869ff5dba23495f2d321c5baed85f203e1a62
|
7
|
+
data.tar.gz: c5f0128d0d3af334102449d2223d66be96f437698287506dcaa5f8c9d517ea4360839dcb406e2974195564fbb12e07bb899e55e90fbbb6e2ca3b29b969cb638f
|
data/lib/albacore/dsl.rb
CHANGED
@@ -41,8 +41,11 @@ module Albacore
|
|
41
41
|
yield c, own_args
|
42
42
|
|
43
43
|
fail "unable to find MsBuild or XBuild" unless c.exe
|
44
|
-
|
45
|
-
|
44
|
+
|
45
|
+
c.files.each do |f|
|
46
|
+
command = Albacore::Build::Cmd.new(c.work_dir, c.exe, c.params_for_file(f))
|
47
|
+
Albacore::Build::Task.new(command).execute
|
48
|
+
end
|
46
49
|
end
|
47
50
|
end
|
48
51
|
|
@@ -53,7 +56,7 @@ module Albacore
|
|
53
56
|
c = Albacore::NugetsRestore::Config.new
|
54
57
|
yield c, own_args
|
55
58
|
|
56
|
-
c.ensure_authentication!
|
59
|
+
c.ensure_authentication!
|
57
60
|
|
58
61
|
c.packages.each do |p|
|
59
62
|
command = Albacore::NugetsRestore::Cmd.new(c.work_dir, c.exe, c.opts_for_pkgcfg(p))
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'albacore/logging'
|
2
|
+
require 'albacore/project'
|
3
|
+
|
4
|
+
module Albacore
|
5
|
+
# a solution encapsulates the properties from a sln file.
|
6
|
+
class Solution
|
7
|
+
include Logging
|
8
|
+
|
9
|
+
attr_reader :path_base, :filename, :content
|
10
|
+
|
11
|
+
def initialize path
|
12
|
+
raise ArgumentError, 'solution path does not exist' unless File.exists? path.to_s
|
13
|
+
path = path.to_s unless path.is_a? String
|
14
|
+
@content = open(path)
|
15
|
+
@path_base, @filename = File.split path
|
16
|
+
end
|
17
|
+
|
18
|
+
def projects
|
19
|
+
project_paths.map { |path| File.join(@path_base, path) }
|
20
|
+
.select { |path| File.file?(path) }
|
21
|
+
.map {|path| Albacore::Project.new(File.absolute_path(path)) }
|
22
|
+
end
|
23
|
+
|
24
|
+
def project_paths
|
25
|
+
project_matches.map { |matches| matches[:location] }
|
26
|
+
.select { |path| File.extname(path).end_with? 'proj' }
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
# get the path of the solution file
|
31
|
+
def path
|
32
|
+
File.join @path_base, @filename
|
33
|
+
end
|
34
|
+
|
35
|
+
# Gets the path of the solution file
|
36
|
+
def to_s
|
37
|
+
path
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def project_matches
|
43
|
+
project_regexp = /^\s*Project\(.+\) = "(?<name>.+?)", "(?<location>.+?)", "(?<guid>.+?)"/
|
44
|
+
@content.map { |line| project_regexp.match(line) }.reject(&:nil?)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -42,6 +42,8 @@ module Albacore
|
|
42
42
|
|
43
43
|
w = lambda { |e| CrossPlatformCmd.which(e) ? e : nil }
|
44
44
|
|
45
|
+
@files = []
|
46
|
+
|
45
47
|
@exe = w.call( "xbuild" ) ||
|
46
48
|
w.call( "msbuild" ) ||
|
47
49
|
heuristic_executable
|
@@ -54,9 +56,11 @@ module Albacore
|
|
54
56
|
'minimal')
|
55
57
|
end
|
56
58
|
|
59
|
+
attr_accessor :files
|
60
|
+
|
57
61
|
# this is the solution file to build (or the project files themselves)
|
58
62
|
attr_path_accessor :sln, :file do |val|
|
59
|
-
@
|
63
|
+
@files.concat [*val]
|
60
64
|
end
|
61
65
|
|
62
66
|
# Call for each target that you want to add, or pass an array or
|
@@ -100,7 +104,6 @@ module Albacore
|
|
100
104
|
set_logging mode
|
101
105
|
end
|
102
106
|
|
103
|
-
|
104
107
|
# Gets or sets a target .NET Framework version to build the project with, which
|
105
108
|
# enables an MSBuild task to build a project that targets a different version of
|
106
109
|
# the .NET Framework than the one specified in the project. Valid values are 2.0,
|
@@ -145,6 +148,11 @@ module Albacore
|
|
145
148
|
@parameters.add "/nologo"
|
146
149
|
end
|
147
150
|
|
151
|
+
def params_for_file file
|
152
|
+
update_file file
|
153
|
+
@parameters
|
154
|
+
end
|
155
|
+
|
148
156
|
private
|
149
157
|
def set_logging mode
|
150
158
|
modes = %w{quiet minimal normal detailed diagnostic}.collect{ |m| "/verbosity:#{m}" }
|
@@ -169,6 +177,12 @@ module Albacore
|
|
169
177
|
@parameters.add "/#{prop_name}:#{callable_prop_val.call}"
|
170
178
|
end
|
171
179
|
|
180
|
+
# There can be only one
|
181
|
+
def update_file val
|
182
|
+
@parameters.delete_if { |param| File.file? param }
|
183
|
+
@parameters.add ::Albacore::Paths.normalise_slashes val
|
184
|
+
end
|
185
|
+
|
172
186
|
def make_target
|
173
187
|
@targets.join(';')
|
174
188
|
end
|
@@ -195,7 +209,6 @@ module Albacore
|
|
195
209
|
end
|
196
210
|
CrossPlatformCmd.which(msb) ? msb : nil
|
197
211
|
end
|
198
|
-
|
199
212
|
end
|
200
213
|
class Task
|
201
214
|
def initialize command_line
|
@@ -40,6 +40,7 @@ module Albacore
|
|
40
40
|
|
41
41
|
pars = original_pars.dup
|
42
42
|
pars << nuspec_file
|
43
|
+
pars << '-NoPackageAnalysis' unless @opts.get :package_analysis
|
43
44
|
pkg = get_nuget_path_of do
|
44
45
|
system @executable, pars, :work_dir => @work_dir
|
45
46
|
end
|
@@ -49,9 +50,9 @@ module Albacore
|
|
49
50
|
# if the symbols flag is set and there's a symbols file specified
|
50
51
|
# then run NuGet.exe to generate the .symbols.nupkg file
|
51
52
|
if nuspec_symbols_file
|
52
|
-
pars = original_pars.dup
|
53
|
-
pars << '-Symbols'
|
54
|
-
pars << nuspec_symbols_file
|
53
|
+
pars = original_pars.dup
|
54
|
+
pars << '-Symbols'
|
55
|
+
pars << nuspec_symbols_file
|
55
56
|
spkg = with_subterfuge pkg do
|
56
57
|
get_nuget_path_of do
|
57
58
|
system @executable, pars, :work_dir => @work_dir
|
@@ -103,7 +104,7 @@ and report a bug to albacore with the full output. Here's the nuget process outp
|
|
103
104
|
res
|
104
105
|
end
|
105
106
|
end
|
106
|
-
|
107
|
+
|
107
108
|
# This tasktype allows you to quickly package project files to nuget
|
108
109
|
# packages.
|
109
110
|
#
|
@@ -135,7 +136,7 @@ and report a bug to albacore with the full output. Here's the nuget process outp
|
|
135
136
|
attr_writer :files
|
136
137
|
|
137
138
|
# sets the nuspec file
|
138
|
-
attr_writer :nuspec
|
139
|
+
attr_writer :nuspec
|
139
140
|
|
140
141
|
|
141
142
|
# sets the MsBuild configuration that is used to produce the output into
|
@@ -148,6 +149,7 @@ and report a bug to albacore with the full output. Here's the nuget process outp
|
|
148
149
|
@symbols = false
|
149
150
|
@project_dependencies = true
|
150
151
|
@nuget_dependencies = true
|
152
|
+
@package_analysis = true
|
151
153
|
@leave_nuspec = false
|
152
154
|
fill_required
|
153
155
|
end
|
@@ -185,6 +187,12 @@ and report a bug to albacore with the full output. Here's the nuget process outp
|
|
185
187
|
@nuget_dependencies = false
|
186
188
|
end
|
187
189
|
|
190
|
+
# call this if you want to disable NuGet's package analysis
|
191
|
+
# when creating the nupkg file
|
192
|
+
def no_package_analysis
|
193
|
+
@package_analysis = false
|
194
|
+
end
|
195
|
+
|
188
196
|
def nuget_gem_exe
|
189
197
|
@exe = Albacore::Nugets::find_nuget_gem_exe
|
190
198
|
end
|
@@ -195,7 +203,7 @@ and report a bug to albacore with the full output. Here's the nuget process outp
|
|
195
203
|
|
196
204
|
unless @nuspec
|
197
205
|
[:authors, :description, :version].each do |required|
|
198
|
-
warn "metadata##{required} is missing from nugets_pack [nugets pack: config]" if @package.metadata.send(required) == 'MISSING'
|
206
|
+
warn "metadata##{required} is missing from nugets_pack [nugets pack: config]" if @package.metadata.send(required) == 'MISSING'
|
199
207
|
end
|
200
208
|
end
|
201
209
|
|
@@ -210,6 +218,7 @@ and report a bug to albacore with the full output. Here's the nuget process outp
|
|
210
218
|
:configuration => @configuration,
|
211
219
|
:project_dependencies => @project_dependencies,
|
212
220
|
:nuget_dependencies => @nuget_dependencies,
|
221
|
+
:package_analysis => @package_analysis,
|
213
222
|
:original_path => FileUtils.pwd,
|
214
223
|
:leave_nuspec => @leave_nuspec
|
215
224
|
})
|
@@ -230,7 +239,7 @@ and report a bug to albacore with the full output. Here's the nuget process outp
|
|
230
239
|
include Logging
|
231
240
|
|
232
241
|
def initialize opts, &before_execute
|
233
|
-
|
242
|
+
|
234
243
|
unless opts.get(:nuspec)
|
235
244
|
raise ArgumentError, 'opts is not a map' unless opts.is_a? Map
|
236
245
|
raise ArgumentError, 'no files given' unless opts.get(:files).length > 0
|
@@ -316,7 +325,7 @@ and report a bug to albacore with the full output. Here's the nuget process outp
|
|
316
325
|
target = @opts.get :target
|
317
326
|
|
318
327
|
trace "creating NON-SYMBOL package for '#{proj.name}', targeting '#{target}' [nugets pack: task]"
|
319
|
-
nuspec = Albacore::NugetModel::Package.from_xxproj proj,
|
328
|
+
nuspec = Albacore::NugetModel::Package.from_xxproj proj,
|
320
329
|
symbols: false,
|
321
330
|
verify_files: true,
|
322
331
|
dotnet_version: target,
|
@@ -368,10 +377,12 @@ and report a bug to albacore with the full output. Here's the nuget process outp
|
|
368
377
|
out = path_to(@opts.get(:out), cwd)
|
369
378
|
nuspec = path_to nuspec, cwd
|
370
379
|
nuspec_symbols = path_to nuspec_symbols, cwd if nuspec_symbols
|
371
|
-
|
380
|
+
|
372
381
|
cmd = Albacore::NugetsPack::Cmd.new exe,
|
373
|
-
work_dir:
|
374
|
-
out:
|
382
|
+
work_dir: cwd,
|
383
|
+
out: out,
|
384
|
+
package_analysis: @opts.get(:package_analysis)
|
385
|
+
|
375
386
|
|
376
387
|
# run any concerns that modify the command
|
377
388
|
@before_execute.call cmd if @before_execute
|
@@ -398,14 +409,14 @@ and report a bug to albacore with the full output. Here's the nuget process outp
|
|
398
409
|
:nuspec => nuspec,
|
399
410
|
:nupkg => nuget,
|
400
411
|
:location => nuget
|
401
|
-
)
|
412
|
+
)
|
402
413
|
end
|
403
414
|
|
404
415
|
def self.accept? f
|
405
416
|
File.extname(f).downcase != '.nuspec'
|
406
417
|
end
|
407
418
|
end
|
408
|
-
|
419
|
+
|
409
420
|
# generate a nuget from a nuspec
|
410
421
|
class NuspecTask
|
411
422
|
include Logging
|
@@ -451,4 +462,4 @@ and report a bug to albacore with the full output. Here's the nuget process outp
|
|
451
462
|
end
|
452
463
|
end
|
453
464
|
end
|
454
|
-
end
|
465
|
+
end
|
data/lib/albacore/version.rb
CHANGED
data/spec/build_spec.rb
CHANGED
@@ -7,7 +7,7 @@ describe 'build config' do
|
|
7
7
|
subject do
|
8
8
|
Albacore::Build::Config.new
|
9
9
|
end
|
10
|
-
%w[file= sln= target target= logging logging= prop cores cores= tools_version tools_version=].each do |writer|
|
10
|
+
%w[files= file= sln= target target= logging logging= prop cores cores= tools_version tools_version=].each do |writer|
|
11
11
|
it "should respond to :#{writer}" do
|
12
12
|
expect(subject).to respond_to(:"#{writer}")
|
13
13
|
end
|
@@ -42,6 +42,7 @@ describe 'when running with sln' do
|
|
42
42
|
|
43
43
|
before do
|
44
44
|
cfg.sln = 'src/HelloWorld.sln'
|
45
|
+
cfg.params_for_file cfg.sln
|
45
46
|
cfg.target = %w|Clean Build|
|
46
47
|
cmd.execute
|
47
48
|
end
|
@@ -60,4 +61,3 @@ describe 'when running with sln' do
|
|
60
61
|
expect(subject.is_mono_command?).to be false
|
61
62
|
end
|
62
63
|
end
|
63
|
-
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'albacore/solution'
|
3
|
+
require 'albacore/project'
|
4
|
+
|
5
|
+
describe Albacore::Solution, "when reading solution file" do
|
6
|
+
def solution_path
|
7
|
+
File.expand_path('../testdata/Project/Project.sln', __FILE__)
|
8
|
+
end
|
9
|
+
subject do
|
10
|
+
Albacore::Solution.new solution_path
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should contain Project path in project_paths" do
|
14
|
+
expect(subject.project_paths).to include 'Project.fsproj'
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should contain Project in projects" do
|
18
|
+
project_path = File.expand_path('../testdata/Project/Project.fsproj', __FILE__)
|
19
|
+
project = Albacore::Project.new project_path
|
20
|
+
expect(subject.projects.map { |p| p.id }).to include project.id
|
21
|
+
end
|
22
|
+
|
23
|
+
describe 'public API' do
|
24
|
+
it do
|
25
|
+
expect(subject).to respond_to :projects
|
26
|
+
end
|
27
|
+
it do
|
28
|
+
expect(subject).to respond_to :project_paths
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: albacore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.
|
4
|
+
version: 2.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henrik Feldt
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-09-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -151,6 +151,7 @@ files:
|
|
151
151
|
- "./lib/albacore/project.rb"
|
152
152
|
- "./lib/albacore/rake_overrides.rb"
|
153
153
|
- "./lib/albacore/semver.rb"
|
154
|
+
- "./lib/albacore/solution.rb"
|
154
155
|
- "./lib/albacore/task_types/asmver.rb"
|
155
156
|
- "./lib/albacore/task_types/asmver/cpp.rb"
|
156
157
|
- "./lib/albacore/task_types/asmver/cs.rb"
|
@@ -219,6 +220,7 @@ files:
|
|
219
220
|
- spec/shared_contexts.rb
|
220
221
|
- spec/smoke_require_spec.rb
|
221
222
|
- spec/smoke_spec.rb
|
223
|
+
- spec/solution_spec.rb
|
222
224
|
- spec/spec_helper.rb
|
223
225
|
- spec/sql_cmd_spec.rb
|
224
226
|
- spec/sql_package_spec.rb
|
@@ -418,7 +420,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
418
420
|
version: '0'
|
419
421
|
requirements: []
|
420
422
|
rubyforge_project: albacore
|
421
|
-
rubygems_version: 2.
|
423
|
+
rubygems_version: 2.5.1
|
422
424
|
signing_key:
|
423
425
|
specification_version: 4
|
424
426
|
summary: Dolphin-safe and awesome Mono and .Net Rake-tasks
|
@@ -461,6 +463,7 @@ test_files:
|
|
461
463
|
- spec/shared_contexts.rb
|
462
464
|
- spec/smoke_require_spec.rb
|
463
465
|
- spec/smoke_spec.rb
|
466
|
+
- spec/solution_spec.rb
|
464
467
|
- spec/spec_helper.rb
|
465
468
|
- spec/sql_cmd_spec.rb
|
466
469
|
- spec/sql_package_spec.rb
|