private string ProjectHeader(MonoIsland island)
        {
            string            str1     = "4.0";
            string            str2     = "10.0.20506";
            ScriptingLanguage language = SolutionSynchronizer.ScriptingLanguageFor(island);

            if (this._settings.VisualStudioVersion == 9)
            {
                str1 = "3.5";
                str2 = "9.0.21022";
            }
            object[] objArray = new object[9] {
                (object)str1, (object)str2, (object)this.ProjectGuid(island._output), (object)this._settings.EngineAssemblyPath, (object)this._settings.EditorAssemblyPath, (object)string.Join(";", ((IEnumerable <string>) new string[2] {
                    "DEBUG", "TRACE"
                }).Concat <string>((IEnumerable <string>) this._settings.Defines).Concat <string>((IEnumerable <string>)island._defines).Distinct <string>().ToArray <string>()), (object)SolutionSynchronizer.MSBuildNamespaceUri, (object)Path.GetFileNameWithoutExtension(island._output), (object)EditorSettings.projectGenerationRootNamespace
            };
            try
            {
                return(string.Format(this._settings.GetProjectHeaderTemplate(language), objArray));
            }
            catch (Exception ex)
            {
                throw new NotSupportedException("Failed creating c# project because the c# project header did not have the correct amount of arguments, which is " + (object)objArray.Length);
            }
        }
Exemple #2
0
        private string ProjectHeader(MonoIsland island, string[] additionalDefines)
        {
            string            text     = "v3.5";
            string            text2    = "4";
            string            text3    = "4.0";
            string            text4    = "10.0.20506";
            string            text5    = ".";
            ScriptingLanguage language = SolutionSynchronizer.ScriptingLanguageFor(island);

            if (PlayerSettingsEditor.IsLatestApiCompatibility(island._api_compatibility_level))
            {
                text  = "v4.6";
                text2 = "6";
            }
            else if (ScriptEditorUtility.GetScriptEditorFromPreferences() == ScriptEditorUtility.ScriptEditor.Rider)
            {
                text = "v4.5";
            }
            else if (this._settings.VisualStudioVersion == 9)
            {
                text3 = "3.5";
                text4 = "9.0.21022";
            }
            object[] array = new object[]
            {
                text3,
                text4,
                this.ProjectGuid(island._output),
                this._settings.EngineAssemblyPath,
                this._settings.EditorAssemblyPath,
                string.Join(";", new string[]
                {
                    "DEBUG",
                    "TRACE"
                }.Concat(this._settings.Defines).Concat(island._defines).Concat(additionalDefines).Distinct <string>().ToArray <string>()),
                SolutionSynchronizer.MSBuildNamespaceUri,
                Path.GetFileNameWithoutExtension(island._output),
                EditorSettings.projectGenerationRootNamespace,
                text,
                text2,
                text5
            };
            string result;

            try
            {
                result = string.Format(this._settings.GetProjectHeaderTemplate(language), array);
            }
            catch (Exception)
            {
                throw new NotSupportedException("Failed creating c# project because the c# project header did not have the correct amount of arguments, which is " + array.Length);
            }
            return(result);
        }
        private string GenerateAllAssetProjectPart()
        {
            StringBuilder stringBuilder = new StringBuilder();

            foreach (string allAssetPath in AssetDatabase.GetAllAssetPaths())
            {
                string extension = Path.GetExtension(allAssetPath);
                if (this.IsSupportedExtension(extension) && SolutionSynchronizer.ScriptingLanguageFor(extension) == ScriptingLanguage.None)
                {
                    stringBuilder.AppendFormat("     <None Include=\"{0}\" />{1}", (object)this.EscapedRelativePathFor(allAssetPath), (object)SolutionSynchronizer.WindowsNewline);
                }
            }
            return(stringBuilder.ToString());
        }
