public static string GenerateCreateHelperClassesArgs(MissingUnityEventsManagerConfiguration config)
 {
     return($"generate-helper-code " +
            $"-t \"{string.Join(MultipleItemsForArgCommandLineDelimiter, GetUnityRequiredDllPaths(config, true))}\" " +
            $"-o \"{config.HelperClassFilePath}\" " +
            $"-n \"{config.HelperClassNamespace}\" " +
            $"--using-statements System:UnityEngine " +
            $"--enabled-build-symbol {MissingUnityEventsManagerConfiguration.CustomAutoGeneratedEventsEnabledBuildSymbol} " +
            $"--include-custom-code-when-no-build-symbol \"{config.HelperClassIncludeCustomCodeWhenNoBuildSymbol.Replace("\"", "\\\"")}\"");
 }
        private static List <FileInfo> GetUnityRequiredDllPaths(MissingUnityEventsManagerConfiguration config, bool singlePerDllType)
        {
            var unityRequiredDllPaths = config.EventConfigurationEntries.Select(c => c.DllName).GroupBy(d => d).Select(g => g.First())
                                        .SelectMany(dllName =>
                                                    new DirectoryInfo(UnityEditorDataDirectoryPath)
                                                    .GetFiles(dllName + ".dll", SearchOption.AllDirectories)
                                                    ).ToList();

            if (singlePerDllType)
            {
                unityRequiredDllPaths = unityRequiredDllPaths
                                        .GroupBy(f => f.Name)
                                        .Select(g => g.First())
                                        .ToList();
            }

            return(unityRequiredDllPaths);
        }
Пример #3
0
        private static List <string> GetUnityRequiredDllPaths(MissingUnityEventsManagerConfiguration config, bool singlePerDllType)
        {
            var unityRequiredDllPaths = new List <string>();

            var rootDir           = new DirectoryInfo(UnityEditorDataDirectoryPath);
            var unityRequiredDlls = config.EventConfigurationEntries.Select(c => c.DllName).GroupBy(d => d).Select(g => g.First());

            foreach (var unityRequiredDll in unityRequiredDlls)
            {
                RecursivelyFindDlls(rootDir, unityRequiredDll, unityRequiredDllPaths);
            }

            if (singlePerDllType)
            {
                unityRequiredDllPaths = unityRequiredDllPaths
                                        .GroupBy(f => f)
                                        .Select(g => g.First())
                                        .ToList();
            }

            return(unityRequiredDllPaths);
        }
 public static string GenerateAddEventsCommandLineArgs(MissingUnityEventsManagerConfiguration config)
 {
     return($"add-events " +
            $"-t \"{string.Join(MultipleItemsForArgCommandLineDelimiter, GetUnityRequiredDllPaths(config, false))}\" " +
            $"--target-definitions {string.Join(MultipleItemsForArgCommandLineDelimiter, config.EventConfigurationEntries.Select(c => $"{c.ObjectType}-{c.PropertyName}-{c.DllName}"))}");
 }
 public static string GenerateRevertToOriginalCommandLineArgs(MissingUnityEventsManagerConfiguration config)
 {
     return($"revert-to-original " +
            $"-t \"{string.Join(MultipleItemsForArgCommandLineDelimiter, GetUnityRequiredDllPaths(config, false))}\"");
 }