Create a SparkleLib library for sharing code between frontends

Start moving some files into SparkleLib, and have SparkleShare and
SparkleDiff depend on it.
This commit is contained in:
Bertrand Lorentz 2010-08-02 17:42:42 +02:00
parent 4d02b28f95
commit dea7426364
25 changed files with 205 additions and 47 deletions

6
.gitignore vendored
View file

@ -4,10 +4,6 @@
*.userprefs
*.pidb
*.gmo
/SparkleShare/bin
/SparkleShare/obj
/notify-sharp/bin
/notify-sharp/obj
po/POTFILES
Makefile.in
Makefile
@ -31,7 +27,7 @@ missing
po/.intltool-merge-cache
po/Makefile.in.in
po/stamp-it
SparkleShare/AssemblyInfo.cs
SparkleLib/AssemblyInfo.cs
build/m4/shave/shave
build/m4/*.m4
build/m4/shave/shave-libtool

View file

@ -1,6 +1,7 @@
SUBDIRS = \
build \
NotifySharp \
SparkleLib \
SparkleShare \
SparkleDiff \
data \

View file

@ -3,14 +3,13 @@ TARGET = exe
LINK = $(REF_SPARKLEDIFF)
SOURCES = \
$(top_srcdir)/SparkleShare/Defines.cs \
$(top_srcdir)/FriendFace/FriendFace.cs \
$(top_srcdir)/FriendFace/IconProvider.cs \
$(top_srcdir)/FriendFace/GravatarIconProvider.cs \
SparkleDiff.cs \
SparkleDiffWindow.cs \
RevisionView.cs \
RevisionImage.cs
SOURCES = \
$(top_srcdir)/FriendFace/FriendFace.cs \
$(top_srcdir)/FriendFace/GravatarIconProvider.cs \
$(top_srcdir)/FriendFace/IconProvider.cs \
RevisionImage.cs \
RevisionView.cs \
SparkleDiff.cs \
SparkleDiffWindow.cs
include $(top_srcdir)/build/build.mk

View file

@ -20,6 +20,7 @@ using System;
using System.Diagnostics;
using System.IO;
using System.Text.RegularExpressions;
using SparkleLib;
namespace SparkleShare {

View file

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{17BF02CB-852A-4756-BA05-EC454643C428}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>SparkleDiff</RootNamespace>
<AssemblyName>SparkleDiff</AssemblyName>
</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>
<Compile Include="SparkleDiff.cs" />
<Compile Include="SparkleDiffWindow.cs" />
<Compile Include="RevisionView.cs" />
<Compile Include="RevisionImage.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FriendFace\FriendFace.csproj">
<Project>{3BA434AF-494F-4F5D-9D21-B7BD24FD67AF}</Project>
<Name>FriendFace</Name>
</ProjectReference>
<ProjectReference Include="..\SparkleLib\SparkleLib.csproj">
<Project>{2C914413-B31C-4362-93C7-1AE34F09112A}</Project>
<Name>SparkleLib</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<Package>gtk-sharp-2.0</Package>
</Reference>
<Reference Include="Mono.Posix" />
</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>
</ProjectExtensions>
</Project>

View file

@ -0,0 +1,11 @@
/*
* AssemblyInfo.cs
*
* This is free software. See COPYING for details.
*/
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyVersion("@VERSION@")]
[assembly: AssemblyTitle ("SparkleShare")]

View file

