示例#1
0
        static void CreateSymlinksFor(
            PackageManager.PackageInfo[] packages,
            int localPackagesCount,
            DirectoryInfo rootPath
            )
        {
            var links   = new DirectoryInfo[localPackagesCount];
            var targets = new DirectoryInfo[localPackagesCount];

            for (int i = 0; i < localPackagesCount; ++i)
            {
                var package = packages[i];
                Assert.AreEqual(PackageSource.Local, package.source);

                links[i]   = new DirectoryInfo(Path.GetFullPath(Path.Combine(rootPath.FullName, package.assetPath)));
                targets[i] = new DirectoryInfo(package.resolvedPath);
            }

            if (!links.AreSymbolicLinks())
            {
                if (!SymbolicLinkUtilities.CreateSymbolicLinks(links, targets))
                {
                    throw new Exception("Failed to create packages symlinks in ProjectFolder/Library/ShaderAnalysis/PackageSymlinks/Packages/*. Please check if you have sufficient privileges to create symlinks or manually create the symlinks for each package.");
                }
            }
        }
示例#2
0
        static void CreateSymlinksFor(
            PackageManager.PackageInfo[] packages,
            int localPackagesCount,
            DirectoryInfo rootPath
            )
        {
            var links   = new DirectoryInfo[localPackagesCount];
            var targets = new DirectoryInfo[localPackagesCount];

            for (int i = 0; i < localPackagesCount; ++i)
            {
                var package = packages[i];
                Assert.AreEqual(PackageSource.Local, package.source);

                links[i]   = new DirectoryInfo(Path.GetFullPath(Path.Combine(rootPath.FullName, package.assetPath)));
                targets[i] = new DirectoryInfo(package.resolvedPath);
            }

            if (!links.AreSymbolicLinks())
            {
                SymbolicLinkUtilities.CreateSymbolicLinks(links, targets);
            }
        }