Beispiel #1
0
 static Connection()
 {
     UserAgentString = String.Format("ShippingEasy .NET Client: {0}/{1} ({2} {3})",
                                     AssemblyInfo.GetAssemblyName(),
                                     AssemblyInfo.GetAssemblyVersion(),
                                     AssemblyInfo.GetFileVersion(),
                                     AssemblyInfo.GetCommitIdentifier());
 }
Beispiel #2
0
 void OnEnable()
 {
     assemblyInfo = (AssemblyInfo)target;
     newVersion   = assemblyInfo.GetAssemblyName().Version;
     animBoolExtraAssembliesProperty = new AnimBool(assemblyInfo.canEditMultipleScriptFiles);
     animBoolExtraAssembliesProperty.valueChanged.AddListener(Repaint);
     animBoolEditProjectSettings = new AnimBool(assemblyInfo.updatesProjectVersion);
     animBoolEditProjectSettings.valueChanged.AddListener(Repaint);
 }
Beispiel #3
0
        public Runner(ListArticleGenerator listArticleGenerator, ReferencesEditor referencesEditor, ArticleAnalyzer articleAnalyzer,
                      Util util, AssemblyInfo assemblyInfo)
        {
            this.util = util;
            this.listArticleGenerator = listArticleGenerator;
            this.referencesEditor     = referencesEditor;
            this.articleAnalyzer      = articleAnalyzer;

            quit = false;

            var    assemblyName = assemblyInfo.GetAssemblyName();
            string appVersion   = assemblyInfo.GetAssemblyValue("Version", assemblyName);

            Console.DisplayAssemblyInfo(assemblyName.Name, appVersion);
        }
Beispiel #4
0
        public override void OnInspectorGUI()
        {
            const int fieldCount = 3;

            bool compiling = EditorApplication.isCompiling ||
                             EditorApplication.isUpdating;

            AssemblyName assemblyName = assemblyInfo.GetAssemblyName();

            string versionString;

            bool enabled = assemblyInfo.canBeEdited && InAssetsFolder(assemblyInfo);

            if (!VersionsEquals(assemblyName.Version, newVersion))
            {
                versionString = assemblyName.Version.ToString(fieldCount) + " → " + newVersion.ToString(fieldCount) +
                                " (awaiting asset refresh)";
                enabled = false;
            }
            else if (compiling)
            {
                versionString = assemblyName.Version.ToString(fieldCount) + " (awaiting compilation)";
                enabled       = false;
            }
            else
            {
                versionString = assemblyName.Version.ToString(fieldCount);
            }

            EditorGUILayout.Space();
            EditorGUILayout.LabelField(assemblyName.Name, EditorStyles.boldLabel);

            GUI.enabled = enabled;

            string input = EditorGUILayout.DelayedTextField("Assembly Version", versionString);

            if (System.Version.TryParse(input, out System.Version version) &&
                !VersionsEquals(version, assemblyName.Version))
            {
                OverwriteAssemblyVersion(assemblyInfo, version);
                if (assemblyInfo.canEditMultipleScriptFiles &&
                    assemblyInfo.alsoEditsAssemblyInfos != null)
                {
                    foreach (MonoScript otherAssemblyInfo in assemblyInfo.alsoEditsAssemblyInfos)
                    {
                        OverwriteAssemblyVersion(otherAssemblyInfo, version);
                    }
                }

                newVersion = version;

                if (assemblyInfo.updatesProjectVersion)
                {
                    PlayerSettings.bundleVersion = newVersion.ToString(fieldCount);
                }
            }

            GUI.enabled = true;

            if (!(assemblyInfo.canBeEdited && InAssetsFolder(assemblyInfo)))
            {
                return;
            }

            EditorGUILayout.Space();
            EditorGUILayout.HelpBox("Changing above version will recompile source.", MessageType.Warning);

            EditorGUILayout.Space();

            SerializedProperty updatesProjectVersion =
                serializedObject.FindProperty(nameof(AssemblyInfo.updatesProjectVersion));

            EditorGUILayout.PropertyField(updatesProjectVersion, true);

            animBoolEditProjectSettings.target = updatesProjectVersion.boolValue;
            if (EditorGUILayout.BeginFadeGroup(animBoolEditProjectSettings.faded))
            {
                GUI.enabled = false;
                EditorGUILayout.TextField("Project Version", Application.version);
                GUI.enabled = true;
            }
            EditorGUILayout.EndFadeGroup();

            EditorGUILayout.Space();

            SerializedProperty editsOtherScripts =
                serializedObject.FindProperty(nameof(AssemblyInfo.canEditMultipleScriptFiles));

            EditorGUILayout.PropertyField(editsOtherScripts, true);

            animBoolExtraAssembliesProperty.target = editsOtherScripts.boolValue;
            if (EditorGUILayout.BeginFadeGroup(animBoolExtraAssembliesProperty.faded))
            {
                SerializedProperty otherScripts =
                    serializedObject.FindProperty(nameof(AssemblyInfo.alsoEditsAssemblyInfos));
                EditorGUILayout.PropertyField(otherScripts, true);
            }
            EditorGUILayout.EndFadeGroup();

            serializedObject.ApplyModifiedProperties();
        }