Attempt to fix Mono weekly in travis (once again)

This commit is contained in:
JustArchi 2016-08-27 09:34:08 +02:00
parent d06fbda6d6
commit 2a61ecb681
7 changed files with 97 additions and 1 deletions

View file

@ -6,11 +6,18 @@ git:
mono:
- weekly
- alpha
- beta
- latest
matrix:
allow_failures:
- mono: weekly
- mono: alpha
- mono: beta
before_script:
- source mono_envsetup.sh
notifications:
email: false

View file

@ -62,7 +62,7 @@
<ApplicationIcon>cirno.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>false</SignAssembly>
@ -188,6 +188,10 @@
copy "$(TargetDir)$(TargetName).exe" "$(SolutionDir)out\ASF.exe"
</PostBuildEvent>
<PostBuildEvent Condition=" '$(OS)' == 'Unix' AND '$(ConfigurationName)' == 'Release' ">
if [[ -f "$(SolutionDir)/mono_envsetup.sh" ]]; then
source "$(SolutionDir)/mono_envsetup.sh"
fi
mkdir -p "$(SolutionDir)out/config"
cp "$(TargetDir)config/ASF.json" "$(SolutionDir)out/config"
cp "$(TargetDir)config/example.json" "$(SolutionDir)out/config"

View file

@ -42,6 +42,9 @@
<PropertyGroup>
<ApplicationIcon>cirno.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
@ -120,6 +123,10 @@
copy "$(TargetDir)$(TargetName).exe" "$(SolutionDir)out\ASF-ConfigGenerator.exe"
</PostBuildEvent>
<PostBuildEvent Condition=" '$(OS)' == 'Unix' AND '$(ConfigurationName)' == 'Release' ">
if [[ -f "$(SolutionDir)/mono_envsetup.sh" ]]; then
source "$(SolutionDir)/mono_envsetup.sh"
fi
mono --llvm --server -O=all "$(SolutionDir)tools/ILRepack/ILRepack.exe" /ndebug /internalize /parallel /targetplatform:v4 /wildcards /out:"$(SolutionDir)out/ASF-ConfigGenerator.exe" "$(TargetDir)$(TargetName).exe" "$(TargetDir)*.dll"
rm "$(SolutionDir)out/ASF-ConfigGenerator.exe.config"
</PostBuildEvent>

View file

@ -40,6 +40,9 @@
<PropertyGroup>
<ApplicationIcon>cirno.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
</PropertyGroup>
<ItemGroup>
<Reference Include="HtmlAgilityPack, Version=1.4.9.5, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
<HintPath>..\packages\HtmlAgilityPack.1.4.9.5\lib\Net45\HtmlAgilityPack.dll</HintPath>
@ -200,6 +203,19 @@
<None Include="Resources\SteamUnknownAvatar.jpg" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent Condition=" '$(OS)' != 'Unix' AND '$(ConfigurationName)' == 'Release' ">
copy "$(TargetDir)$(TargetName).exe" "$(SolutionDir)out\ASF-GUI.exe"
</PostBuildEvent>
<PostBuildEvent Condition=" '$(OS)' == 'Unix' AND '$(ConfigurationName)' == 'Release' ">
if [[ -f "$(SolutionDir)/mono_envsetup.sh" ]]; then
source "$(SolutionDir)/mono_envsetup.sh"
fi
mono --llvm --server -O=all "$(SolutionDir)tools/ILRepack/ILRepack.exe" /ndebug /internalize /parallel /targetplatform:v4 /wildcards /out:"$(SolutionDir)out/ASF-GUI.exe" "$(TargetDir)$(TargetName).exe" "$(TargetDir)*.dll"
rm "$(SolutionDir)out/ASF-GUI.exe.config"
</PostBuildEvent>
</PropertyGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>

4
cc.sh
View file

@ -29,6 +29,10 @@ XBUILD_ARGS+=("/p:Configuration=$BUILD")
cd "$(dirname "$(readlink -f "$0")")"
if [[ -f "mono_envsetup.sh" ]]; then
source "mono_envsetup.sh"
fi
if [[ -d ".git" ]] && hash git &>/dev/null; then
git pull || true
fi

54
mono_envsetup.sh Normal file
View file

@ -0,0 +1,54 @@
#!/bin/bash
MONO_DEBUG_IF_AVAILABLE() {
local PREVIOUS_MONO_DEBUG="$MONO_DEBUG"
# Add change if needed
if [[ -z "$PREVIOUS_MONO_DEBUG" ]]; then
export MONO_DEBUG="$1"
elif echo "$PREVIOUS_MONO_DEBUG" | grep -Fq "$1"; then
return 0
else
export MONO_DEBUG="${PREVIOUS_MONO_DEBUG},${1}"
fi
# If we did a change, check if Mono supports that option
# If not, it will be listed as invalid option on line 1
if mono "" 2>&1 | head -n 1 | grep -Fq "$1"; then
export MONO_DEBUG="$PREVIOUS_MONO_DEBUG"
return 1
fi
return 0
}
VERSION_GREATER() {
if [[ "$1" = "$2" ]]; then
return 1
fi
! VERSION_LESS_EQUAL "$1" "$2"
}
VERSION_GREATER_EQUAL() {
! VERSION_LESS "$1" "$2"
}
VERSION_LESS() {
if [[ "$1" = "$2" ]]; then
return 1
fi
VERSION_LESS_EQUAL "$1" "$2"
}
VERSION_LESS_EQUAL() {
[[ "$1" = "$(echo -e "$1\n$2" | sort -V | head -n 1)" ]]
}
MONO_VERSION="$(mono -V | head -n 1 | cut -d ' ' -f 5)"
if VERSION_GREATER_EQUAL "$MONO_VERSION" "4.6.0"; then
MONO_DEBUG_IF_AVAILABLE "no-compact-seq-points"
fi

4
run.sh
View file

@ -31,6 +31,10 @@ fi
cd "$(dirname "$(readlink -f "$0")")"
if [[ -f "mono_envsetup.sh" ]]; then
source "mono_envsetup.sh"
fi
BINARY="ArchiSteamFarm/bin/$BUILD/ArchiSteamFarm.exe"
if [[ ! -f "$BINARY" ]]; then