albacore 2.6.8 → 2.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bdd7da28f41d358858e327a54c3378cdf22778b8
4
- data.tar.gz: 442052d33e2d352603046db85fa044d893eab437
3
+ metadata.gz: aef5de193931f046bcf24674b1fad2bb6c1bb95e
4
+ data.tar.gz: c8dd8962e6ec0b0568aa177f868ed9d75957ec50
5
5
  SHA512:
6
- metadata.gz: 53ebedaaeca50e8bddae319591ac688f79d7bb189ae45f23762b73efe328b15c5916462b97fdad4b1d6b405d0979969bc3b1fe4d16cdf9fa6dcb60658ec2d827
7
- data.tar.gz: 083a1406657644e9ef0bc0df4369ad69da2aa71d6c63c9e184f6b926bd9f1175ec9b4b1805798ee21dd141bd69cd2f26d726b766e2707796ba6a2fdcda87921d
6
+ metadata.gz: 82f80d6e1e3dc636c19401d971c7751d4aef9bd550e91f55769fdc0cf51fbb64333fcdab2c64c2413c1b3367ed79bdbb65ebf533e5a95a261f784c886deba8d3
7
+ data.tar.gz: 9890885e7f6b3c618fdaf192f6968378df1321934d47716e70d76354c4933ea8efa181dc4810a8f430ff23f083d6459b605853363c8b8a0a37740461c210765a
@@ -79,6 +79,11 @@ module Albacore
79
79
  read_property 'License'
80
80
  end
81
81
 
82
+ # the target .NET Framework / .NET Standard version
83
+ def target_framework
84
+ read_property 'TargetFrameworkVersion'
85
+ end
86
+
82
87
  # gets the output path of the project given the configuration or raise
83
88
  # an error otherwise
84
89
  def output_path conf
@@ -145,7 +145,7 @@ and report a bug to albacore with the full output. Here's the nuget process outp
145
145
 
146
146
  def initialize
147
147
  @package = Albacore::NugetModel::Package.new
148
- @target = 'net40'
148
+ @target = ''
149
149
  @symbols = false
150
150
  @project_dependencies = true
151
151
  @nuget_dependencies = true
@@ -329,7 +329,10 @@ and report a bug to albacore with the full output. Here's the nuget process outp
329
329
  framework_dependencies = @opts.get(:package).metadata.framework_assemblies
330
330
  project_dependencies = @opts.get(:project_dependencies, true)
331
331
  nuget_dependencies = @opts.get(:nuget_dependencies, true)
332
- target = @opts.get :target
332
+ target = if '' == @opts.get(:target) then proj.target_framework else @opts.get :target end
333
+ if target.start_with? 'v'
334
+ target = "net#{target[1..target.size].gsub('.', '')}"
335
+ end
333
336
 
334
337
  trace "creating NON-SYMBOL package for '#{proj.name}', targeting '#{target}' [nugets pack: task]"
335
338
  nuspec = Albacore::NugetModel::Package.from_xxproj proj,
@@ -1,3 +1,3 @@
1
1
  module Albacore
2
- VERSION = "2.6.8"
2
+ VERSION = "2.7.0"
3
3
  end
@@ -9,10 +9,13 @@ require 'albacore/nuget_model'
9
9
 
10
10
  include ::Albacore::NugetsPack
11
11
 
12
+ # The .NET Framework / .NET Standard specified by default
13
+ DEFAULT_FRAMEWORK = 'net461'
14
+
12
15
  class ConfigFac
13
- def self.create id, curr, gen_symbols = true
16
+ def self.create id, curr, target, gen_symbols = true
14
17
  cfg = Albacore::NugetsPack::Config.new
15
- cfg.target = 'mono32'
18
+ cfg.target = target
16
19
  cfg.configuration = 'Debug'
17
20
  cfg.files = Dir.glob(File.join(curr, 'testdata', 'Project', '*.fsproj'))
18
21
  cfg.out = 'spec/testdata/pkg'
