Skip to content

Commit 8f49e45

Browse files
authored
Merge branch 'main' into use-hub-api
2 parents 90d3c6a + 4f9a0db commit 8f49e45

File tree

10 files changed

+1690
-53
lines changed

10 files changed

+1690
-53
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.1.0]
9+
10+
### Added
11+
12+
- Added bundle version tools to update project bundle version and build numbers
13+
814
## [1.0.12]
915

1016
### Added

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021-2024 Dinomite
3+
Copyright (c) 2021-2025 Dinomite
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

index.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
// Copyright (c) Dinomite. All rights reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

4-
export * from './lib/unity-log-streamer';
5-
export * from './lib/unity-tool-runner';
6-
export * from './lib/unity-path-tools';
7-
export * from './lib/unity-version-tools';
8-
export * from './lib/unity-package-manager-tools';
9-
export * from './lib/unity-scene-tools';
10-
export * from './lib/utilities';
11-
export * from './lib/models';
4+
export * from "./lib/unity-log-streamer";
5+
export * from "./lib/unity-tool-runner";
6+
export * from "./lib/unity-path-tools";
7+
export * from "./lib/unity-version-tools";
8+
export * from "./lib/unity-versioning-tools";
9+
export * from "./lib/unity-package-manager-tools";
10+
export * from "./lib/unity-scene-tools";
11+
export * from "./lib/utilities";
12+
export * from "./lib/models";

lib/models.ts

Lines changed: 50 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,49 +5,67 @@
55
* Supported operating systems.
66
*/
77
export enum OS {
8-
Windows = 0,
9-
MacOS,
10-
Linux
11-
};
8+
Windows = 0,
9+
MacOS,
10+
Linux,
11+
}
12+
13+
/**
14+
* Structure holds the bulid number for each platform
15+
* of a Unity project.
16+
*/
17+
export interface BuildNumbers {
18+
Standalone: number;
19+
VisionOS: number;
20+
iPhone: number;
21+
tvOS: number;
22+
}
23+
24+
/**
25+
* Structure holds the bundle version of a Unity project.
26+
*/
27+
export interface SemanticVersion {
28+
major: number;
29+
minor: number;
30+
patch: number;
31+
}
1232

1333
/**
1434
* Information about a Unity engine version.
1535
*/
1636
export interface UnityVersionInfo {
37+
/**
38+
* Version identifier, e.g. 2019.3.5f1.
39+
*/
40+
version: string;
1741

18-
/**
19-
* Version identifier, e.g. 2019.3.5f1.
20-
*/
21-
version: string;
42+
/**
43+
* Version revision if available, e.g. d691e07d38ef.
44+
*/
45+
revision?: string;
2246

23-
/**
24-
* Version revision if available, e.g. d691e07d38ef.
25-
*/
26-
revision?: string;
47+
/**
48+
* Is this a beta version of Unity?
49+
*/
50+
isBeta: boolean;
2751

28-
/**
29-
* Is this a beta version of Unity?
30-
*/
31-
isBeta: boolean;
32-
33-
/**
34-
* Is this an alpha version of Unity?
35-
*/
36-
isAlpha: boolean;
37-
};
52+
/**
53+
* Is this an alpha version of Unity?
54+
*/
55+
isAlpha: boolean;
56+
}
3857

3958
/**
4059
* The result of an attempt to determine a project's last used Unity editor version.
4160
*/
4261
export interface UnityVersionInfoResult {
62+
/**
63+
* Information found about the project's last used Unity editor version.
64+
*/
65+
info?: UnityVersionInfo;
4366

44-
/**
45-
* Information found about the project's last used Unity editor version.
46-
*/
47-
info?: UnityVersionInfo;
48-
49-
/**
50-
* Error information in case the version information could not be retrieved.
51-
*/
52-
error?: string;
53-
}
67+
/**
68+
* Error information in case the version information could not be retrieved.
69+
*/
70+
error?: string;
71+
}

lib/unity-version-tools.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ export class UnityVersionTools {
1515

1616
/**
1717
* Gets a Unity project's Unity editor version by looking up the project version file in the project directory.
18-
* @param projectRootPath Relative path to the Unity project's root folder containing the assets folder, starting from the current working directory.
18+
* @param projectPath Relative path to the Unity project's root folder containing the assets folder, starting from the current working directory.
1919
* @returns The project's used Unity editor version in case of success. Error message in case of failure.
2020
*/
21-
public static determineProjectVersionFromFile(projectRootPath: string): UnityVersionInfoResult {
21+
public static determineProjectVersionFromFile(projectPath: string): UnityVersionInfoResult {
2222
try {
23-
const projectVersionFilePath = path.join(projectRootPath, UnityVersionTools.unityProjectSettingsFolder, UnityVersionTools.unityProjectEditorVersionFile);
23+
const projectVersionFilePath = path.join(projectPath, UnityVersionTools.unityProjectSettingsFolder, UnityVersionTools.unityProjectEditorVersionFile);
2424
const projectVersionFileContent = fs.readFileSync(projectVersionFilePath, { encoding: 'utf8' });
2525
const projectVersionResult = this.determineProjectVersionFromContent(projectVersionFileContent);
2626

0 commit comments

Comments
 (0)