예제 #1
0
                              private void validate_Platforms(ValidationContext ctx)
                              {
                                  var output = ctx.Output;

                                  try//PLATFORMS
                                  {
                                      foreach (var pn in PlatformConfNodes)
                                      {
                                          var name = pn.AttrByName(CONFIG_NAME_ATTR).Value;
                                          if (name.IsNullOrWhiteSpace())
                                          {
                                              output.Add(new MetabaseValidationMsg(MetabaseValidationMessageType.Error, null, null, StringConsts.METABASE_NAME_ATTR_UNDEFINED_ERROR + "platforms"));
                                          }

                                          if (!name.IsValidName())
                                          {
                                              output.Add(new MetabaseValidationMsg(MetabaseValidationMessageType.Error, null, null, StringConsts.METABASE_ENTITY_NAME_INVALID_ERROR.Args("platforms", name)));
                                          }
                                      }


                                      //Duplicate platform name
                                      if (PlatformNames.Distinct(INVSTRCMP).Count() != PlatformNames.Count())
                                      {
                                          output.Add(new MetabaseValidationMsg(MetabaseValidationMessageType.Error, null, null, StringConsts.METABASE_PLATFORM_NAME_DUPLICATION_ERROR));
                                      }

                                      //Platform/OS names
                                      foreach (var os in OSNames)
                                      {
                                          if (!os.IsValidName())
                                          {
                                              output.Add(new MetabaseValidationMsg(MetabaseValidationMessageType.Error, null, null, StringConsts.METABASE_ENTITY_NAME_INVALID_ERROR.Args("OS", os)));
                                          }

                                          try
                                          {
                                              if (INVSTRCMP.Equals(os, BinCatalog.PackageInfo.ANY))
                                              {
                                                  throw new MetabaseException(StringConsts.METABASE_PLATFORM_OS_RESERVED_NAME_ERROR.Args(os));
                                              }
                                              GetOSConfNode(os);
                                          }
                                          catch (Exception error)
                                          {
                                              output.Add(new MetabaseValidationMsg(MetabaseValidationMessageType.Error, null, null, error.ToMessageWithType(), error));
                                          }
                                      }
                                  }
                                  catch (Exception general)
                                  {
                                      output.Add(new MetabaseValidationMsg(MetabaseValidationMessageType.Error, null, null, general.ToMessageWithType(), general));
                                  }
                              }
예제 #2
0
        public static void SetFileExecutable(string FullPath)
        {
            if (File.Exists(FullPath))
            {
                PlatformNames CurrentPlatform = RuntimeOrEditorGetPlatform();

                if (CurrentPlatform == PlatformNames.Editor_OSX || CurrentPlatform == PlatformNames.Standalone_OSX)
                {
                    string ChmodOutput = "";
                    string ChmodError  = "";

                    int ChmodRC = RunProcessCrossPlatform("chmod", "", "+x " + FullPath, Path.GetFullPath("."), ref ChmodOutput, ref ChmodError, true);

                    if (ChmodRC != 0)
                    {
                        IgorDebug.CoreLogError("Failed to make file " + FullPath + " executable!\nOutput:\n\n" + ChmodOutput + "\n\nError:\n\n" + ChmodError);
                    }
                }
            }
        }