Example #1
0
        public void AarWithRClassesJar()
        {
            var path = Path.Combine("temp", TestName);
            var lib1 = new XamarinAndroidBindingProject {
                ProjectName        = "Library1",
                AndroidClassParser = "class-parse",
                Jars =
                {
                    new AndroidItem.LibraryProjectZip("Library1.aar")
                    {
                        BinaryContent = () => ResourceData.Library1Aar
                    }
                },
            };
            var lib2 = new XamarinAndroidBindingProject {
                ProjectName        = "Library2",
                AndroidClassParser = "class-parse",
                Jars =
                {
                    new AndroidItem.LibraryProjectZip("Library2.aar")
                    {
                        BinaryContent = () => ResourceData.Library2Aar
                    }
                },
            };
            var app = new XamarinAndroidApplicationProject();

            app.AddReference(lib1);
            app.AddReference(lib2);
            using (var lib1Builder = CreateDllBuilder(Path.Combine(path, lib1.ProjectName)))
                using (var lib2Builder = CreateDllBuilder(Path.Combine(path, lib2.ProjectName)))
                    using (var appBuilder = CreateApkBuilder(Path.Combine(path, app.ProjectName))) {
                        Assert.IsTrue(lib1Builder.Build(lib1), "Library1 build should have succeeded.");
                        Assert.IsTrue(lib2Builder.Build(lib2), "Library2 build should have succeeded.");
                        Assert.IsTrue(appBuilder.Build(app), "App build should have succeeded.");
                    }
        }