Skip to content

Commit

Permalink
issue with package restore fixed. some other projects also required u…
Browse files Browse the repository at this point in the history
…pdating
  • Loading branch information
shiftbot committed Jan 22, 2012
2 parents b999dc5 + c498cfe commit b15022c
Show file tree
Hide file tree
Showing 9 changed files with 248 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Extensions/BitbucketAnnouncer/BitbucketAnnouncer.csproj
Expand Up @@ -12,6 +12,8 @@
<AssemblyName>BitbucketAnnouncer</AssemblyName> <AssemblyName>BitbucketAnnouncer</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\jibbr\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -53,6 +55,7 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
Expand Down
3 changes: 3 additions & 0 deletions Extensions/CCNetAnnouncer/CCNetAnnouncer.csproj
Expand Up @@ -12,6 +12,8 @@
<AssemblyName>CCNetAnnouncer</AssemblyName> <AssemblyName>CCNetAnnouncer</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\jibbr\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -64,6 +66,7 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
Expand Down
27 changes: 27 additions & 0 deletions Extensions/TeamCityAnnouncer/ProjectModel.cs
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TeamCityAnnouncer
{
public class ProjectModel
{
public string ProjectName { get; private set; }
public string ProjectId { get; private set; }
public string BuildConfigName { get; private set; }
public string LastBuildTime { get; private set; }
public string LastBuildStatus { get; private set; }
public string LastBuildStatusText { get; private set; }

public ProjectModel(string projectName, string projectId, string buildConfigName, string lastBuildTime, string lastBuildStatus, string lastBuildStatusText)
{
this.ProjectName = projectName;
this.ProjectId = projectId;
this.BuildConfigName = buildConfigName;
this.LastBuildTime = DateTime.ParseExact(lastBuildTime, "yyyyMMdd'T'HHmmss-ffff", System.Globalization.CultureInfo.InvariantCulture).ToString("dd/MM/yyyy HH:mm:ss");
this.LastBuildStatus = lastBuildStatus;
this.LastBuildStatusText = lastBuildStatusText;
}
}
}
36 changes: 36 additions & 0 deletions Extensions/TeamCityAnnouncer/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("TeamCityAnnouncer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("TeamCityAnnouncer")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("38f1adff-07f5-44f7-8743-b5ab198ea6ac")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
88 changes: 88 additions & 0 deletions Extensions/TeamCityAnnouncer/TeamCityAnnouncer.cs
@@ -0,0 +1,88 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Jabbot;
using Jabbot.Sprockets.Core;
using TeamCitySharp;
using TeamCitySharp.DomainEntities;

namespace TeamCityAnnouncer
{
public class TeamCityAnnouncer : IAnnounce
{
public const string IpAddressOrHostNameOfCCServer = "teamcity.codebetter.com";
public static readonly string[] Projects = { };
public static List<ProjectModel> MappedProjects = new List<ProjectModel>();

private TeamCityClient _client;

public TimeSpan Interval
{
get { return TimeSpan.FromMinutes(10); }
}

private void NotifyRooms(Bot bot, ProjectModel project)
{
foreach (var room in bot.Rooms)
{
bot.Say(
string.Format("TeamCity Build Server: {0} / {1} - {2} ({3}) ",
project.BuildConfigName,
project.ProjectName,
project.LastBuildTime,
project.LastBuildStatus), room);
}
}

private void Update(Bot bot, ProjectModel project)
{
if (Projects.Contains(project.ProjectName))
{
if (MappedProjects.All(x => x.ProjectName != project.ProjectName))
{
MappedProjects.Add(project);
NotifyRooms(bot, project);
}
else
{
var mappedProject = MappedProjects.FirstOrDefault(x => x.ProjectName == project.ProjectName);
if (mappedProject != null)
{
if (project.LastBuildTime != mappedProject.LastBuildTime)
{
MappedProjects.Remove(mappedProject);
MappedProjects.Add(project);
NotifyRooms(bot, project);
}
}
}
}
}

public void Execute(Bot bot)
{
if (string.IsNullOrWhiteSpace(IpAddressOrHostNameOfCCServer) || !Projects.Any()) return;

_client = new TeamCityClient(IpAddressOrHostNameOfCCServer);
_client.Connect("teamcitysharpuser", "qwerty");

var allProjects = _client.AllProjects();
var allBuildConfigs = _client.AllBuildConfigs();

foreach (var proj in allProjects)
{
Project currentProject = proj;
var buildConfigs = allBuildConfigs.Where(buildConfig => currentProject.Id == buildConfig.Project.Id);

foreach (var currentBuildConfig in buildConfigs)
{
var build = _client.LastBuildByBuildConfigId(currentBuildConfig.Id);

var project = new ProjectModel(currentProject.Name, currentProject.Id, currentBuildConfig.Name, build.StartDate,
build.Status, build.StatusText);
Update(bot, project);
}
}
}
}
}
71 changes: 71 additions & 0 deletions Extensions/TeamCityAnnouncer/TeamCityAnnouncer.csproj
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{577B79CF-B210-4ED1-8D1C-AF51BDAA2344}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TeamCityAnnouncer</RootNamespace>
<AssemblyName>TeamCityAnnouncer</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\jibbr\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="TeamCitySharp">
<HintPath>..\..\packages\TeamCitySharp.0.3.1\lib\net40\TeamCitySharp.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="ProjectModel.cs" />
<Compile Include="TeamCityAnnouncer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Jabbot\Jabbot.csproj">
<Project>{478BFCF7-9397-49A7-AFD4-060B6B749E77}</Project>
<Name>Jabbot</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
6 changes: 6 additions & 0 deletions Extensions/TeamCityAnnouncer/packages.config
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EasyHttp" version="1.4.3.0" />
<package id="JsonFx" version="2.0.1106.2610" />
<package id="TeamCitySharp" version="0.3.1" />
</packages>
2 changes: 1 addition & 1 deletion Extensions/TwitterAnnouncer/TwitterAnnouncer.csproj
Expand Up @@ -12,7 +12,7 @@
<AssemblyName>TwitterAnnouncer</AssemblyName> <AssemblyName>TwitterAnnouncer</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\jibbr\</SolutionDir> <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\jibbr\</SolutionDir>
<RestorePackages>true</RestorePackages> <RestorePackages>true</RestorePackages>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down
13 changes: 13 additions & 0 deletions Jabbot.sln
Expand Up @@ -77,6 +77,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GithubAnnouncements", "Exte
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CCNetAnnouncer", "Extensions\CCNetAnnouncer\CCNetAnnouncer.csproj", "{9731A150-94A1-4B46-A9AB-5B74B5D196AC}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CCNetAnnouncer", "Extensions\CCNetAnnouncer\CCNetAnnouncer.csproj", "{9731A150-94A1-4B46-A9AB-5B74B5D196AC}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TeamCityAnnouncer", "Extensions\TeamCityAnnouncer\TeamCityAnnouncer.csproj", "{577B79CF-B210-4ED1-8D1C-AF51BDAA2344}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VotingSprocket", "Extensions\VotingSprocket\VotingSprocket.csproj", "{23F45EDA-A95D-4041-8B78-6F691A98B0CB}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VotingSprocket", "Extensions\VotingSprocket\VotingSprocket.csproj", "{23F45EDA-A95D-4041-8B78-6F691A98B0CB}"
EndProject EndProject
Global Global
Expand Down Expand Up @@ -303,6 +305,16 @@ Global
{23F45EDA-A95D-4041-8B78-6F691A98B0CB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {23F45EDA-A95D-4041-8B78-6F691A98B0CB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{23F45EDA-A95D-4041-8B78-6F691A98B0CB}.Release|Mixed Platforms.Build.0 = Release|Any CPU {23F45EDA-A95D-4041-8B78-6F691A98B0CB}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{23F45EDA-A95D-4041-8B78-6F691A98B0CB}.Release|x86.ActiveCfg = Release|Any CPU {23F45EDA-A95D-4041-8B78-6F691A98B0CB}.Release|x86.ActiveCfg = Release|Any CPU
{577B79CF-B210-4ED1-8D1C-AF51BDAA2344}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{577B79CF-B210-4ED1-8D1C-AF51BDAA2344}.Debug|Any CPU.Build.0 = Debug|Any CPU
{577B79CF-B210-4ED1-8D1C-AF51BDAA2344}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{577B79CF-B210-4ED1-8D1C-AF51BDAA2344}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{577B79CF-B210-4ED1-8D1C-AF51BDAA2344}.Debug|x86.ActiveCfg = Debug|Any CPU
{577B79CF-B210-4ED1-8D1C-AF51BDAA2344}.Release|Any CPU.ActiveCfg = Release|Any CPU
{577B79CF-B210-4ED1-8D1C-AF51BDAA2344}.Release|Any CPU.Build.0 = Release|Any CPU
{577B79CF-B210-4ED1-8D1C-AF51BDAA2344}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{577B79CF-B210-4ED1-8D1C-AF51BDAA2344}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{577B79CF-B210-4ED1-8D1C-AF51BDAA2344}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
Expand All @@ -324,6 +336,7 @@ Global
{9518C000-0F98-41B0-81E9-5E065CF5387E} = {7170D00A-149E-427F-A7F9-FBA91CE3F9D7} {9518C000-0F98-41B0-81E9-5E065CF5387E} = {7170D00A-149E-427F-A7F9-FBA91CE3F9D7}
{9731A150-94A1-4B46-A9AB-5B74B5D196AC} = {7170D00A-149E-427F-A7F9-FBA91CE3F9D7} {9731A150-94A1-4B46-A9AB-5B74B5D196AC} = {7170D00A-149E-427F-A7F9-FBA91CE3F9D7}
{23F45EDA-A95D-4041-8B78-6F691A98B0CB} = {7170D00A-149E-427F-A7F9-FBA91CE3F9D7} {23F45EDA-A95D-4041-8B78-6F691A98B0CB} = {7170D00A-149E-427F-A7F9-FBA91CE3F9D7}
{577B79CF-B210-4ED1-8D1C-AF51BDAA2344} = {7170D00A-149E-427F-A7F9-FBA91CE3F9D7}
{3E8A88F3-737F-4F93-92EA-151B1FE3A44B} = {A3A6EC44-1F10-4427-98DC-CF13D11F8C79} {3E8A88F3-737F-4F93-92EA-151B1FE3A44B} = {A3A6EC44-1F10-4427-98DC-CF13D11F8C79}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

0 comments on commit b15022c

Please sign in to comment.