take care of proper PATH and error handling

add dependencies and build scripts to be able to build all configurations from the solution SparkleShare.sln
the used git binaries are now built from source

build configurations are now:

Debug: with debug symbols and symbol DEBUG defined
Release: without debug symbols, with optimizations, depends on installed Mono framework
ReleaseDist: like Release, but all depending frameworks are merged into one OSX binary, installed Mono framework not needed / used
This commit is contained in:
Markus Stoll 2014-11-28 10:18:10 +01:00
parent 068800ccdc
commit 5bece5c274
8 changed files with 106 additions and 31 deletions

View file

@ -3,7 +3,7 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{009FDCD7-1D57-4202-BB6D-8477D8C6B8EE}</ProjectGuid>
<OutputType>Library</OutputType>
@ -11,21 +11,21 @@
<RootNamespace>SparkleLib.Git</RootNamespace>
<AssemblyName>SparkleLib.Git</AssemblyName>
<FileAlignment>512</FileAlignment>
<ReleaseVersion />
<ReleaseVersion>
</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>True</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>False</Optimize>
<OutputPath>bin\Debug</OutputPath>
<WarningLevel>4</WarningLevel>
<DefineConstants>TRACE DEBUG</DefineConstants>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<ItemGroup>
<Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" />

View file

@ -3,27 +3,29 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{2C914413-B31C-4362-93C7-1AE34F09112A}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>SparkleLib</RootNamespace>
<AssemblyName>SparkleLib</AssemblyName>
<ReleaseVersion />
<ReleaseVersion>
</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>False</Optimize>
<Optimize>true</Optimize>
<OutputPath>..\bin</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>False</Optimize>
<OutputPath>..\bin</OutputPath>
<WarningLevel>4</WarningLevel>
<DebugSymbols>true</DebugSymbols>
<DefineConstants>DEBUG</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
@ -46,19 +48,4 @@
<Compile Include="SparkleFetcherSSH.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<MonoDevelop>
<Properties>
<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

@ -23,16 +23,14 @@
<WarningLevel>4</WarningLevel>
<CustomCommands>
<CustomCommands>
<Command type="AfterBuild" command="sh -c 'mkdir -p ${TargetDir}/${SolutionName}.app/Contents/Frameworks &amp;&amp; cp -R git ${TargetDir}/${SolutionName}.app/Contents/Resources &amp;&amp; cp -R SparkleShareInviteOpener.app ${TargetDir}/${SolutionName}.app/Contents/Resources'" externalConsole="True" />
<Command type="AfterBuild" command="${ProjectDir}/postBuild.sh ${TargetDir}/${SolutionName}.app" />
</CustomCommands>
</CustomCommands>
<EnableCodeSigning>False</EnableCodeSigning>
<CreatePackage>False</CreatePackage>
<EnablePackageSigning>False</EnablePackageSigning>
<IncludeMonoRuntime>True</IncludeMonoRuntime>
<IncludeMonoRuntime>false</IncludeMonoRuntime>
<ConsolePause>False</ConsolePause>
<CodeSigningKey>Mac Developer</CodeSigningKey>
<PackageSigningKey>3rd Party Mac Developer Installer</PackageSigningKey>
<UseSGen>false</UseSGen>
<UseRefCounting>false</UseRefCounting>
</PropertyGroup>
@ -44,7 +42,7 @@
<WarningLevel>4</WarningLevel>
<CustomCommands>
<CustomCommands>
<Command type="AfterBuild" command="sh -c 'mkdir -p ${TargetDir}/${SolutionName}.app/Contents/Frameworks &amp;&amp; cp -R git ${TargetDir}/${SolutionName}.app/Contents/Resources &amp;&amp; cp -R SparkleShareInviteOpener.app ${TargetDir}/${SolutionName}.app/Contents/Resources'" externalConsole="True" />
<Command type="AfterBuild" command="${ProjectDir}/postBuild.sh ${TargetDir}/${SolutionName}.app" />
</CustomCommands>
</CustomCommands>
<EnableCodeSigning>False</EnableCodeSigning>
@ -52,12 +50,26 @@
<EnablePackageSigning>False</EnablePackageSigning>
<IncludeMonoRuntime>false</IncludeMonoRuntime>
<ConsolePause>False</ConsolePause>
<CodeSigningKey>Mac Developer</CodeSigningKey>
<PackageSigningKey>3rd Party Mac Developer Installer</PackageSigningKey>
<DebugSymbols>true</DebugSymbols>
<UseSGen>false</UseSGen>
<UseRefCounting>false</UseRefCounting>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'ReleaseDist|AnyCPU' ">
<Optimize>false</Optimize>
<OutputPath>bin\ReleaseDist</OutputPath>
<WarningLevel>4</WarningLevel>
<UseSGen>false</UseSGen>
<IncludeMonoRuntime>false</IncludeMonoRuntime>
<EnablePackageSigning>false</EnablePackageSigning>
<CustomCommands>
<CustomCommands>
<Command type="AfterBuild" command="${ProjectDir}/postBuild.sh ${TargetDir}/${SolutionName}.app" />
<Command type="AfterBuild" command="${ProjectDir}/packReleaseDist.sh ${TargetDir}/${SolutionName}.app" />
</CustomCommands>
</CustomCommands>
<EnableCodeSigning>false</EnableCodeSigning>
<CreatePackage>false</CreatePackage>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />

