예제 #1
0
        public ProjectPaths BuildExtension(string hostAppName, string extensionName, int expectedErrorCount = 0)
        {
            var mtouchPaths = SetupProjectPaths(hostAppName);

            MonoTouchProject = mtouchPaths;

            string extensionPath = Path.Combine(AppBundlePath, "PlugIns", extensionName + ".appex");
            var    proj          = new ProjectPaths {
                AppBundlePath = extensionPath,
            };

            Engine.ProjectCollection.SetGlobalProperty("Platform", Platform);
            Engine.ProjectCollection.SetGlobalProperty("Configuration", Config);

            RunTarget(mtouchPaths, "Clean");
            Assert.IsFalse(Directory.Exists(AppBundlePath), "App bundle exists after cleanup: {0} ", AppBundlePath);

            RunTarget(mtouchPaths, "Build", expectedErrorCount: expectedErrorCount);

            if (expectedErrorCount > 0)
            {
                return(proj);
            }

            Assert.IsTrue(Directory.Exists(AppBundlePath), "App Bundle does not exist: {0} ", AppBundlePath);

            TestPList(AppBundlePath, new string[] { "CFBundleExecutable", "CFBundleVersion" });

            Assert.IsTrue(Directory.Exists(extensionPath), "Appex directory does not exist: {0} ", extensionPath);

            TestPList(extensionPath, new string[] { "CFBundleExecutable", "CFBundleVersion" });

            TestFilesExists(AppBundlePath, ExpectedAppFiles);
            TestFilesDoNotExist(AppBundlePath, UnexpectedAppFiles);

            string [] coreFiles;
            var       basedirs = new List <string> ();

            if (IsWatchOS)
            {
                basedirs.Add(extensionPath);
                coreFiles = GetCoreAppFiles(extensionName + ".dll", Path.GetFileNameWithoutExtension(extensionPath));
            }
            else
            {
                basedirs.Add(AppBundlePath);
                if (Platform == "iPhone")
                {
                    basedirs.Add(Path.Combine(AppBundlePath, ".monotouch-32"));
                    basedirs.Add(Path.Combine(AppBundlePath, "Frameworks", "Xamarin.Sdk.framework", "MonoBundle"));
                    basedirs.Add(Path.Combine(AppBundlePath, "Frameworks", "Xamarin.Sdk.framework", "MonoBundle", ".monotouch-32"));
                }
                coreFiles = GetCoreAppFiles(hostAppName + ".exe", hostAppName);
            }
            TestFilesExists(basedirs.ToArray(), coreFiles);

            return(proj);
        }
예제 #2
0
        void BuildProjectNoEmbedding(ProjectPaths project, bool clean = true)
        {
            Engine.ProjectCollection.SetGlobalProperty("Platform", Platform);

            if (clean)
            {
                RunTarget(project, "Clean");
            }
            RunTarget(project, "Build");
        }
        void BuildProjectNoEmbedding(ProjectPaths project, bool clean = true)
        {
            Engine.ProjectCollection.SetGlobalProperty("Platform", Platform);
            var proj = SetupProject(Engine, project.ProjectCSProjPath);

            SetNoBindingEmbedding();

            if (clean)
            {
                RunTarget(proj, "Clean", 0);
            }
            RunTarget(proj, "Build", 0);
        }
예제 #4
0
        void BuildProjectNoEmbedding(ProjectPaths project, bool clean = true)
        {
            Engine.ProjectCollection.SetGlobalProperty("Platform", Platform);

            var properties = new Dictionary <string, string> {
                { "NoBindingEmbedding", "true" },
            };

            if (clean)
            {
                RunTarget(project, "Clean", properties: properties);
            }
            RunTarget(project, "Build", properties: properties);
        }
예제 #5
0
 public virtual void Setup()
 {
     engine = null;
     paths  = null;
 }