Skip to content

Commit

Permalink
[Android][build] Fix android package name containing - (dotnet#93077)
Browse files Browse the repository at this point in the history
* [Android][build] Fix Android package naming

* Remove unnecessary code
  • Loading branch information
mdh1418 committed Oct 6, 2023
1 parent c441891 commit f37e653
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tasks/AndroidAppBuilder/ApkBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ public ApkBuilder(TaskLoggingHelper logger)
string monodroidSource = (IsLibraryMode) ? "monodroid-librarymode.c" : "monodroid.c";

string cmakeLists = Utils.GetEmbeddedResource("CMakeLists-android.txt")
.Replace("%ProjectName%", ProjectName)
.Replace("%MonoInclude%", monoRuntimeHeaders)
.Replace("%NativeLibrariesToLink%", nativeLibraries)
.Replace("%MONODROID_SOURCE%", monodroidSource)
Expand Down Expand Up @@ -393,6 +392,9 @@ public ApkBuilder(TaskLoggingHelper logger)
if (!string.IsNullOrEmpty(ProjectName) && checkNumerics.IsMatch(ProjectName))
ProjectName = checkNumerics.Replace(ProjectName, @"_$1");

if (!string.IsNullOrEmpty(ProjectName) && ProjectName.Contains('-'))
ProjectName = ProjectName.Replace("-", "_");

string packageId = $"net.dot.{ProjectName}";

File.WriteAllText(javaActivityPath,
Expand Down

0 comments on commit f37e653

Please sign in to comment.