Skip to content

Commit

Permalink
Fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dellis1972 committed Nov 4, 2024
1 parent 13dc8fe commit 26cfd6d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ public override bool RunTask ()
while ((line = reader.ReadLine()) != null) {
if (string.IsNullOrEmpty (line))
continue;
//string [] tok = line.Split (';');
//AddRename (tok [1].Replace ('/', Path.DirectorySeparatorChar), tok [0].Replace ('/', Path.DirectorySeparatorChar));
string [] tok = line.Split (';');
AddRename (tok [1].Replace ('/', Path.DirectorySeparatorChar), tok [0].Replace ('/', Path.DirectorySeparatorChar));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -756,20 +756,20 @@ public void BuildInDesignTimeMode ([Values(false, true)] bool useManagedParser)
builder.Target = "UpdateAndroidResources";
builder.Build (proj, parameters: new string[] { "DesignTimeBuild=true" });
Assert.IsFalse (builder.Output.IsTargetSkipped ("_CreatePropertiesCache"), "target \"_CreatePropertiesCache\" should have been run.");
Assert.IsFalse (builder.Output.IsTargetSkipped ("_ResolveLibraryProjectImports"), "target \"_ResolveLibraryProjectImports\' should have been run.");
Assert.IsFalse (builder.Output.IsTargetSkipped ("_GenerateRtxt"), "target \"_GenerateRtxt\' should have been run.");
var intermediate = Path.Combine (Root, builder.ProjectDirectory, proj.IntermediateOutputPath);
var librarycache = Path.Combine (intermediate, "designtime", "libraryprojectimports.cache");
Assert.IsTrue (File.Exists (librarycache), $"'{librarycache}' should exist.");
librarycache = Path.Combine (intermediate, "libraryprojectimports.cache");
Assert.IsFalse (File.Exists (librarycache), $"'{librarycache}' should not exist.");
var rTxtFile = Path.Combine (intermediate, "designtime", "R.txt");
Assert.IsTrue (File.Exists (rTxtFile), $"'{rTxtFile}' should exist.");
rTxtFile = Path.Combine (intermediate, "R.txt");
Assert.IsFalse (File.Exists (rTxtFile), $"'{rTxtFile}' should not exist.");
builder.Build (proj, parameters: new string[] { "DesignTimeBuild=true" });
Assert.IsFalse (builder.Output.IsTargetSkipped ("_CreatePropertiesCache"), "target \"_CreatePropertiesCache\" should have been run.");
Assert.IsTrue (builder.Output.IsTargetSkipped ("_ResolveLibraryProjectImports"), "target \"_ResolveLibraryProjectImports\' should have been skipped.");
Assert.IsTrue (builder.Output.IsTargetSkipped ("_GenerateRtxt"), "target \"_GenerateRtxt\' should have been skipped.");
Assert.IsTrue (builder.Clean (proj), "Clean Should have succeeded");
builder.Target = "_CleanDesignTimeIntermediateDir";
Assert.IsTrue (builder.Build (proj), "_CleanDesignTimeIntermediateDir should have succeeded");
librarycache = Path.Combine (intermediate, "designtime", "libraryprojectimports.cache");
Assert.IsFalse (File.Exists (librarycache), $"'{librarycache}' should not exist.");
rTxtFile = Path.Combine (intermediate, "designtime", "R.txt");
Assert.IsFalse (File.Exists (rTxtFile), $"'{rTxtFile}' should not exist.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1177,14 +1177,14 @@ public void DesignTimeBuild ()
var proj = new XamarinAndroidApplicationProject ();
using (var b = CreateApkBuilder (Path.Combine ("temp", $"{nameof (IncrementalBuildTest)}{TestName}"))) {
Assert.IsTrue (b.DesignTimeBuild (proj), "first dtb should have succeeded.");
var target = "_ResolveLibraryProjectImports";
var target = "_GenerateResourceDesignerAssembly";
Assert.IsFalse (b.Output.IsTargetSkipped (target), $"`{target}` should not have been skipped.");
// DesignTimeBuild=true lowercased
var parameters = new [] { "DesignTimeBuild=true" };
Assert.IsTrue (b.RunTarget (proj, "Compile", doNotCleanupOnUpdate: true, parameters: parameters), "second dtb should have succeeded.");
Assert.IsTrue (b.Output.IsTargetSkipped (target), $"`{target}` should have been skipped.");
Assert.IsTrue (b.Output.IsTargetSkipped (target, defaultIfNotUsed: true), $"`{target}` should have been skipped.");
Assert.IsTrue (b.RunTarget (proj, "UpdateGeneratedFiles", doNotCleanupOnUpdate: true, parameters: parameters), "UpdateGeneratedFiles should have succeeded.");
Assert.IsTrue (b.Output.IsTargetSkipped (target), $"`{target}` should have been skipped.");
Assert.IsTrue (b.Output.IsTargetSkipped (target, defaultIfNotUsed: true), $"`{target}` should have been skipped.");
Assert.IsTrue (b.Build (proj, doNotCleanupOnUpdate: true, saveProject: false), "full build should have succeeded.");
Assert.IsFalse (b.Output.IsTargetSkipped (target), $"`{target}` should not have been skipped.");
}
Expand All @@ -1211,7 +1211,7 @@ public void DesignTimeBuildSignAndroidPackage ()
Assert.IsTrue (builder.RunTarget (proj, "SignAndroidPackage", parameters: parameters), $"{proj.ProjectName} should succeed");
builder.Output.AssertTargetIsNotSkipped ("_GenerateResourceCaseMap", occurrence: 2);
builder.Output.AssertTargetIsSkipped ("_GenerateRtxt", occurrence: 1);
builder.Output.AssertTargetIsSkipped ("_GenerateResourceDesignerIntermediateClass", occurrence: 1);
builder.Output.AssertTargetIsNotSkipped ("_GenerateResourceDesignerIntermediateClass");
builder.Output.AssertTargetIsSkipped ("_GenerateResourceDesignerAssembly", occurrence: 2);
builder.BuildLogFile = "build2.log";
Assert.IsTrue (builder.RunTarget (proj, "SignAndroidPackage", parameters: parameters), $"{proj.ProjectName} should succeed 2");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ Copyright (C) 2011-2012 Xamarin. All rights reserved.
<Import Project="$(MSBuildThisFileDirectory)Xamarin.Android.Assets.targets" Condition=" '$(DesignTimeBuild)' != 'true' " />
<Import Project="$(MSBuildThisFileDirectory)Xamarin.Android.DesignTime.targets" />
<Import Project="$(MSBuildThisFileDirectory)Xamarin.Android.EmbeddedResource.targets" />
<Import Project="$(MSBuildThisFileDirectory)Xamarin.Android.Javac.targets" Condition=" '$(DesignTimeBuild)' != 'true' " />
<Import Project="$(MSBuildThisFileDirectory)Xamarin.Android.Javac.targets" />
<Import Project="$(MSBuildThisFileDirectory)Xamarin.Android.Resource.Designer.targets" />
<Import Project="$(MSBuildThisFileDirectory)Xamarin.Android.Tooling.targets" />

Expand Down Expand Up @@ -2847,7 +2847,7 @@ because xbuild doesn't support framework reference assemblies.

<Import Project="$(MSBuildThisFileDirectory)Xamarin.Android.Application.targets"
Condition=" '$(AndroidApplication)' == 'True' "/>
<!-- <Import Project="$(MSBuildThisFileDirectory)Xamarin.Android.Designer.targets" /> -->
<Import Project="$(MSBuildThisFileDirectory)Xamarin.Android.Designer.targets" />

<Import Project="$(MSBuildThisFileDirectory)Xamarin.Installer.Common.targets"
Condition="Exists('$(MSBuildThisFileDirectory)Xamarin.Installer.Common.targets') And '$(DesignTimeBuild)' != 'true' "/>
Expand Down

0 comments on commit 26cfd6d

Please sign in to comment.