@@ -48,7 +51,7 @@ shared_context 'pack_config' do
48
51
  File.dirname(__FILE__)
49
52
  end
50
53
  let :config do
51
- cfg = ConfigFac.create id, curr, true
54
+ cfg = ConfigFac.create id, curr, DEFAULT_FRAMEWORK, true
52
55
  end
53
56
  end
54
57
 
@@ -60,7 +63,7 @@ shared_context 'pack_config no symbols' do
60
63
  File.dirname(__FILE__)
61
64
  end
62
65
  let :config do
63
- cfg = ConfigFac.create id, curr, false
66
+ cfg = ConfigFac.create id, curr, DEFAULT_FRAMEWORK, false
64
67
  end
65
68
  end
66
69
 
@@ -229,12 +232,12 @@ end
229
232
 
230
233
  # testing project task
231
234
 
232
- describe ProjectTask do
235
+ describe ProjectTask, 'when target framework is specified' do
233
236
  include_context 'pack_config no symbols'
234
237
  include_context 'package_metadata_dsl'
235
238
 
236
- it 'sanity: should have config with target=mono32' do
237
- expect(config.opts().get(:target)).to eq('mono32')
239
+ it "sanity: should have config with target=#{DEFAULT_FRAMEWORK}" do
240
+ expect(config.opts().get(:target)).to eq(DEFAULT_FRAMEWORK)
238
241
  end
239
242
 
240
243
  let :projfile do
@@ -247,7 +250,26 @@ describe ProjectTask do
247
250
  ProjectTask.new( config.opts() ).send(:create_nuspec, proj, [])[0] # index0 first nuspec Alabacore::Package
248
251
  end
249
252
 
250
- has_file 'bin/Debug/Project.dll', 'lib/mono32'
253
+ has_file 'bin/Debug/Project.dll', "lib/#{DEFAULT_FRAMEWORK}"
254
+ end
255
+
256
+ describe ProjectTask, 'when target framework is unspecified' do
257
+ include_context 'pack_config no symbols'
258
+ include_context 'package_metadata_dsl'
259
+
260
+ let :projfile do
261
+ curr = File.dirname(__FILE__)
262
+ File.join curr, "testdata", "Project", "Project.fsproj"
263
+ end
264
+ let :vanilla_config do
265
+ cfg = ConfigFac.create id, curr, '', false
266
+ end
267
+ subject do
268
+ proj = Albacore::Project.new projfile
269
+ ProjectTask.new( vanilla_config.opts() ).send(:create_nuspec, proj, [])[0] # index0 first nuspec Alabacore::Package
270
+ end
271
+
272
+ has_file 'bin/Debug/Project.dll', 'lib/net45'
251
273
  end
252
274
 
253
275
  describe ProjectTask, "when testing public interface" do
data/spec/project_spec.rb CHANGED
@@ -68,7 +68,10 @@ describe Albacore::Project, "when reading project file" do
68
68
  it "should contain library1" do
69
69
  expect(library1).to_not be_nil
70
70
  end
71
-
71
+ it 'should contain the target framework' do
72
+ expect(subject.target_framework).to eq "v4.5"
73
+ end
74
+
72
75
  describe 'public API' do
73
76
  it do
74
77
  expect(subject).to respond_to :name
@@ -85,6 +88,15 @@ describe Albacore::Project, "when reading project file" do
85
88
  it do
86
89
  expect(subject).to respond_to :authors
87
90
  end
91
+ it do
92
+ expect(subject).to respond_to :description
93
+ end
94
+ it do
95
+ expect(subject).to respond_to :license
96
+ end
97
+ it do
98
+ expect(subject).to respond_to :target_framework
99
+ end
88
100
  it 'should have five referenced assemblies' do
89
101
  expect(subject.find_refs.length).to eq 5
90
102
  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.8
4
+ version: 2.7.0
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: 2017-05-23 00:00:00.000000000 Z
12
+ date: 2017-06-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake