Skip to content

Commit 2d07a35

Browse files
Remove $(AndroidWorkloadExtendsElement)
1 parent e0bd0ce commit 2d07a35

File tree

1 file changed

+1
-34
lines changed

1 file changed

+1
-34
lines changed

build-tools/create-packs/ConfigureLocalWorkload.targets

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -47,34 +47,6 @@
4747
<Exec Command="&quot;$(DotNetPreviewTool)&quot; pack @(_PackProps, ' ') &quot;$(XamarinAndroidSourcePath)src\Microsoft.Android.Templates\Microsoft.Android.Templates.csproj&quot;" />
4848
</Target>
4949

50-
<UsingTask TaskName="GetAndroidWorkloadExtends" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
51-
<ParameterGroup>
52-
<JsonFilePath ParameterType="System.String" Required="true" />
53-
<ExtendsElement Output="true" ParameterType="System.String" />
54-
</ParameterGroup>
55-
<Task>
56-
<Using Namespace="System" />
57-
<Using Namespace="System.IO" />
58-
<Code Type="Fragment" Language="cs">
59-
<![CDATA[
60-
var jsonContent = File.ReadAllText(JsonFilePath);
61-
var startElement = "\"extends\" : [";
62-
var startIndex = jsonContent.IndexOf(startElement);
63-
var endIndex = jsonContent.IndexOf("]");
64-
if (startIndex != -1) {
65-
startIndex += startElement.Length;
66-
endIndex = jsonContent.IndexOf("]", startIndex);
67-
if (endIndex != -1) {
68-
ExtendsElement = jsonContent.Substring(startIndex, endIndex - startIndex)?.Trim();
69-
}
70-
}
71-
if (startIndex == -1 || endIndex == -1 || string.IsNullOrEmpty(ExtendsElement))
72-
Log.LogError($"Failed to find extends element in workload json '{JsonFilePath}'");
73-
]]>
74-
</Code>
75-
</Task>
76-
</UsingTask>
77-
7850
<Target Name="InstallManifestAndDependencies"
7951
DependsOnTargets="_GetDefaultPackageVersion">
8052
<PropertyGroup>
@@ -90,20 +62,15 @@
9062
Targets="_GenerateXAWorkloadContent"
9163
/>
9264

93-
<GetAndroidWorkloadExtends JsonFilePath="$(_LocalAndroidManifestFolder)WorkloadManifest.json">
94-
<Output TaskParameter="ExtendsElement" PropertyName="AndroidWorkloadExtendsElement" />
95-
</GetAndroidWorkloadExtends>
96-
9765
<PropertyGroup>
9866
<_EmptyWorkloadJsonContent>
9967
<![CDATA[
100-
{"version": "0.0.1", "workloads": { "android-deps": { "extends" : [ $(AndroidWorkloadExtendsElement) ] } } }
68+
{"version": "0.0.1", "workloads": { "android-deps": { "extends" : [ "microsoft-net-runtime-android" ] } } }
10169
]]>
10270
</_EmptyWorkloadJsonContent>
10371
</PropertyGroup>
10472

10573
<!-- Create empty workload to install dotnet/runtime dependencies, and then clean up the workload and metadata files from install -->
106-
<Error Condition=" '$(AndroidWorkloadExtendsElement)' == '' " Text="Failed to find extends element in workload json" />
10774
<MakeDir Directories="$(_EmptyWorkloadDir)" />
10875
<WriteLinesToFile
10976
File="$(_EmptyWorkloadDir)WorkloadManifest.json"

0 commit comments

Comments
 (0)