Skip to content

Commit

Permalink
Fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
dellis1972 committed Jan 23, 2023
1 parent d9930e6 commit a0f0711
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -553,24 +553,6 @@ protected string GetPathToAapt ()
return GetPathToLatestBuildTools (exe);
}

protected string GetResourceDesignerPath (DotNetCLI builder, XASdkProject project, bool designtime = false)
{
string path;
if (Builder.UseDotNet) {
path = Path.Combine (Root, builder.ProjectDirectory, project.IntermediateOutputPath);
if (string.Compare (project.GetProperty ("AndroidUseDesignerAssembly"), "True", ignoreCase: true) == 0) {
return Path.Combine (path, "_Microsoft.Android.Resource.Designer.dll");
}
if (designtime)
path = Path.Combine (Root, builder.ProjectDirectory, project.IntermediateOutputPath);
} else {
path = Path.Combine (Root, builder.ProjectDirectory, "Resources");
if (designtime)
path = Path.Combine (Root, builder.ProjectDirectory, project.IntermediateOutputPath);
}
return Path.Combine (path, "Resource.designer" + project.Language.DefaultDesignerExtension);
}

protected string GetResourceDesignerPath (ProjectBuilder builder, XamarinAndroidProject project, bool designtime = false)
{
string path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,12 +522,16 @@ public void GenerateResourceDesigner_false([Values (false, true)] bool useDesign
var dotnet = CreateDotNetBuilder (proj);
Assert.IsTrue (dotnet.Build(target: "CoreCompile", parameters: new string[] { "BuildingInsideVisualStudio=true" }), "Designtime build should succeed.");
var intermediate = Path.Combine (FullProjectDirectory, proj.IntermediateOutputPath);
var resource_designer_cs = GetResourceDesignerPath (dotnet, proj, designtime: true);
var resource_designer_cs = Path.Combine (intermediate, "designtime", "Resource.designer.cs");
if (useDesignerAssembly)
resource_designer_cs = Path.Combine (intermediate, "__Microsoft.Android.Resource.Designer.cs");
FileAssert.DoesNotExist (resource_designer_cs);

Assert.IsTrue (dotnet.Build (), "build should succeed");

resource_designer_cs = GetResourceDesignerPath (dotnet, proj);
resource_designer_cs = Path.Combine (intermediate, "Resource.designer.cs");
if (useDesignerAssembly)
resource_designer_cs = Path.Combine (intermediate, "__Microsoft.Android.Resource.Designer.cs");
FileAssert.DoesNotExist (resource_designer_cs);

var assemblyPath = Path.Combine (FullProjectDirectory, proj.OutputPath, $"{proj.ProjectName}.dll");
Expand Down

0 comments on commit a0f0711

Please sign in to comment.