Exemple #4
0
        private Dictionary <string, string> GenerateAllAssetProjectParts()
        {
            Dictionary <string, StringBuilder> dictionary = new Dictionary <string, StringBuilder>();

            string[] allAssetPaths = AssetDatabase.GetAllAssetPaths();
            int      i             = 0;

            while (i < allAssetPaths.Length)
            {
                string text = allAssetPaths[i];
                if (!AssetDatabase.IsPackagedAssetPath(text))
                {
                    goto IL_4B;
                }
                string text2 = Path.GetFullPath(text).ConvertSeparatorsToUnity();
                if (text2.StartsWith(this._projectDirectory))
                {
                    goto IL_4B;
                }
IL_FE:
                i++;
                continue;
IL_4B:
                string extension = Path.GetExtension(text);
                if (this.IsSupportedExtension(extension) && SolutionSynchronizer.ScriptingLanguageFor(extension) == ScriptingLanguage.None)
                {
                    string text3 = CompilationPipeline.GetAssemblyNameFromScriptPath(text + ".cs");
                    text3 = (text3 ?? CompilationPipeline.GetAssemblyNameFromScriptPath(text + ".js"));
                    text3 = (text3 ?? CompilationPipeline.GetAssemblyNameFromScriptPath(text + ".boo"));
                    text3 = Path.GetFileNameWithoutExtension(text3);
                    StringBuilder stringBuilder = null;
                    if (!dictionary.TryGetValue(text3, out stringBuilder))
                    {
                        stringBuilder     = new StringBuilder();
                        dictionary[text3] = stringBuilder;
                    }
                    stringBuilder.AppendFormat("     <None Include=\"{0}\" />{1}", this.EscapedRelativePathFor(text), SolutionSynchronizer.WindowsNewline);
                }
                goto IL_FE;
            }
            Dictionary <string, string> dictionary2 = new Dictionary <string, string>();

            foreach (KeyValuePair <string, StringBuilder> current in dictionary)
            {
                dictionary2[current.Key] = current.Value.ToString();
            }
            return(dictionary2);
        }
        private string GenerateAllAssetProjectPart()
        {
            StringBuilder stringBuilder = new StringBuilder();

            string[] allAssetPaths = AssetDatabase.GetAllAssetPaths();
            for (int i = 0; i < allAssetPaths.Length; i++)
            {
                string text      = allAssetPaths[i];
                string extension = Path.GetExtension(text);
                if (this.IsSupportedExtension(extension) && SolutionSynchronizer.ScriptingLanguageFor(extension) == ScriptingLanguage.None)
                {
                    stringBuilder.AppendFormat("     <None Include=\"{0}\" />{1}", this.EscapedRelativePathFor(text), SolutionSynchronizer.WindowsNewline);
                }
            }
            return(stringBuilder.ToString());
        }
        private string ProjectHeader(MonoIsland island)
        {
            string            text     = "4.0";
            string            text2    = "10.0.20506";
            ScriptingLanguage language = SolutionSynchronizer.ScriptingLanguageFor(island);

            if (this._settings.VisualStudioVersion == 9)
            {
                text  = "3.5";
                text2 = "9.0.21022";
            }
            object[] array = new object[]
            {
                text,
                text2,
                this.ProjectGuid(island._output),
                this._settings.EngineAssemblyPath,
                this._settings.EditorAssemblyPath,
                string.Join(";", new string[]
                {
                    "DEBUG",
                    "TRACE"
                }.Concat(this._settings.Defines).Concat(island._defines).Distinct <string>().ToArray <string>()),
                SolutionSynchronizer.MSBuildNamespaceUri,
                Path.GetFileNameWithoutExtension(island._output),
                EditorSettings.projectGenerationRootNamespace
            };
            string result;

            try
            {
                result = string.Format(this._settings.GetProjectHeaderTemplate(language), array);
            }
            catch (Exception)
            {
                throw new NotSupportedException("Failed creating c# project because the c# project header did not have the correct amount of arguments, which is " + array.Length);
            }
            return(result);
        }
 private string ProjectFooter(MonoIsland island)
 {
     return(string.Format(this._settings.GetProjectFooterTemplate(SolutionSynchronizer.ScriptingLanguageFor(island)), this.ReadExistingMonoDevelopProjectProperties(island)));
 }
 private static IEnumerable <MonoIsland> RelevantIslandsForMode(IEnumerable <MonoIsland> islands, SolutionSynchronizer.Mode mode)
 {
     return(from i in islands
            where mode == SolutionSynchronizer.Mode.UnityScriptAsUnityProj || ScriptingLanguage.CSharp == SolutionSynchronizer.ScriptingLanguageFor(i)
            select i);
 }
        public string ProjectFile(MonoIsland island)
        {
            ScriptingLanguage key = SolutionSynchronizer.ScriptingLanguageFor(island);

            return(Path.Combine(this._projectDirectory, string.Format("{0}{1}", Path.GetFileNameWithoutExtension(island._output), SolutionSynchronizer.ProjectExtensions[key])));
        }
 private static ScriptingLanguage ScriptingLanguageFor(MonoIsland island)
 {
     return(SolutionSynchronizer.ScriptingLanguageFor(island.GetExtensionOfSourceFiles()));
 }