1
- #addin "nuget:?package=Cake.MinVer&version=1.0.0 "
2
- #addin "nuget:?package=Cake.Args&version=1.0.0 "
1
+ #addin "nuget:?package=Cake.MinVer&version=1.0.1 "
2
+ #addin "nuget:?package=Cake.Args&version=1.0.1 "
3
3
4
4
var target = ArgumentOrDefault < string > ( "target" ) ?? "pack" ;
5
5
var buildVersion = MinVer ( s => s . WithTagPrefix ( "v" ) . WithDefaultPreReleasePhase ( "preview" ) ) ;
6
6
7
7
Task ( "clean" )
8
8
. Does ( ( ) =>
9
9
{
10
- CleanDirectory ( "./build/artifacts" ) ;
11
- CleanDirectories ( "./src/**/bin" ) ;
12
- CleanDirectories ( "./src/**/obj" ) ;
13
- CleanDirectories ( "./test/**/bin" ) ;
14
- CleanDirectories ( "./test/**/obj" ) ;
10
+ CleanDirectories ( "./artifact/**" ) ;
11
+ CleanDirectories ( "./**/^{bin,obj}" ) ;
15
12
} ) ;
16
13
17
14
Task ( "restore" )
@@ -26,28 +23,18 @@ Task("restore")
26
23
27
24
Task ( "build" )
28
25
. IsDependentOn ( "restore" )
29
- . Does ( ( ) =>
26
+ . DoesForEach ( new [ ] { "Debug" , "Release" } , ( configuration ) =>
30
27
{
31
28
DotNetCoreBuild ( "./Ookii.Dialogs.Wpf.sln" , new DotNetCoreBuildSettings
32
29
{
33
- Configuration = "Debug" ,
34
- NoRestore = true ,
35
- NoIncremental = false ,
36
- ArgumentCustomization = args =>
37
- args . AppendQuoted ( $ "-p:Version={ buildVersion . Version } ")
38
- . AppendQuoted ( $ "-p:FileVersion={ buildVersion . FileVersion } ")
39
- . AppendQuoted ( $ "-p:ContinuousIntegrationBuild=true")
40
- } ) ;
41
-
42
- DotNetCoreBuild ( "./Ookii.Dialogs.Wpf.sln" , new DotNetCoreBuildSettings
43
- {
44
- Configuration = "Release" ,
30
+ Configuration = configuration ,
45
31
NoRestore = true ,
46
32
NoIncremental = false ,
47
- ArgumentCustomization = args =>
48
- args . AppendQuoted ( $ "-p:Version={ buildVersion . Version } ")
49
- . AppendQuoted ( $ "-p:FileVersion={ buildVersion . FileVersion } ")
50
- . AppendQuoted ( $ "-p:ContinuousIntegrationBuild=true")
33
+ MSBuildSettings = new DotNetCoreMSBuildSettings ( )
34
+ . WithProperty ( "Version" , buildVersion . Version )
35
+ . WithProperty ( "AssemblyVersion" , buildVersion . AssemblyVersion )
36
+ . WithProperty ( "FileVersion" , buildVersion . FileVersion )
37
+ . WithProperty ( "ContinuousIntegrationBuild" , BuildSystem . IsLocalBuild ? "false" : "true" )
51
38
} ) ;
52
39
} ) ;
53
40
@@ -82,10 +69,10 @@ Task("pack")
82
69
NoBuild = true ,
83
70
IncludeSymbols = true ,
84
71
IncludeSource = true ,
85
- OutputDirectory = "./build/artifacts " ,
86
- ArgumentCustomization = args =>
87
- args . AppendQuoted ( $ "-p: Version= { buildVersion . Version } " )
88
- . AppendQuoted ( $ "-p: PackageReleaseNotes= { releaseNotes } " )
72
+ OutputDirectory = "./artifact/nuget " ,
73
+ MSBuildSettings = new DotNetCoreMSBuildSettings ( )
74
+ . WithProperty ( " Version" , buildVersion . Version )
75
+ . WithProperty ( " PackageReleaseNotes" , releaseNotes )
89
76
} ) ;
90
77
91
78
DotNetCorePack ( "./src/Ookii.Dialogs/Ookii.Dialogs.csproj" , new DotNetCorePackSettings
@@ -95,14 +82,14 @@ Task("pack")
95
82
NoBuild = true ,
96
83
IncludeSymbols = false ,
97
84
IncludeSource = false ,
98
- OutputDirectory = "./build/artifacts " ,
99
- ArgumentCustomization = args =>
100
- args . AppendQuoted ( $ "-p: Version= { buildVersion . Version } " )
101
- . AppendQuoted ( $ "-p: PackageReleaseNotes= { releaseNotes } " )
85
+ OutputDirectory = "./artifact/nuget " ,
86
+ MSBuildSettings = new DotNetCoreMSBuildSettings ( )
87
+ . WithProperty ( " Version" , buildVersion . Version )
88
+ . WithProperty ( " PackageReleaseNotes" , releaseNotes )
102
89
} ) ;
103
90
} ) ;
104
91
105
- Task ( "publish " )
92
+ Task ( "push " )
106
93
. IsDependentOn ( "pack" )
107
94
. Does ( context =>
108
95
{
@@ -126,7 +113,7 @@ Task("publish")
126
113
ApiKey = apiKey ,
127
114
} ;
128
115
129
- foreach ( var nugetPackageFile in GetFiles ( "./build/artifacts /*.nupkg" ) )
116
+ foreach ( var nugetPackageFile in GetFiles ( "./artifact/nuget /*.nupkg" ) )
130
117
{
131
118
DotNetCoreNuGetPush ( nugetPackageFile . FullPath , nugetPushSettings ) ;
132
119
}
0 commit comments