Skip to content

Commit 365b343

Browse files
committed
Fixing build; marking 6.0
1 parent 53cbf97 commit 365b343

File tree

8 files changed

+23
-77
lines changed

8 files changed

+23
-77
lines changed

default.ps1

Lines changed: 12 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ properties {
1010

1111

1212
task default -depends local
13-
task local -depends init, compile, test
13+
task local -depends compile, test
1414
task ci -depends clean, release, local, benchmark
1515

1616
task clean {
@@ -28,16 +28,23 @@ task release {
2828
}
2929

3030
task compile -depends clean {
31-
$version = if ($env:APPVEYOR_BUILD_NUMBER -ne $NULL) { $env:APPVEYOR_BUILD_NUMBER } else { '0' }
32-
$version = "{0:D5}" -f [convert]::ToInt32($version, 10)
31+
32+
$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL];
33+
$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
34+
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "master" -and $revision -ne "local"]
35+
$commitHash = $(git rev-parse --short HEAD)
36+
$buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""]
37+
38+
echo "build: Package version suffix is $suffix"
39+
echo "build: Build version suffix is $buildSuffix"
3340

3441
exec { .\src\.nuget\nuget.exe restore $source_dir\AutoMapper.sln }
3542

3643
exec { dotnet restore $source_dir\AutoMapper.sln }
3744

38-
exec { dotnet build $source_dir\AutoMapper.sln -c $config -v q /nologo }
45+
exec { dotnet build $source_dir\AutoMapper.sln -c $config --version-suffix=$buildSuffix -v q /nologo }
3946

40-
exec { dotnet pack $source_dir\AutoMapper -c $config --version-suffix $version}
47+
exec { dotnet pack $source_dir\AutoMapper -c $config --include-symbols --no-build --version-suffix=$suffix }
4148
}
4249

4350
task benchmark {
@@ -57,39 +64,3 @@ task test {
5764
exec { & $testRunner $source_dir/UnitTests/bin/$config/AutoMapper.UnitTests.Net4.dll }
5865
exec { & $testRunner $source_dir/IntegrationTests.Net4/bin/$config/AutoMapper.IntegrationTests.Net4.dll }
5966
}
60-
61-
function Install-Dotnet
62-
{
63-
$dotnetcli = where-is('dotnet')
64-
65-
if($dotnetcli -eq $null)
66-
{
67-
$dotnetPath = "$pwd\.dotnet"
68-
$dotnetCliVersion = if ($env:DOTNET_CLI_VERSION -eq $null) { 'Latest' } else { $env:DOTNET_CLI_VERSION }
69-
$dotnetInstallScriptUrl = 'https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/install.ps1'
70-
$dotnetInstallScriptPath = '.\scripts\obtain\install.ps1'
71-
72-
md -Force ".\scripts\obtain\" | Out-Null
73-
curl $dotnetInstallScriptUrl -OutFile $dotnetInstallScriptPath
74-
& .\scripts\obtain\install.ps1 -Channel "preview" -version $dotnetCliVersion -InstallDir $dotnetPath -NoPath
75-
$env:Path = "$dotnetPath;$env:Path"
76-
}
77-
}
78-
79-
function where-is($command) {
80-
(ls env:\path).Value.split(';') | `
81-
where { $_ } | `
82-
%{ [System.Environment]::ExpandEnvironmentVariables($_) } | `
83-
where { test-path $_ } |`
84-
%{ ls "$_\*" -include *.bat,*.exe,*cmd } | `
85-
%{ $file = $_.Name; `
86-
if($file -and ($file -eq $command -or `
87-
$file -eq ($command + '.exe') -or `
88-
$file -eq ($command + '.bat') -or `
89-
$file -eq ($command + '.cmd'))) `
90-
{ `
91-
$_.FullName `
92-
} `
93-
} | `
94-
select -unique
95-
}

src/AutoMapper/AutoMapper.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4+
<Summary>A convention-based object-object mapper</Summary>
45
<Description>A convention-based object-object mapper. AutoMapper uses a fluent configuration API to define an object-object mapping strategy. AutoMapper uses a convention-based matching algorithm to match up source to destination values. Currently, AutoMapper is designed for model projection scenarios to flatten complex object models to DTOs and other simple objects, whose design is better suited for serialization, communication, messaging, or simply an anti-corruption layer between the domain and application layer.</Description>
56
<VersionPrefix>6.0.0</VersionPrefix>
67
<Authors>Jimmy Bogard</Authors>
@@ -17,7 +18,7 @@
1718
<PackageProjectUrl>http://automapper.org</PackageProjectUrl>
1819
<PackageLicenseUrl>https://github.com/AutoMapper/AutoMapper/blob/master/LICENSE.txt</PackageLicenseUrl>
1920
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
20-
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
21+
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
2122
</PropertyGroup>
2223

2324
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">

src/AutoMapper/Configuration/MapperConfigurationExpression.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public NamedProfile(string profileName, Action<IProfileExpression> config) : bas
3636

3737
public void AddProfile(Profile profile)
3838
{
39-
profile.Initialize();
4039
_profiles.Add(profile);
4140
}
4241

src/AutoMapper/Profile.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -182,16 +182,6 @@ public void IncludeSourceExtensionMethods(Type type)
182182
m.GetParameters().Length == 1));
183183
}
184184

