Skip to content

Commit

Permalink
reset to upstream/master, add windows files and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wimh committed Jun 11, 2011
1 parent 01f266c commit c166237
Show file tree
Hide file tree
Showing 19 changed files with 791 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
@@ -0,0 +1,2 @@
.gitattributes eol=lf
.gitmodules eol=lf
8 changes: 7 additions & 1 deletion .gitignore
Expand Up @@ -6,6 +6,9 @@
*.app *.app
*.pidb *.pidb
*.gmo *.gmo
*.bak
*.suo
*.sln.cache
po/POTFILES po/POTFILES
Makefile.in Makefile.in
Makefile Makefile
Expand All @@ -22,6 +25,7 @@ INSTALL
aclocal.m4 aclocal.m4
autom4te.cache/ autom4te.cache/
bin/ bin/
obj/
install-sh install-sh
libtool libtool
ltmain.sh ltmain.sh
Expand All @@ -33,7 +37,9 @@ SparkleLib/AssemblyInfo.cs
build/m4/shave/shave build/m4/shave/shave
build/m4/*.m4 build/m4/*.m4
build/m4/shave/shave-libtool build/m4/shave/shave-libtool
Defines.cs SparkleLib/Defines.cs
SparkleLib/windows/Defines.cs
SparkleLib/windows/GlobalAssemblyInfo.cs
SparkleShare/sparkleshare SparkleShare/sparkleshare
po/sparkleshare.pot po/sparkleshare.pot
SparkleShare/Nautilus/sparkleshare-nautilus-extension.py SparkleShare/Nautilus/sparkleshare-nautilus-extension.py
Expand Down
7 changes: 6 additions & 1 deletion SparkleLib/Git/SparkleRepoGit.cs
Expand Up @@ -348,7 +348,12 @@ private void ResolveConflict ()
List <SparkleChangeSet> change_sets = new List <SparkleChangeSet> (); List <SparkleChangeSet> change_sets = new List <SparkleChangeSet> ();


SparkleGit git_log = new SparkleGit (LocalPath, "log -" + count + " --raw -M --date=iso"); SparkleGit git_log = new SparkleGit (LocalPath, "log -" + count + " --raw -M --date=iso");
Console.OutputEncoding = System.Text.Encoding.Unicode; if ((SparkleBackend.Platform == PlatformID.Unix ||
SparkleBackend.Platform == PlatformID.MacOSX)) {
// this causes an IOException on windows
Console.OutputEncoding = System.Text.Encoding.Unicode;
}

git_log.Start (); git_log.Start ();


// Reading the standard output HAS to go before // Reading the standard output HAS to go before
Expand Down
1 change: 1 addition & 0 deletions SparkleLib/SparkleBackend.cs
Expand Up @@ -32,6 +32,7 @@ public class SparkleBackend {
public SparkleBackend (string name, string [] paths) public SparkleBackend (string name, string [] paths)
{ {
Name = name; Name = name;
Path = "git"; // default


foreach (string path in paths) { foreach (string path in paths) {
if (File.Exists (path)) { if (File.Exists (path)) {
Expand Down
16 changes: 11 additions & 5 deletions SparkleLib/SparkleFetcherBase.cs
Expand Up @@ -136,9 +136,12 @@ private void DisableHostKeyCheckingForHost (string host)
writer.Close (); writer.Close ();
} }


UnixFileSystemInfo file_info = new UnixFileInfo (ssh_config_file_path); if ((SparkleBackend.Platform == PlatformID.Unix ||
file_info.FileAccessPermissions = (FileAccessPermissions.UserRead | SparkleBackend.Platform == PlatformID.MacOSX)) {
UnixFileSystemInfo file_info = new UnixFileInfo (ssh_config_file_path);
file_info.FileAccessPermissions = (FileAccessPermissions.UserRead |
FileAccessPermissions.UserWrite); FileAccessPermissions.UserWrite);
}


SparkleHelpers.DebugInfo ("Fetcher", "Disabled host key checking"); SparkleHelpers.DebugInfo ("Fetcher", "Disabled host key checking");
} }
Expand Down Expand Up @@ -174,10 +177,13 @@ private void EnableHostKeyCheckingForHost (string host)
TextWriter writer = new StreamWriter (ssh_config_file_path); TextWriter writer = new StreamWriter (ssh_config_file_path);
writer.WriteLine (current_ssh_config); writer.WriteLine (current_ssh_config);
writer.Close (); writer.Close ();
if ((SparkleBackend.Platform == PlatformID.Unix ||
SparkleBackend.Platform == PlatformID.MacOSX)) {


UnixFileSystemInfo file_info = new UnixFileInfo (ssh_config_file_path); UnixFileSystemInfo file_info = new UnixFileInfo (ssh_config_file_path);
file_info.FileAccessPermissions = (FileAccessPermissions.UserRead | file_info.FileAccessPermissions = (FileAccessPermissions.UserRead |
FileAccessPermissions.UserWrite); FileAccessPermissions.UserWrite);
}
} }
} }


Expand Down
14 changes: 14 additions & 0 deletions SparkleLib/windows/AssemblyInfo.cs
@@ -0,0 +1,14 @@
/*
* AssemblyInfo.cs
*
* This is free software. See COPYING for details.
*/

