示例#1
0
        void AssembleZip()
        {
            ZipFolder = Path.Combine(OutputFolder, "SourceAFIS-" + Versions.Release);
            Console.WriteLine("Assembling ZIP archive: {0}", ZipFolder);
            Command.ForceDeleteDirectory(ZipFolder);
            Directory.CreateDirectory(ZipFolder);
            string prefix = Command.FixPath(ZipFolder + @"\");

            Directory.CreateDirectory(prefix + "Bin");
            if (!Mono)
            {
                Command.CopyTo(@"SourceAFIS\bin\Release\SourceAFIS.dll", prefix + "Bin");
                Command.CopyTo(@"SourceAFIS\bin\Release\SourceAFIS.xml", prefix + "Bin");
                Command.CopyTo(@"SourceAFIS.Visualization\bin\Release\SourceAFIS.Visualization.dll", prefix + "Bin");
                Command.CopyTo(@"SourceAFIS.FingerprintAnalysis\bin\Release\SourceAFIS.FingerprintAnalysis.exe", prefix + "Bin");
            }
            else
            {
                Command.CopyTo(@"SourceAFIS\bin\Release\SourceAFIS.Mono.dll", prefix + "Bin");
                Command.CopyTo(@"SourceAFIS\bin\Release\SourceAFIS.Mono.xml", prefix + "Bin");
            }
            Command.CopyTo(@"SourceAFIS.Tuning\bin\Release\SourceAFIS.Tuning.dll", prefix + "Bin");
            Command.CopyTo(@"DatabaseAnalyzer\bin\Release\DatabaseAnalyzer.exe", prefix + "Bin");
            Command.CopyTo(@"DatabaseAnalyzer\bin\Release\DatabaseAnalyzer.exe.config", prefix + "Bin");
            Command.CopyTo(@"Data\DatabaseAnalyzerConfiguration.xml", prefix + "Bin");
            if (!Mono)
            {
                Command.CopyTo(@"java\sourceafis\bin\dist\sourceafis.jar", prefix + "Bin");
            }

            Directory.CreateDirectory(prefix + "Documentation");
            Command.CopyTo(@"Data\license.txt", prefix + "Documentation");
            Command.CopyTo(@"Data\SourceAFIS_Home.html", prefix + "Documentation");
            if (!Mono)
            {
                Command.CopyTo(@"SourceAFIS\bin\Release\SourceAFIS.xml", prefix + "Documentation");
                Command.CopyTo(@"DocProject\bin\Release\SourceAFIS.chm", prefix + "Documentation");
                Command.CopyTo(@"DocProject\bin\Release\SourceAFIS.HxS", prefix + "Documentation");

                Directory.CreateDirectory(prefix + @"Documentation\SourceAFIS");
                Command.CopyDirectory(@"DocProject\Help\html", prefix + @"Documentation\SourceAFIS\html");
                Command.CopyDirectory(@"DocProject\Help\Icons", prefix + @"Documentation\SourceAFIS\icons");
                Command.CopyDirectory(@"DocProject\Help\Scripts", prefix + @"Documentation\SourceAFIS\scripts");
                Directory.CreateDirectory(prefix + @"Documentation\SourceAFIS\styles");
                File.Copy(@"DocProject\Help\Styles\Presentation.css", prefix + @"Documentation\SourceAFIS\styles\presentation.css");
                Command.CopyTo(@"DocProject\Help\Styles\TopicDesigner.css", prefix + @"Documentation\SourceAFIS\styles");

                Command.CopyDirectory(@"java\sourceafis\doc", prefix + @"Documentation\javadoc");

                Command.CopyDirectory("Sample", prefix + "Sample");
                Command.DeleteFileIfExists(prefix + @"Sample\Sample.suo");
                Command.ForceDeleteDirectory(prefix + @"Sample\obj");
                Command.ForceDeleteDirectory(prefix + @"Sample\bin\Release");
                Command.DeleteFileIfExists(prefix + @"Sample\bin\Debug\Sample.exe.mdb");
            }

            if (!Mono)
            {
                string linuxZip = SolutionFolder + @"\Data\LinuxShare\SourceAFIS-" + Versions.Release;
                Command.UnZip(linuxZip + ".zip");
                Command.CopyTo(linuxZip + @"\Bin\SourceAFIS.Mono.dll", prefix + "Bin");
                Command.CopyTo(linuxZip + @"\Bin\SourceAFIS.Mono.xml", prefix + "Bin");
            }

            Command.Zip(ZipFolder);
        }