@@ -64,14 +64,49 @@ export class UnityVersioning {
6464 ) ;
6565
6666 if ( bundleVersionMode === VersioningMode . Increment ) {
67- bundleVersion = UnityVersioningTools . incrementBundleVersion (
68- projectPath ,
69- bundleVersion
70- ) ;
67+ if (
68+ buildPlatform !== BuildPlatform . VisionOS &&
69+ buildPlatform !== BuildPlatform . TVOS
70+ ) {
71+ bundleVersion = UnityVersioningTools . incrementBundleVersion (
72+ projectPath ,
73+ bundleVersion
74+ ) ;
75+ } else if ( buildPlatform === BuildPlatform . VisionOS ) {
76+ bundleVersion = UnityVersioningTools . incrementVisionOSBundleVersion (
77+ projectPath ,
78+ bundleVersion
79+ ) ;
80+ } else if ( buildPlatform === BuildPlatform . TVOS ) {
81+ bundleVersion = UnityVersioningTools . incrementTvOSBundleVersion (
82+ projectPath ,
83+ bundleVersion
84+ ) ;
85+ } else {
86+ throw new Error ( `Invalid build platform: ${ buildPlatform } ` ) ;
87+ }
7188 } else if ( bundleVersionMode === VersioningMode . Set ) {
72- throw new Error (
73- "Bundle version mode set is not implemented yet. Please use increment mode."
74- ) ;
89+ if (
90+ buildPlatform !== BuildPlatform . VisionOS &&
91+ buildPlatform !== BuildPlatform . TVOS
92+ ) {
93+ bundleVersion = UnityVersioningTools . setBundleVersion (
94+ projectPath ,
95+ bundleVersion
96+ ) ;
97+ } else if ( buildPlatform === BuildPlatform . VisionOS ) {
98+ bundleVersion = UnityVersioningTools . setVisionOSBundleVersion (
99+ projectPath ,
100+ bundleVersion
101+ ) ;
102+ } else if ( buildPlatform === BuildPlatform . TVOS ) {
103+ bundleVersion = UnityVersioningTools . setTvOSBundleVersion (
104+ projectPath ,
105+ bundleVersion
106+ ) ;
107+ } else {
108+ throw new Error ( `Invalid build platform: ${ buildPlatform } ` ) ;
109+ }
75110 } else {
76111 throw new Error ( `Invalid bundle version mode: ${ bundleVersionMode } ` ) ;
77112 }
@@ -129,9 +164,35 @@ export class UnityVersioning {
129164 throw new Error ( `Invalid build platform: ${ buildPlatform } ` ) ;
130165 }
131166 } else if ( buildNumberMode === VersioningMode . Set ) {
132- throw new Error (
133- "Build number mode set is not implemented yet. Please use increment mode."
134- ) ;
167+ if (
168+ buildPlatform !== BuildPlatform . VisionOS &&
169+ buildPlatform !== BuildPlatform . IOS &&
170+ buildPlatform !== BuildPlatform . TVOS &&
171+ buildPlatform !== BuildPlatform . Android
172+ ) {
173+ buildCode = UnityVersioningTools . setBuildNumber ( projectPath , {
174+ Standalone : buildNumber ,
175+ } ) . Standalone ;
176+ } else if ( buildPlatform === BuildPlatform . Android ) {
177+ buildCode = UnityVersioningTools . setAndroidBundleVersionCode (
178+ projectPath ,
179+ buildNumber
180+ ) ;
181+ } else if ( buildPlatform === BuildPlatform . VisionOS ) {
182+ buildCode = UnityVersioningTools . setBuildNumber ( projectPath , {
183+ VisionOS : buildNumber ,
184+ } ) . VisionOS ;
185+ } else if ( buildPlatform === BuildPlatform . IOS ) {
186+ buildCode = UnityVersioningTools . setBuildNumber ( projectPath , {
187+ iPhone : buildNumber ,
188+ } ) . iPhone ;
189+ } else if ( buildPlatform === BuildPlatform . TVOS ) {
190+ buildCode = UnityVersioningTools . setBuildNumber ( projectPath , {
191+ tvOS : buildNumber ,
192+ } ) . tvOS ;
193+ } else {
194+ throw new Error ( `Invalid build platform: ${ buildPlatform } ` ) ;
195+ }
135196 } else {
136197 throw new Error ( `Invalid build number mode: ${ buildNumberMode } ` ) ;
137198 }
0 commit comments