Skip to content

Commit 79cf76a

Browse files
committed
BuildTool mini application to help us with our special build and test needs.
1 parent 9ea3a4c commit 79cf76a

File tree

8 files changed

+177
-0
lines changed

8 files changed

+177
-0
lines changed

Tools/BuildTool/BuildTool.csproj

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
6+
<ProductVersion>8.0.30703</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{9F599EF4-F977-4063-9141-3D95359EE076}</ProjectGuid>
9+
<OutputType>Exe</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace>BuildTool</RootNamespace>
12+
<AssemblyName>BuildTool</AssemblyName>
13+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
14+
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
15+
<FileAlignment>512</FileAlignment>
16+
</PropertyGroup>
17+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
18+
<PlatformTarget>x86</PlatformTarget>
19+
<DebugSymbols>true</DebugSymbols>
20+
<DebugType>full</DebugType>
21+
<Optimize>false</Optimize>
22+
<OutputPath>bin\Debug\</OutputPath>
23+
<DefineConstants>DEBUG;TRACE</DefineConstants>
24+
<ErrorReport>prompt</ErrorReport>
25+
<WarningLevel>4</WarningLevel>
26+
</PropertyGroup>
27+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
28+
<PlatformTarget>x86</PlatformTarget>
29+
<DebugType>pdbonly</DebugType>
30+
<Optimize>true</Optimize>
31+
<OutputPath>bin\Release\</OutputPath>
32+
<DefineConstants>TRACE</DefineConstants>
33+
<ErrorReport>prompt</ErrorReport>
34+
<WarningLevel>4</WarningLevel>
35+
</PropertyGroup>
36+
<ItemGroup>
37+
<Reference Include="System" />
38+
<Reference Include="System.Core" />
39+
<Reference Include="System.Xml.Linq" />
40+
<Reference Include="System.Data.DataSetExtensions" />
41+
<Reference Include="System.Data" />
42+
<Reference Include="System.Xml" />
43+
</ItemGroup>
44+
<ItemGroup>
45+
<Compile Include="Program.cs" />
46+
<Compile Include="Properties\AssemblyInfo.cs" />
47+
</ItemGroup>
48+
<ItemGroup>
49+
<None Include="app.config" />
50+
</ItemGroup>
51+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
52+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
53+
Other similar extension points exist, see Microsoft.Common.targets.
54+
<Target Name="BeforeBuild">
55+
</Target>
56+
<Target Name="AfterBuild">
57+
</Target>
58+
-->
59+
</Project>

Tools/BuildTool/BuildTool.sln

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 11.00
3+
# Visual Studio 2010
4+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BuildTool", "BuildTool.csproj", "{9F599EF4-F977-4063-9141-3D95359EE076}"
5+
EndProject
6+
Global
7+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8+
Debug|x86 = Debug|x86
9+
Release|x86 = Release|x86
10+
EndGlobalSection
11+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
12+
{9F599EF4-F977-4063-9141-3D95359EE076}.Debug|x86.ActiveCfg = Debug|x86
13+
{9F599EF4-F977-4063-9141-3D95359EE076}.Debug|x86.Build.0 = Debug|x86
14+
{9F599EF4-F977-4063-9141-3D95359EE076}.Release|x86.ActiveCfg = Release|x86
15+
{9F599EF4-F977-4063-9141-3D95359EE076}.Release|x86.Build.0 = Release|x86
16+
EndGlobalSection
17+
GlobalSection(SolutionProperties) = preSolution
18+
HideSolutionNode = FALSE
19+
EndGlobalSection
20+
EndGlobal

Tools/BuildTool/Program.cs

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Text;
6+
7+
namespace BuildTool
8+
{
9+
class Program
10+
{
11+
static int Main(string[] args)
12+
{
13+
string command = args[0];
14+
15+
if (command == "pick-folder")
16+
{
17+
string[] folders = Directory.GetDirectories(args[1]);
18+
for (int i = 0; i < folders.Length; i++)
19+
{
20+
Console.WriteLine((char)('A' + i) + ": " + Path.GetFileName(folders[i]));
21+
}
22+
while (true)
23+
{
24+
Console.WriteLine(args[3]);
25+
var key = Console.ReadKey();
26+
Console.WriteLine();
27+
if (key.KeyChar >= 'A' && key.KeyChar <= 'Z' || key.KeyChar >= 'a' && key.KeyChar <= 'z')
28+
{
29+
int index = key.KeyChar.ToString().ToUpper()[0] - 'A';
30+
File.WriteAllText(args[2], folders[index]);
31+
break;
32+
}
33+
}
34+
35+
return 0;
36+
}
37+
else if (command == "prompt")
38+
{
39+
while(true)
40+
{
41+
Console.WriteLine("[" + string.Join(", ", args[1].ToCharArray().Select(c => c.ToString()).ToArray()) + "]?");
42+
char[] characters = args[1].ToLower().ToCharArray();
43+
var key = char.ToLower(Console.ReadKey().KeyChar);
44+
Console.WriteLine();
45+
if (characters.Contains(key))
46+
return characters.ToList().IndexOf(key);
47+
}
48+
}
49+
else
50+
{
51+
Console.WriteLine("Invalid command: " + command);
52+
return 255;
53+
}
54+
}
55+
}
56+
}

Tools/BuildTool/app.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0"?>
2+
<configuration>
3+
<startup><supportedRuntime version="v2.0.50727" sku="Client"/></startup></configuration>
6 KB
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0"?>
2+
<configuration>
3+
<startup><supportedRuntime version="v2.0.50727" sku="Client"/></startup></configuration>
13.5 KB
Binary file not shown.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("BuildTool")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("Microsoft")]
12+
[assembly: AssemblyProduct("BuildTool")]
13+
[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("d4504371-aeb8-4a01-9617-68965fb3af68")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

0 commit comments

Comments
 (0)