using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle ("SparkleLib")]
[assembly: AssemblyDescription ("SparkleShare is a simple file sharing and collaboration tool.")]

[assembly: Guid ("38092E48-5DCC-4d23-8109-9D994E710ACF")]
46 changes: 46 additions & 0 deletions SparkleLib/windows/Defines.tt
@@ -0,0 +1,46 @@
// SparkleShare, an instant update workflow to Git.
// Copyright (C) 2010 Hylke Bons <hylkebons@gmail.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

<#@ template language="C#v3.5" HostSpecific="true" #>
<#@ output extension="cs" #>

<#@ include file="getversion.tt" #>

<#
PlatformID platform = Environment.OSVersion.Platform;
bool IsWindows = (platform == PlatformID.Win32NT
|| platform == PlatformID.Win32S
|| platform == PlatformID.Win32Windows
|| platform == PlatformID.WinCE);
#>

using System;

namespace SparkleLib {

public class Defines {

public const string VERSION = "<#= VERSION #>";
public const string LOCALE_DIR = "@prefix@/share/locale";
public const string DATAROOTDIR = "@expanded_datadir@";
public const string GETTEXT_PACKAGE = "@GETTEXT_PACKAGE@";
public const string PREFIX = "@prefix@";
public const string OPEN_COMMAND = "xdg-open";

}

}

25 changes: 25 additions & 0 deletions SparkleLib/windows/GlobalAssemblyInfo.tt
@@ -0,0 +1,25 @@
/*
* GlobalAssemblyInfo.cs
*
* This is free software. See COPYING for details.
*/
<#@ template language="C#v3.5" HostSpecific="true" #>
<#@ output extension="cs" #>

<#@ include file="getversion.tt" #>

using System.Reflection;
using System.Runtime.CompilerServices;

[assembly: AssemblyProduct("SparkleShare")]

[assembly: AssemblyVersion("<#= ASM_VERSION #>")]
[assembly: AssemblyFileVersion("<#= ASM_FILE_VERSION #>")]
[assembly: AssemblyInformationalVersion("<#= VERSION #>")]

#if DEBUG
[assembly: AssemblyConfiguration("Debug")]
#else
[assembly: AssemblyConfiguration("Release")]
#endif