@ -16,7 +16,7 @@
using System;
namespace SparkleShare {
namespace SparkleLib {
public class Defines {

13
SparkleLib/Makefile.am Normal file
View file

@ -0,0 +1,13 @@
ASSEMBLY = SparkleLib
TARGET = library
LINK = $(REF_SPARKLELIB)
SOURCES = \
Defines.cs \
SparkleFetcher.cs \
SparkleHelpers.cs \
SparklePaths.cs \
SparkleRepo.cs
include $(top_srcdir)/build/build.mk

View file

@ -14,12 +14,11 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using Gtk;
using System;
using System.IO;
using System.Diagnostics;
namespace SparkleShare {
namespace SparkleLib {
public class SparkleFetcher {

View file

@ -23,7 +23,7 @@ using System.Security.Cryptography;
using System.Text;
namespace SparkleShare {
namespace SparkleLib {
public static class SparkleHelpers
{

View file

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{2C914413-B31C-4362-93C7-1AE34F09112A}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>SparkleLib</RootNamespace>
<AssemblyName>SparkleLib</AssemblyName>
</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="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<Package>gtk-sharp-2.0</Package>
</Reference>
<Reference Include="Mono.Posix" />
</ItemGroup>
<ItemGroup>
<Compile Include="SparkleRepo.cs" />
<Compile Include="SparkleFetcher.cs" />
<Compile Include="Defines.cs" />
<Compile Include="SparkleHelpers.cs" />
<Compile Include="SparklePaths.cs" />
</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>
</ProjectExtensions>
</Project>

View file

@ -14,11 +14,11 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using Mono.Unix;
using System;
using System.IO;
using Mono.Unix;
namespace SparkleShare {
namespace SparkleLib {
public static class SparklePaths
{

View file

@ -14,16 +14,14 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using Gtk;
using Mono.Unix;
using SparkleShare;
using System;
using System.Diagnostics;
using System.IO;
using System.Text.RegularExpressions;
using System.Timers;
namespace SparkleShare {
namespace SparkleLib {
public class SparkleRepo
{

View file

@ -7,6 +7,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NotifySharp", "NotifySharp\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FriendFace", "FriendFace\FriendFace.csproj", "{3BA434AF-494F-4F5D-9D21-B7BD24FD67AF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SparkleDiff", "SparkleDiff\SparkleDiff.csproj", "{17BF02CB-852A-4756-BA05-EC454643C428}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SparkleLib", "SparkleLib\SparkleLib.csproj", "{2C914413-B31C-4362-93C7-1AE34F09112A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -17,6 +21,14 @@ Global
{005CCA8E-DFBF-464A-B6DA-452C62D4589C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{005CCA8E-DFBF-464A-B6DA-452C62D4589C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{005CCA8E-DFBF-464A-B6DA-452C62D4589C}.Release|Any CPU.Build.0 = Release|Any CPU
{17BF02CB-852A-4756-BA05-EC454643C428}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{17BF02CB-852A-4756-BA05-EC454643C428}.Debug|Any CPU.Build.0 = Debug|Any CPU
{17BF02CB-852A-4756-BA05-EC454643C428}.Release|Any CPU.ActiveCfg = Release|Any CPU
{17BF02CB-852A-4756-BA05-EC454643C428}.Release|Any CPU.Build.0 = Release|Any CPU
{2C914413-B31C-4362-93C7-1AE34F09112A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2C914413-B31C-4362-93C7-1AE34F09112A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2C914413-B31C-4362-93C7-1AE34F09112A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2C914413-B31C-4362-93C7-1AE34F09112A}.Release|Any CPU.Build.0 = Release|Any CPU
{3BA434AF-494F-4F5D-9D21-B7BD24FD67AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3BA434AF-494F-4F5D-9D21-B7BD24FD67AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3BA434AF-494F-4F5D-9D21-B7BD24FD67AF}.Release|Any CPU.ActiveCfg = Release|Any CPU

View file

@ -8,14 +8,9 @@ LINK = $(REF_SPARKLESHARE)
SOURCES = \
Defines.cs \
SparkleBubble.cs \
SparkleFetcher.cs \
SparkleHelpers.cs \
SparkleIntro.cs \
SparklePaths.cs \
SparklePlatform.cs \
SparkleRepo.cs \
SparkleShare.cs \
SparkleSpinner.cs \
SparkleStatusIcon.cs \

View file

@ -16,7 +16,7 @@
using Gtk;
using Mono.Unix;
using SparkleShare;
using SparkleLib;
using System;
using System.Diagnostics;
using System.IO;

View file

@ -18,6 +18,7 @@ using Gtk;
using Mono.Unix;
using System;
using System.Diagnostics;
using SparkleLib;
namespace SparkleShare {

View file

@ -42,29 +42,28 @@
</ItemGroup>
<ItemGroup>
<Compile Include="SparkleBubble.cs" />
<Compile Include="SparkleFetcher.cs" />
<Compile Include="SparkleIntro.cs" />
<Compile Include="SparkleHelpers.cs" />
<Compile Include="SparklePaths.cs" />
<Compile Include="SparklePlatform.cs" />
<Compile Include="SparkleRepo.cs" />
<Compile Include="SparkleShare.cs" />
<Compile Include="SparkleSpinner.cs" />
<Compile Include="SparkleStatusIcon.cs" />
<Compile Include="SparkleUI.cs" />
<Compile Include="SparkleWindow.cs" />
<Compile Include="SparkleIntro.cs" />
<Compile Include="Defines.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NotifySharp\NotifySharp.csproj">
<Project>{005CCA8E-DFBF-464A-B6DA-452C62D4589C}</Project>
<Name>NotifySharp</Name>
</ProjectReference>
<ProjectReference Include="..\SparkleLib\SparkleLib.csproj">
<Project>{2C914413-B31C-4362-93C7-1AE34F09112A}</Project>
<Name>SparkleLib</Name>
</ProjectReference>
</ItemGroup>
<ProjectExtensions>
<MonoDevelop>
<Properties>
<Properties InternalTargetFrameworkVersion="3.5">
<MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="true" RelativeMakefileName="Makefile.am">
<BuildFilesVar Sync="true" Name="SOURCES" />
<DeployFilesVar />

View file

@ -16,6 +16,7 @@
using Gtk;
using System.Timers;
using SparkleLib;
namespace SparkleShare {

View file

@ -16,7 +16,7 @@
using Gtk;
using Mono.Unix;
using SparkleShare;
using SparkleLib;
using System;
using System.Diagnostics;
using System.IO;

View file

@ -17,7 +17,7 @@
using Gtk;
using Mono.Unix;
using Mono.Unix.Native;
using SparkleShare;
using SparkleLib;
using System;
using System.Collections.Generic;
using System.Diagnostics;

View file

@ -16,7 +16,7 @@
using Gtk;
using Mono.Unix;
using SparkleShare;
using SparkleLib;
using System;
using System.Collections.Generic;
using System.Diagnostics;

View file

@ -30,13 +30,13 @@ REF_NOTIFY_SHARP = $(LINK_SYSTEM) $(LINK_DBUS) $(GTKSHARP_LIBS) $(GLIBSHARP_LIBS
LINK_NOTIFY_SHARP = -r:$(DIR_BIN)/NotifySharp.dll
LINK_NOTIFY_SHARP_DEPS = $(REF_NOTIFY_SHARP) $(LINK_NOTIFY_SHARP)
REF_SPARKLESHARE = $(LINK_SYSTEM) $(LINK_GTK) $(LINK_DBUS) $(LINK_NOTIFY_SHARP_DEPS) $(LINK_MONO_POSIX)
LINK_SPARKLESHARE = -r:$(DIR_BIN)/SparkleShare.exe
LINK_SPARKLESHARE_DEPS = $(REF_SPARKLESHARE) $(LINK_SPARKLESHARE)
REF_SPARKLELIB = $(LINK_SYSTEM) $(LINK_GTK) $(LINK_MONO_POSIX)
LINK_SPARKLELIB = -r:$(DIR_BIN)/SparkleLib.dll
LINK_SPARKLELIB_DEPS = $(REF_SPARKLELIB) $(LINK_SPARKLELIB)
REF_SPARKLEDIFF = $(LINK_SYSTEM) $(LINK_GTK) $(LINK_DBUS) $(LINK_MONO_POSIX)
LINK_SPARKLEDIFF = -r:$(DIR_BIN)/SparkleShare.exe
LINK_SPARKLEDIFF_DEPS = $(REF_SPARKLEDIFF) $(LINK_SPARKLEDIFF)
REF_SPARKLESHARE = $(LINK_DBUS) $(LINK_NOTIFY_SHARP_DEPS) $(LINK_SPARKLELIB_DEPS)
REF_SPARKLEDIFF = $(LINK_SPARKLELIB_DEPS)
# Cute hack to replace a space with something
colon:= :

View file

@ -9,7 +9,7 @@ ASSEMBLY_INFO_SOURCE_REAL = \
then \
echo "$(addprefix $(srcdir)/, $(ASSEMBLY_INFO_SOURCE))"; \
else \
echo "$(top_srcdir)/SparkleShare/AssemblyInfo.cs"; \
echo "$(top_srcdir)/SparkleLib/AssemblyInfo.cs"; \
fi)
SOURCES_BUILD = $(addprefix $(srcdir)/, $(SOURCES))

View file

@ -90,9 +90,10 @@ data/Makefile
data/icons/Makefile
NotifySharp/Makefile
SparkleDiff/Makefile
SparkleLib/AssemblyInfo.cs
SparkleLib/Defines.cs
SparkleLib/Makefile
SparkleShare/sparkleshare
SparkleShare/Defines.cs
SparkleShare/AssemblyInfo.cs
SparkleShare/Makefile
SparkleShare/Nautilus/Makefile
SparkleShare/Nautilus/sparkleshare-nautilus-extension.py