diff --git a/.travis.yml b/.travis.yml index ad17ca5fd..cbb7ac956 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/ArchiSteamFarm/ArchiSteamFarm.csproj b/ArchiSteamFarm/ArchiSteamFarm.csproj index c41522a17..9d8bbbcd1 100644 --- a/ArchiSteamFarm/ArchiSteamFarm.csproj +++ b/ArchiSteamFarm/ArchiSteamFarm.csproj @@ -62,7 +62,7 @@ cirno.ico - OnBuildSuccess + OnOutputUpdated false @@ -188,6 +188,10 @@ copy "$(TargetDir)$(TargetName).exe" "$(SolutionDir)out\ASF.exe" + 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" diff --git a/ConfigGenerator/ConfigGenerator.csproj b/ConfigGenerator/ConfigGenerator.csproj index e6df86138..e59314b97 100644 --- a/ConfigGenerator/ConfigGenerator.csproj +++ b/ConfigGenerator/ConfigGenerator.csproj @@ -42,6 +42,9 @@ cirno.ico + + OnOutputUpdated + ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll @@ -120,6 +123,10 @@ copy "$(TargetDir)$(TargetName).exe" "$(SolutionDir)out\ASF-ConfigGenerator.exe" + 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" diff --git a/GUI/GUI.csproj b/GUI/GUI.csproj index e3101e7b2..546b53e79 100644 --- a/GUI/GUI.csproj +++ b/GUI/GUI.csproj @@ -40,6 +40,9 @@ cirno.ico + + OnOutputUpdated + ..\packages\HtmlAgilityPack.1.4.9.5\lib\Net45\HtmlAgilityPack.dll @@ -200,6 +203,19 @@ + + + copy "$(TargetDir)$(TargetName).exe" "$(SolutionDir)out\ASF-GUI.exe" + + + 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" + + 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}. diff --git a/cc.sh b/cc.sh index 02e754497..216552710 100755 --- a/cc.sh +++ b/cc.sh @@ -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 diff --git a/mono_envsetup.sh b/mono_envsetup.sh new file mode 100644 index 000000000..d55f7787d --- /dev/null +++ b/mono_envsetup.sh @@ -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 diff --git a/run.sh b/run.sh index 12b3d8a6d..a7cfb061a 100755 --- a/run.sh +++ b/run.sh @@ -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