185-
[Obsolete(
186-
"Create a constructor and configure inside of your profile's constructor instead. Will be removed in 6.0")]
187-
protected virtual void Configure()
188-
{
189-
}
190-
191-
#pragma warning disable 618
192-
internal void Initialize() => Configure();
193-
#pragma warning restore 618
194-
195185
private IMappingExpression<TSource, TDestination> CreateMappingExpression<TSource, TDestination>(
196186
MemberList memberList)
197187
{

src/AutoMapperSamples/Configuration/Profiles.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class OrderEditViewModel
2626

2727
public class ViewModelProfile : Profile
2828
{
29-
protected override void Configure()
29+
public ViewModelProfile()
3030
{
3131
CreateMap<Order, OrderListViewModel>();
3232

src/UnitTests/ConvensionTest.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,20 @@ public void Fact()
5656

5757
public class ConventionProfile : Profile
5858
{
59-
protected override void Configure()
59+
public ConventionProfile()
6060
{
6161
AddMemberConfiguration().AddName<PrePostfixName>(
62-
_ => _.AddStrings(p => p.DestinationPostfixes, "Transfer")
63-
.AddStrings(p => p.Postfixes, "Transfer")
64-
.AddStrings(p => p.DestinationPrefixes, "Trans")
65-
.AddStrings(p => p.Prefixes, "Trans"));
62+
_ => _.AddStrings(p => p.DestinationPostfixes, "Transfer")
63+
.AddStrings(p => p.Postfixes, "Transfer")
64+
.AddStrings(p => p.DestinationPrefixes, "Trans")
65+
.AddStrings(p => p.Prefixes, "Trans"));
6666
AddConditionalObjectMapper().Where((s, d) => s.Name.Contains(d.Name) || d.Name.Contains(s.Name));
6767
}
6868
}
6969

7070
public class ToDTO : Profile
7171
{
72-
protected override void Configure()
72+
public ToDTO()
7373
{
7474
AddMemberConfiguration().AddName<PrePostfixName>(
7575
_ => _.AddStrings(p => p.Postfixes, "Transfer")
@@ -79,7 +79,7 @@ protected override void Configure()
7979
}
8080
public class FromDTO : Profile
8181
{
82-
protected override void Configure()
82+
public FromDTO()
8383
{
8484
AddMemberConfiguration().AddName<PrePostfixName>(
8585
_ => _.AddStrings(p => p.DestinationPostfixes, "Transfer")

src/UnitTests/MappingInheritance/IncludeBaseShouldNotCreateMaps.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class Dest : BaseDest { }
2020

2121
public class TestProfile : Profile
2222
{
23-
protected override void Configure()
23+
public TestProfile()
2424
{
2525
CreateMap<BaseSource, BaseDest>();
2626
CreateMap<Source, Dest>()

src/UnitTests/Tests/TypeMapFactorySpecs.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,6 @@ protected override void Establish_context()
5555
private class TestProfile : Profile
5656
{
5757
public override string ProfileName => "Test";
58-
59-
protected override void Configure()
60-
{
61-
62-
}
6358
}
6459

6560
[Fact]
@@ -102,11 +97,6 @@ private class Destination
10297
private class TestProfile : Profile
10398
{
10499
public override string ProfileName => "Test";
105-
106-
protected override void Configure()
107-
{
108-
109-
}
110100
}
111101
protected override void Establish_context()
112102
{
@@ -160,11 +150,6 @@ private class Destination
160150
private class TestProfile : Profile
161151
{
162152
public override string ProfileName => "Test";
163-
164-
protected override void Configure()
165-
{
166-
167-
}
168153
}
169154

170155
protected override void Establish_context()

0 commit comments

Comments
 (0)