Skip to content

Commit 9e637fe

Browse files
committed
Make clr hack use configurable build config
1 parent ef16d3d commit 9e637fe

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs

+9-8
Original file line numberDiff line numberDiff line change
@@ -163,26 +163,27 @@ void HackMakeArchiveItem (NativeRuntimeComponents.Archive archive, List<ITaskIte
163163
var relativeArtifactPaths = new List<(string path, string abi)> ();
164164
string archiveName = Path.GetFileName (archive.Name);
165165
string commonClrObjDir = Path.Combine ("artifacts", "obj", "coreclr");
166+
const string config = "Release"; // or Debug
166167

167168
if (IsArchive ("libcoreclr.a")) {
168169
archiveName = "libcoreclr_static.a";
169-
MakeRelativeArtifactPaths ((string clrArch) => Path.Combine (commonClrObjDir, $"android.{clrArch}.Release", "dlls", "mscoree", "coreclr"));
170+
MakeRelativeArtifactPaths ((string clrArch) => Path.Combine (commonClrObjDir, $"android.{clrArch}.{config}", "dlls", "mscoree", "coreclr"));
170171
} else if (IsArchive ("libcoreclrpal.a")) {
171-
MakeRelativeArtifactPaths ((string clrArch) => Path.Combine (commonClrObjDir, $"android.{clrArch}.Release", "pal", "src"));
172+
MakeRelativeArtifactPaths ((string clrArch) => Path.Combine (commonClrObjDir, $"android.{clrArch}.{config}", "pal", "src"));
172173
} else if (IsArchive ("libminipal.a")) {
173-
MakeRelativeArtifactPaths ((string clrArch) => Path.Combine (commonClrObjDir, $"android.{clrArch}.Release", "shared_minipal"));
174+
MakeRelativeArtifactPaths ((string clrArch) => Path.Combine (commonClrObjDir, $"android.{clrArch}.{config}", "shared_minipal"));
174175
} else if (IsArchive ("libcoreclrminipal.a")) {
175-
MakeRelativeArtifactPaths ((string clrArch) => Path.Combine (commonClrObjDir, $"android.{clrArch}.Release", "minipal", "Unix"));
176+
MakeRelativeArtifactPaths ((string clrArch) => Path.Combine (commonClrObjDir, $"android.{clrArch}.{config}", "minipal", "Unix"));
176177
} else if (IsArchive ("libgc_pal.a")) {
177-
MakeRelativeArtifactPaths ((string clrArch) => Path.Combine (commonClrObjDir, $"android.{clrArch}.Release", "gc", "unix"));
178+
MakeRelativeArtifactPaths ((string clrArch) => Path.Combine (commonClrObjDir, $"android.{clrArch}.{config}", "gc", "unix"));
178179
} else if (IsArchive ("libeventprovider.a")) {
179-
MakeRelativeArtifactPaths ((string clrArch) => Path.Combine (commonClrObjDir, $"android.{clrArch}.Release", "pal", "src", "eventprovider", "dummyprovider"));
180+
MakeRelativeArtifactPaths ((string clrArch) => Path.Combine (commonClrObjDir, $"android.{clrArch}.{config}", "pal", "src", "eventprovider", "dummyprovider"));
180181
} else if (IsArchive ("libnativeresourcestring.a")) {
181-
MakeRelativeArtifactPaths ((string clrArch) => Path.Combine (commonClrObjDir, $"android.{clrArch}.Release", "nativeresources"));
182+
MakeRelativeArtifactPaths ((string clrArch) => Path.Combine (commonClrObjDir, $"android.{clrArch}.{config}", "nativeresources"));
182183
} else {
183184
foreach (string abi in uniqueAbis) {
184185
string clrArch = GetClrArch (abi);
185-
relativeArtifactPaths.Add ((Path.Combine ("artifacts", "bin", $"microsoft.netcore.app.runtime.android-{clrArch}", "Release", "runtimes", $"android-{clrArch}", "native"), abi));
186+
relativeArtifactPaths.Add ((Path.Combine ("artifacts", "bin", $"microsoft.netcore.app.runtime.android-{clrArch}", config, "runtimes", $"android-{clrArch}", "native"), abi));
186187
}
187188
}
188189

0 commit comments

Comments
 (0)