Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Köplinger <alex.koeplinger@outlook.com>2018-11-07 21:42:06 +0300
committerLudovic Henry <luhenry@microsoft.com>2018-11-07 21:42:06 +0300
commitab9c940dffc9095d8bb317a4d70502a0de0aacc0 (patch)
tree94ee2b2626875feb5af47ce1119cae9f58ff4c65
parente14d92437ed0d4e7b5bc7d3478c738787246c744 (diff)
[android sdk] Package resource assemblies into app bundle (#11583)
.NET resource assemblies live in subdirectories named after the culture of the resource. We need to package these assemblies too. Follow up to https://github.com/mono/mono/pull/11575
-rw-r--r--mcs/class/corlib/Test/System.Resources/ResourceManagerTest.cs1
-rw-r--r--sdks/android/Makefile7
-rw-r--r--sdks/android/app/src/main/java/org/mono/android/AndroidRunner.java14
-rw-r--r--sdks/android/managed/main.cs2
4 files changed, 21 insertions, 3 deletions
diff --git a/mcs/class/corlib/Test/System.Resources/ResourceManagerTest.cs b/mcs/class/corlib/Test/System.Resources/ResourceManagerTest.cs
index ff5692b5fc2..176191482a9 100644
--- a/mcs/class/corlib/Test/System.Resources/ResourceManagerTest.cs
+++ b/mcs/class/corlib/Test/System.Resources/ResourceManagerTest.cs
@@ -787,7 +787,6 @@ namespace MonoTests.System.Resources
}
[Test]
- [Category ("SatelliteAssembliesNotWorking")]
public void TestSatellites ()
{
ResourceManager manager = new ResourceManager("Resources", GetType ().Assembly);
diff --git a/sdks/android/Makefile b/sdks/android/Makefile
index 456f8d305f2..67cc60b80b8 100644
--- a/sdks/android/Makefile
+++ b/sdks/android/Makefile
@@ -167,6 +167,13 @@ endef
$(foreach check,$(BCL_CHECKS),$(eval $(call BCLTestAssemblyTemplate,$(check))))
+# corlib tests need additional resource assemblies
+app/assets/asm/monodroid_corlib_test.dll: app/assets/asm/es-ES/monodroid_corlib_test.resources.dll app/assets/asm/nn-NO/monodroid_corlib_test.resources.dll
+
+app/assets/asm/%/monodroid_corlib_test.resources.dll: $(TOP)/mcs/class/lib/monodroid/tests/%/monodroid_corlib_test.resources.dll
+ mkdir -p $(dir $@)
+ cp $< $@
+
## Package the mini test assembly
MINI_TEST_SOURCES= \
diff --git a/sdks/android/app/src/main/java/org/mono/android/AndroidRunner.java b/sdks/android/app/src/main/java/org/mono/android/AndroidRunner.java
index 9d53cd51eb7..4a9b4ae9b47 100644
--- a/sdks/android/app/src/main/java/org/mono/android/AndroidRunner.java
+++ b/sdks/android/app/src/main/java/org/mono/android/AndroidRunner.java
@@ -15,6 +15,7 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
+import java.io.FileNotFoundException;
import org.mono.android.AndroidTestRunner.R;
@@ -72,8 +73,19 @@ public class AndroidRunner extends Instrumentation
for (int i = 0; i < res.length; ++i) {
String fromFile = path + "/" + res [i];
String toFile = outpath + "/" + res [i];
+
+ InputStream fromStream;
+ try {
+ fromStream = am.open (fromFile);
+ } catch (FileNotFoundException e) {
+ // am.list() returns directories, we need to process them too
+ new File (toFile).mkdirs ();
+ copyAssetDir (am, fromFile, toFile);
+ continue;
+ }
+
Log.w ("MONO", "\tCOPYING " + fromFile + " to " + toFile);
- copy (am.open (fromFile), new FileOutputStream (toFile));
+ copy (fromStream, new FileOutputStream (toFile));
}
} catch (Exception e) {
Log.w ("MONO", "WTF", e);
diff --git a/sdks/android/managed/main.cs b/sdks/android/managed/main.cs
index 1644b918aab..86b66f8aff7 100644
--- a/sdks/android/managed/main.cs
+++ b/sdks/android/managed/main.cs
@@ -15,7 +15,7 @@ public class Driver
public static void RunTests ()
{
- string exclude = "NotOnMac,NotWorking,ValueAdd,CAS,InetAccess,MobileNotWorking,SatelliteAssembliesNotWorking,AndroidNotWorking";
+ string exclude = "NotOnMac,NotWorking,ValueAdd,CAS,InetAccess,MobileNotWorking,AndroidNotWorking";
if (IntPtr.Size == 4)
exclude += ",LargeFileSupport";