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
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ void Extract (
// temporarily extracted directory will look like:
// __library_projects__/[dllname]/[library_project_imports | jlibs]/bin
using (var zip = MonoAndroidHelper.ReadZipFile (finfo.FullName)) {
updated |= Files.ExtractAll (zip, outDirForDll, modifyCallback: (entryFullName) => {
return entryFullName.Replace ("library_project_imports", ImportsDirectory);
updated |= Files.ExtractAll (zip, importsDir, modifyCallback: (entryFullName) => {
return entryFullName.Replace ("library_project_imports/", "");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we prefer "" over string.Empty ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore that last comment

}, forceUpdate: false);
}

Expand Down
1 change: 1 addition & 0 deletions tests/locales/LibraryResources/Environment.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
THIS_IS_MY_ENVIRONMENT=Well, hello there!
3 changes: 3 additions & 0 deletions tests/locales/LibraryResources/LibraryResources.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
<ItemGroup>
<AndroidResource Include="Resources\values\Strings.xml" />
</ItemGroup>
<ItemGroup>
<AndroidEnvironment Include="Environment.txt" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<ItemGroup>
<EmbeddedResource Include="strings.de-DE.resx" />
Expand Down
19 changes: 19 additions & 0 deletions tests/locales/Xamarin.Android.Locale-Tests/EnvironmentTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Reflection;

using NUnit.Framework;

namespace Xamarin.Android.LocaleTests
{
[TestFixture]
public class EnvironmentTests
{
[Test (Description="https://bugzilla.xamarin.com/show_bug.cgi?id=58673")]
public void EnvironmentVariablesFromLibraryProjectsAreMerged ()
{
var v = Environment.GetEnvironmentVariable ("THIS_IS_MY_ENVIRONMENT");
Assert.AreEqual (v, "Well, hello there!");
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<Reference Include="Xamarin.Android.NUnitLite" />
</ItemGroup>
<ItemGroup>
<Compile Include="EnvironmentTests.cs" />
<Compile Include="MainActivity.cs" />
<Compile Include="Resources\Resource.designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down