コード例 #1
0
ファイル: CreateExcelAddIn.cs プロジェクト: xinablak/ExcelDna
        private static bool ShouldCopy64BitDnaOutput(BuildItemSpec item, IEnumerable <BuildItemSpec> buildItems)
        {
            if (item.InputDnaFileName.Equals(item.InputDnaFileNameAs64Bit))
            {
                return(true);
            }

            var specificFileExists = buildItems
                                     .Any(bi => item.InputDnaFileNameAs64Bit.Equals(bi.InputDnaFileName, StringComparison.OrdinalIgnoreCase));

            return(!specificFileExists);
        }
コード例 #2
0
        private void TryBuildAddInFor64Bit(BuildItemSpec[] buildItemsForDnaFiles)
        {
            foreach (var item in buildItemsForDnaFiles)
            {
                if (Create64BitAddIn && ShouldCopy64BitDnaOutput(item, buildItemsForDnaFiles))
                {
                    // Copy .dna file to build output folder for 64-bit
                    CopyFileToBuildOutput(item.InputDnaFileName, item.OutputDnaFileNameAs64Bit, overwrite: true);

                    // Copy .xll file to build output folder for 64-bit
                    CopyFileToBuildOutput(Xll64FilePath, item.OutputXllFileNameAs64Bit, overwrite: true);

                    // Copy .config file to build output folder for 64-bit (if exist)
                    TryCopyConfigFileToOutput(item.InputConfigFileNameAs64Bit, item.InputConfigFileNameFallbackAs64Bit, item.OutputConfigFileNameAs64Bit);

                    AddDnaToListOfFilesToPack(item.OutputDnaFileNameAs64Bit, item.OutputXllFileNameAs64Bit, item.OutputConfigFileNameAs64Bit);
                }
            }
        }
コード例 #3
0
        private static bool ShouldCopy64BitDnaOutput(BuildItemSpec item, IEnumerable<BuildItemSpec> buildItems)
        {
            if (item.InputDnaFileName.Equals(item.InputDnaFileNameAs64Bit))
            {
                return true;
            }

            var specificFileExists = buildItems
                .Any(bi => item.InputDnaFileNameAs64Bit.Equals(bi.InputDnaFileName, StringComparison.OrdinalIgnoreCase));

            return !specificFileExists;
        }