Exemplo n.º 1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="buildInfo">Build Info</param>
 public Build(BuildInfo buildInfo)
 {
     this.buildInfo = buildInfo;
     sProjectDir = sProjectsDir + @"\project-" + buildInfo.project_id;
     commands = new LinkedList<string>();
     outputList = new ConcurrentQueue<string>();
     completed = false;
 }
Exemplo n.º 2
0
        void BuildEvents_OnBuildDone(vsBuildScope Scope, vsBuildAction Action)
        {
            string solutionName = System.IO.Path.GetFileNameWithoutExtension(this._applicationObject.Solution.FullName);
            bool success = (this._applicationObject.Solution.SolutionBuild.LastBuildInfo == 0);

            // use another thread so that we dont slow the build down
            BuildInfo info = new BuildInfo(solutionName, success, true);
            System.Threading.ParameterizedThreadStart pts = new System.Threading.ParameterizedThreadStart(SendNotification);
            System.Threading.Thread t = new System.Threading.Thread(pts);
            t.Start(info);
        }
Exemplo n.º 3
0
        void BuildEvents_OnBuildProjConfigDone(string Project, string ProjectConfig, string Platform, string SolutionConfig, bool Success)
        {
            if (!Properties.Settings.Default.SolutionOnly)
            {
                string name = GetProjectName(Project);

                // use another thread so that we dont slow the build down
                BuildInfo info = new BuildInfo(name, Success, false);
                System.Threading.ParameterizedThreadStart pts = new System.Threading.ParameterizedThreadStart(SendNotification);
                System.Threading.Thread t = new System.Threading.Thread(pts);
                t.Start(info);
            }
        }
            private ProjectFileInfo CreateProjectFileInfo(VisualBasicProjectFileLoader.VisualBasicProjectFile.VisualBasicCompilerInputs compilerInputs, BuildInfo buildInfo)
            {
                string outputPath = Path.Combine(this.GetOutputDirectory(), compilerInputs.OutputFileName);
                string assemblyName = this.GetAssemblyName();
                var documents = buildInfo.Project != null ? this.GetDocuments(compilerInputs.Sources, buildInfo.Project) : SpecializedCollections.EmptyEnumerable<DocumentFileInfo>();
                var additionalDocuments = buildInfo.Project != null ? this.GetDocuments(compilerInputs.AdditionalFiles, buildInfo.Project) : SpecializedCollections.EmptyEnumerable<DocumentFileInfo>();
                var projectRefeferences = buildInfo.Project != null ? base.GetProjectReferences(buildInfo.Project) : SpecializedCollections.EmptyEnumerable<ProjectFileReference>();

                return new ProjectFileInfo(
                    outputPath,
                    assemblyName,
                    compilerInputs.CommandLineArgs,
                    documents,
                    additionalDocuments,
                    projectRefeferences,
                    buildInfo.ErrorMessage);
            }
