Index: Tools/BuildRelease/Wiki/DownloadsPage.cs
===================================================================
deleted file mode 100644
--- a/Tools/BuildRelease/Wiki/DownloadsPage.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
-Copyright 2013 Google Inc
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-using System;
-using System.IO;
-using System.Linq;
-using System.Text.RegularExpressions;
-
-using Google.Apis.Samples.Helper;
-using Google.Build.Utils.Text;
-
-namespace BuildRelease.Wiki
-{
- /// Updator for the Downloads wiki page.
- public class DownloadsPage
- {
- private const string StableStartTag = "GENERATED_STABLE_BEGIN";
- private const string StableEndTag = "GENERATED_STABLE_END";
- private const string DownloadsStartTag = "GENERATED_DOWNLOADS_BEGIN";
- private const string DownloadsEndTag = "GENERATED_DOWNLOADS_END";
-
- private static readonly Regex LinkRegex = new Regex(@"\[([^ \]]*/)\S+ ([^\]]+)]", RegexOptions.Compiled);
-
- /// The Samples repository used for generating the list of samples.
- public string ReleaseNotes { get; private set; }
-
- /// The directory containing the release .zip files.
- public string ZipDir { get; private set; }
-
- /// The Name of this release.
- public string ReleaseName { get; private set; }
-
- public DownloadsPage(string releaseNotes, string zipDir)
- {
- ReleaseNotes = releaseNotes;
- ZipDir = zipDir;
- ReleaseName = Path.GetFileName(Path.GetDirectoryName(Path.GetDirectoryName(zipDir)));
- }
-
- /// Generates the Releases Notes section.
- private string GenerateNotes()
- {
- return "{{{" + Environment.NewLine + ReleaseNotes + Environment.NewLine + "}}}";
- }
-
- ///
- /// Replaces the download links references for binaries, source and samples to the current version number.
- ///
- /// The text block containing the wiki links.
- /// Replaced & updated text.
- private string ReplaceLinks(string input)
- {
- const string format =
- "[http://contrib.google-api-dotnet-client.googlecode.com/hg/{0}/Generated/ZipFiles/{1} {2}]";
- return LinkRegex.Replace(input, (match) => string.Format(format,
- ReleaseName,
- GetFileName(match.Groups[2].ToString()),
- match.Groups[2].ToString()));
- }
-
- ///
- /// Retrieves the filename of the release for the specified title/keyword.
- /// Example:
- /// 'Binary Release' results in 'google-api-dotnet-client-1.0.0.Binary.zip'
- ///
- private string GetFileName(string title)
- {
- string keyword = title.Split(' ')[0];
- return Path.GetFileName(Directory.GetFiles(ZipDir, "*" + keyword + "*").Single());
- }
-
- /// Modifies the existing Downloads wiki file by replacing the "generated" section.
- private void InsertIntoFile(string file)
- {
- string content = File.ReadAllText(file);
- content = TextUtils.InsertIntoText(content, StableStartTag, StableEndTag, GenerateNotes());
- content = TextUtils.ReplaceInText(content, DownloadsStartTag, DownloadsEndTag, ReplaceLinks);
- File.WriteAllText(file, content);
- }
-
- /// Updates the Wiki.
- public void UpdateWiki(string workingDirectory)
- {
- if (ReleaseNotes != null)
- {
- CommandLine.WriteAction("Updating 'Downloads.wiki' ...");
- InsertIntoFile(Path.Combine(workingDirectory, "Downloads.wiki"));
- }
- }
- }
-}