1
1
var IOSVERSION = Argument ( "iosversion" , "9.2.0" ) ;
2
2
var MACVERSION = Argument ( "macversion" , "4.2.0" ) ;
3
3
var target = Argument ( "target" , "Default" ) ;
4
+ var NUGET_API_KEY = EnvironmentVariable ( "NUGET_API_KEY" ) ;
4
5
5
6
Task ( "MacModel" )
6
7
. Description ( "Builds 'PSPDFKit.Mac.Model.dll', expects 'PSPDFKit.framework' inside './PSPDFKit.Mac.Model/' Directory\n " )
@@ -25,7 +26,7 @@ Task ("iOSModel")
25
26
Information ( "=== PSPDFKit.iOS.Model.dll ===" ) ;
26
27
if ( ! DirectoryExists ( "./PSPDFKit.iOS.Model/PSPDFKit.framework/" ) )
27
28
throw new Exception ( "Unable to locate 'PSPDFKit.framework' inside './PSPDFKit.iOS.Model' Directory" ) ;
28
-
29
+
29
30
MSBuild ( "./PSPDFKit.iOS.Model/PSPDFKit.iOS.Model.csproj" , new MSBuildSettings ( )
30
31
. SetConfiguration ( "Release" )
31
32
) ;
@@ -140,6 +141,38 @@ Task ("NuGet")
140
141
} ) ;
141
142
} ) ;
142
143
144
+ Task ( "NuGet-Push" )
145
+ . IsDependentOn ( "Nuget" )
146
+ . Does ( ( ) =>
147
+ {
148
+ // Get the path to the packages
149
+ var modelPackage = "./nuget/pkgs/PSPDFKit.iOS.Model." + IOSVERSION + ".nupkg" ;
150
+ var uiPackage = "./nuget/pkgs/PSPDFKit.iOS.UI." + IOSVERSION + ".nupkg" ;
151
+ var instantPackage = "./nuget/pkgs/PSPDFKit.iOS.Instant." + IOSVERSION + ".nupkg" ;
152
+ var macModelPackage = "./nuget/pkgs/PSPDFKit.Mac.Model." + MACVERSION + ".nupkg" ;
153
+
154
+ // Push the packages
155
+ NuGetPush ( modelPackage , new NuGetPushSettings {
156
+ Source = "https://api.nuget.org/v3/index.json" ,
157
+ ApiKey = NUGET_API_KEY
158
+ } ) ;
159
+
160
+ NuGetPush ( uiPackage , new NuGetPushSettings {
161
+ Source = "https://api.nuget.org/v3/index.json" ,
162
+ ApiKey = NUGET_API_KEY
163
+ } ) ;
164
+
165
+ NuGetPush ( instantPackage , new NuGetPushSettings {
166
+ Source = "https://api.nuget.org/v3/index.json" ,
167
+ ApiKey = NUGET_API_KEY
168
+ } ) ;
169
+
170
+ NuGetPush ( macModelPackage , new NuGetPushSettings {
171
+ Source = "https://api.nuget.org/v3/index.json" ,
172
+ ApiKey = NUGET_API_KEY
173
+ } ) ;
174
+ } ) ;
175
+
143
176
Task ( "Clean" )
144
177
. Description ( "Cleans the build.\n " )
145
178
. Does ( ( ) => {
@@ -189,4 +222,4 @@ Task ("Clean")
189
222
}
190
223
) ;
191
224
192
- RunTarget ( target ) ;
225
+ RunTarget ( target ) ;
0 commit comments