Exemplo n.º 5
0
        public void runTest()
        {
            // copied from official gitlab ci runner spec
            BuildInfo buildInfo = new BuildInfo();
            buildInfo.commands = "dir";
            buildInfo.allow_git_fetch = false;
            buildInfo.project_id = 0;
            buildInfo.id = 9312;
            buildInfo.repo_url = "https://github.com/randx/six.git";
            buildInfo.sha = "2e008a711430a16092cd6a20c225807cb3f51db7";
            buildInfo.timeout = 1800;
            buildInfo.@ref = "master";

            gitlab_ci_runner.runner.Build target = new gitlab_ci_runner.runner.Build(buildInfo);
            target.run();
            Console.WriteLine(target.output);
            Assert.AreEqual(target.state, State.SUCCESS);
        }
            private ProjectFileInfo CreateProjectFileInfo(CSharpCompilerInputs compilerInputs, BuildInfo buildInfo)
            {
                var outputPath = Path.Combine(this.GetOutputDirectory(), compilerInputs.OutputFileName);
                var assemblyName = this.GetAssemblyName();

                var project = buildInfo.Project;
                if (project == null)
                {
                    return new ProjectFileInfo(
                        outputPath,
                        assemblyName,
                        commandLineArgs: SpecializedCollections.EmptyEnumerable<string>(),
                        documents: SpecializedCollections.EmptyEnumerable<DocumentFileInfo>(),
                        additionalDocuments: SpecializedCollections.EmptyEnumerable<DocumentFileInfo>(),
                        projectReferences: SpecializedCollections.EmptyEnumerable<ProjectFileReference>(),
                        errorMessage: buildInfo.ErrorMessage);
                }

                string projectDirectory = project.Directory;
                string directorySeparator = Path.DirectorySeparatorChar.ToString();
                if (!projectDirectory.EndsWith(directorySeparator, StringComparison.OrdinalIgnoreCase))
                {
                    projectDirectory += directorySeparator;
                }

                var docs = compilerInputs.Sources
                        .Where(s => !Path.GetFileName(s.ItemSpec).StartsWith("TemporaryGeneratedFile_", StringComparison.Ordinal))
                        .Select(s => MakeDocumentFileInfo(projectDirectory, s))
                        .ToImmutableArray();

                var additionalDocs = compilerInputs.AdditionalSources
                        .Select(s => MakeDocumentFileInfo(projectDirectory, s))
                        .ToImmutableArray();

                return new ProjectFileInfo(
                    outputPath,
                    assemblyName,
                    compilerInputs.CommandLineArgs,
                    docs,
                    additionalDocs,
                    this.GetProjectReferences(buildInfo.Project),
                    buildInfo.ErrorMessage);
            }
        public static void ParseBuildCommandLine(ref BuildInfo buildInfo)
        {
            string[] arguments = System.Environment.GetCommandLineArgs();

            buildInfo.IsCommandLine = true;

            for (int i = 0; i < arguments.Length; ++i)
            {
                // Can't use -buildTarget which is something Unity already takes as an argument for something.
                if (string.Equals(arguments[i], "-duskBuildTarget", StringComparison.InvariantCultureIgnoreCase))
                {
                    buildInfo.BuildTarget = (BuildTarget)Enum.Parse(typeof(BuildTarget), arguments[++i]);
                }
                else if (string.Equals(arguments[i], "-wsaSDK", StringComparison.InvariantCultureIgnoreCase))
                {
                    string wsaSdkArg = arguments[++i];

                    buildInfo.WSASdk = (WSASDK)Enum.Parse(typeof(WSASDK), wsaSdkArg);
                }
                else if (string.Equals(arguments[i], "-wsaUWPBuildType", StringComparison.InvariantCultureIgnoreCase))
                {

                    buildInfo.WSAUWPBuildType = (WSAUWPBuildType)Enum.Parse(typeof(WSAUWPBuildType), arguments[++i]);
                }
                else if (string.Equals(arguments[i], "-wsaGenerateReferenceProjects", StringComparison.InvariantCultureIgnoreCase))
                {
                    buildInfo.WSAGenerateReferenceProjects = Boolean.Parse(arguments[++i]);
                }
                else if (string.Equals(arguments[i], "-buildOutput", StringComparison.InvariantCultureIgnoreCase))
                {
                    buildInfo.OutputDirectory = arguments[++i];
                }
                else if (string.Equals(arguments[i], "-buildDesc", StringComparison.InvariantCultureIgnoreCase))
                {
                    ParseBuildDescriptionFile(arguments[++i], ref buildInfo);
                }
                else if (string.Equals(arguments[i], "-unityBuildSymbols", StringComparison.InvariantCultureIgnoreCase))
                {
                    string newBuildSymbols = arguments[++i];
                    buildInfo.AppendSymbols(newBuildSymbols.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries));
                }
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="buildInfo">Build Info</param>
        public Build(BuildInfo buildInfo)
        {
            this.buildInfo = buildInfo;
            Config.PrebuildConfig cfg = Config.getDataForBuild(buildInfo);

            if (cfg.ProjectDir != "")
            {
                if (Path.IsPathRooted(cfg.ProjectDir))
                {
                    sProjectDir = cfg.ProjectDir;
                }
                else
                {
                    sProjectDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"\" + cfg.ProjectDir;
                }
            }
            sProjectDir = sProjectDir.EndsWith(@"\") ? sProjectDir : sProjectDir + @"\";

            commands = new LinkedList<string>();
            outputList = new ConcurrentQueue<string>();
            completed = false;

            commands.AddFirst("echo \"Project directory is set to: " + cfg.ProjectDir + "\"");
        }
        public static void PerformBuild(BuildInfo buildInfo)
        {
            BuildTargetGroup buildTargetGroup = GetGroup(buildInfo.BuildTarget);
            string oldBuildSymbols = PlayerSettings.GetScriptingDefineSymbolsForGroup(buildTargetGroup);
            if (!string.IsNullOrEmpty(oldBuildSymbols))
            {
                if (buildInfo.HasConfigurationSymbol())
                {
                    buildInfo.AppendSymbols(BuildInfo.RemoveConfigurationSymbols(oldBuildSymbols));
                }
                else
                {
                    buildInfo.AppendSymbols(oldBuildSymbols.Split(';'));
                }
            }

            if ((buildInfo.BuildOptions & BuildOptions.Development) == BuildOptions.Development)
            {
                if (!buildInfo.HasConfigurationSymbol())
                {
                    buildInfo.AppendSymbols(BuildSLNUtilities.BuildSymbolDebug);
                }
            }

            if (buildInfo.HasAnySymbols(BuildSLNUtilities.BuildSymbolDebug))
            {
                buildInfo.BuildOptions |= BuildOptions.Development | BuildOptions.AllowDebugging;
            }

            if (buildInfo.HasAnySymbols(BuildSLNUtilities.BuildSymbolRelease))
            {
                //Unity automatically adds the DEBUG symbol if the BuildOptions.Development flag is
                //specified. In order to have debug symbols and the RELEASE symbole we have to
                //inject the symbol Unity relies on to enable the /debug+ flag of csc.exe which is "DEVELOPMENT_BUILD"
                buildInfo.AppendSymbols("DEVELOPMENT_BUILD");
            }

            var oldBuildTarget = EditorUserBuildSettings.activeBuildTarget;
            EditorUserBuildSettings.SwitchActiveBuildTarget(buildInfo.BuildTarget);

            var oldWSASDK = EditorUserBuildSettings.wsaSDK;
            if (buildInfo.WSASdk.HasValue)
            {
                EditorUserBuildSettings.wsaSDK = buildInfo.WSASdk.Value;
            }

            WSAUWPBuildType? oldWSAUWPBuildType = null;
            if (EditorUserBuildSettings.wsaSDK == WSASDK.UWP)
            {
                oldWSAUWPBuildType = EditorUserBuildSettings.wsaUWPBuildType;
                if (buildInfo.WSAUWPBuildType.HasValue)
                {
                    EditorUserBuildSettings.wsaUWPBuildType = buildInfo.WSAUWPBuildType.Value;
                }
            }

            var oldWSAGenerateReferenceProjects = EditorUserBuildSettings.wsaGenerateReferenceProjects;
            if (buildInfo.WSAGenerateReferenceProjects.HasValue)
            {
                EditorUserBuildSettings.wsaGenerateReferenceProjects = buildInfo.WSAGenerateReferenceProjects.Value;
            }

            var oldColorSpace = PlayerSettings.colorSpace;
            if (buildInfo.ColorSpace.HasValue)
            {
                PlayerSettings.colorSpace = buildInfo.ColorSpace.Value;
            }

            if (buildInfo.BuildSymbols != null)
            {
                PlayerSettings.SetScriptingDefineSymbolsForGroup(buildTargetGroup, buildInfo.BuildSymbols);
            }

            string buildError = "Error";
            try
            {
                // For the WSA player, Unity builds into a target directory.
                // For other players, the OutputPath parameter indicates the
                // path to the target executable to build.
                if (buildInfo.BuildTarget == BuildTarget.WSAPlayer)
                {
                    Directory.CreateDirectory(buildInfo.OutputDirectory);
                }

                OnPreProcessBuild(buildInfo);
                buildError = BuildPipeline.BuildPlayer(
                    buildInfo.Scenes.ToArray(),
                    buildInfo.OutputDirectory,
                    buildInfo.BuildTarget,
                    buildInfo.BuildOptions);

                if (buildError.StartsWith("Error"))
                {
                    throw new Exception(buildError);
                }
            }
            finally
            {
                OnPostProcessBuild(buildInfo, buildError);

                PlayerSettings.colorSpace = oldColorSpace;
                PlayerSettings.SetScriptingDefineSymbolsForGroup(buildTargetGroup, oldBuildSymbols);

                EditorUserBuildSettings.wsaSDK = oldWSASDK;

                if (oldWSAUWPBuildType.HasValue)
                {
                    EditorUserBuildSettings.wsaUWPBuildType = oldWSAUWPBuildType.Value;
                }

                EditorUserBuildSettings.wsaGenerateReferenceProjects = oldWSAGenerateReferenceProjects;

                EditorUserBuildSettings.SwitchActiveBuildTarget(oldBuildTarget);
            }
        }
        private static void OnPreProcessBuild(BuildInfo buildInfo)
        {
            // Raise the global event for listeners
            BuildStarted.RaiseEvent(buildInfo);

            // Call the pre-build action, if any
            if (buildInfo.PreBuildAction != null)
            {
                buildInfo.PreBuildAction(buildInfo);
            }
        }
        public static void ParseBuildDescriptionFile(string filename, ref BuildInfo buildInfo)
        {
            Debug.Log(string.Format(CultureInfo.InvariantCulture, "Build: Using \"{0}\" as build description", filename));

            // Parse the XML file
            XmlTextReader reader = new XmlTextReader(filename);

            while (reader.Read())
            {
                switch (reader.NodeType)
                {
                    case XmlNodeType.Element:
                        if (string.Equals(reader.Name, "SceneList", StringComparison.InvariantCultureIgnoreCase))
                        {
                            // Set the scenes we want to build
                            buildInfo.Scenes = ReadSceneList(reader);
                        }
                        else if (string.Equals(reader.Name, "CopyList", StringComparison.InvariantCultureIgnoreCase))
                        {
                            // Set the directories we want to copy
                            buildInfo.CopyDirectories = ReadCopyList(reader);
                        }
                        break;
                }
            }
        }
Exemplo n.º 12
0
 /// <summary> 
 /// get the types for the scoped names specified in an inheritance relationship
 /// </summary>
 /// <param name="data">the buildinfo of the container of the type having this inheritance relationship</param>    
 private Type[] ParseInheritanceRelation(SimpleNode node, BuildInfo data) {        
     ArrayList result = new ArrayList();
     for (int i = 0; i < node.jjtGetNumChildren(); i++) {
         // get symbol
         Symbol sym = (Symbol)(node.jjtGetChild(i).jjtAccept(this, data)); // accept interface_name
         if (sym.getDeclaredIn().GetFullyQualifiedNameForSymbol(sym.getSymbolName()).Equals("java.io.Serializable")) {
             Console.WriteLine("ignoring inheritance from java.io.Serializable, because not allowed");                
             continue;
         }
         // get Type
         TypeContainer resultType = m_typeManager.GetKnownType(sym);
         if (resultType == null) {
             // this is an error: type must be created before it is inherited from
             throw new InvalidIdlException("type " + sym.getSymbolName() +
                                           " not seen before in inheritance spec");
         } else if (m_typeManager.IsFwdDeclared(sym)) {
             // this is an error: can't inherit from a fwd declared type
             throw new InvalidIdlException("type " + sym.getSymbolName() + 
                                           " only fwd declared, but for inheritance full definition is needed");
         }
         result.Add(resultType.GetCompactClsType());
     }
     return (System.Type[])result.ToArray(typeof(Type));
 }
        private static void OnPostProcessBuild(BuildInfo buildInfo, string buildError)
        {
            if (string.IsNullOrEmpty(buildError))
            {
                if (buildInfo.CopyDirectories != null)
                {
                    string inputProjectDirectoryPath = GetProjectPath();
                    string outputProjectDirectoryPath = Path.Combine(GetProjectPath(), buildInfo.OutputDirectory);
                    foreach (var directory in buildInfo.CopyDirectories)
                    {
                        CopyDirectory(inputProjectDirectoryPath, outputProjectDirectoryPath, directory);
                    }
                }
            }

            // Raise the global event for listeners
            BuildCompleted.RaiseEvent(buildInfo, buildError);

            // Call the post-build action, if any
            if (buildInfo.PostBuildAction != null)
            {
                buildInfo.PostBuildAction(buildInfo, buildError);
            }
        }
Exemplo n.º 14
0
        private async Task<BuildResultClassification> PopulateFailedBuildResult(BuildInfo buildInfo, string jobKind, PullRequestInfo prInfo)
        {
            var buildId = buildInfo.Id;
            BuildResult buildResult;
            try
            {
                buildResult = await _client.GetBuildResultAsync(buildInfo);
            }
            catch (Exception ex)
            {
                WriteLine(buildId, $"error getting build result {ex.Message}");
                throw;
            }

            if (buildResult.FailureInfo == null)
            {
                return BuildResultClassification.Unknown;
            }

            var classification = BuildResultClassification.Unknown;
            foreach (var cause in buildResult.FailureInfo.CauseList)
            {
                var current = ConvertToClassification(cause);
                if (classification.Kind == ClassificationKind.Unknown || classification.Kind == ClassificationKind.MergeConflict)
                {
                    classification = current;
                }
            }

            return classification;
        }
 public Value()
 {
     Build = new BuildInfo();
 }
        public static void PerformBuild_CommandLine()
        {
            BuildInfo buildInfo = new BuildInfo()
            {
                // Use scenes from the editor build settings.
                Scenes = EditorBuildSettings.scenes.Select(scene => scene.path),
            };

            ParseBuildCommandLine(ref buildInfo);

            PerformBuild(buildInfo);
        }
 private static void OnPreProcessBuild(BuildInfo buildInfo)
 {
     if (buildInfo.PreBuildAction != null)
     {
         buildInfo.PreBuildAction(buildInfo);
     }
 }
Exemplo n.º 18
0
 /**
  * @see parser.IDLParserVisitor#visit(ASTspecification, Object)
  * @param data unused
  */
 public Object visit(ASTspecification node, Object data) {
     if (!m_initalized) { 
         throw new InternalCompilerException("initalize not called"); 
     }
     Scope topScope = m_symbolTable.getTopScope();
     BuildInfo info = new BuildInfo(topScope, null, null);
     node.childrenAccept(this, info);
     m_initalized = false; // this file is finished
     m_typeManager.AssertAllTypesDefined(); // check if all types are completely defined. if not ok, assembly can't be saved to file.
     return null;
 }
Exemplo n.º 19
0
 /** search in a value_header_node / abs_value_node for inheritance information and parse it
  * @param parentOfPossibleInhNode the node possibly containing value inheritance nodes
  */
 private Type[] ParseValueInheritSpec(Node parentOfPossibleInhNode, BuildInfo data) {
     Type[] result = new Type[0];
     if (parentOfPossibleInhNode.jjtGetNumChildren() > 0) {
         if (parentOfPossibleInhNode.jjtGetChild(0) is ASTvalue_base_inheritance_spec) {
             ASTvalue_base_inheritance_spec inheritSpec = (ASTvalue_base_inheritance_spec) parentOfPossibleInhNode.jjtGetChild(0);
             result = (Type[])inheritSpec.jjtAccept(this, data);
         } else if (parentOfPossibleInhNode.jjtGetChild(0) is ASTvalue_support_inheritance_spec){
             ASTvalue_support_inheritance_spec inheritSpec = (ASTvalue_support_inheritance_spec) parentOfPossibleInhNode.jjtGetChild(0);
             result = (Type[])inheritSpec.jjtAccept(this, data);    
         }
     }
     if ((parentOfPossibleInhNode.jjtGetNumChildren() > 1) && (parentOfPossibleInhNode.jjtGetChild(1) is ASTvalue_support_inheritance_spec)) {
         // append the support inheritance spec to the rest
         ASTvalue_support_inheritance_spec inheritSpec = (ASTvalue_support_inheritance_spec) parentOfPossibleInhNode.jjtGetChild(1);
         Type[] supportTypes = (Type[])inheritSpec.jjtAccept(this, data);
         Type[] resultCrt = new Type[result.Length + supportTypes.Length];
         Array.Copy(result, 0, resultCrt, 0, result.Length);
         Array.Copy(supportTypes, 0, resultCrt, result.Length, supportTypes.Length);
         result = resultCrt;
     }
     return result;
 }
Exemplo n.º 20
0
    /**
     * @see parser.IDLParserVisitor#visit(ASTvalue_abs_decl, Object)
     */
    public Object visit(ASTvalue_abs_decl node, Object data) {
        CheckParameterForBuildInfo(data, node);
        // data contains the scope, this value type is declared in
        Scope enclosingScope = ((BuildInfo) data).GetBuildScope();
        // an IDL abstract value type
        
        Symbol forSymbol = enclosingScope.getSymbol(node.getIdent());
        // check if type is known from a previous run over a parse tree --> if so: skip
        if (m_typeManager.CheckSkip(forSymbol)) { 
            return null; 
        }

        Type[] interfaces = ParseValueInheritSpec(node, (BuildInfo) data);
        if ((interfaces.Length > 0) && (interfaces[0].IsClass)) { 
            throw new InvalidIdlException("invalid " + node.GetIdentification() + 
                                          ", can only inherit from abstract value types, but not from: " + 
                                          interfaces[0].FullName);
        }
        int bodyNodeIndex = 0;
        for (int i = 0; i < node.jjtGetNumChildren(); i++) {
            if (!((node.jjtGetChild(i) is ASTvalue_base_inheritance_spec) || (node.jjtGetChild(i) is ASTvalue_support_inheritance_spec))) {
                bodyNodeIndex = i;
                break;
            }
        }

        TypeBuilder valueToBuild = CreateOrGetValueDcl(forSymbol, null, interfaces,
                                                       true, false); 

        // generate elements
        BuildInfo buildInfo = new BuildInfo(enclosingScope.getChildScope(forSymbol.getSymbolName()), 
                                            valueToBuild, forSymbol);
        for (int i = bodyNodeIndex; i < node.jjtGetNumChildren(); i++) { // for all export children
            Node child = node.jjtGetChild(i);
            child.jjtAccept(this, buildInfo);    
        }

        // finally create the type
        m_typeManager.EndTypeDefinition(forSymbol);
        return null;
    }
Exemplo n.º 21
0
    /**
     * @see parser.IDLParserVisitor#visit(ASTinterface_dcl, Object)
     * @param data expected is the buildinfo of the scope, this interface is declared in
     * @return the created type
     */
    public Object visit(ASTinterface_dcl node, Object data) {
        CheckParameterForBuildInfo(data, node);
        // data contains the scope, this interface is declared in
        Scope enclosingScope = ((BuildInfo) data).GetBuildScope();
        
        
        // an IDL concrete interface
        // get the header
        ASTinterface_header header = (ASTinterface_header)node.jjtGetChild(0);
        Symbol forSymbol = enclosingScope.getSymbol(header.getIdent());
        // check if a type declaration exists from a previous run / in ref assemblies
        if (m_typeManager.CheckSkip(forSymbol)) { 
            return null; 
        }

        // retrieve first types for the inherited
        System.Type[] interfaces = (System.Type[])header.jjtAccept(this, data);
        TypeBuilder interfaceToBuild = CreateOrGetInterfaceDcl(forSymbol, interfaces, 
                                                               header.isAbstract(), header.isLocal(),
                                                               false);

        // generate body
        ASTinterface_body body = (ASTinterface_body)node.jjtGetChild(1);
        BuildInfo buildInfo = new BuildInfo(enclosingScope.getChildScope(forSymbol.getSymbolName()),
                                            interfaceToBuild, forSymbol);
        body.jjtAccept(this, buildInfo);
    
        // create the type
        m_typeManager.EndTypeDefinition(forSymbol);
        return null;
    }
Exemplo n.º 22
0
 /**
  * @see parser.IDLParserVisitor#visit(ASTmodule, Object)
  * @param data an instance of buildInfo is expected
  */
 public Object visit(ASTmodule node, Object data) {
     CheckParameterForBuildInfo(data, node);
     Trace.WriteLine("accepting module with ident: " + node.getIdent());
     BuildInfo info = (BuildInfo) data;
     // info contains the scope this module is defined in
     Scope enclosingScope = info.GetBuildScope();
     Scope moduleScope = enclosingScope.getChildScope(node.getIdent());
     BuildInfo modInfo = new BuildInfo(moduleScope, info.GetContainterType(),
                                       info.GetContainerSymbol());
     node.childrenAccept(this, modInfo);
     Trace.WriteLine("module with ident sucessfully accepted: " + node.getIdent());
     return null;
 }
        private static void OnPostProcessBuild(BuildInfo buildInfo, string buildError)
        {
            if (string.IsNullOrEmpty(buildError))
            {
                if (buildInfo.CopyDirectories != null)
                {
                    string inputProjectDirectoryPath = GetProjectPath();
                    string outputProjectDirectoryPath = Path.Combine(GetProjectPath(), buildInfo.OutputDirectory);
                    foreach (var directory in buildInfo.CopyDirectories)
                    {
                        CopyDirectory(inputProjectDirectoryPath, outputProjectDirectoryPath, directory);
                    }
                }
            }

            if (buildInfo.PostBuildAction != null)
            {
                buildInfo.PostBuildAction(buildInfo, buildError);
            }
        }
Exemplo n.º 24
0
        public string GetBuildLog( Device device )
        {
            BuildInfo buildInfo;

            buildInfo = new BuildInfo( this, device );
            return InteropTools.ReadString( buildInfo, (uint)ProgramBuildInfo.LOG );
        }
Exemplo n.º 25
0
 /// <summary>
 /// collects all explicitely used discriminator values in switch cases.
 /// </summary>
 private ArrayList ExtractCoveredDiscriminatorRange(ASTswitch_body node, TypeContainer discrType,
                                                    BuildInfo unionInfo) {
     ArrayList result = new ArrayList();
     for (int i = 0; i < node.jjtGetNumChildren(); i++) {
         ASTcasex caseNode = (ASTcasex)node.jjtGetChild(i);
         object[] discrValsForCase = CollectDiscriminatorValuesForCase(caseNode, discrType, unionInfo);
         foreach (object discrVal in discrValsForCase) {
             if (discrVal.Equals(UnionGenerationHelper.DefaultCaseDiscriminator)) {
                 continue; // do not add default case here
             }
             if (result.Contains(discrVal)) {
                 throw new InvalidIdlException(
                     String.Format("discriminator value {0} used more than once in {1}",
                                   discrVal, node.GetIdentification()));
             }
             result.Add(discrVal);
         }
     }
     return result;
 }
Exemplo n.º 26
0
        public BuildStatus GetBuildStatus( Device device )
        {
            BuildInfo buildInfo;

            buildInfo = new BuildInfo( this, device );
            return (BuildStatus)InteropTools.ReadInt( buildInfo, (uint)ProgramBuildInfo.STATUS );
        }
Exemplo n.º 27
0
        private async Task<List<BuildFailureEntity>> GetUnitTestFailures(BuildInfo buildInfo, string jobKind, PullRequestInfo prInfo)
        {
            // TODO: Resolve this with CoreCLR.  They are producing way too many failures at the moment though
            // and we need to stop uploading 50,000 rows a day until we can resolve this.
            if (buildInfo.Id.JobName.Contains("dotnet_coreclr"))
            {
                return new List<BuildFailureEntity>(capacity: 0);
            }

            var buildId = buildInfo.Id;
            var testCaseNames = await _client.GetFailedTestCasesAsync(buildInfo.BuildId);

            // Ignore obnoxious long test names.  This is a temporary work around due to CoreFX generating giantic test
            // names and log files.
            // https://github.com/dotnet/corefx/pull/11905
            if (testCaseNames.Any(x => x.Length > 10000))
            {
                return new List<BuildFailureEntity>(capacity: 0);
            }

            var entityList = testCaseNames
                .Select(x => BuildFailureEntity.CreateTestCaseFailure(buildInfo.Date, buildId, x, jobKind: jobKind, machineName: buildInfo.MachineName, prInfo: prInfo))
                .ToList();
            EnsureTestCaseNamesUnique(entityList);
            return entityList;
        }
Exemplo n.º 28
0
 /// <summary>
 /// Save build to data.
 /// </summary>
 /// <param name="buildName">Name of the build.</param>
 /// <param name="build">Build info.</param>
 public static void SaveBuild(string buildName, BuildInfo build)
 {
     Debugger.Log("Saving: " + buildName, null, Debugger.LogTypes.Data);
     SaveData.Save(buildName, build, BuildsFolder);
 }
Exemplo n.º 29
0
        public string GetBuildOptions( Device device )
        {
            BuildInfo buildInfo;

            buildInfo = new BuildInfo( this, device );
            return InteropTools.ReadString( buildInfo, (uint)ProgramBuildInfo.OPTIONS );
        }
Exemplo n.º 30
0
    /**
     * @see parser.IDLParserVisitor#visit(ASTexcept_dcl, Object)
     * @param data expected is an instance of BuildInfo
     * if ((BuildInfo)data).getContainerType() is null, than an independant type-decl is created, else
     * the type delcaration is added to the Type in creation
     */
    public Object visit(ASTexcept_dcl node, Object data) {
        CheckParameterForBuildInfo(data, node);
        BuildInfo buildInfo = (BuildInfo) data;
        Symbol forSymbol = buildInfo.GetBuildScope().getSymbol(node.getIdent());
        // check if type is known from a previous run over a parse tree --> if so: skip
        if (m_typeManager.CheckSkip(forSymbol)) { 
            return null;
        }
       
        TypeBuilder exceptToCreate = 
            m_typeManager.StartTypeDefinition(forSymbol,
                                              TypeAttributes.Class | TypeAttributes.Public,
                                              typeof(AbstractUserException), Type.EmptyTypes, 
                                              false);
                                                                               
        BuildInfo thisTypeInfo = new BuildInfo(buildInfo.GetBuildScope().getChildScope(forSymbol.getSymbolName()),
                                               exceptToCreate,
                                               forSymbol);

        // add fileds ...
        IList members = (IList)GenerateMemberList(node, thisTypeInfo);
        // add inheritance from IIdlEntity        
        exceptToCreate.AddInterfaceImplementation(typeof(IIdlEntity));
        AddExceptionRequiredSerializationCode(exceptToCreate, members);
        AddExplicitSerializationOrder(exceptToCreate, members);
        
        // create the type
        m_typeManager.EndTypeDefinition(forSymbol);
        return null;
    }