Skip to content

Commit b70ba77

Browse files
author
Daniel Grim
authored
Merge pull request #64 from degrim/UseDotnetPreview2
Add Preview2 dependency
2 parents 6099e48 + 0975c4e commit b70ba77

File tree

9 files changed

+38
-22
lines changed

9 files changed

+38
-22
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"projects": [ "src", "test" ],
3+
"sdk": {
4+
"version": "1.0.0-preview1-002702"
5+
}
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"projects": [ "src", "test" ],
3+
"sdk": {
4+
"version": "1.0.0-preview1-002702"
5+
}
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"projects": [ "src", "test" ],
3+
"sdk": {
4+
"version": "1.0.0-preview1-002702"
5+
}
6+
}

cf_spec/integration/deploy_aspnet5_app_spec.rb renamed to cf_spec/integration/deploy_dotnetcore_app_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
$LOAD_PATH << 'cf_spec'
22
require 'spec_helper'
33

4-
describe 'CF Asp.Net5 Buildpack' do
4+
describe 'CF ASP.NET Core Buildpack' do
55
subject(:app) { Machete.deploy_app(app_name) }
66
let(:browser) { Machete::Browser.new(app) }
77

lib/buildpack/compile/dotnet_installer.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@
1919

2020
module AspNetCoreBuildpack
2121
class DotnetInstaller
22-
VERSION = '1.0.0-preview1-002702'.freeze
23-
2422
def initialize(shell)
2523
@shell = shell
2624
end
2725

2826
def install(dir, out)
27+
@version = DotnetVersion.new.version(dir, out)
2928
dest_dir = "#{dir}/.dotnet"
3029

3130
out.print("dotnet version: #{version}")
@@ -41,10 +40,6 @@ def should_install(dir)
4140
true
4241
end
4342

44-
def version
45-
VERSION
46-
end
47-
4843
private
4944

5045
def buildpack_root
@@ -55,5 +50,7 @@ def buildpack_root
5550
def dependency_name
5651
"dotnet-dev-ubuntu-x64.#{version}.tar.gz"
5752
end
53+
54+
attr_reader :version
5855
end
5956
end

lib/buildpack/compile/dotnet_version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
module AspNetCoreBuildpack
2020
class DotnetVersion
2121
DOTNET_VERSION_FILE_NAME = 'global.json'.freeze
22-
DEFAULT_DOTNET_VERSION = 'latest'.freeze
22+
DEFAULT_DOTNET_VERSION = '1.0.0-preview2-003121'.freeze
2323

2424
def version(dir, out)
2525
dotnet_version = DEFAULT_DOTNET_VERSION

manifest.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,29 @@ url_to_dependency_map:
55
- match: libunwind-(.*)-(\d+\.\d+)
66
name: libunwind
77
version: $2
8-
- match: dotnet-dev-ubuntu-x64\.([\w\.-]+)\.tar\.gz
8+
- match: dotnet-dev-ubuntu-x64\.(.*)\.tar\.gz
99
name: dotnet
10-
version: 1.0.0-preview1-002702
10+
version: $1
1111

1212
dependencies:
1313
- name: libunwind
1414
version: 1.1
1515
cf_stacks:
1616
- cflinuxfs2
17-
uri: https://github.com/cloudfoundry-community/asp.net5-buildpack/releases/download/v0.7/libunwind-cflinuxfs2-1.1.tar.gz
17+
uri: https://github.com/cloudfoundry-community/dotnet-core-buildpack/releases/download/v0.7/libunwind-cflinuxfs2-1.1.tar.gz
1818
md5: b76452a8a2400f3cfdf189761e8be97e
1919
- name: dotnet
2020
version: 1.0.0-preview1-002702
2121
cf_stacks:
2222
- cflinuxfs2
23-
uri: https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/1.0.0-preview1-002702/dotnet-dev-ubuntu-x64.1.0.0-preview1-002702.tar.gz
24-
md5: 38b8ee1062cd3b967237309707fb4b04
23+
uri: https://go.microsoft.com/fwlink/?LinkID=798405
24+
md5: 44d1dcae69a11976cfc6facc83b3aa49
25+
- name: dotnet
26+
version: 1.0.0-preview2-003121
27+
cf_stacks:
28+
- cflinuxfs2
29+
uri: https://go.microsoft.com/fwlink/?LinkID=809129
30+
md5: 301bf94c4253c6e07826dd6e1d79821f
2531

2632
exclude_files:
2733
- .git/

spec/buildpack/compile/dotnet_installer_spec.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@
2323
let(:out) { double(:out) }
2424
subject(:installer) { AspNetCoreBuildpack::DotnetInstaller.new(shell) }
2525

26-
describe '#version' do
27-
it 'has a default version' do
28-
expect(subject.version).to eq('1.0.0-preview1-002702')
29-
end
30-
end
31-
3226
describe '#install' do
3327
it 'downloads file with compile-extensions' do
3428
allow(shell).to receive(:exec).and_return(0)

spec/buildpack/compile/dotnet_version_spec.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@
2121
describe AspNetCoreBuildpack::DotnetVersion do
2222
let(:out) { double(:out) }
2323
let(:dir) { Dir.mktmpdir }
24+
let(:latest_version) { '1.0.0-preview2-003121'.freeze }
2425

2526
describe '#version' do
2627
context 'global.json does not exist' do
2728
it 'resolves to the latest version' do
28-
expect(subject.version(dir, out)).to eq('latest')
29+
expect(subject.version(dir, out)).to eq(latest_version)
2930
end
3031
end
3132

@@ -59,7 +60,7 @@
5960

6061
it 'warns and resolves to the latest version' do
6162
expect(out).to receive(:warn).with("File #{dir}/global.json is not valid JSON")
62-
expect(subject.version(dir, out)).to eq('latest')
63+
expect(subject.version(dir, out)).to eq(latest_version)
6364
end
6465
end
6566

@@ -70,7 +71,7 @@
7071
end
7172

7273
it 'resolves to the latest version' do
73-
expect(subject.version(dir, out)).to eq('latest')
74+
expect(subject.version(dir, out)).to eq(latest_version)
7475
end
7576
end
7677
end

0 commit comments

Comments
 (0)