From 99d0421ba7d9509c86a4db33d760232d08a4da82 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sun, 31 Dec 2017 13:53:16 -0500 Subject: [PATCH] Fixed: Don't fail build on test failure (#173) * Fixed: Don't fail build on test failure This sets Appveyor up to use the original build.sh and test.sh scripts. Enables tests for Travis Add frontend linting checks to Appveyor builds Add Failed Tests message to Appveyor builds Fix windows installer naming Fix a few UI issues causing eslint and stylelint to fail * fixup! forgot one ui fix. * fixup! Inno doesn't like appveyor appending string to pr version * fixup! It's too late, my brain is mush --- .travis.yml | 2 +- LICENSE => LICENSE.md | 0 appveyor-package.sh | 27 ++ appveyor.yml | 22 +- build-appveyor.cake | 314 ------------------ build-appveyor.ps1 | 184 ---------- build.sh | 145 ++++---- frontend/src/Album/Summary/TrackDetailRow.css | 22 +- .../Artist/Details/ArtistDetailsSeason.css | 4 +- .../Components/Form/EnhancedSelectInput.css | 1 + frontend/src/Components/Form/Form.css | 11 - .../Quality/Definition/QualityDefinition.js | 8 +- frontend/src/Styles/Mixins/truncate.css | 2 +- setup/lidarr.iss | 11 +- test.sh | 23 +- 15 files changed, 169 insertions(+), 607 deletions(-) rename LICENSE => LICENSE.md (100%) create mode 100644 appveyor-package.sh delete mode 100644 build-appveyor.cake delete mode 100644 build-appveyor.ps1 delete mode 100644 frontend/src/Components/Form/Form.css diff --git a/.travis.yml b/.travis.yml index 127a108f5..d77aa01b5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ addons: script: - ./build.sh - chmod +x test.sh -# - ./test.sh Linux Unit Takes far too long, maybe even crashes travis :/ + - ./test.sh Linux Unit after_success: - chmod +x package.sh - ./package.sh diff --git a/LICENSE b/LICENSE.md similarity index 100% rename from LICENSE rename to LICENSE.md diff --git a/appveyor-package.sh b/appveyor-package.sh new file mode 100644 index 000000000..f160115a8 --- /dev/null +++ b/appveyor-package.sh @@ -0,0 +1,27 @@ +#! /bin/bash + +artifactsFolder="./_artifacts"; +artifactsFolderWindows=$artifactsFolder/windows +artifactsFolderLinux=$artifactsFolder/linux +artifactsFolderMacOS=$artifactsFolder/macos +artifactsFolderMacOSApp=$artifactsFolder/macos-app + +PublishArtifacts() +{ + 7z a $artifactsFolder/Lidarr.${APPVEYOR_REPO_BRANCH}.${APPVEYOR_BUILD_VERSION}.windows.zip $artifactsFolderWindows/* + + 7z a $artifactsFolder/Lidarr.${APPVEYOR_REPO_BRANCH}.${APPVEYOR_BUILD_VERSION}.osx-app.zip $artifactsFolderMacOSApp/* + + 7z a -ttar $artifactsFolder/Lidarr.${APPVEYOR_REPO_BRANCH}.${APPVEYOR_BUILD_VERSION}.osx.tar $artifactsFolderMacOS/* + 7z a -tgzip $artifactsFolder/Lidarr.${APPVEYOR_REPO_BRANCH}.${APPVEYOR_BUILD_VERSION}.osx.tar.gz $artifactsFolder/Lidarr.${APPVEYOR_REPO_BRANCH}.${APPVEYOR_BUILD_VERSION}.osx.tar + rm -f $artifactsFolder/Lidarr.${APPVEYOR_REPO_BRANCH}.${APPVEYOR_BUILD_VERSION}.osx.tar + + 7z a -ttar $artifactsFolder/Lidarr.${APPVEYOR_REPO_BRANCH}.${APPVEYOR_BUILD_VERSION}.linux.tar $artifactsFolderLinux/* + 7z a -tgzip $artifactsFolder/Lidarr.${APPVEYOR_REPO_BRANCH}.${APPVEYOR_BUILD_VERSION}.linux.tar.gz $artifactsFolder/Lidarr.${APPVEYOR_REPO_BRANCH}.${APPVEYOR_BUILD_VERSION}.linux.tar + rm -f $artifactsFolder/Lidarr.${APPVEYOR_REPO_BRANCH}.${APPVEYOR_BUILD_VERSION}.linux.tar + + ./setup/inno/ISCC.exe "./setup/lidarr.iss" + cp ./setup/output/Lidarr.*windows.exe $artifactsFolder/Lidarr.${APPVEYOR_REPO_BRANCH}.${APPVEYOR_BUILD_VERSION}.windows.exe +} + +PublishArtifacts diff --git a/appveyor.yml b/appveyor.yml index 3a379d039..baaa255f1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,20 +14,16 @@ install: - git submodule update --init --recursive build_script: - - ps: ./build-appveyor.ps1 + - C:\msys64\usr\bin\bash -lc "cd \"$APPVEYOR_BUILD_FOLDER\" && exec ./build.sh + +after_build: + - C:\msys64\usr\bin\bash -lc "cd \"$APPVEYOR_BUILD_FOLDER\" && exec ./appveyor-package.sh + - ps: Get-ChildItem .\_artifacts\*.zip | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } + - ps: Get-ChildItem .\_artifacts\*.exe | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } + - ps: Get-ChildItem .\_artifacts\*.tar.gz | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } -test: - assemblies: - - '_tests\*Test.dll' - categories: - except: - - IntegrationTest - - AutomationTest - -artifacts: - - path: '_artifacts\*.zip' - - path: '_artifacts\*.exe' - - path: '_artifacts\*.tar.gz' +test_script: + - C:\msys64\usr\bin\bash -lc "cd \"$APPVEYOR_BUILD_FOLDER\" && exec ./test.sh Windows Unit cache: - '%USERPROFILE%\.nuget\packages' diff --git a/build-appveyor.cake b/build-appveyor.cake deleted file mode 100644 index bd0fb3704..000000000 --- a/build-appveyor.cake +++ /dev/null @@ -1,314 +0,0 @@ -#addin "Cake.Npm" -#addin "Cake.Yarn" -#addin "SharpZipLib" -#addin "Cake.Compression" - -// Build variables -var outputFolder = "./_output"; -var outputFolderMono = outputFolder + "_mono"; -var outputFolderOsx = outputFolder + "_osx"; -var outputFolderOsxApp = outputFolderOsx + "_app"; -var testPackageFolder = "./_tests"; -var testSearchPattern = "*.Test/bin/x86/Release"; -var sourceFolder = "./src"; -var solutionFile = sourceFolder + "/Lidarr.sln"; -var updateFolder = outputFolder + "/Lidarr.Update"; -var updateFolderMono = outputFolderMono + "/Lidarr.Update"; - -// Artifact variables -var artifactsFolder = "./_artifacts"; -var artifactsFolderWindows = artifactsFolder + "/windows"; -var artifactsFolderLinux = artifactsFolder + "/linux"; -var artifactsFolderOsx = artifactsFolder + "/osx"; -var artifactsFolderOsxApp = artifactsFolder + "/osx-app"; - -// Utility methods -public void RemoveEmptyFolders(string startLocation) { - foreach (var directory in System.IO.Directory.GetDirectories(startLocation)) - { - RemoveEmptyFolders(directory); - - if (System.IO.Directory.GetFiles(directory).Length == 0 && - System.IO.Directory.GetDirectories(directory).Length == 0) - { - DeleteDirectory(directory, false); - } - } -} - -public void CleanFolder(string path, bool keepConfigFiles) { - DeleteFiles(path + "/**/*.transform"); - - if (!keepConfigFiles) { - DeleteFiles(path + "/**/*.dll.config"); - } - - DeleteFiles(path + "/**/FluentValidation.resources.dll"); - DeleteFiles(path + "/**/App.config"); - - DeleteFiles(path + "/**/*.less"); - - DeleteFiles(path + "/**/*.vshost.exe"); - - DeleteFiles(path + "/**/*.dylib"); - - RemoveEmptyFolders(path); -} - -public void CreateMdbs(string path) { - foreach (var file in System.IO.Directory.EnumerateFiles(path, "*.pdb", System.IO.SearchOption.AllDirectories)) { - var actualFile = file.Substring(0, file.Length - 4); - - if (FileExists(actualFile + ".exe")) { - StartProcess("./tools/pdb2mdb/pdb2mdb.exe", new ProcessSettings() - .WithArguments(args => args.Append(actualFile + ".exe"))); - } - - if (FileExists(actualFile + ".dll")) { - StartProcess("./tools/pdb2mdb/pdb2mdb.exe", new ProcessSettings() - .WithArguments(args => args.Append(actualFile + ".dll"))); - } - } -} - -// Build Tasks -Task("Compile").Does(() => { - // Build - if (DirectoryExists(outputFolder)) { - DeleteDirectory(outputFolder, true); - } - - MSBuild(solutionFile, config => - config.UseToolVersion(MSBuildToolVersion.VS2015) - .WithTarget("Clean") - .SetVerbosity(Verbosity.Minimal)); - - NuGetRestore(solutionFile); - - MSBuild(solutionFile, config => - config.UseToolVersion(MSBuildToolVersion.VS2015) - .SetPlatformTarget(PlatformTarget.x86) - .SetConfiguration("Release") - .WithProperty("AllowedReferenceRelatedFileExtensions", new string[] { ".pdb" }) - .WithTarget("Build") - .SetVerbosity(Verbosity.Minimal)); - - CleanFolder(outputFolder, false); - - // Add JsonNet - DeleteFiles(outputFolder + "/Newtonsoft.Json.*"); - CopyFiles(sourceFolder + "/packages/Newtonsoft.Json.*/lib/net35/*.dll", outputFolder); - CopyFiles(sourceFolder + "/packages/Newtonsoft.Json.*/lib/net35/*.dll", updateFolder); - - // Remove Mono stuff - DeleteFile(outputFolder + "/Mono.Posix.dll"); -}); - -Task("Gulp").Does(() => { - NpmInstall(new NpmInstallSettings { - LogLevel = NpmLogLevel.Silent, - WorkingDirectory = "./", - Production = true - }); - - NpmRunScript("build"); -}); - -Task("PackageMono").Does(() => { - // Start mono package - if (DirectoryExists(outputFolderMono)) { - DeleteDirectory(outputFolderMono, true); - } - - CopyDirectory(outputFolder, outputFolderMono); - - // Create MDBs - CreateMdbs(outputFolderMono); - - // Remove PDBs - DeleteFiles(outputFolderMono + "/**/*.pdb"); - - // Remove service helpers - DeleteFiles(outputFolderMono + "/ServiceUninstall.*"); - DeleteFiles(outputFolderMono + "/ServiceInstall.*"); - - // Remove native windows binaries - DeleteFiles(outputFolderMono + "/sqlite3.*"); - DeleteFiles(outputFolderMono + "/MediaInfo.*"); - - // Adding Lidarr.Core.dll.config (for dllmap) - CopyFile(sourceFolder + "/NzbDrone.Core/Lidarr.Core.dll.config", outputFolderMono + "/Lidarr.Core.dll.config"); - - // Adding CurlSharp.dll.config (for dllmap) - CopyFile(sourceFolder + "/NzbDrone.Common/CurlSharp.dll.config", outputFolderMono + "/CurlSharp.dll.config"); - - // Renaming Lidarr.Console.exe to Lidarr.exe - DeleteFiles(outputFolderMono + "/Lidarr.exe*"); - MoveFile(outputFolderMono + "/Lidarr.Console.exe", outputFolderMono + "/Lidarr.exe"); - MoveFile(outputFolderMono + "/Lidarr.Console.exe.config", outputFolderMono + "/Lidarr.exe.config"); - MoveFile(outputFolderMono + "/Lidarr.Console.exe.mdb", outputFolderMono + "/Lidarr.exe.mdb"); - - // Remove Lidarr.Windows.* - DeleteFiles(outputFolderMono + "/Lidarr.Windows.*"); - - // Adding Lidarr.Mono to updatePackage - CopyFiles(outputFolderMono + "/Lidarr.Mono.*", updateFolderMono); -}); - -Task("PackageOsx").Does(() => { - // Start osx package - if (DirectoryExists(outputFolderOsx)) { - DeleteDirectory(outputFolderOsx, true); - } - - CopyDirectory(outputFolderMono, outputFolderOsx); - - // Adding sqlite dylibs - CopyFiles(sourceFolder + "/Libraries/Sqlite/*.dylib", outputFolderOsx); - - // Adding MediaInfo dylib - CopyFiles(sourceFolder + "/Libraries/MediaInfo/*.dylib", outputFolderOsx); - - // Adding Startup script - CopyFile("./osx/Lidarr", outputFolderOsx + "/Lidarr"); -}); - -Task("PackageOsxApp").Does(() => { - // Start osx app package - if (DirectoryExists(outputFolderOsxApp)) { - DeleteDirectory(outputFolderOsxApp, true); - } - - CreateDirectory(outputFolderOsxApp); - - // Copy osx package files - CopyDirectory("./osx/Lidarr.app", outputFolderOsxApp + "/Lidarr.app"); - CopyDirectory(outputFolderOsx, outputFolderOsxApp + "/Lidarr.app/Contents/MacOS"); -}); - -Task("PackageTests").Does(() => { - // Start tests package - if (DirectoryExists(testPackageFolder)) { - DeleteDirectory(testPackageFolder, true); - } - - CreateDirectory(testPackageFolder); - - // Copy tests - CopyFiles(sourceFolder + "/" + testSearchPattern + "/*", testPackageFolder); - foreach (var directory in System.IO.Directory.GetDirectories(sourceFolder, "*.Test")) { - var releaseDirectory = directory + "/bin/x86/Release"; - if (DirectoryExists(releaseDirectory)) { - foreach (var releaseSubDirectory in System.IO.Directory.GetDirectories(releaseDirectory)) { - Information(System.IO.Path.GetDirectoryName(releaseSubDirectory)); - CopyDirectory(releaseSubDirectory, testPackageFolder + "/" + System.IO.Path.GetFileName(releaseSubDirectory)); - } - } - } - - // Install NUnit.ConsoleRunner - NuGetInstall("NUnit.ConsoleRunner", new NuGetInstallSettings { - Version = "3.2.0", - OutputDirectory = testPackageFolder - }); - - // Copy dlls - CopyFiles(outputFolder + "/*.dll", testPackageFolder); - - // Copy scripts - CopyFiles("./*.sh", testPackageFolder); - - // Create MDBs for tests - CreateMdbs(testPackageFolder); - - // Remove config - DeleteFiles(testPackageFolder + "/*.log.config"); - - // Clean - CleanFolder(testPackageFolder, true); - - // Adding Lidarr.Core.dll.config (for dllmap) - CopyFile(sourceFolder + "/NzbDrone.Core/Lidarr.Core.dll.config", testPackageFolder + "/Lidarr.Core.dll.config"); - - // Adding CurlSharp.dll.config (for dllmap) - CopyFile(sourceFolder + "/NzbDrone.Common/CurlSharp.dll.config", testPackageFolder + "/CurlSharp.dll.config"); - - // Adding CurlSharp libraries - CopyFiles(sourceFolder + "/ExternalModules/CurlSharp/libs/i386/*", testPackageFolder); -}); - -Task("CleanupWindowsPackage").Does(() => { - // Remove mono - DeleteFiles(outputFolder + "/Lidarr.Mono.*"); - - // Adding Lidarr.Windows to updatePackage - CopyFiles(outputFolder + "/Lidarr.Windows.*", updateFolder); -}); - -Task("Build") - .IsDependentOn("Compile") - .IsDependentOn("Gulp") - .IsDependentOn("PackageMono") - .IsDependentOn("PackageOsx") - .IsDependentOn("PackageOsxApp") - .IsDependentOn("PackageTests") - .IsDependentOn("CleanupWindowsPackage"); - -// Build Artifacts -Task("CleanArtifacts").Does(() => { - if (DirectoryExists(artifactsFolder)) { - DeleteDirectory(artifactsFolder, true); - } - - CreateDirectory(artifactsFolder); -}); - -Task("ArtifactsWindows").Does(() => { - CopyDirectory(outputFolder, artifactsFolderWindows + "/Lidarr"); -}); - -Task("ArtifactsWindowsInstaller").Does(() => { - InnoSetup("./setup/lidarr.iss", new InnoSetupSettings { - OutputDirectory = artifactsFolder, - ToolPath = "./setup/inno/ISCC.exe" - }); -}); - -Task("ArtifactsLinux").Does(() => { - CopyDirectory(outputFolderMono, artifactsFolderLinux + "/Lidarr"); -}); - -Task("ArtifactsOsx").Does(() => { - CopyDirectory(outputFolderOsx, artifactsFolderOsx + "/Lidarr"); -}); - -Task("ArtifactsOsxApp").Does(() => { - CopyDirectory(outputFolderOsxApp, artifactsFolderOsxApp); -}); - -Task("CompressArtifacts").Does(() => { - var prefix = ""; - - if (AppVeyor.IsRunningOnAppVeyor) { - prefix += AppVeyor.Environment.Repository.Branch.Replace("/", "-") + "."; - prefix += AppVeyor.Environment.Build.Version + "."; - } - - Zip(artifactsFolderWindows, artifactsFolder + "/Lidarr." + prefix + "windows.zip"); - GZipCompress(artifactsFolderLinux, artifactsFolder + "/Lidarr." + prefix + "linux.tar.gz"); - GZipCompress(artifactsFolderOsx, artifactsFolder + "/Lidarr." + prefix + "osx.tar.gz"); - Zip(artifactsFolderOsxApp, artifactsFolder + "/Lidarr." + prefix + "osx-app.zip"); -}); - -Task("Artifacts") - .IsDependentOn("CleanArtifacts") - .IsDependentOn("ArtifactsWindows") - .IsDependentOn("ArtifactsWindowsInstaller") - .IsDependentOn("ArtifactsLinux") - .IsDependentOn("ArtifactsOsx") - .IsDependentOn("ArtifactsOsxApp") - .IsDependentOn("CompressArtifacts"); - -// Run -RunTarget("Build"); -RunTarget("Artifacts"); diff --git a/build-appveyor.ps1 b/build-appveyor.ps1 deleted file mode 100644 index fd3bea746..000000000 --- a/build-appveyor.ps1 +++ /dev/null @@ -1,184 +0,0 @@ -########################################################################## -# This is the Cake bootstrapper script for PowerShell. -# This file was downloaded from https://github.com/cake-build/resources -# Feel free to change this file to fit your needs. -########################################################################## - -<# -.SYNOPSIS -This is a Powershell script to bootstrap a Cake build. -.DESCRIPTION -This Powershell script will download NuGet if missing, restore NuGet tools (including Cake) -and execute your Cake build script with the parameters you provide. -.PARAMETER Script -The build script to execute. -.PARAMETER Target -The build script target to run. -.PARAMETER Configuration -The build configuration to use. -.PARAMETER Verbosity -Specifies the amount of information to be displayed. -.PARAMETER Experimental -Tells Cake to use the latest Roslyn release. -.PARAMETER WhatIf -Performs a dry run of the build script. -No tasks will be executed. -.PARAMETER Mono -Tells Cake to use the Mono scripting engine. -.PARAMETER SkipToolPackageRestore -Skips restoring of packages. -.PARAMETER ScriptArgs -Remaining arguments are added here. -.LINK -http://cakebuild.net -#> - -[CmdletBinding()] -Param( - [string]$Script = "build-appveyor.cake", - [string]$Target = "Default", - [ValidateSet("Release", "Debug")] - [string]$Configuration = "Release", - [ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")] - [string]$Verbosity = "Verbose", - [switch]$Experimental, - [Alias("DryRun","Noop")] - [switch]$WhatIf, - [switch]$Mono, - [switch]$SkipToolPackageRestore, - [Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)] - [string[]]$ScriptArgs -) - -[Reflection.Assembly]::LoadWithPartialName("System.Security") | Out-Null -function MD5HashFile([string] $filePath) -{ - if ([string]::IsNullOrEmpty($filePath) -or !(Test-Path $filePath -PathType Leaf)) - { - return $null - } - - [System.IO.Stream] $file = $null; - [System.Security.Cryptography.MD5] $md5 = $null; - try - { - $md5 = [System.Security.Cryptography.MD5]::Create() - $file = [System.IO.File]::OpenRead($filePath) - return [System.BitConverter]::ToString($md5.ComputeHash($file)) - } - finally - { - if ($file -ne $null) - { - $file.Dispose() - } - } -} - -Write-Host "Preparing to run build script..." - -if(!$PSScriptRoot){ - $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent -} - -$TOOLS_DIR = Join-Path $PSScriptRoot "tools-cake" -$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe" -$CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe" -$NUGET_URL = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" -$PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config" -$PACKAGES_CONFIG_MD5 = Join-Path $TOOLS_DIR "packages.config.md5sum" - -# Should we use mono? -$UseMono = ""; -if($Mono.IsPresent) { - Write-Verbose -Message "Using the Mono based scripting engine." - $UseMono = "-mono" -} - -# Should we use the new Roslyn? -$UseExperimental = ""; -if($Experimental.IsPresent -and !($Mono.IsPresent)) { - Write-Verbose -Message "Using experimental version of Roslyn." - $UseExperimental = "-experimental" -} - -# Is this a dry run? -$UseDryRun = ""; -if($WhatIf.IsPresent) { - $UseDryRun = "-dryrun" -} - -# Make sure tools folder exists -if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) { - Write-Verbose -Message "Creating tools directory..." - New-Item -Path $TOOLS_DIR -Type directory | out-null -} - -# Make sure that packages.config exist. -if (!(Test-Path $PACKAGES_CONFIG)) { - Write-Verbose -Message "Downloading packages.config..." - try { (New-Object System.Net.WebClient).DownloadFile("http://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG) } catch { - Throw "Could not download packages.config." - } -} - -# Try find NuGet.exe in path if not exists -if (!(Test-Path $NUGET_EXE)) { - Write-Verbose -Message "Trying to find nuget.exe in PATH..." - $existingPaths = $Env:Path -Split ';' | Where-Object { (![string]::IsNullOrEmpty($_)) -and (Test-Path $_) } - $NUGET_EXE_IN_PATH = Get-ChildItem -Path $existingPaths -Filter "nuget.exe" | Select -First 1 - if ($NUGET_EXE_IN_PATH -ne $null -and (Test-Path $NUGET_EXE_IN_PATH.FullName)) { - Write-Verbose -Message "Found in PATH at $($NUGET_EXE_IN_PATH.FullName)." - $NUGET_EXE = $NUGET_EXE_IN_PATH.FullName - } -} - -# Try download NuGet.exe if not exists -if (!(Test-Path $NUGET_EXE)) { - Write-Verbose -Message "Downloading NuGet.exe..." - try { - (New-Object System.Net.WebClient).DownloadFile($NUGET_URL, $NUGET_EXE) - } catch { - Throw "Could not download NuGet.exe." - } -} - -# Save nuget.exe path to environment to be available to child processed -$ENV:NUGET_EXE = $NUGET_EXE - -# Restore tools from NuGet? -if(-Not $SkipToolPackageRestore.IsPresent) { - Push-Location - Set-Location $TOOLS_DIR - - # Check for changes in packages.config and remove installed tools if true. - [string] $md5Hash = MD5HashFile($PACKAGES_CONFIG) - if((!(Test-Path $PACKAGES_CONFIG_MD5)) -Or - ($md5Hash -ne (Get-Content $PACKAGES_CONFIG_MD5 ))) { - Write-Verbose -Message "Missing or changed package.config hash..." - Remove-Item * -Recurse -Exclude packages.config,nuget.exe - } - - Write-Verbose -Message "Restoring tools from NuGet..." - $NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`"" - - if ($LASTEXITCODE -ne 0) { - Throw "An error occured while restoring NuGet tools." - } - else - { - $md5Hash | Out-File $PACKAGES_CONFIG_MD5 -Encoding "ASCII" - } - Write-Verbose -Message ($NuGetOutput | out-string) - Pop-Location -} - -# Make sure that Cake has been installed. -if (!(Test-Path $CAKE_EXE)) { - Throw "Could not find Cake.exe at $CAKE_EXE" -} - -# Start Cake -Write-Host "Running build script..." -Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseMono $UseDryRun $UseExperimental $ScriptArgs" -exit $LASTEXITCODE \ No newline at end of file diff --git a/build.sh b/build.sh index 7a4e6bd7f..20c17b89d 100755 --- a/build.sh +++ b/build.sh @@ -1,15 +1,22 @@ #! /bin/bash msBuild='/c/Program Files (x86)/MSBuild/14.0/Bin' outputFolder='./_output' -outputFolderMono='./_output_mono' -outputFolderOsx='./_output_osx' -outputFolderOsxApp='./_output_osx_app' +outputFolderLinux='./_output_linux' +outputFolderMacOS='./_output_macos' +outputFolderMacOSApp='./_output_macos_app' testPackageFolder='./_tests/' testSearchPattern='*.Test/bin/x86/Release' sourceFolder='./src' slnFile=$sourceFolder/Lidarr.sln updateFolder=$outputFolder/Lidarr.Update -updateFolderMono=$outputFolderMono/Lidarr.Update +updateFolderMono=$outputFolderLinux/Lidarr.Update + +#Artifact variables +artifactsFolder="./_artifacts"; +artifactsFolderWindows=$artifactsFolder/windows +artifactsFolderLinux=$artifactsFolder/linux +artifactsFolderMacOS=$artifactsFolder/macos +artifactsFolderMacOSApp=$artifactsFolder/macos-app nuget='tools/nuget/nuget.exe'; CheckExitCode() @@ -23,12 +30,21 @@ CheckExitCode() return $status } +ProgressStart() +{ + echo "Start '$1'" +} + +ProgressEnd() +{ + echo "Finish '$1'" +} + CleanFolder() { local path=$1 local keepConfigFiles=$2 - find $path -name "*.transform" -exec rm "{}" \; if [ $keepConfigFiles != true ] ; then @@ -49,13 +65,11 @@ CleanFolder() find $path -depth -empty -type d -exec rm -r "{}" \; } - - AddJsonNet() { rm $outputFolder/Newtonsoft.Json.* cp $sourceFolder/packages/Newtonsoft.Json.*/lib/net35/*.dll $outputFolder - cp $sourceFolder/packages/Newtonsoft.Json.*/lib/net35/*.dll $outputFolder/NzbDrone.Update + cp $sourceFolder/packages/Newtonsoft.Json.*/lib/net35/*.dll $updateFolder } BuildWithMSBuild() @@ -74,16 +88,6 @@ BuildWithXbuild() CheckExitCode xbuild /p:Configuration=Release /p:Platform=x86 /t:Build /p:AllowedReferenceRelatedFileExtensions=.pdb $slnFile } -ProgressStart() -{ - echo "##teamcity[progressStart '$1']" -} - -ProgressEnd() -{ - echo "##teamcity[progressEnd '$1']" -} - LintUI() { ProgressStart 'ESLint' @@ -97,7 +101,7 @@ LintUI() Build() { - echo "##teamcity[progressStart 'Build']" + ProgressStart 'Build' rm -rf $outputFolder @@ -114,15 +118,15 @@ Build() echo "Removing Mono.Posix.dll" rm $outputFolder/Mono.Posix.dll - echo "##teamcity[progressFinish 'Build']" + ProgressEnd 'Build' } RunGulp() { - ProgressStart 'npm install' + ProgressStart 'yarn install' yarn install #npm-cache install npm || CheckExitCode npm install --no-optional --no-bin-links - ProgressEnd 'npm install' + ProgressEnd 'yarn install' LintUI @@ -150,88 +154,91 @@ CreateMdbs() PackageMono() { - echo "##teamcity[progressStart 'Creating Mono Package']" - rm -rf $outputFolderMono - cp -r $outputFolder $outputFolderMono + ProgressStart 'Creating Mono Package' + + rm -rf $outputFolderLinux + cp -r $outputFolder $outputFolderLinux echo "Creating MDBs" - CreateMdbs $outputFolderMono + CreateMdbs $outputFolderLinux echo "Removing PDBs" - find $outputFolderMono -name "*.pdb" -exec rm "{}" \; + find $outputFolderLinux -name "*.pdb" -exec rm "{}" \; echo "Removing Service helpers" - rm -f $outputFolderMono/ServiceUninstall.* - rm -f $outputFolderMono/ServiceInstall.* + rm -f $outputFolderLinux/ServiceUninstall.* + rm -f $outputFolderLinux/ServiceInstall.* echo "Removing native windows binaries Sqlite, MediaInfo" - rm -f $outputFolderMono/sqlite3.* - rm -f $outputFolderMono/MediaInfo.* + rm -f $outputFolderLinux/sqlite3.* + rm -f $outputFolderLinux/MediaInfo.* echo "Adding Lidarr.Core.dll.config (for dllmap)" - cp $sourceFolder/NzbDrone.Core/Lidarr.Core.dll.config $outputFolderMono + cp $sourceFolder/NzbDrone.Core/Lidarr.Core.dll.config $outputFolderLinux echo "Adding CurlSharp.dll.config (for dllmap)" - cp $sourceFolder/NzbDrone.Common/CurlSharp.dll.config $outputFolderMono + cp $sourceFolder/NzbDrone.Common/CurlSharp.dll.config $outputFolderLinux echo "Renaming Lidarr.Console.exe to Lidarr.exe" - rm $outputFolderMono/Lidarr.exe* - for file in $outputFolderMono/Lidarr.Console.exe*; do + rm $outputFolderLinux/Lidarr.exe* + for file in $outputFolderLinux/Lidarr.Console.exe*; do mv "$file" "${file//.Console/}" done echo "Removing Lidarr.Windows" - rm $outputFolderMono/Lidarr.Windows.* + rm $outputFolderLinux/Lidarr.Windows.* echo "Adding Lidarr.Mono to UpdatePackage" - cp $outputFolderMono/Lidarr.Mono.* $updateFolderMono + cp $outputFolderLinux/Lidarr.Mono.* $updateFolderMono - echo "##teamcity[progressFinish 'Creating Mono Package']" + ProgressEnd 'Creating Mono Package' } PackageOsx() { - echo "##teamcity[progressStart 'Creating OS X Package']" - rm -rf $outputFolderOsx - cp -r $outputFolderMono $outputFolderOsx + ProgressStart 'Creating MacOS Package' + + rm -rf $outputFolderMacOS + cp -r $outputFolderLinux $outputFolderMacOS echo "Adding sqlite dylibs" - cp $sourceFolder/Libraries/Sqlite/*.dylib $outputFolderOsx + cp $sourceFolder/Libraries/Sqlite/*.dylib $outputFolderMacOS echo "Adding MediaInfo dylib" - cp $sourceFolder/Libraries/MediaInfo/*.dylib $outputFolderOsx + cp $sourceFolder/Libraries/MediaInfo/*.dylib $outputFolderMacOS echo "Adding Startup script" - cp ./osx/Lidarr $outputFolderOsx + cp ./osx/Lidarr $outputFolderMacOS - echo "##teamcity[progressFinish 'Creating OS X Package']" + ProgressEnd 'Creating MacOS Package' } PackageOsxApp() { - echo "##teamcity[progressStart 'Creating OS X App Package']" - rm -rf $outputFolderOsxApp - mkdir $outputFolderOsxApp + ProgressStart 'Creating MacOS App Package' - cp -r ./osx/Lidarr.app $outputFolderOsxApp - cp -r $outputFolderOsx $outputFolderOsxApp/Lidarr.app/Contents/MacOS + rm -rf $outputFolderMacOSApp + mkdir $outputFolderMacOSApp - echo "##teamcity[progressFinish 'Creating OS X App Package']" + cp -r ./osx/Lidarr.app $outputFolderMacOSApp + cp -r $outputFolderMacOS $outputFolderMacOSApp/Lidarr.app/Contents/MacOS + + ProgressEnd 'Creating MacOS App Package' } PackageTests() { - echo "Packaging Tests" - echo "##teamcity[progressStart 'Creating Test Package']" + ProgressStart 'Creating Test Package' + rm -rf $testPackageFolder mkdir $testPackageFolder find $sourceFolder -path $testSearchPattern -exec cp -r -u -T "{}" $testPackageFolder \; if [ $runtime = "dotnet" ] ; then - $nuget install NUnit.ConsoleRunner -Version 3.2.0 -Output $testPackageFolder + $nuget install NUnit.ConsoleRunner -Version 3.7.0 -Output $testPackageFolder else - mono $nuget install NUnit.ConsoleRunner -Version 3.2.0 -Output $testPackageFolder + mono $nuget install NUnit.ConsoleRunner -Version 3.7.0 -Output $testPackageFolder fi cp $outputFolder/*.dll $testPackageFolder @@ -253,16 +260,41 @@ PackageTests() echo "Copying CurlSharp libraries" cp $sourceFolder/ExternalModules/CurlSharp/libs/i386/* $testPackageFolder - echo "##teamcity[progressFinish 'Creating Test Package']" + ProgressEnd 'Creating Test Package' } CleanupWindowsPackage() { + ProgressStart 'Cleaning Windows Package' + echo "Removing Lidarr.Mono" rm -f $outputFolder/Lidarr.Mono.* echo "Adding Lidarr.Windows to UpdatePackage" cp $outputFolder/Lidarr.Windows.* $updateFolder + + ProgressEnd 'Cleaning Windows Package' +} + +PackageArtifacts() +{ + echo "Creating Artifact Directories" + + rm -rf $artifactsFolder + mkdir $artifactsFolder + + mkdir $artifactsFolderWindows + mkdir $artifactsFolderMacOS + mkdir $artifactsFolderLinux + mkdir $artifactsFolderWindows/Lidarr + mkdir $artifactsFolderMacOS/Lidarr + mkdir $artifactsFolderLinux/Lidarr + mkdir $artifactsFolderMacOSApp + + cp -r $outputFolder/* $artifactsFolderWindows/Lidarr + cp -r $outputFolderMacOSApp/* $artifactsFolderMacOSApp + cp -r $outputFolderMacOS/* $artifactsFolderMacOS/Lidarr + cp -r $outputFolderLinux/* $artifactsFolderLinux/Lidarr } # Use mono or .net depending on OS @@ -284,3 +316,4 @@ PackageOsx PackageOsxApp PackageTests CleanupWindowsPackage +PackageArtifacts diff --git a/frontend/src/Album/Summary/TrackDetailRow.css b/frontend/src/Album/Summary/TrackDetailRow.css index 0366fa14f..bd499527f 100644 --- a/frontend/src/Album/Summary/TrackDetailRow.css +++ b/frontend/src/Album/Summary/TrackDetailRow.css @@ -1,31 +1,31 @@ .title { - composes: cell from 'Components/Table/Cells/TableRowCell.css'; + composes: cell from 'Components/Table/Cells/TableRowCell.css'; - white-space: nowrap; + white-space: nowrap; } .monitored { - composes: cell from 'Components/Table/Cells/TableRowCell.css'; + composes: cell from 'Components/Table/Cells/TableRowCell.css'; - width: 42px; + width: 42px; } .trackNumber { - composes: cell from 'Components/Table/Cells/TableRowCell.css'; + composes: cell from 'Components/Table/Cells/TableRowCell.css'; - width: 50px; + width: 50px; } .audio { - composes: cell from 'Components/Table/Cells/TableRowCell.css'; + composes: cell from 'Components/Table/Cells/TableRowCell.css'; - width: 200px; + width: 200px; } .language, .video, .status { - composes: cell from 'Components/Table/Cells/TableRowCell.css'; + composes: cell from 'Components/Table/Cells/TableRowCell.css'; - width: 100px; -} \ No newline at end of file + width: 100px; +} diff --git a/frontend/src/Artist/Details/ArtistDetailsSeason.css b/frontend/src/Artist/Details/ArtistDetailsSeason.css index 4cb0065e9..f8b26545b 100644 --- a/frontend/src/Artist/Details/ArtistDetailsSeason.css +++ b/frontend/src/Artist/Details/ArtistDetailsSeason.css @@ -23,9 +23,9 @@ } .albumCount { - font-size: 18px; - font-style: italic; color: #8895aa; + font-style: italic; + font-size: 18px; } .episodeCountContainer { diff --git a/frontend/src/Components/Form/EnhancedSelectInput.css b/frontend/src/Components/Form/EnhancedSelectInput.css index dc86311ec..e269a7adf 100644 --- a/frontend/src/Components/Form/EnhancedSelectInput.css +++ b/frontend/src/Components/Form/EnhancedSelectInput.css @@ -73,6 +73,7 @@ .optionsModalScroller { composes: scroller from 'Components/Scroller/Scroller.css'; + border: 1px solid $inputBorderColor; border-radius: 4px; background-color: $white; diff --git a/frontend/src/Components/Form/Form.css b/frontend/src/Components/Form/Form.css deleted file mode 100644 index 987b1a0a1..000000000 --- a/frontend/src/Components/Form/Form.css +++ /dev/null @@ -1,11 +0,0 @@ -.form { - -} - -.error { - color: $dangerColor; -} - -.warning { - color: $warningColor; -} diff --git a/frontend/src/Settings/Quality/Definition/QualityDefinition.js b/frontend/src/Settings/Quality/Definition/QualityDefinition.js index 08bb192f1..83db5b23c 100644 --- a/frontend/src/Settings/Quality/Definition/QualityDefinition.js +++ b/frontend/src/Settings/Quality/Definition/QualityDefinition.js @@ -111,13 +111,13 @@ class QualityDefinition extends Component {
- - + +
- - + +
diff --git a/frontend/src/Styles/Mixins/truncate.css b/frontend/src/Styles/Mixins/truncate.css index d0762a029..1941afc9b 100644 --- a/frontend/src/Styles/Mixins/truncate.css +++ b/frontend/src/Styles/Mixins/truncate.css @@ -10,7 +10,7 @@ * occur. */ - @define-mixin truncate { +@define-mixin truncate { overflow: hidden !important; max-width: 100%; /* 1 */ text-overflow: ellipsis !important; diff --git a/setup/lidarr.iss b/setup/lidarr.iss index 09c44e103..0c00d31c0 100644 --- a/setup/lidarr.iss +++ b/setup/lidarr.iss @@ -6,9 +6,10 @@ #define AppURL "https://lidarr.audio/" #define ForumsURL "https://forums.lidarr.audio/" #define AppExeName "Lidarr.exe" -#define BuildNumber "0.3" -#define BuildNumber GetEnv('BUILD_NUMBER') -#define BranchName GetEnv('branch') +#define BuildNumber "0.2" +#define BuildNumber GetEnv('APPVEYOR_BUILD_NUMBER') +#define BuildVersion GetEnv('APPVEYOR_BUILD_VERSION') +#define BranchName GetEnv('APPVEYOR_REPO_BRANCH') [Setup] ; NOTE: The value of AppId uniquely identifies this application. @@ -25,7 +26,7 @@ DefaultDirName={commonappdata}\Lidarr\bin DisableDirPage=yes DefaultGroupName={#AppName} DisableProgramGroupPage=yes -OutputBaseFilename=Lidarr.{#BranchName}.{#BuildNumber}.windows +OutputBaseFilename=Lidarr.{#BranchName}.{#BuildVersion}.windows SolidCompression=yes AppCopyright=Creative Commons 3.0 License AllowUNCPath=False @@ -34,7 +35,7 @@ DisableReadyPage=True CompressionThreads=2 Compression=lzma2/normal AppContact={#ForumsURL} -VersionInfoVersion={#BuildNumber} +VersionInfoVersion=0.2.0.{#BuildNumber} [Languages] Name: "english"; MessagesFile: "compiler:Default.isl" diff --git a/test.sh b/test.sh index 0e4d1d381..f0f242a95 100644 --- a/test.sh +++ b/test.sh @@ -13,11 +13,19 @@ fi rm -f "$TEST_LOG_FILE" # Uncomment to log test output to a file instead of the console -# export LIDARR_TESTS_LOG_OUTPUT="File" +export LIDARR_TESTS_LOG_OUTPUT="File" -NUNIT="$TEST_DIR/NUnit.ConsoleRunner.3.2.0/tools/nunit3-console.exe" -NUNIT_COMMAND="$NUNIT" -NUNIT_PARAMS="--teamcity --workers=1" +if [[ -z "${APPVEYOR}" ]]; then + NUNIT="$TEST_DIR/NUnit.ConsoleRunner.3.7.0/tools/nunit3-console.exe" + NUNIT_COMMAND="$NUNIT" + NUNIT_PARAMS="--workers=1" +else + NUNIT="nunit3-console" + NUNIT_COMMAND="$NUNIT" + NUNIT_PARAMS="--result=myresults.xml;format=AppVeyor --workers=1" + unset TMP + unset TEMP +fi if [ "$PLATFORM" = "Windows" ]; then WHERE="$WHERE && cat != LINUX" @@ -51,7 +59,12 @@ $NUNIT_COMMAND --where "$WHERE" $NUNIT_PARAMS $ASSEMBLIES; EXIT_CODE=$? if [ "$EXIT_CODE" -ge 0 ]; then - echo "Failed tests: $EXIT_CODE" + if [[ -z "${APPVEYOR}" ]]; then + echo "Failed tests: $EXIT_CODE" + else + echo "Failed tests: $EXIT_CODE" + appveyor AddMessage "Failed tests: $EXIT_CODE" + fi exit 0 else exit $EXIT_CODE