Skip to content

Commit

Permalink
Make file extension optional for WebGL builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Edvinas01 committed Jan 29, 2025
1 parent 79b3073 commit ed821a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions Packages/com.chark.build-tools/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### Changed

- Menu item order to use `150` instead of `-1000`. This way `CHARK` won't dominate existing entries.
- Made file extensions optional for WebGL builds.

## [v0.0.1](https://github.com/chark/build-tools/compare/v0.0.1) - 2023-10-04

Expand Down
9 changes: 6 additions & 3 deletions Packages/com.chark.build-tools/Editor/PlayerBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,11 @@ private static string GetBuildPath(BuildOptions buildOptions)
}

var buildFileExtension = GetFileExtension(buildOptions.BuildTarget);
var buildFileName = $"{string.Join(settings.BuildNameDelimiter, parts)}." +
$"{buildFileExtension}";
var buildFileName = $"{string.Join(settings.BuildNameDelimiter, parts)}";
if (string.IsNullOrWhiteSpace(buildFileExtension) == false)
{
buildFileName = $".{buildFileExtension}";
}

var buildDirectory = settings.BuildDirectory;

Expand Down Expand Up @@ -228,7 +231,7 @@ private static string GetFileExtension(BuildToolsTarget target)
BuildToolsTarget.StandaloneLinux64 => "x86_64",
BuildToolsTarget.StandaloneOSX => "app",
BuildToolsTarget.iOS => "ipa",
BuildToolsTarget.WebGL => "html",
BuildToolsTarget.WebGL => "",
_ => throw new Exception($"Unsupported target: {target}"),
};
}
Expand Down

0 comments on commit ed821a1

Please sign in to comment.