Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/common/mac/ApiDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ namespace ExampleBinding
//
// For more information, see http://developer.xamarin.com/guides/ios/advanced_topics/binding_objective-c/
//
%CODE%
REPLACE_CODE_REPLACE
}
2 changes: 1 addition & 1 deletion tests/common/mac/BindingProjectWithNoTag.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
%CODE%
REPLACE_CODE_REPLACE
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down
2 changes: 1 addition & 1 deletion tests/common/mac/Component1.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ namespace FSharpXM45Library
type Class1() =
member this.X = "F#"

%CODE%
REPLACE_CODE_REPLACE
2 changes: 1 addition & 1 deletion tests/common/mac/MobileBinding.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
%CODE%
REPLACE_CODE_REPLACE
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down
2 changes: 1 addition & 1 deletion tests/common/mac/MyClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ public MyClass ()
}
}

%CODE%
REPLACE_CODE_REPLACE
14 changes: 7 additions & 7 deletions tests/common/mac/ProjectTestHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public static BuildResult BuildProject (string csprojTarget, bool shouldFail = f

static string ProjectTextReplacement (UnifiedTestConfig config, string text)
{
text = text.Replace ("%CODE%", config.CSProjConfig)
text = text.Replace ("REPLACE_CODE_REPLACE", config.CSProjConfig)
.Replace ("%REFERENCES%", config.References)
.Replace ("%REFERENCES_BEFORE_PLATFORM%", config.ReferencesBeforePlatform)
.Replace ("%NAME%", config.AssemblyName ?? Path.GetFileNameWithoutExtension (config.ProjectName))
Expand Down Expand Up @@ -304,8 +304,8 @@ public static string GenerateEXEProject (UnifiedTestConfig config)
public static string GenerateBindingLibraryProject (UnifiedTestConfig config)
{
string sourceDir = FindSourceDirectory ();
CopyFileWithSubstitutions (Path.Combine (sourceDir, "ApiDefinition.cs"), Path.Combine (config.TmpDir, "ApiDefinition.cs"), text => text.Replace ("%CODE%", config.APIDefinitionConfig));
CopyFileWithSubstitutions (Path.Combine (sourceDir, "StructsAndEnums.cs"), Path.Combine (config.TmpDir, "StructsAndEnums.cs"), text => text.Replace ("%CODE%", config.StructsAndEnumsConfig));
CopyFileWithSubstitutions (Path.Combine (sourceDir, "ApiDefinition.cs"), Path.Combine (config.TmpDir, "ApiDefinition.cs"), text => text.Replace ("REPLACE_CODE_REPLACE", config.APIDefinitionConfig));
CopyFileWithSubstitutions (Path.Combine (sourceDir, "StructsAndEnums.cs"), Path.Combine (config.TmpDir, "StructsAndEnums.cs"), text => text.Replace ("REPLACE_CODE_REPLACE", config.StructsAndEnumsConfig));

string linkWithName = null;
if (config.LinkWithName != null) {
Expand All @@ -331,7 +331,7 @@ public static string GenerateUnifiedLibraryProject (UnifiedTestConfig config)
string projectSuffix = config.FSharp ? ".fsproj" : ".csproj";

CopyFileWithSubstitutions (Path.Combine (sourceDir, sourceFileName), Path.Combine (config.TmpDir, sourceFileName), text => {
return text.Replace ("%CODE%", config.TestCode);
return text.Replace ("REPLACE_CODE_REPLACE", config.TestCode);
});

return CopyFileWithSubstitutions (Path.Combine (sourceDir, config.ProjectName + projectSuffix), Path.Combine (config.TmpDir, config.ProjectName + projectSuffix), text => {
Expand Down Expand Up @@ -474,7 +474,7 @@ open AppKit
[<EntryPoint>]
let main args =
NSApplication.Init ()
%CODE%
REPLACE_CODE_REPLACE
0";

const string MainTemplate = @"
Expand All @@ -490,12 +490,12 @@ class MainClass
static void Main (string[] args)
{
NSApplication.Init ();
%CODE%
REPLACE_CODE_REPLACE
}
}
}";
string currentTemplate = fsharp ? FSharpMainTemplate : MainTemplate;
string testCase = currentTemplate.Replace ("%CODE%", content).Replace ("%DECL%", decl);
string testCase = currentTemplate.Replace ("REPLACE_CODE_REPLACE", content).Replace ("%DECL%", decl);
using (StreamWriter s = new StreamWriter (location))
s.Write(testCase);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/common/mac/StructsAndEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

namespace ExampleBinding
{
%CODE%
REPLACE_CODE_REPLACE
}
4 changes: 2 additions & 2 deletions tests/common/mac/SystemMonoExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<Optimize>false</Optimize>
<DebugSymbols>true</DebugSymbols>
<Profiling>false</Profiling>
%CODE%
REPLACE_CODE_REPLACE
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<EnableCodeSigning>false</EnableCodeSigning>
Expand All @@ -34,7 +34,7 @@
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
<DebugSymbols>true</DebugSymbols>
%CODE%
REPLACE_CODE_REPLACE
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down
2 changes: 1 addition & 1 deletion tests/common/mac/Today/TodayViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public TodayViewController (IntPtr handle) : base (handle)
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
%TESTCODE%
REPLACE_CODE_REPLACE
// Do any additional setup after loading the view.
}

Expand Down
4 changes: 2 additions & 2 deletions tests/common/mac/UnifiedExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<UseRefCounting>true</UseRefCounting>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
%CODE%
REPLACE_CODE_REPLACE
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -39,7 +39,7 @@
<UseSGen>true</UseSGen>
<UseRefCounting>true</UseRefCounting>
<LinkMode>SdkOnly</LinkMode>
%CODE%
REPLACE_CODE_REPLACE
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down
2 changes: 1 addition & 1 deletion tests/common/mac/UnifiedLibrary.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<CreatePackage>false</CreatePackage>
<EnableCodeSigning>false</EnableCodeSigning>
<EnablePackageSigning>false</EnablePackageSigning>
%CODE%
REPLACE_CODE_REPLACE
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down
2 changes: 1 addition & 1 deletion tests/common/mac/XM45Binding.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
%CODE%
REPLACE_CODE_REPLACE
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down
4 changes: 2 additions & 2 deletions tests/common/mac/XM45Example.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<EnablePackageSigning>false</EnablePackageSigning>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
%CODE%
REPLACE_CODE_REPLACE
<Profiling>false</Profiling>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
Expand All @@ -35,7 +35,7 @@
<EnableCodeSigning>false</EnableCodeSigning>
<CreatePackage>false</CreatePackage>
<EnablePackageSigning>false</EnablePackageSigning>
%CODE%
REPLACE_CODE_REPLACE
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion tests/common/mac/XM45Library.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
%CODE%
REPLACE_CODE_REPLACE
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down
2 changes: 1 addition & 1 deletion tests/mmptest/src/ExtensionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void TodayExtension_SmokeTest ()
string project = Path.Combine (tmpDir, "Today/TodayExtensionTest.csproj");
string main = Path.Combine (tmpDir, "Today/TodayViewController.cs");
TI.CopyFileWithSubstitutions (project, project, s => s.Replace ("%ITEMGROUP%", ""));
TI.CopyFileWithSubstitutions (main, main, s => s.Replace ("%TESTCODE%", ""));
TI.CopyFileWithSubstitutions (main, main, s => s.Replace ("REPLACE_CODE_REPLACE", ""));
TI.BuildProject (project);
});
}
Expand Down
2 changes: 1 addition & 1 deletion tests/mmptest/src/PackageReferenceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void ExtensionProjectPackageReferencs_Build ()
string main = Path.Combine (tmpDir, "Today/TodayViewController.cs");

TI.CopyFileWithSubstitutions (project, project, s => s.Replace ("%ITEMGROUP%", PackageReference));
TI.CopyFileWithSubstitutions (main, main, s => s.Replace ("%TESTCODE%", TestCode));
TI.CopyFileWithSubstitutions (main, main, s => s.Replace ("REPLACE_CODE_REPLACE", TestCode));

TI.NugetRestore (project);
var buildResult = TI.BuildProject (Path.Combine (tmpDir, "Today/TodayExtensionTest.csproj"));
Expand Down
2 changes: 1 addition & 1 deletion tests/mmptest/src/XM45Example.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<UseRefCounting>false</UseRefCounting>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
%CODE%
REPLACE_CODE_REPLACE
<Profiling>false</Profiling></PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down