Exemple #1
0
        //=====================================
        //	関数
        //=====================================

        /// <summary>
        /// 処理
        /// </summary>
        protected override void DoProcess(RuntimePlatform platform, BuildTarget target, IBundleBuildConfig config, IList <IBundleFileManifest> bundleList)
        {
            for (int i = 0; i < bundleList.Count; i++)
            {
                var data       = bundleList[i];
                var pathHash   = CalcPathHash(data);
                var bundleHash = CalcBundleHash(data);
                var identifier = data.Identifier;
                var path       = config.GetBundleName($"{bundleHash}/{pathHash}");
                // 更新
                //data.Apply(config.TargetDirPath, identifier, path, data.Assets);
            }
        }
Exemple #2
0
        public override IBundleFileManifest Instantiate(IBundleBuildConfig config, IBundleGroup group, string[] labels)
        {
            var data = new ABBuildData
            {
                FolderPrefix = config.TargetDirPath,
                Identifier   = group.Identifier,
                ABName       = config.GetBundleName(group.Identifier),
                Assets       = group.Assets,
                Labels       = labels,
            };

            return(data);
        }
Exemple #3
0
        protected virtual IBundleFileManifest Build(IBundleBuildConfig config, IBundleGroup group, BundlePackRule rule)
        {
            var data = new BundleBuildData
            {
                TopDirectoryPath = config.TargetDirPath,
                Identifier       = group.Identifier,
                ABName           = config.GetBundleName(group.Identifier),
                Assets           = group.Assets,
                Labels           = rule.Labels,
            };

            data.CalcAddress();
            return(data);
        }
Exemple #4
0
        /// <summary>
        /// 実行
        /// </summary>
        protected override void DoProcess(RuntimePlatform platform, BuildTarget target, IBundleBuildConfig settings, ABBuildResult result, IList <IBundleFileManifest> bundleList)
        {
            //	親ディレクトリ
            var rootDirPath = OutputPath.Get(platform);

            if (!Directory.Exists(rootDirPath.BasePath))
            {
                Debug.LogWarning($"OutputDir is Not Exists : { rootDirPath}");
                return;
            }

            //	ファイル一覧
            var fileList = Directory.EnumerateFiles(
                path: rootDirPath.BasePath,
                searchPattern: settings.GetBundleName("*"),
                searchOption: SearchOption.AllDirectories
                )
                           .Select(c => c.Replace("\\", "/"))
                           .OrderBy(c => c)
                           .ToList();

            // 出力結果にあるものは除外していく
            foreach (var ab in bundleList)
            {
                var abPath = rootDirPath.ToLocation(ab.ABName);
                if (File.Exists(abPath.FullPath))
                {
                    fileList.Remove(abPath.FullPath);
                }
            }

            var builder = new StringBuilder();

            //	不要になったファイルを削除
            foreach (var f in fileList)
            {
                builder.AppendLine($"delete :: {f}");
                SafeDelete(f);
                SafeDelete(f + ".manifest");
            }
            File.WriteAllText(rootDirPath.ToLocation("delete-log.txt").FullPath, builder.ToString(), new UTF8Encoding(false));
        }