예제 #1
0
        public void Save(XamarinProject project, bool doNotCleanupOnUpdate = false, bool saveProject = true)
        {
            var files = project.Save(saveProject);

            if (!built_before)
            {
                if (project.ShouldPopulate)
                {
                    if (Directory.Exists(ProjectDirectory))
                    {
                        FileSystemUtils.SetDirectoryWriteable(ProjectDirectory);
                        Directory.Delete(ProjectDirectory, true);
                    }
                    if (Directory.Exists(PackagesDirectory))
                    {
                        Directory.Delete(PackagesDirectory, true);
                    }
                    project.Populate(ProjectDirectory, files);
                }

                // Copy our solution's NuGet.config
                var nuget_config = Path.Combine(XABuildPaths.TopDirectory, "NuGet.config");
                var dest         = Path.Combine(Root, ProjectDirectory, "NuGet.config");
                if (File.Exists(nuget_config) && !File.Exists(dest))
                {
                    File.Copy(nuget_config, dest, overwrite: true);
                }
            }
            else
            {
                project.UpdateProjectFiles(ProjectDirectory, files, doNotCleanupOnUpdate);
            }
        }
        public void Save(XamarinProject project, bool doNotCleanupOnUpdate = false, bool saveProject = true)
        {
            var files = project.Save(saveProject);

            if (!built_before)
            {
                if (project.ShouldPopulate)
                {
                    if (Directory.Exists(ProjectDirectory))
                    {
                        FileSystemUtils.SetDirectoryWriteable(ProjectDirectory);
                        Directory.Delete(ProjectDirectory, true);
                    }
                    if (Directory.Exists(PackagesDirectory))
                    {
                        Directory.Delete(PackagesDirectory, true);
                    }
                    project.Populate(ProjectDirectory, files);
                }

                project.CopyNuGetConfig(ProjectDirectory);
            }
            else
            {
                project.UpdateProjectFiles(ProjectDirectory, files, doNotCleanupOnUpdate);
            }
        }
예제 #3
0
 /// <summary>
 /// Adds a reference to another project. The optional include path uses a relative path and ProjectName if omitted.
 /// </summary>
 public void AddReference(XamarinProject other, string include = null)
 {
     if (string.IsNullOrEmpty(include))
     {
         include = $"..\\{other.ProjectName}\\{other.ProjectName}.csproj";
     }
     References.Add(new BuildItem.ProjectReference(include, other.ProjectName, other.ProjectGuid));
 }
예제 #4
0
        public bool RunTarget(XamarinProject project, string target, bool doNotCleanupOnUpdate = false, string [] parameters = null, Dictionary <string, string> environmentVariables = null, bool saveProject = true)
        {
            var oldTarget = Target;

            Target = target;
            try {
                return(Build(project, doNotCleanupOnUpdate: doNotCleanupOnUpdate, parameters: parameters, saveProject: saveProject, environmentVariables: environmentVariables));
            } finally {
                Target = oldTarget;
            }
        }
예제 #5
0
        public bool Restore(XamarinProject project, bool doNotCleanupOnUpdate = false)
        {
            var oldTarget = Target;

            Target = "Restore";
            try {
                return(Build(project, doNotCleanupOnUpdate));
            } finally {
                Target = oldTarget;
            }
        }
예제 #6
0
        public bool UpdateAndroidResources(XamarinProject project, bool doNotCleanupOnUpdate = false, string [] parameters = null, Dictionary <string, string> environmentVariables = null)
        {
            var oldTarget = Target;

            Target = "UpdateAndroidResources";
            try {
                return(Build(project, doNotCleanupOnUpdate: doNotCleanupOnUpdate, parameters: parameters, environmentVariables: environmentVariables));
            }
            finally {
                Target = oldTarget;
            }
        }
예제 #7
0
        public bool UpdateAndroidResources(XamarinProject project, bool doNotCleanupOnUpdate = false, string [] parameters = null)
        {
            var oldTarget = Target;

            Target = "UpdateAndroidResources";
            try {
                return(Build(project, doNotCleanupOnUpdate: doNotCleanupOnUpdate, parameters: parameters));
            }
            finally {
                Target = oldTarget;
            }
        }
예제 #8
0
 public bool DesignTimeBuild(XamarinProject project, string target = "Compile", bool doNotCleanupOnUpdate = false, string [] parameters = null)
 {
     if (parameters == null)
     {
         return(RunTarget(project, target, doNotCleanupOnUpdate, parameters: new string [] { "DesignTimeBuild=True" }));
     }
     else
     {
         var designTimeParameters = new string [parameters.Length + 1];
         parameters.CopyTo(designTimeParameters, 0);
         designTimeParameters [parameters.Length] = "DesignTimeBuild=True";
         return(RunTarget(project, target, doNotCleanupOnUpdate, parameters: designTimeParameters));
     }
 }
예제 #9
0
        public bool Build(XamarinProject project, bool doNotCleanupOnUpdate = false, string [] parameters = null, bool saveProject = true)
        {
            Save (project, doNotCleanupOnUpdate, saveProject);

            Output = project.CreateBuildOutput (this);

            project.NuGetRestore (ProjectDirectory, PackagesDirectory);

            bool result = BuildInternal (Path.Combine (ProjectDirectory, project.ProjectFilePath), Target, parameters);
            built_before = true;

            if (CleanupAfterSuccessfulBuild)
                Cleanup ();
            last_build_result = result;
            return result;
        }
