-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathbuild.fsx
executable file
·153 lines (132 loc) · 4.89 KB
/
build.fsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#r @"packages/FAKE.3.5.4/tools/FakeLib.dll"
#load "build-helpers.fsx"
open Fake
open System
open System.IO
open System.Linq
open BuildHelpers
open Fake.XamarinHelper
Target "restore-nuget" (fun () ->
RestorePackagesOutput "../SimpleAuth/samples/SimpleAuth.Samples.sln" "../SimpleAuth/samples/packages/"
RestorePackagesOutput "../SimpleAuth/src/SimpleAuth.sln" "../SimpleAuth/src/packages/"
RestorePackages "MusicPlayer.sln"
)
Target "ios-build" (fun () ->
RestorePackagesOutput "../SimpleAuth/samples/SimpleAuth.Samples.sln" "../SimpleAuth/samples/packages/"
RestorePackagesOutput "../SimpleAuth/src/SimpleAuth.sln" "../SimpleAuth/src/packages/"
RestorePackages "MusicPlayer.sln"
iOSBuild (fun defaults ->
{defaults with
ProjectPath = "MusicPlayer.sln"
Configuration = "Debug|iPhoneSimulator"
Target = "Build"
})
)
Target "ios-adhoc" (fun () ->
RestorePackages "../SimpleAuth/samples/SimpleAuth.Samples.sln"
RestorePackages "../SimpleAuth/src/SimpleAuth.sln"
RestorePackages "MusicPlayer.sln"
iOSBuild (fun defaults ->
{defaults with
ProjectPath = "MusicPlayer.sln"
Configuration = "Ad-Hoc|iPhone"
Target = "Build"
})
let appPath = Directory.EnumerateFiles(Path.Combine("src", "MusicPlayer", "bin", "iPhone", "Ad-Hoc"), "*.ipa").First()
TeamCityHelper.PublishArtifact appPath
)
Target "ios-appstore" (fun () ->
RestorePackages "../SimpleAuth/samples/SimpleAuth.Samples.sln"
RestorePackages "../SimpleAuth/src/SimpleAuth.sln"
RestorePackages "MusicPlayer.sln"
iOSBuild (fun defaults ->
{defaults with
ProjectPath = "MusicPlayer.sln"
Configuration = "AppStore|iPhone"
Target = "Build"
})
let outputFolder = Path.Combine("src", "MusicPlayer", "bin", "iPhone", "AppStore")
let appPath = Directory.EnumerateDirectories(outputFolder, "*.app").First()
let zipFilePath = Path.Combine(outputFolder, "MusicPlayer.zip")
let zipArgs = String.Format("-r -y '{0}' '{1}'", zipFilePath, appPath)
Exec "zip" zipArgs
TeamCityHelper.PublishArtifact zipFilePath
)
//Target "ios-uitests" (fun () ->
// let appPath = Directory.EnumerateDirectories(Path.Combine("src", "TipCalc.iOS", "bin", "iPhoneSimulator", "Debug"), "*.app").First()
//
// RunUITests appPath
//)
Target "ios-testcloud" (fun () ->
RestorePackages "../SimpleAuth/samples/SimpleAuth.Samples.sln"
RestorePackages "MusicPlayer.sln"
iOSBuild (fun defaults ->
{defaults with
ProjectPath = "MusicPlayer.sln"
Configuration = "TestCloud|iPhone"
Target = "Build"
})
let appPath = Directory.EnumerateFiles(Path.Combine( "MusicPlayer.iOS", "bin", "iPhone", "TestCloud"), "*.ipa").First()
getBuildParam "devices" |> RunTestCloudTests appPath
)
//Target "android-build" (fun () ->
// RestorePackages "TipCalc.Android.sln"
//
// MSBuild "src/TipCalc.Android/bin/Release" "Build" [ ("Configuration", "Release") ] [ "TipCalc.Android.sln" ] |> ignore
//)
//
//Target "android-package" (fun () ->
// AndroidPackage (fun defaults ->
// {defaults with
// ProjectPath = "src/TipCalc.Android/TipCalc.Android.csproj"
// Configuration = "Release"
// OutputPath = "src/TipCalc.Android/bin/Release"
// })
// |> AndroidSignAndAlign (fun defaults ->
// {defaults with
// KeystorePath = "tipcalc.keystore"
// KeystorePassword = "tipcalc" // TODO: don't store this in the build script for a real app!
// KeystoreAlias = "tipcalc"
// })
// |> fun file -> TeamCityHelper.PublishArtifact file.FullName
//)
//
//Target "android-uitests" (fun () ->
// AndroidPackage (fun defaults ->
// {defaults with
// ProjectPath = "src/TipCalc.Android/TipCalc.Android.csproj"
// Configuration = "Release"
// OutputPath = "src/TipCalc.Android/bin/Release"
// }) |> ignore
//
// let appPath = Directory.EnumerateFiles(Path.Combine("src", "TipCalc.Android", "bin", "Release"), "*.apk", SearchOption.AllDirectories).First()
//
// RunUITests appPath
//)
//
//Target "android-testcloud" (fun () ->
// AndroidPackage (fun defaults ->
// {defaults with
// ProjectPath = "src/TipCalc.Android/TipCalc.Android.csproj"
// Configuration = "Release"
// OutputPath = "src/TipCalc.Android/bin/Release"
// }) |> ignore
//
// let appPath = Directory.EnumerateFiles(Path.Combine("src", "TipCalc.Android", "bin", "Release"), "*.apk", SearchOption.AllDirectories).First()
//
// getBuildParam "devices" |> RunTestCloudTests appPath
//)
//"core-build"
// ==> "core-tests"
//
//"ios-build"
// ==> "ios-uitests"
//"android-build"
// ==> "android-uitests"
//
//"android-build"
// ==> "android-testcloud"
//
//"android-build"
// ==> "android-package"
RunTarget()