Esempio n. 1
0
        public override void GetClassAndNamespace(string filePath, string definedSymbols,
                                                  out string outClassName, out string outNamespace)
        {
            var responseFilePath = Path.Combine("Assets", MicrosoftCSharpCompiler.ResponseFilename);
            var responseFileData = ScriptCompilerBase.ParseResponseFileFromFile(
                responseFilePath,
                Directory.GetParent(Application.dataPath).FullName,
                GetSystemReferenceDirectories(ApiCompatibilityLevel.NET_4_6));

            var definedSymbolSplit = definedSymbols.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            var uniqueSymbols      = responseFileData.Defines.Union(definedSymbolSplit).Distinct().ToArray();

            CSharpNamespaceParser.GetClassAndNamespace(ReadAndConverteNewLines(filePath).ReadToEnd(),
                                                       Path.GetFileNameWithoutExtension(filePath), out outClassName, out outNamespace, uniqueSymbols);
        }
Esempio n. 2
0
 public override void GetClassAndNamespace(string filePath, out string outClassName, out string outNamespace)
 {
     CSharpNamespaceParser.GetClassAndNamespace(ReadAndConverteNewLines(filePath).ReadToEnd(),
                                                Path.GetFileNameWithoutExtension(filePath), out outClassName, out outNamespace);
 }