-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.fsx
125 lines (114 loc) · 5.19 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
#r @"tools/FAKE/tools/FakeLib.dll"
#load "build-helpers.fsx"
open Fake
open System
open System.IO
open System.Linq;
open BuildHelpers
open Fake.XMLHelper
open Fake.XamarinHelper
//let private androidKeystorePassword = getBuildParamOrDefault "android_keystore_password" "not_provided"
//
//let private googleMapsForAndroidv2ApiKey = getBuildParamOrDefault "google_maps_for_android_v2_api_key" "not_provided"
//
//let private mobileAppSourcePath = "../../src/MobileApp/"
////
//let private solutionFile = (mobileAppSourcePath + "XamarinCRM.sln")
////
//let private nuGetPackageOutputPath = (mobileAppSourcePath + "packages/")
////
//let private iOSProjectPath = (mobileAppSourcePath + "XamarinCRM.iOS/")
//
//let private iOSBuildOutputPath = "src/MobileApp/XamarinCRM.iOS/bin/" // This path isn't relative to ~/automation/fake like the rest of the paths. The tool that uses it runs in the repo's root folder.
//
//let private androidProjectPath = (mobileAppSourcePath + "XamarinCRM.Android/")
//
//let private androidProjectFile = (androidProjectPath + "XamarinCRM.Android.csproj")
//
//let private androidBuildOutputPath = (androidProjectPath + "bin/")
// a function that restores all the packages in the solution to a particular directory, instead of the default, which would be relative to the working directory
//let private RestorePackagesToHintPath =
// Exec "tools/NuGet/NuGet.exe" ("restore " + solutionFile + " -PackagesDirectory " + nuGetPackageOutputPath)
Target "common-build" ( fun() ->
//RestorePackages "XamarinCRM.sln"
MSBuild "XamarinCRM/bin/Debug" "Build" [("Configuration","Debug") ; ("Platform","Any CPU") ] ["XamarinCRM.sln"] |>ignore
)
RunTarget()
//// a function that encapsulates the different iOS combinations
//let private TemplatediOSBuild configName platform provisioningCategory =
//
// CleanDir (iOSBuildOutputPath + configName)
//
// RestorePackagesToHintPath
//
// iOSBuild (fun defaults ->
// {defaults with
// ProjectPath = solutionFile
// Platform = platform
// Configuration = ("iOS " + configName + " (" + provisioningCategory + ")")
// Target = "Build"
// BuildIpa = true
// })
// TeamCityHelper.PublishArtifact (iOSBuildOutputPath + platform + "/" + configName + "/*.ipa")
//
//// a function that encapsulates the different Android combinations
//let private TemplatedAndroidBuild configName keystoreFile keystoreAlias keystorePassword googleMapsApiKey =
//
// RestorePackagesToHintPath
//
// // Delete the (androidProjectPath + "Resources/values/api-keys.xml") file, because of what happens right below.
// DeleteFile (androidProjectPath + "Resources/values/api-keys.xml")
//
// // Insert Google Maps For Android v2 API Key into api-keys.xml file in Android project
// // The actual values/api-keys.xml does not exist in source. It gets copied into place by an MSBuild target in the csproj file, from the valuesTemplate/api-keys.xml file.
// // So, we place the api key value into the valuesTemplate/api-keys.xml file instead, knowing that it will get copied into place.
//
// XmlPokeInnerText (androidProjectPath + "Resources/valuesTemplate/api-keys.xml") "(/resources/string[@name='GoogleMapsKey'])[1]" googleMapsForAndroidv2ApiKey
//
// // Build, sign, and zip-align
// AndroidPackage (fun defaults ->
// {defaults with
// ProjectPath = androidProjectFile
// Configuration = configName
// OutputPath = (androidBuildOutputPath + configName)
// })
// |> AndroidSignAndAlign (fun defaults ->
// {defaults with
// ZipalignPath = "tools/zipalign"
// KeystorePath = (mobileAppSourcePath + keystoreFile)
// KeystorePassword = androidKeystorePassword // TODO: Don't store this in the build script for a real app! This gets passed in at the top of the build script.
// KeystoreAlias = keystoreAlias
// })
// |> fun file -> TeamCityHelper.PublishArtifact file.FullName
//
//// This target is mostly for a sanity check, to make sure the app builds with debug settings.
//Target "ios-iphone-debug" (fun () ->
// TemplatediOSBuild "Debug" "iPhone" "Development"
//)
//
//// This target is an iOS release build, signed for App Store distribution.
//Target "ios-iphone-appstore" (fun () ->
// TemplatediOSBuild "AppStore" "iPhone" "Distribution"
//)
//
//// This target is an iOS release build, signed for InHouse distribution.
//Target "ios-iphone-inhouse" (fun () ->
// TemplatediOSBuild "InHouse" "iPhone" "Distribution"
//)
//
//// This target is an iOS release build, signed for Ad-Hoc distribution.
//Target "ios-iphone-adhoc" (fun () ->
// TemplatediOSBuild "Ad-Hoc" "iPhone" "Distribution"
//)
//
//// this target is an Android debug build, signed for AdHoc distribution
//Target "android-debug" (fun () ->
// TemplatedAndroidBuild "Debug" "debug.keystore" "androiddebugkey" androidKeystorePassword googleMapsForAndroidv2ApiKey
//)
//
//// this target is an Android release build, signed for AdHoc distribution
//Target "android-release" (fun () ->
// TemplatedAndroidBuild "Release" "XamarinCRMAndroid.keystore" "XamarinCRMAndroid" androidKeystorePassword googleMapsForAndroidv2ApiKey
//)
//
//RunTarget()