Merge pull request #145 from derivator/linux-fixes
Linux: set AssemblyInformationalVersion to git version and add install target to makefile
This commit is contained in:
commit
8d3eb2c395
6 files changed
+39
-7
No files matched your search
@@ -598,12 +598,7 @@ namespace Vocaluxe.Base.Server
|
|||||||
|
|
||||||
public static string GetServerVersion()
|
public static string GetServerVersion()
|
||||||
{
|
{
|
||||||
var informationalVersion = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false).FirstOrDefault();
|
return Application.ProductVersion;
|
||||||
if (informationalVersion != null)
|
|
||||||
{
|
|
||||||
informationalVersion = "";
|
|
||||||
}
|
|
||||||
return Assembly.GetExecutingAssembly().GetName().Version.ToString() + " (" + informationalVersion + ")";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CBase64Image GetDelayedImage(string hashedFilename)
|
public static CBase64Image GetDelayedImage(string hashedFilename)
|
||||||
|
|||||||
Executable
+5
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
PROJECT=$1
|
||||||
|
cd $PROJECT
|
||||||
|
sed -i -r -e 's/AssemblyInformationalVersion\(".*?"\)/AssemblyInformationalVersion("GITVERSION")/' $PROJECT/Properties/AssemblyInfo.cs
|
||||||
|
sed -i -e 's/var matchingServerVersion = "";/var matchingServerVersion = "'$(git describe --long)'";/' $PROJECT/../Output/Website/js/main.js
|
||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
PROJECT=$1
|
||||||
|
cd $PROJECT
|
||||||
|
sed -i -e s/GITVERSION/$(git describe --long)/ $PROJECT/Properties/AssemblyInfo.cs
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Type=Application
|
||||||
|
Version=1.0
|
||||||
|
Name=Vocaluxe
|
||||||
|
Keywords=game;party;singing;
|
||||||
|
GenericName=Karaoke
|
||||||
|
Icon=INSTALLPATH/Vocaluxe.ico
|
||||||
|
Path=INSTALLPATH
|
||||||
|
Exec=mono INSTALLPATH/Vocaluxe.exe %U
|
||||||
|
Terminal=false
|
||||||
|
StartupNotify=false
|
||||||
|
Categories=Game;
|
||||||
@@ -539,10 +539,12 @@
|
|||||||
<PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">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 '(?<=var *matchingServerVersion * = *\")\w*(?=\" *;)', "$version"} | Set-Content -Encoding UTF8 '$(ProjectDir)..\Output\Website\js\main.js'"
|
powershell -command "$version = git describe --long; (Get-Content -Encoding UTF8 '$(ProjectDir)..\Output\Website\js\main.js') | Foreach-Object {$_ -replace '(?<=var *matchingServerVersion * = *\")\w*(?=\" *;)', "$version"} | Set-Content -Encoding UTF8 '$(ProjectDir)..\Output\Website\js\main.js'"
|
||||||
powershell -command "(Get-Content -Encoding UTF8 '$(ProjectDir)Properties\AssemblyInfo.cs') | Foreach-Object {$_ -replace '(?<=AssemblyInformationalVersion\()(.*)(?=\))', '\"GITVERSION\"'} | Set-Content -Encoding UTF8 '$(ProjectDir)Properties\AssemblyInfo.cs'"</PostBuildEvent>
|
powershell -command "(Get-Content -Encoding UTF8 '$(ProjectDir)Properties\AssemblyInfo.cs') | Foreach-Object {$_ -replace '(?<=AssemblyInformationalVersion\()(.*)(?=\))', '\"GITVERSION\"'} | Set-Content -Encoding UTF8 '$(ProjectDir)Properties\AssemblyInfo.cs'"</PostBuildEvent>
|
||||||
<PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">cp -ruT "$(ProjectDir)Website" "$(SolutionDir)/PhoneGap"</PostBuildEvent>
|
<PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">cp -ruT "$(ProjectDir)Website" "$(SolutionDir)/PhoneGap"</PostBuildEvent>
|
||||||
|
<PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">$(ProjectDir)Linux/Build/PostBuildEvent.sh $(ProjectDir)</PostBuildEvent>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<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>
|
<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>
|
||||||
|
<PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">$(ProjectDir)Linux/Build/PreBuildEvent.sh $(ProjectDir)</PreBuildEvent>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<!-- 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.
|
||||||
|
|||||||
@@ -11,3 +11,17 @@ clean:
|
|||||||
$(MAKE) -C PitchTracker clean
|
$(MAKE) -C PitchTracker clean
|
||||||
$(MAKE) -C Vocaluxe/Lib/Video/Acinerella clean
|
$(MAKE) -C Vocaluxe/Lib/Video/Acinerella clean
|
||||||
git checkout $(windowsLibs)
|
git checkout $(windowsLibs)
|
||||||
|
|
||||||
|
INSTALLPATH?=/usr/share/vocaluxe
|
||||||
|
WRONG_ARCH=$(shell echo $(ARCH) | sed -e s/x86/x64/ -e s/x64/x86/)
|
||||||
|
install:
|
||||||
|
mkdir -p $(DESTDIR)$(INSTALLPATH)
|
||||||
|
cp -ru Output/. $(DESTDIR)$(INSTALLPATH)
|
||||||
|
rm -rf $(DESTDIR)$(INSTALLPATH)/$(WRONG_ARCH)
|
||||||
|
|
||||||
|
ICONPATH?=/usr/share/applications
|
||||||
|
install_icon:
|
||||||
|
mkdir -p $(DESTDIR)$(ICONPATH)
|
||||||
|
cp Vocaluxe/Linux/Package/Vocaluxe.desktop $(DESTDIR)$(ICONPATH)/
|
||||||
|
sed -i -e 's=INSTALLPATH=$(INSTALLPATH)=' $(DESTDIR)$(ICONPATH)/Vocaluxe.desktop
|
||||||
|
|
||||||
Reference in new issue
Block a user