Skip to content

Commit

Permalink
Make Vocaluxe buildable and playable on GNU/Linux
Browse files Browse the repository at this point in the history
Build with MonoDevelop or make.
Summary of the biggest changes:

* Correct for case differences between System.Data.SQLite and
  Mono.Data.Sqlite
* Exclude Direct3D and DirectSound from linux builds
* Provide linux versions of some windows-specific build events
* Exclude VocaluxeTests from linux builds so xbuild will work
* Add ability to build the native PitchTracker on linux
* Fix some problems with acinerella module
* Fix some windows-specific dependency checks that fail on linux
* Set OpenGL color format to 24-bit on linux
  • Loading branch information
derivator committed Feb 13, 2015
1 parent 2b9a38f commit 5049ba5
Show file tree
Hide file tree
Showing 28 changed files with 123 additions and 32 deletions.
4 changes: 4 additions & 0 deletions HowToBuildLinux.md
@@ -0,0 +1,4 @@
# Build Vocaluxe - HowTo (Linux)

* Clone the repository (see [this](https://github.com/Vocaluxe/Vocaluxe/blob/develop/HowToBuildWin.md) for help)
* Navigate to the cloned repository and execute `make`. Make sure that all dependencies are installed and the process completes without errors.
Binary file added Output/Linux/blank.cur
Binary file not shown.
7 changes: 6 additions & 1 deletion PartyModes/PartyModeChallenge/PartyModeChallenge.csproj
Expand Up @@ -93,9 +93,14 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>if exist "$(SolutionDir)Output\PartyModes\$(TargetName)\Code" rd "$(SolutionDir)Output\PartyModes\$(TargetName)\Code" /S /Q
<PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">if exist "$(SolutionDir)Output\PartyModes\$(TargetName)\Code" rd "$(SolutionDir)Output\PartyModes\$(TargetName)\Code" /S /Q
cd $(SolutionDir)Partymodes\
xcopy "$(ProjectDir)*.cs" "$(SolutionDir)Output\PartyModes\$(TargetName)\Code\" /EXCLUDE:Excludes.txt /I /Y</PostBuildEvent>
<PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">rm -rf "$(SolutionDir)Output\PartyModes\$(TargetName)\Code"
mkdir -p "$(SolutionDir)Output\PartyModes\$(TargetName)\Code\"
cp -R $(ProjectDir)*.cs "$(SolutionDir)Output\PartyModes\$(TargetName)\Code\"
rm -f "$(SolutionDir)Output\PartyModes\$(TargetName)\Code\GlobalSuppressions.cs"
</PostBuildEvent>
</PropertyGroup>
<!-- 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.
Expand Down
Expand Up @@ -93,9 +93,14 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>if exist "$(SolutionDir)Output\PartyModes\$(TargetName)\Code" rd "$(SolutionDir)Output\PartyModes\$(TargetName)\Code" /S /Q
<PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">if exist "$(SolutionDir)Output\PartyModes\$(TargetName)\Code" rd "$(SolutionDir)Output\PartyModes\$(TargetName)\Code" /S /Q
cd $(SolutionDir)Partymodes\
xcopy "$(ProjectDir)*.cs" "$(SolutionDir)Output\PartyModes\$(TargetName)\Code\" /EXCLUDE:Excludes.txt /I /Y</PostBuildEvent>
<PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">rm -rf "$(SolutionDir)Output\PartyModes\$(TargetName)\Code"
mkdir -p "$(SolutionDir)Output\PartyModes\$(TargetName)\Code\"
cp -R $(ProjectDir)*.cs "$(SolutionDir)Output\PartyModes\$(TargetName)\Code\"
rm -f "$(SolutionDir)Output\PartyModes\$(TargetName)\Code\GlobalSuppressions.cs"
</PostBuildEvent>
</PropertyGroup>
<!-- 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.
Expand Down
7 changes: 6 additions & 1 deletion PartyModes/PartyModeTicTacToe/PartyModeTicTacToe.csproj
Expand Up @@ -92,9 +92,14 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>if exist "$(SolutionDir)Output\PartyModes\$(TargetName)\Code" rd "$(SolutionDir)Output\PartyModes\$(TargetName)\Code" /S /Q
<PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">if exist "$(SolutionDir)Output\PartyModes\$(TargetName)\Code" rd "$(SolutionDir)Output\PartyModes\$(TargetName)\Code" /S /Q
cd $(SolutionDir)Partymodes\
xcopy "$(ProjectDir)*.cs" "$(SolutionDir)Output\PartyModes\$(TargetName)\Code\" /EXCLUDE:Excludes.txt /I /Y</PostBuildEvent>
<PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">rm -rf "$(SolutionDir)Output\PartyModes\$(TargetName)\Code"
mkdir -p "$(SolutionDir)Output\PartyModes\$(TargetName)\Code\"
cp -R $(ProjectDir)*.cs "$(SolutionDir)Output\PartyModes\$(TargetName)\Code\"
rm -f "$(SolutionDir)Output\PartyModes\$(TargetName)\Code\GlobalSuppressions.cs"
</PostBuildEvent>
</PropertyGroup>
<!-- 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.
Expand Down
2 changes: 1 addition & 1 deletion PitchTracker/Helper.h
@@ -1,5 +1,5 @@
#pragma once

#include <stddef.h>
float* short2FloatArray(short* in, size_t len);
double* short2DoubleArray(short* in, size_t len, bool scale = true);
void freeFloatArray(float* floats);
Expand Down
7 changes: 6 additions & 1 deletion PitchTracker/PitchWrapper.h
Expand Up @@ -4,7 +4,12 @@
#include "ptAKF.h"
#include "dywapitchtrack/ptDyWa.h"

#define DllExport extern "C" __declspec(dllexport)
#ifdef __linux__
#define DllExport extern "C"
#else
#define DllExport extern "C" __declspec(dllexport)
#endif


DllExport Analyzer* Analyzer_Create(unsigned step);
DllExport void Analyzer_Free(Analyzer* analyzer);
Expand Down
20 changes: 20 additions & 0 deletions PitchTracker/makefile
@@ -0,0 +1,20 @@
objects = \
compatibility.o \
dywapitchtrack/dywapitchtrack.o \
dywapitchtrack/ptDyWa.o \
FFT/FFT.o \
FFT/RealFFTf.o \
Helper.o \
performous/pitch.o \
ptAKF.o \
PitchWrapper.o

CPPFLAGS = -std=gnu++11 -fPIC

PitchTracker: $(objects)
gcc -shared -o libPitchTracker.dll.so -fPIC $(objects)
strip libPitchTracker.dll.so
cp libPitchTracker.dll.so ../Output/

clean:
rm -f ../Output/libPitchTracker.dll.so libPitchTracker.dll.so $(objects)
8 changes: 0 additions & 8 deletions Vocaluxe.sln
Expand Up @@ -202,10 +202,6 @@ Global
{54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseWin|x64.Build.0 = Release|x64
{54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseWin|x86.ActiveCfg = Release|Win32
{54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseWin|x86.Build.0 = Release|Win32
{93356718-3A0B-4784-AAE1-215065BFFC66}.DebugLinux|x64.ActiveCfg = Debug|x64
{93356718-3A0B-4784-AAE1-215065BFFC66}.DebugLinux|x64.Build.0 = Debug|x64
{93356718-3A0B-4784-AAE1-215065BFFC66}.DebugLinux|x86.ActiveCfg = Debug|x86
{93356718-3A0B-4784-AAE1-215065BFFC66}.DebugLinux|x86.Build.0 = Debug|x86
{93356718-3A0B-4784-AAE1-215065BFFC66}.DebugWin|x64.ActiveCfg = Debug|x64
{93356718-3A0B-4784-AAE1-215065BFFC66}.DebugWin|x64.Build.0 = Debug|x64
{93356718-3A0B-4784-AAE1-215065BFFC66}.DebugWin|x86.ActiveCfg = Debug|x86
Expand All @@ -214,10 +210,6 @@ Global
{93356718-3A0B-4784-AAE1-215065BFFC66}.InstallerWin|x64.Build.0 = Release|x64
{93356718-3A0B-4784-AAE1-215065BFFC66}.InstallerWin|x86.ActiveCfg = Release|x86
{93356718-3A0B-4784-AAE1-215065BFFC66}.InstallerWin|x86.Build.0 = Release|x86
{93356718-3A0B-4784-AAE1-215065BFFC66}.ReleaseLinux|x64.ActiveCfg = Release|x64
{93356718-3A0B-4784-AAE1-215065BFFC66}.ReleaseLinux|x64.Build.0 = Release|x64
{93356718-3A0B-4784-AAE1-215065BFFC66}.ReleaseLinux|x86.ActiveCfg = Release|x86
{93356718-3A0B-4784-AAE1-215065BFFC66}.ReleaseLinux|x86.Build.0 = Release|x86
{93356718-3A0B-4784-AAE1-215065BFFC66}.ReleaseWin|x64.ActiveCfg = Release|x64
{93356718-3A0B-4784-AAE1-215065BFFC66}.ReleaseWin|x64.Build.0 = Release|x64
{93356718-3A0B-4784-AAE1-215065BFFC66}.ReleaseWin|x86.ActiveCfg = Release|x86
Expand Down
2 changes: 2 additions & 0 deletions Vocaluxe/Base/CRecord.cs
Expand Up @@ -17,7 +17,9 @@

using System.Collections.ObjectModel;
using Vocaluxe.Lib.Sound.Record;
#if WIN
using Vocaluxe.Lib.Sound.Record.DirectSound;
#endif
using Vocaluxe.Lib.Sound.Record.PortAudio;
using VocaluxeLib;

Expand Down
4 changes: 3 additions & 1 deletion Vocaluxe/CProgrammHelper.cs
Expand Up @@ -98,6 +98,7 @@ private static bool _IsVC2010Installed()

public static bool CheckRequirements()
{
#if WIN
if (!_IsVC2012Installed())
{
CLog.LogError(
Expand All @@ -119,7 +120,8 @@ public static bool CheckRequirements()
true, true);
return false;
}
* */
*/
#endif //TODO: check for dependencies on linux?
return true;
}

Expand Down
3 changes: 3 additions & 0 deletions Vocaluxe/Lib/Database/CCoverDB.cs
Expand Up @@ -29,6 +29,9 @@

#else
using Mono.Data.Sqlite;
using SQLiteCommand = Mono.Data.Sqlite.SqliteCommand;
using SQLiteDataReader = Mono.Data.Sqlite.SqliteDataReader;
using SQLiteTransaction = Mono.Data.Sqlite.SqliteTransaction;
#endif

namespace Vocaluxe.Lib.Database
Expand Down
3 changes: 3 additions & 0 deletions Vocaluxe/Lib/Database/CDatabaseBase.cs
Expand Up @@ -22,6 +22,9 @@

#else
using Mono.Data.Sqlite;
using SQLiteCommand = Mono.Data.Sqlite.SqliteCommand;
using SQLiteConnection = Mono.Data.Sqlite.SqliteConnection;
using SQLiteDataReader = Mono.Data.Sqlite.SqliteDataReader;
#endif

namespace Vocaluxe.Lib.Database
Expand Down
4 changes: 4 additions & 0 deletions Vocaluxe/Lib/Database/CHighscoreDB.cs
Expand Up @@ -29,6 +29,10 @@

#else
using Mono.Data.Sqlite;
using SQLiteCommand = Mono.Data.Sqlite.SqliteCommand;
using SQLiteConnection = Mono.Data.Sqlite.SqliteConnection;
using SQLiteDataReader = Mono.Data.Sqlite.SqliteDataReader;
using SQLiteTransaction = Mono.Data.Sqlite.SqliteTransaction;
#endif

namespace Vocaluxe.Lib.Database
Expand Down
4 changes: 4 additions & 0 deletions Vocaluxe/Lib/Database/CResourceDB.cs
Expand Up @@ -28,6 +28,10 @@

#else
using Mono.Data.Sqlite;
using SQLiteCommand = Mono.Data.Sqlite.SqliteCommand;
using SQLiteConnection = Mono.Data.Sqlite.SqliteConnection;
using SQLiteDataReader = Mono.Data.Sqlite.SqliteDataReader;
using SQLiteTransaction = Mono.Data.Sqlite.SqliteTransaction;
#endif

namespace Vocaluxe.Lib.Database
Expand Down
6 changes: 6 additions & 0 deletions Vocaluxe/Lib/Draw/CDrawBaseWindows.cs
Expand Up @@ -154,13 +154,19 @@ protected void _OnMouseUp(object sender, MouseEventArgs e)
protected void _OnMouseLeave(object sender, EventArgs e)
{
_Mouse.Visible = false;
#if !WIN && !DEBUG
_Form.Cursor = Cursors.Default;
#endif
Cursor.Show();
}

protected void _OnMouseEnter(object sender, EventArgs e)
{
Cursor.Hide();
_Mouse.Visible = true;
#if !WIN && !DEBUG //don't want to be stuck without a cursor when debugging
_Form.Cursor = new Cursor("Linux/blank.cur"); //Cursor.Hide() doesn't work in Mono
#endif
}
#endregion

Expand Down
4 changes: 4 additions & 0 deletions Vocaluxe/Lib/Draw/COpenGL.cs
Expand Up @@ -108,7 +108,11 @@ public COpenGL()
bool ok = false;
try
{
#if WIN
var gm = new GraphicsMode(32, 24, 0, (int)CConfig.Config.Graphics.AAMode);
#else
var gm = new GraphicsMode(24, 24, 0, (int)CConfig.Config.Graphics.AAMode);
#endif
_Control = new GLControl(gm, 2, 1, GraphicsContextFlags.Default);
if (_Control.GraphicsMode != null)
ok = true;
Expand Down
2 changes: 1 addition & 1 deletion Vocaluxe/Lib/Input/CHIDAPI.cs
Expand Up @@ -57,7 +57,7 @@ public static class CHIDApi
#endif

#if LINUX
private const string _HIDApiDll = "libhidapi.so";
private const string _HIDApiDll = "libhidapi-libusb.so";
#endif
#endif

Expand Down
Expand Up @@ -27,7 +27,7 @@ public override bool Init()
{
if (_Initialized)
return false;

#if WIN
#if ARCH_X86
const string varName = "GSTREAMER_1_0_ROOT_X86";
#endif
Expand All @@ -42,7 +42,7 @@ public override bool Init()
}
string dllDirectory = gstreamerEnvVar + "bin\\";
COSFunctions.AddEnvironmentPath(dllDirectory);

#endif
Application.Init();

_Initialized = Application.IsInitialized;
Expand Down
Expand Up @@ -110,7 +110,7 @@ public override bool Open(bool prescan)
return false;
Length = -1;
Element convert = ElementFactory.Make("audioconvert", "convert");
Element audiosink = ElementFactory.Make("directsoundsink", "audiosink");
Element audiosink = ElementFactory.Make("autoaudiosink", "audiosink");

if (convert == null || audiosink == null)
{
Expand Down
3 changes: 3 additions & 0 deletions Vocaluxe/Lib/Sound/Record/PortAudio/CPortAudioRecord.cs
Expand Up @@ -136,7 +136,10 @@ public bool Stop()
return false;

foreach (IntPtr handle in _RecHandle)
{
PortAudioSharp.PortAudio.Pa_StopStream(handle);
PortAudioSharp.PortAudio.Pa_CloseStream(handle);
}
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion Vocaluxe/Lib/Video/Acinerella/CAcinerella.cs
Expand Up @@ -186,7 +186,7 @@ public static class CAcinerella
#endif

#if LINUX
private const string _AcDll = "x64/libacinerella.so";
private const string _AcDll = "libacinerella.so";
#endif
#endif

Expand Down
3 changes: 2 additions & 1 deletion Vocaluxe/Lib/Video/Acinerella/acinerella.c
Expand Up @@ -26,6 +26,7 @@
#include <libswresample/swresample.h>
#include <string.h>

#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000
#define AUDIO_BUFFER_BASE_SIZE AVCODEC_MAX_AUDIO_FRAME_SIZE

#define CODEC_TYPE_VIDEO AVMEDIA_TYPE_VIDEO
Expand Down Expand Up @@ -252,7 +253,7 @@ void CALL_CONVT ac_free_package(lp_ac_package pPackage)
if (pPackage != NULL) {
AVPacket* pkt = &((lp_ac_package_data)pPackage)->ffpackage;
if (pkt) {
if (pkt->destruct) pkt->destruct(pkt);
if (pkt->destruct){pkt->destruct = av_destruct_packet; pkt->destruct(pkt);} //FIXME: workaround for deprecation of AVPacket::destruct
pkt->data = NULL; pkt->size = 0;
}
av_free((lp_ac_package_data)pPackage);
Expand Down
8 changes: 6 additions & 2 deletions Vocaluxe/Lib/Video/Acinerella/makefile
@@ -1,10 +1,14 @@
acinerella: acinerella.c acinerella.h
gcc -c acinerella.c -I /usr/local/include
gcc -c -fPIC acinerella.c -I /usr/local/include

ifeq ($(shell uname),Linux)
gcc -shared -o libacinerella.so acinerella.o -lavformat -lavcodec -lavutil -lm -lswscale
gcc -shared -o libacinerella.so acinerella.o -lavformat -lavcodec -lavutil -lm -lswscale -lswresample
strip libacinerella.so
cp libacinerella.so ../../../../Output/
else
gcc -shared -o acinerella.dll -fPIC acinerella.o -lavformat -lavcodec -lavutil -lm -lswscale -lws2_32
strip acinerella.dll
endif

clean:
rm -f libacinerella.so ../../../../Output/libacinerella.so
3 changes: 3 additions & 0 deletions Vocaluxe/Program.cs
Expand Up @@ -349,6 +349,9 @@ private static Assembly _AssemblyResolver(Object sender, ResolveEventArgs args)
CLog.LogError("Cannot load assembly " + args.Name + " from " + path + ": " + e + "\r\nOuter Error: " + e1);
}
}
#if LINUX
catch(FileNotFoundException){}
#endif
}
return assembly;
}
Expand Down
20 changes: 11 additions & 9 deletions Vocaluxe/Vocaluxe.csproj
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?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)' == '' ">DebugWin</Configuration>
Expand Down Expand Up @@ -178,8 +178,8 @@
<Reference Include="Community.CsharpSqlite">
<HintPath>..\Output\Community.CsharpSqlite.dll</HintPath>
</Reference>
<Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<Reference Include="glib-sharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f, processorArchitecture=MSIL">
<SpecificVersion>True</SpecificVersion>
<HintPath>..\Output\glib-sharp.dll</HintPath>
</Reference>
<Reference Include="gstreamer-sharp, Version=0.99.0.0, Culture=neutral, PublicKeyToken=5cbf79803e97ff61, processorArchitecture=MSIL">
Expand Down Expand Up @@ -213,6 +213,7 @@
<Reference Include="System.Web.Services" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.XML" />
<Reference Include="Mono.Data.Sqlite" Condition=" !('$(Configuration)' == 'DebugWin' Or '$(Configuration)' == 'ReleaseWin' Or '$(Configuration)' == 'InstallerWin')"/>
</ItemGroup>
<ItemGroup>
<Compile Include="Base\CBackgroundMusic.cs" />
Expand Down Expand Up @@ -287,8 +288,8 @@
<Compile Include="Lib\Input\CControllerFramework.cs" />
<Compile Include="Lib\Sound\Playback\GstreamerSharp\CGstreamerSharpAudio.cs" />
<Compile Include="Lib\Sound\Record\CRecordBase.cs" />
<Compile Include="Lib\Sound\Record\DirectSound\CSampleDataEventArgs.cs" />
<Compile Include="Lib\Sound\Record\DirectSound\CSoundCardSource.cs" />
<Compile Include="Lib\Sound\Record\DirectSound\CSampleDataEventArgs.cs" Condition=" ('$(Configuration)' == 'DebugWin' Or '$(Configuration)' == 'ReleaseWin' Or '$(Configuration)' == 'InstallerWin')"/>
<Compile Include="Lib\Sound\Record\DirectSound\CSoundCardSource.cs" Condition=" ('$(Configuration)' == 'DebugWin' Or '$(Configuration)' == 'ReleaseWin' Or '$(Configuration)' == 'InstallerWin')"/>
<Compile Include="Lib\Sound\Record\PitchTracker\CPitchTrackerTest.cs" />
<Compile Include="Lib\Sound\Record\PitchTracker\CPtAKF.cs" />
<Compile Include="Lib\Sound\Record\PitchTracker\CPtDyWa.cs" />
Expand All @@ -303,7 +304,7 @@
<Compile Include="GameModes\IGameMode.cs" />
<Compile Include="SongQueue\ISongQueue.cs" />
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="Lib\Draw\CDirect3D.cs">
<Compile Include="Lib\Draw\CDirect3D.cs" Condition=" ('$(Configuration)' == 'DebugWin' Or '$(Configuration)' == 'ReleaseWin' Or '$(Configuration)' == 'InstallerWin')">
<SubType>Form</SubType>
</Compile>
<Compile Include="Lib\Draw\CDrawWinForm.cs">
Expand All @@ -318,7 +319,7 @@
<Compile Include="Lib\Input\WiiMote\CWiiMote.cs" />
<Compile Include="Lib\Input\WiiMote\WiiMoteLib.cs" />
<Compile Include="Lib\Playlist\CPlaylistFile.cs" />
<Compile Include="Lib\Sound\Record\DirectSound\CDirectSoundRecord.cs" />
<Compile Include="Lib\Sound\Record\DirectSound\CDirectSoundRecord.cs" Condition=" ('$(Configuration)' == 'DebugWin' Or '$(Configuration)' == 'ReleaseWin' Or '$(Configuration)' == 'InstallerWin')" />
<Compile Include="Lib\Sound\Playback\OpenAL\COpenALPlay.cs" />
<Compile Include="Base\CSound.cs" />
<Compile Include="Lib\Sound\Playback\PortAudio\CPortAudioPlay.cs" />
Expand Down Expand Up @@ -530,12 +531,13 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy /E /D /Y "$(ProjectDir)\Website" "$(SolutionDir)\PhoneGap"
<PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">xcopy /E /D /Y "$(ProjectDir)\Website" "$(SolutionDir)\PhoneGap"
powershell -command "$version = git describe --long; (Get-Content -Encoding UTF8 '$(ProjectDir)..\Output\Website\js\main.js') | Foreach-Object {$_ -replace '(?&lt;=var *matchingServerVersion * = *\\\")\w*(?=\\\" *;)', %2524('@(VersionNumber)'+' ('+$version+')')} | Set-Content -Encoding UTF8 '$(ProjectDir)..\Output\Website\js\main.js'"
powershell -command "(Get-Content -Encoding UTF8 '$(ProjectDir)Properties\AssemblyInfo.cs') | Foreach-Object {$_ -replace '(?&lt;=AssemblyInformationalVersion\()(.*)(?=\))', '\"GITVERSION\"'} | Set-Content -Encoding UTF8 '$(ProjectDir)Properties\AssemblyInfo.cs'"</PostBuildEvent>
<PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">cp -ruT "$(ProjectDir)Website" "$(SolutionDir)/PhoneGap"</PostBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent>powershell -command "$version = git describe --long; (Get-Content -Encoding UTF8 '$(ProjectDir)Properties\AssemblyInfo.cs') | Foreach-Object {$_ -replace 'GITVERSION', $version} | Set-Content -Encoding UTF8 '$(ProjectDir)Properties\AssemblyInfo.cs'"</PreBuildEvent>
<PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">powershell -command "$version = git describe --long; (Get-Content -Encoding UTF8 '$(ProjectDir)Properties\AssemblyInfo.cs') | Foreach-Object {$_ -replace 'GITVERSION', $version} | Set-Content -Encoding UTF8 '$(ProjectDir)Properties\AssemblyInfo.cs'"</PreBuildEvent>
</PropertyGroup>
<!-- 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.
Expand Down

0 comments on commit 5049ba5

Please sign in to comment.