View file

@ -11,20 +11,27 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Release|Any CPU = Release|Any CPU
Debug|Any CPU = Debug|Any CPU
ReleaseDist|Any CPU = ReleaseDist|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{009FDCD7-1D57-4202-BB6D-8477D8C6B8EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{009FDCD7-1D57-4202-BB6D-8477D8C6B8EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{009FDCD7-1D57-4202-BB6D-8477D8C6B8EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{009FDCD7-1D57-4202-BB6D-8477D8C6B8EE}.Release|Any CPU.Build.0 = Release|Any CPU
{009FDCD7-1D57-4202-BB6D-8477D8C6B8EE}.ReleaseDist|Any CPU.ActiveCfg = Release|Any CPU
{009FDCD7-1D57-4202-BB6D-8477D8C6B8EE}.ReleaseDist|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
{2C914413-B31C-4362-93C7-1AE34F09112A}.ReleaseDist|Any CPU.ActiveCfg = Release|Any CPU
{2C914413-B31C-4362-93C7-1AE34F09112A}.ReleaseDist|Any CPU.Build.0 = Release|Any CPU
{CF5BC8DB-A633-4FCC-8A3E-E3AC9B59FABC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CF5BC8DB-A633-4FCC-8A3E-E3AC9B59FABC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CF5BC8DB-A633-4FCC-8A3E-E3AC9B59FABC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CF5BC8DB-A633-4FCC-8A3E-E3AC9B59FABC}.Release|Any CPU.Build.0 = Release|Any CPU
{CF5BC8DB-A633-4FCC-8A3E-E3AC9B59FABC}.ReleaseDist|Any CPU.ActiveCfg = ReleaseDist|Any CPU
{CF5BC8DB-A633-4FCC-8A3E-E3AC9B59FABC}.ReleaseDist|Any CPU.Build.0 = ReleaseDist|Any CPU
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = SparkleShare.csproj

37
SparkleShare/Mac/checkGit.sh Executable file
View file

@ -0,0 +1,37 @@
#!/bin/sh
function abspath()
{
case "${1}" in
[./]*)
echo "$(cd ${1%/*}; pwd)/${1##*/}"
;;
*)
echo "${PWD}/${1}"
;;
esac
}
export projectFolder=$(dirname $0)
export projectFolder=$(abspath ${projectFolder})
export gitVersion=$(cat ${projectFolder}/git.version)
set -e
if [ ! -f ${projectFolder}/git-${gitVersion}.tar.gz ]
then
curl -s https://codeload.github.com/git/git/zip/v${gitVersion} > git.zip
unzip -q git.zip
cd git-${gitVersion}
make configure
./configure --prefix=${projectFolder}/git
make install
cd ..
tar cfz git-${gitVersion}.tar.gz git
rm -rf git
rm -rf git-${gitVersion}
rm git.zip
fi

View file

@ -0,0 +1 @@
1.8.5.5

View file

@ -0,0 +1,16 @@
#!/bin/sh
# expect path to app bundle argument
export bundle=$1
export projectFolder=$(dirname $0)
echo packing ${bundle} for release without Mono framework dependency
export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig
export AS="as -arch i386"
export CC="cc -arch i386 -lobjc -liconv -framework Foundation"
export PATH=/usr/local/bin:/opt/local/bin:/Library/Frameworks/Mono.framework/Versions/Current/bin:/usr/bin:/bin
cd ${bundle}/Contents/MonoBundle/
mkbundle --static --deps -o ../MacOS/SparkleShare SparkleShare.exe SparkleLib.dll MonoMac.dll SparkleLib.Git.dll
rm *.dll *.exe

15
SparkleShare/Mac/postBuild.sh Executable file
View file

@ -0,0 +1,15 @@
#!/bin/sh
# expect path to app bundle argument
export bundle=$1
export projectFolder=$(dirname $0)
export gitVersion=$(cat ${projectFolder}/git.version)
echo postprocessing ${bundle}
export PATH=/usr/local/bin:/opt/local/bin:/Library/Frameworks/Mono.framework/Versions/Current/bin:/usr/bin:/bin
${projectFolder}/checkGit.sh
tar -x -f ${projectFolder}/git-${gitVersion}.tar.gz -C ${bundle}/Contents/Resources
cp -R SparkleShareInviteOpener.app ${bundle}/Contents/Resources
cp config ${bundle}/Contents/MonoBundle