159 changes: 159 additions & 0 deletions SparkleLib/windows/SparkleLib.csproj
@@ -0,0 +1,159 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{2C914413-B31C-4362-93C7-1AE34F09112A}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>SparkleLib</RootNamespace>
<AssemblyName>SparkleLib</AssemblyName>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>2.0</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\bin</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\bin</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="Mono.Posix" />
<Reference Include="Meebey.SmartIrc4net, Version=0.4.5.0, Culture=neutral, PublicKeyToken=7868485fbf407e0f">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\bin\Meebey.SmartIrc4net.dll</HintPath>
</Reference>
<Reference Include="System.XML" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Git\SparkleFetcherGit.cs">
<Link>SparkleFetcherGit.cs</Link>
<SubType>Component</SubType>
</Compile>
<Compile Include="..\Git\SparkleRepoGit.cs">
<Link>SparkleRepoGit.cs</Link>
</Compile>
<Compile Include="..\Hg\SparkleFetcherHg.cs">
<Link>SparkleFetcherHg.cs</Link>
<SubType>Component</SubType>
</Compile>
<Compile Include="..\Hg\SparkleRepoHg.cs">
<Link>SparkleRepoHg.cs</Link>
</Compile>
<Compile Include="..\Scp\SparkleFetcherScp.cs">
<Link>SparkleFetcherScp.cs</Link>
<SubType>Component</SubType>
</Compile>
<Compile Include="..\Scp\SparkleRepoScp.cs">
<Link>SparkleRepoScp.cs</Link>
</Compile>
<Compile Include="..\SparkleConfig.cs">
<Link>SparkleConfig.cs</Link>
</Compile>
<Compile Include="..\SparkleRepoBase.cs">
<Link>SparkleRepoBase.cs</Link>
</Compile>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="Defines.cs">
<DependentUpon>Defines.tt</DependentUpon>
<SubType>Code</SubType>
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
</Compile>
<Compile Include="..\SparkleFetcherBase.cs" />
<Compile Include="..\SparkleHelpers.cs" />
<Compile Include="..\SparklePaths.cs" />
<Compile Include="..\SparkleOptions.cs" />
<Compile Include="..\SparkleChangeSet.cs" />
<Compile Include="..\SparkleListenerBase.cs" />
<Compile Include="..\SparkleListenerIrc.cs" />
<Compile Include="..\SparkleBackend.cs" />
<Compile Include="GlobalAssemblyInfo.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>GlobalAssemblyInfo.tt</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
<Visible>False</Visible>
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
<Visible>False</Visible>
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="Defines.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>Defines.cs</LastGenOutput>
</None>
<None Include="GlobalAssemblyInfo.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>GlobalAssemblyInfo.cs</LastGenOutput>
</None>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<MonoDevelop>
<Properties InternalTargetFrameworkVersion="3.5">
<MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="true" RelativeMakefileName="Makefile.am">
<BuildFilesVar Sync="true" Name="SOURCES" />
<DeployFilesVar />
<ResourcesVar />
<OthersVar />
<GacRefVar />
<AsmRefVar />
<ProjectRefVar />
</MonoDevelop.Autotools.MakefileInfo>
</Properties>
</MonoDevelop>
<VisualStudio />
</ProjectExtensions>
<PropertyGroup>
<PreBuildEvent>$(ProjectDir)transform_tt.cmd</PreBuildEvent>
</PropertyGroup>
</Project>
41 changes: 41 additions & 0 deletions SparkleLib/windows/getversion.tt
@@ -0,0 +1,41 @@
<#@ import namespace="System" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Diagnostics" #>
<#@ import namespace="System.Text.RegularExpressions" #>

<#
// Add msysgit to path, as we cannot asume it is added to the path
// Asume it is installed in @"C:\msysgit\msysgit\bin" for now
string MSysGit=@"C:\msysgit\msysgit";

string newPath = MSysGit + @"\bin" + ";"
+ MSysGit + @"\mingw\bin" + ";"
+ MSysGit + @"\cmd" + ";"
+ System.Environment.ExpandEnvironmentVariables ("%PATH%");
System.Environment.SetEnvironmentVariable ("PATH", newPath);

Process process = new Process();
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.FileName = "git";
process.StartInfo.Arguments = "describe --tags --dirty=-d --always";
process.StartInfo.WorkingDirectory = Path.GetDirectoryName(Host.TemplateFile);
process.Start();

String DescribeOutput=process.StandardOutput.ReadLine();

Match m = Regex.Match(DescribeOutput, @"(\d+)\.(\d+)(?:-rc(\d+))?-(\d+)");
int[] version = new int [4];
for(int i=1; i <= 4; i++)
Int32.TryParse(m.Groups[i].Value, out version[i-1]);

String VERSION=DescribeOutput;
String ASM_VERSION=String.Format("{0}.{1}",version[0],version[1]);
String ASM_FILE_VERSION=String.Format("{0}.{1}.{2}.{3}",version[0],version[1],version[2],version[3]);

#>

// VERSION=<#= VERSION #>
// ASM_VERSION=<#= ASM_VERSION #>

7 changes: 7 additions & 0 deletions SparkleLib/windows/transform_tt.cmd
@@ -0,0 +1,7 @@
@echo off

echo running texttransform..
cd %~dp0

"%CommonProgramFiles%\Microsoft Shared\TextTemplating\1.2\texttransform.exe" -out Defines.cs Defines.tt
"%CommonProgramFiles%\Microsoft Shared\TextTemplating\1.2\texttransform.exe" -out GlobalAssemblyInfo.cs GlobalAssemblyInfo.tt

0 comments on commit c166237

Please sign in to comment.