예제 #10
0
        public bool Build(XamarinProject project, bool doNotCleanupOnUpdate = false, string [] parameters = null, bool saveProject = true, Dictionary <string, string> environmentVariables = null)
        {
            Save(project, doNotCleanupOnUpdate, saveProject);

            Output = project.CreateBuildOutput(this);

            project.NuGetRestore(ProjectDirectory, PackagesDirectory);

            bool result = BuildInternal(Path.Combine(ProjectDirectory, project.ProjectFilePath), Target, parameters, environmentVariables);

            built_before = true;

            if (CleanupAfterSuccessfulBuild)
            {
                Cleanup();
            }
            last_build_result = result;
            return(result);
        }
예제 #11
0
 public bool BuildProject(XamarinProject project, string target = "Build")
 {
     BuildSucceeded = BuildInternal(Path.Combine(SolutionPath, project.ProjectName, project.ProjectFilePath), target, restore: project.PackageReferences?.Count > 0);
     return(BuildSucceeded);
 }
예제 #12
0
 public bool BuildProject(XamarinProject project, string target = "Build")
 {
     BuildSucceeded = BuildInternal(Path.Combine(SolutionPath, project.ProjectName, project.ProjectFilePath), target);
     return(BuildSucceeded);
 }
예제 #13
0
 public bool Clean(XamarinProject project, bool doNotCleanupOnUpdate = false)
 {
     var oldTarget = Target;
     Target = "Clean";
     try {
         return Build (project, doNotCleanupOnUpdate);
     }
     finally {
         Target = oldTarget;
     }
 }
예제 #14
0
 public bool Clean(XamarinProject project, bool doNotCleanupOnUpdate = false)
 {
     return(RunTarget(project, "Clean", doNotCleanupOnUpdate));
 }
예제 #15
0
 public bool UpdateAndroidResources(XamarinProject project, bool doNotCleanupOnUpdate = false, string [] parameters = null, Dictionary <string, string> environmentVariables = null)
 {
     return(RunTarget(project, "UpdateAndroidResources", doNotCleanupOnUpdate, parameters, environmentVariables));
 }
예제 #16
0
 public bool Uninstall(XamarinProject project, bool doNotCleanupOnUpdate = false, bool saveProject = true)
 {
     return(RunTarget(project, "Uninstall", doNotCleanupOnUpdate));
 }
예제 #17
0
 public bool Restore(XamarinProject project, bool doNotCleanupOnUpdate = false, string [] parameters = null)
 {
     return(RunTarget(project, "Restore", doNotCleanupOnUpdate, parameters));
 }
예제 #18
0
 public bool Restore(XamarinProject project, bool doNotCleanupOnUpdate = false)
 {
     return(RunTarget(project, "Restore", doNotCleanupOnUpdate));
 }
예제 #19
0
 public bool Install(XamarinProject project, bool doNotCleanupOnUpdate = false, string [] parameters = null, bool saveProject = true)
 {
     //NOTE: since $(BuildingInsideVisualStudio) is set, Build will not happen by default
     return(RunTarget(project, "Build,Install", doNotCleanupOnUpdate, parameters, saveProject: saveProject));
 }
예제 #20
0
 public bool DesignTimeBuild(XamarinProject project, bool doNotCleanupOnUpdate = false)
 {
     return(RunTarget(project, "Compile", doNotCleanupOnUpdate, parameters: new string [] { "DesignTimeBuild=True" }));
 }
예제 #21
0
 public bool UpdateAndroidResources(XamarinProject project, bool doNotCleanupOnUpdate = false, string [] parameters = null)
 {
     var oldTarget = Target;
     Target = "UpdateAndroidResources";
     try {
         return Build (project, doNotCleanupOnUpdate: doNotCleanupOnUpdate, parameters: parameters);
     }
     finally {
         Target = oldTarget;
     }
 }
예제 #22
0
 internal AndroidApplicationBuildOutput(XamarinProject project)
     : base(project)
 {
 }
예제 #23
0
 internal AndroidApplicationBuildOutput(XamarinProject project)
     : base(project)
 {
 }
예제 #24
0
 internal BuildOutput(XamarinProject project)
 {
     Project = project;
 }
예제 #25
0
 internal BuildOutput(XamarinProject project)
 {
     Project = project;
 }
예제 #26
0
        public void Save(XamarinProject project, bool doNotCleanupOnUpdate = false, bool saveProject = true)
        {
            var files = project.Save (saveProject);

            if (!built_before) {
                if (Directory.Exists (ProjectDirectory)) {
                    FileSystemUtils.SetDirectoryWriteable (ProjectDirectory);
                    Directory.Delete (ProjectDirectory, true);
                }
                if (Directory.Exists (PackagesDirectory))
                    Directory.Delete (PackagesDirectory, true);
                project.Populate (ProjectDirectory, files);
            }
            else
                project.UpdateProjectFiles (ProjectDirectory, files, doNotCleanupOnUpdate);
        }