@@ -16,6 +16,25 @@ Write-Output "$('Using build name "')$($Env:BUILD_NAME)$('".')"
1616
1717Write-Output " $ ( ' Using build target "' ) $ ( $Env: BUILD_TARGET ) $ ( ' ".' ) "
1818
19+ #
20+ # Display the build profile
21+ #
22+
23+ if ($Env: BUILD_PROFILE )
24+ {
25+ # User has provided a path to a build profile `.asset` file
26+ #
27+ Write-Output " $ ( ' Using build profile "' ) $ ( $Env: BUILD_PROFILE ) $ ( ' " relative to "' ) $ ( $Env: UNITY_PROJECT_PATH ) $ ( ' ".' ) "
28+ #
29+ }
30+ else
31+ {
32+ # User has not provided a build profile
33+ #
34+ Write-Output " $ ( ' Doing a default "' ) $ ( $Env: BUILD_TARGET ) $ ( ' " platform build.' ) "
35+ #
36+ }
37+
1938#
2039# Display build path and file
2140#
@@ -86,10 +105,38 @@ else {
86105 Write-Output " Not creating Android keystore."
87106}
88107
108+ #
109+ # Assemble the build target or build profile CLI options
110+ #
111+ # The `-buildTarget` and `-activeBuildProfile` are mutually exclusive options.
112+ #
113+
114+ if ($Env :$BUILD_PROFILE ) {
115+ # User has provided a build profile, `-buildTarget` is not necessary.
116+ #
117+ $buildtargetOrProfile = @ (" -activeBuildProfile" , " `" $Env: BUILD_PROFILE `" " )
118+ #
119+ }
120+ else
121+ {
122+ # User has not provided a build profile, `-buildTarget` is necessary.
123+ #
124+ $buildtargetOrProfile = @ (" -buildTarget" , " `" $Env: BUILD_TARGET `" " )
125+ #
126+ }
127+
89128#
90129# Pre-build debug information
91130#
92131
132+ Write-Output " "
133+ Write-Output " ###########################"
134+ Write-Output " # Build target/prof #"
135+ Write-Output " ###########################"
136+ Write-Output " "
137+
138+ Write-Output " $ ( ' "' ) $ ( $buildtargetOrProfile ) $ ( ' "' ) "
139+
93140Write-Output " "
94141Write-Output " ###########################"
95142Write-Output " # Custom parameters #"
@@ -140,7 +187,6 @@ $unityArgs = @(
140187 " -customBuildName" , " `" $Env: BUILD_NAME `" " ,
141188 " -projectPath" , " `" $Env: UNITY_PROJECT_PATH `" " ,
142189 " -executeMethod" , " `" $Env: BUILD_METHOD `" " ,
143- " -buildTarget" , " `" $Env: BUILD_TARGET `" " ,
144190 " -customBuildTarget" , " `" $Env: BUILD_TARGET `" " ,
145191 " -customBuildPath" , " `" $Env: CUSTOM_BUILD_PATH `" " ,
146192 " -buildVersion" , " `" $Env: VERSION `" " ,
@@ -152,7 +198,7 @@ $unityArgs = @(
152198 " -androidExportType" , " `" $Env: ANDROID_EXPORT_TYPE `" " ,
153199 " -androidSymbolType" , " `" $Env: ANDROID_SYMBOL_TYPE `" " ,
154200 " -logfile" , " -"
155- ) + $customParametersArray
201+ ) + $buildtargetOrProfile + $ customParametersArray
156202
157203# Remove null items as that will fail the Start-Process call
158204$unityArgs = $unityArgs | Where-Object { $_ -ne $null }
0 commit comments