예제 #1
0
        private IAssemblyCookie CreateCookie(string assemblyNameOrFile)
        {
            if (assemblyNameOrFile == null || (assemblyNameOrFile = assemblyNameOrFile.Trim()).Length == 0)
            {
                return(null);
            }

            AssemblyReferenceTarget target = null;

            // assembly path
            FileSystemPath path = FileSystemPath.TryParse(assemblyNameOrFile);

            if (!path.IsEmpty && path.IsAbsolute)
            {
                target = new AssemblyReferenceTarget(AssemblyNameInfo.Empty, path);
            }

            // assembly name
            else
            {
                AssemblyNameInfo nameInfo = AssemblyNameInfo.TryParse(assemblyNameOrFile);
                if (nameInfo != null)
                {
                    target = new AssemblyReferenceTarget(nameInfo, FileSystemPath.Empty);
                }
            }

            if (target == null)
            {
                return(null);
            }

            return(CreateCookieCore(target));
        }
예제 #2
0
        private IAssemblyCookie CreateCookieCore([NotNull] AssemblyReferenceTarget target)
        {
            AssemblyReferenceResolveResult result = ResolveManager.Resolve(target, _resolveProject);

            return(result != null
                                ? _assemblyFactory.AddRef(result, "T4", _t4Environment.PlatformID)
                                : null);
        }
예제 #3
0
        private IAssemblyCookie CreateCookieCore([NotNull] AssemblyReferenceTarget target)
        {
            FileSystemPath result = ResolveManager.Resolve(target, _resolveProject, _moduleReferenceResolveContext);

            return(result != null
                                ? _assemblyFactory.AddRef(result, "T4", _moduleReferenceResolveContext)
                                : null);
        }
        private FileSystemPath ResolveAssemblyNameOrFile(
            [NotNull] IProjectFile projectFile,
            [NotNull] string assemblyNameOrFile
            )
        {
            var resolveContext = projectFile.SelectResolveContext();
            var nameInfo       = AssemblyNameInfo.TryParse(assemblyNameOrFile);

            if (nameInfo == null)
            {
                return(null);
            }
            var target  = new AssemblyReferenceTarget(nameInfo, FileSystemPath.Empty);
            var project = projectFile.GetProject().NotNull();

            return(Resolve(target, project, resolveContext));
        }
예제 #5
0
        private IAssemblyCookie CreateCookie(string assemblyNameOrFile)
        {
            if (assemblyNameOrFile == null || (assemblyNameOrFile = assemblyNameOrFile.Trim()).Length == 0)
            {
                return(null);
            }

            AssemblyReferenceTarget target = null;

            // assembly path
            FileSystemPath path = FileSystemPath.TryParse(assemblyNameOrFile);

            if (!path.IsEmpty && path.IsAbsolute)
            {
                target = new AssemblyReferenceTarget(AssemblyNameInfo.Empty, path);
            }

            // assembly name
            else
            {
                AssemblyNameInfo nameInfo = AssemblyNameInfo.TryParse(assemblyNameOrFile);
                if (nameInfo != null)
                {
                    target = new AssemblyReferenceTarget(nameInfo, FileSystemPath.Empty);
                }
            }

            if (target == null)
            {
                return(null);
            }

            AssemblyReferenceResolveResult result = ResolveManager.Resolve(target, _resolveProject);

            if (result == null)
            {
                return(null);
            }

            return(_assemblyFactory.AddRef(result, "T4", _t4Environment.PlatformID));
        }
예제 #6
0
        private IAssemblyCookie CreateCookie(string assemblyNameOrFile)
        {
            if (assemblyNameOrFile == null || (assemblyNameOrFile = assemblyNameOrFile.Trim()).Length == 0)
                return null;

            AssemblyReferenceTarget target = null;

            // assembly path
            FileSystemPath path = FileSystemPath.TryParse(assemblyNameOrFile);
            if (!path.IsEmpty && path.IsAbsolute)
                target = new AssemblyReferenceTarget(AssemblyNameInfo.Empty, path);

            // assembly name
            else {
                AssemblyNameInfo nameInfo = AssemblyNameInfo.TryParse(assemblyNameOrFile);
                if (nameInfo != null)
                    target = new AssemblyReferenceTarget(nameInfo, FileSystemPath.Empty);
            }

            if (target == null)
                return null;

            return CreateCookieCore(target);
        }
예제 #7
0
        private IAssemblyCookie CreateCookie(string assemblyNameOrFile)
        {
            if (assemblyNameOrFile == null || (assemblyNameOrFile = assemblyNameOrFile.Trim()).Length == 0)
                return null;

            AssemblyReferenceTarget target = null;

            // assembly path
            FileSystemPath path = FileSystemPath.TryParse(assemblyNameOrFile);
            if (!path.IsEmpty && path.IsAbsolute)
                target = new AssemblyReferenceTarget(AssemblyNameInfo.Empty, path);

            // assembly name
            else {
                AssemblyNameInfo nameInfo = AssemblyNameInfo.TryParse(assemblyNameOrFile);
                if (nameInfo != null)
                    target = new AssemblyReferenceTarget(nameInfo, FileSystemPath.Empty);
            }

            if (target == null)
                return null;

            AssemblyReferenceResolveResult result = ResolveManager.Resolve(target, _resolveProject);
            if (result == null)
                return null;

            return _assemblyFactory.AddRef(result, "T4", _t4Environment.PlatformID);
        }
 private FileSystemPath Resolve(
     AssemblyReferenceTarget target,
     IProject project,
     IModuleReferenceResolveContext resolveContext
     ) => ResolveManager.Resolve(target, project, resolveContext);
 private VirtualFileSystemPath Resolve(
     AssemblyReferenceTarget target,
     IProject project,
     IModuleReferenceResolveContext resolveContext
     ) => ResolveManager.Resolve(target, project, resolveContext)?.AssemblyPhysicalPath;