forked from dotnet/java-interop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tests] ported environment variables to MSBuild (dotnet#195)
This ensures the following values are set on Windows: - MONO_TRACE_LISTENER - JAVA_INTEROP_GREF_LOG - JAVA_INTEROP_LREF_LOG This also cleans up what needs to be done downstream in xamarin-android: dotnet/android#949 This required a new `Java.Interop.BootstrapTasks` project that adds a `<SetEnvironmentVariable/>` MSBuild task. This will be useful down the road, for setting "prepare" steps in this repo for Windows. Running `PerformanceTests` also is occasionally, *randomly*, slower than expected. (The exact reason why is currently unknown.) When it's "too" slow, an `ArgumentOutOfRangeException` was being thrown from `FormatFraction()` because the overall width for the time was longer than what was permitted. Increase the width to allow more digits. Minor updates to `.gitignore` file.
- Loading branch information
1 parent
93f92fc
commit 5cf61f5
Showing
8 changed files
with
121 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ TestResult-*.xml | |
xa-gendarme.html | ||
packages | ||
.vs/ | ||
*.userprefs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/Java.Interop.BootstrapTasks/Java.Interop.BootstrapTasks.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{3E8E5C8C-59A6-4A9A-B55D-46AB14431B2A}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<RootNamespace>Java.Interop.BootstrapTasks</RootNamespace> | ||
<AssemblyName>Java.Interop.BootstrapTasks</AssemblyName> | ||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion> | ||
<ProductVersion>8.0.30703</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
</PropertyGroup> | ||
<Import Project="..\..\Configuration.props" /> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>True</DebugSymbols> | ||
<DebugType>Full</DebugType> | ||
<Optimize>False</Optimize> | ||
<OutputPath>..\..\bin\BuildDebug</OutputPath> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<ConsolePause>false</ConsolePause> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<Optimize>true</Optimize> | ||
<OutputPath>..\..\bin\BuildRelease</OutputPath> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<ConsolePause>false</ConsolePause> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="mscorlib" /> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Net.Http" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="Microsoft.Build.Framework" /> | ||
<Reference Include="Microsoft.Build.Utilities.v4.0" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="Java.Interop.BootstrapTasks\SetEnvironmentVariable.cs" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | ||
</Project> |
28 changes: 28 additions & 0 deletions
28
src/Java.Interop.BootstrapTasks/Java.Interop.BootstrapTasks/SetEnvironmentVariable.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
|
||
using Microsoft.Build.Framework; | ||
using Microsoft.Build.Utilities; | ||
|
||
namespace Java.Interop.BootstrapTasks | ||
{ | ||
public class SetEnvironmentVariable : Task | ||
{ | ||
[Required] | ||
public string Name { get; set; } | ||
|
||
[Required] | ||
public string Value { get; set; } | ||
|
||
public override bool Execute () | ||
{ | ||
Log.LogMessage (MessageImportance.Low, $"Task {nameof (SetEnvironmentVariable)}"); | ||
Log.LogMessage (MessageImportance.Low, $" {nameof (Name)}: {Name}"); | ||
Log.LogMessage (MessageImportance.Low, $" {nameof (Value)}: {Value}"); | ||
|
||
Environment.SetEnvironmentVariable (Name, Value); | ||
|
||
return !Log.HasLoggedErrors; | ||
} | ||
} | ||
} | ||
|
27 changes: 27 additions & 0 deletions
27
src/Java.Interop.BootstrapTasks/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
|
||
// Information about this assembly is defined by the following attributes. | ||
// Change them to the values specific to your project. | ||
|
||
[assembly: AssemblyTitle ("Java.Interop.BootstrapTasks")] | ||
[assembly: AssemblyDescription ("")] | ||
[assembly: AssemblyConfiguration ("")] | ||
[assembly: AssemblyCompany ("Xamarin Inc.")] | ||
[assembly: AssemblyProduct ("")] | ||
[assembly: AssemblyCopyright ("Xamarin Inc.")] | ||
[assembly: AssemblyTrademark ("Xamarin")] | ||
[assembly: AssemblyCulture ("")] | ||
|
||
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". | ||
// The form "{Major}.{Minor}.*" will automatically update the build and revision, | ||
// and "{Major}.{Minor}.{Build}.*" will update just the revision. | ||
|
||
[assembly: AssemblyVersion ("1.0.*")] | ||
|
||
// The following attributes are used to specify the signing key for the assembly, | ||
// if desired. See the Mono documentation for more information about signing. | ||
|
||
//[assembly: AssemblyDelaySign(false)] | ||
//[assembly: AssemblyKeyFile("")] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters