/// <summary>
        /// Builds all MSBuild projects referenced by a <see cref="MSBuildProjectReference"/> within the Unity project with the default UI.
        /// </summary>
        /// <param name="profile">The name of the profile to build.</param>
        /// <param name="additionalArguments">The additional arguments passed to MSBuild.</param>
        /// <returns>A task that will have a result of true if the build succeeds.</returns>
        public static bool BuildAllProjects(string profile, string additionalArguments = "")
        {
            (IEnumerable <MSBuildProjectReference> withProfile, IEnumerable <MSBuildProjectReference> withoutProfile) = MSBuildProjectBuilder.SplitByProfile(MSBuildProjectBuilder.EnumerateAllMSBuildProjectReferences(), profile);

            foreach (MSBuildProjectReference msBuildProjectReference in withoutProfile)
            {
                Debug.Log($"Skipping {msBuildProjectReference.ProjectPath} because it does not have a profile named {profile}.", msBuildProjectReference);
            }

            return(MSBuildProjectBuilder.BuildProjects(withProfile.ToArray(), profile, additionalArguments));
        }
示例#2
0
            //[MenuItem("MSBuild/Auto Build All Projects [testing only]", priority = int.MaxValue)]
            private static void BuildAllAutoBuiltProjects()
            {
                IEnumerable <IGrouping <string, MSBuildProjectReference> > autoBuildProfiles =
                    from projectReference in MSBuildProjectBuilder.EnumerateAllMSBuildProjectReferences()
                    from profile in projectReference.Profiles
                    where profile.autoBuild
                    group projectReference by profile.name;

                foreach (IGrouping <string, MSBuildProjectReference> autoBuildProfile in autoBuildProfiles)
                {
                    MSBuildProjectBuilder.BuildProjects(autoBuildProfile.ToArray(), autoBuildProfile.Key);
                }
            }
示例#3
0
 //[MenuItem("MSBuild/Auto Build All Projects [testing only]", priority = int.MaxValue)]
 private static void BuildAllAutoBuiltProjects()
 {
     (IEnumerable <MSBuildProjectReference> withProfile, _) = MSBuildProjectBuilder.SplitByProfile(MSBuildProjectBuilder.EnumerateAllMSBuildProjectReferences(), "Build");
     MSBuildProjectBuilder.BuildProjects(withProfile.Where(projectReference => projectReference.AutoBuild).ToArray(), "Build");
 }
 private static void BuildAllAutoBuiltProjects()
 {
     MSBuildProjectBuilder.BuildProjects(MSBuildProjectBuilder.EnumerateAllMSBuildProjectReferences().Where(projectReference => projectReference.AutoBuild).ToArray());
 }
 /// <summary>
 /// Builds all MSBuild projects referenced by a <see cref="MSBuildProjectReference"/> within the Unity project with the default UI.
 /// </summary>
 /// <param name="arguments">The additional arguments passed to MSBuild.</param>
 /// <returns>A task that will have a result of true if the build succeeds.</returns>
 public static bool BuildAllProjects(string arguments = MSBuildProjectBuilder.DefaultBuildArguments)
 {
     return(MSBuildProjectBuilder.BuildProjects(MSBuildProjectBuilder.EnumerateAllMSBuildProjectReferences().ToArray(), arguments));
 }