|
47 | 47 | <Exec Command=""$(DotNetPreviewTool)" pack @(_PackProps, ' ') "$(XamarinAndroidSourcePath)src\Microsoft.Android.Templates\Microsoft.Android.Templates.csproj"" />
|
48 | 48 | </Target>
|
49 | 49 |
|
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 |
| - |
78 | 50 | <Target Name="InstallManifestAndDependencies"
|
79 | 51 | DependsOnTargets="_GetDefaultPackageVersion">
|
80 | 52 | <PropertyGroup>
|
|
90 | 62 | Targets="_GenerateXAWorkloadContent"
|
91 | 63 | />
|
92 | 64 |
|
93 |
| - <GetAndroidWorkloadExtends JsonFilePath="$(_LocalAndroidManifestFolder)WorkloadManifest.json"> |
94 |
| - <Output TaskParameter="ExtendsElement" PropertyName="AndroidWorkloadExtendsElement" /> |
95 |
| - </GetAndroidWorkloadExtends> |
96 |
| - |
97 | 65 | <PropertyGroup>
|
98 | 66 | <_EmptyWorkloadJsonContent>
|
99 | 67 | <![CDATA[
|
100 |
| -{"version": "0.0.1", "workloads": { "android-deps": { "extends" : [ $(AndroidWorkloadExtendsElement) ] } } } |
| 68 | +{"version": "0.0.1", "workloads": { "android-deps": { "extends" : [ "microsoft-net-runtime-android" ] } } } |
101 | 69 | ]]>
|
102 | 70 | </_EmptyWorkloadJsonContent>
|
103 | 71 | </PropertyGroup>
|
104 | 72 |
|
105 | 73 | <!-- 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" /> |
107 | 74 | <MakeDir Directories="$(_EmptyWorkloadDir)" />
|
108 | 75 | <WriteLinesToFile
|
109 | 76 | File="$(_EmptyWorkloadDir)WorkloadManifest.json"
|
|
0 commit comments