diff --git a/appveyor.yml b/.appveyor.yml similarity index 50% rename from appveyor.yml rename to .appveyor.yml index 51f8bc9..afb3780 100644 --- a/appveyor.yml +++ b/.appveyor.yml @@ -15,27 +15,12 @@ branches: only: - develop - master - -#---------------------------------# -# Notifications Configuration # -#---------------------------------# -notifications: - - provider: Webhook - url: https://webhooks.gitter.im/e/592eec477e12726db2ee - on_build_success: true - on_build_failure: true - on_build_status_changed: true + - /release/.*/ + - /hotfix/.*/ #---------------------------------# # Build Cache # #---------------------------------# cache: - Source\packages -> Source\**\packages.config -- Tools -> build.ps1 - -#---------------------------------# -# Skip builds for doc changes # -#---------------------------------# -skip_commits: - # Regex for matching commit message - message: /(doc).*/ +- tools -> setup.cake \ No newline at end of file diff --git a/.gitignore b/.gitignore index 4d9fbcc..b1a3ec6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,26 +1,39 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore # User-specific files *.suo *.user +*.userosscache *.sln.docstates +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + # Build results [Dd]ebug/ [Dd]ebugPublic/ [Rr]elease/ +[Rr]eleases/ x64/ -build/ +x86/ bld/ [Bb]in/ [Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* -#NUNIT +# NUNIT *.VisualState.xml TestResult.xml @@ -29,6 +42,12 @@ TestResult.xml [Rr]eleasePS/ dlldata.c +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ +**/Properties/launchSettings.json + *_i.c *_p.c *_i.h @@ -61,14 +80,18 @@ _Chutzpah* ipch/ *.aps *.ncb +*.opendb *.opensdf *.sdf *.cachefile +*.VC.db +*.VC.VC.opendb # Visual Studio profiler *.psess *.vsp *.vspx +*.sap # TFS 2012 Local Workspace $tf/ @@ -81,7 +104,7 @@ _ReSharper*/ *.[Rr]e[Ss]harper *.DotSettings.user -# JustCode is a .NET coding addin-in +# JustCode is a .NET coding add-in .JustCode # TeamCity is a build add-in @@ -90,10 +113,14 @@ _TeamCity* # DotCover is a Code Coverage Tool *.dotCover +# Visual Studio code coverage results +*.coverage +*.coveragexml + # NCrunch -*.ncrunch* _NCrunch_* .*crunch*.local.xml +nCrunchTemp_* # MightyMoose *.mm.* @@ -121,44 +148,70 @@ publish/ # Publish Web Output *.[Pp]ublish.xml *.azurePubxml - -# NuGet Packages Directory -packages/ -## TODO: If the tool you use requires repositories.config uncomment the next line -#!packages/repositories.config - -# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets -# This line needs to be after the ignore of the build folder (and the packages folder if the line above has been uncommented) -!packages/build/ - -# Windows Azure Build Output +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output csx/ *.build.csdef -# Windows Store app package directory +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ # Others -sql/ -*.Cache ClientBin/ -[Ss]tyle[Cc]op.* ~$* *~ *.dbmdl *.dbproj.schemaview +*.jfm *.pfx *.publishsettings node_modules/ -tools/xunit.runner.console/ -tools/cake/ -tools/Cake.AliaSql/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ # RIA/Silverlight projects Generated_Code/ -# Backup & report files from converting an old project file to a newer -# Visual Studio version. Backup files are not needed, because we have git ;-) +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML @@ -176,6 +229,48 @@ UpgradeLog*.htm # Microsoft Fakes FakesAssemblies/ -# Build related -tools/ +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +tools/** +!tools/packages.config BuildArtifacts/ \ No newline at end of file diff --git a/README.md b/README.md index da6274e..c1c2a0e 100644 --- a/README.md +++ b/README.md @@ -3,25 +3,6 @@ Cake.AliaSql AliaSql Script Alias for [Cake](https://github.com/cake-build/cake) build system. -### Example usage: -```cake -#tool "AliaSQL" -#addin "Cake.AliaSql" - -... - -Task("RebuildDatabase") - .Does(() => { - AliaSql("Rebuild", new AliaSqlSettings - { - ToolPath = "./tools/AliaSQL/tools/AliaSQL.exe", - ConnectionString = ".\\sqldb", - DatabaseName = "TestDatabase", - ScriptsFolder = "./src/Database/Scripts", - }); - }); -``` - ## Information ||Stable|Pre-release| @@ -40,6 +21,10 @@ Task("RebuildDatabase") [![Coverage Status](https://coveralls.io/repos/github/cake-contrib/Cake.AliaSql/badge.svg?branch=develop)](https://coveralls.io/github/cake-contrib/Cake.AliaSql?branch=develop) +## Quick Links + +- [Documentation](https://cake-contrib.github.io/Cake.AliaSql/) + ## Chat Room Come join in the conversation about Cake.AliaSql in our Gitter Chat Room diff --git a/build.ps1 b/build.ps1 index 28dea1d..bdfb32b 100644 --- a/build.ps1 +++ b/build.ps1 @@ -5,14 +5,11 @@ ########################################################################## <# - .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 @@ -32,10 +29,8 @@ Tells Cake to use the Mono scripting engine. Skips restoring of packages. .PARAMETER ScriptArgs Remaining arguments are added here. - .LINK http://cakebuild.net - #> [CmdletBinding()] @@ -165,7 +160,7 @@ if(-Not $SkipToolPackageRestore.IsPresent) { } Write-Verbose -Message "Restoring tools from NuGet..." - $NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`"" + $NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -PreRelease -OutputDirectory `"$TOOLS_DIR`" -Source https://www.myget.org/F/cake/api/v3/index.json" if ($LASTEXITCODE -ne 0) { Throw "An error occured while restoring NuGet tools." @@ -183,9 +178,6 @@ if (!(Test-Path $CAKE_EXE)) { Throw "Could not find Cake.exe at $CAKE_EXE" } -# Make sure that re-usable build.cake file exists. -Invoke-Expression "&`"$NUGET_EXE`" install gep13.DefaultBuild -ExcludeVersion -PreRelease -OutputDirectory `"$TOOLS_DIR`" -Source `"https://www.myget.org/F/gep13/api/v3/index.json`"" - # Start Cake Write-Host "Running build script..." Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseMono $UseDryRun $UseExperimental $ScriptArgs" diff --git a/config.wyam b/config.wyam new file mode 100644 index 0000000..80e3a60 --- /dev/null +++ b/config.wyam @@ -0,0 +1 @@ +System.Globalization.CultureInfo.DefaultThreadCurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("en-GB"); diff --git a/docs/input/blog/new-release-0.6.0.md b/docs/input/blog/new-release-0.6.0.md new file mode 100644 index 0000000..fd21349 --- /dev/null +++ b/docs/input/blog/new-release-0.6.0.md @@ -0,0 +1,22 @@ +--- +Title: New Release - 0.6.0 +Published: 2/2/2017 +Category: Release +Author: gep13 +--- + +# Long time, no release + +Thanks to a contribution from @devlead, we are releasing 0.6.0 of Cake.AliaSql. This includes the following: + +## Improvement + +- [__#13__](https://github.com/cake-contrib/Cake.AliaSql/issues/13) Switch away from using gep13.DefaultBuild and use Cake.Recipe instead + +## Documentation + +- [__#23__](https://github.com/cake-contrib/Cake.AliaSql/issues/23) Add Wyam Documentation generation + +It was decided that this was required due to the fact that with the impending release of Cake 0.18.0 all addins need to be at least 0.16.0, so we decided to upload to the latest. + +Please do not hesitate to reach out in the [Gitter Channel](https://gitter.im/cake-contrib/Lobby) if you have any issues using this addin. \ No newline at end of file diff --git a/docs/input/docs/index.cshtml b/docs/input/docs/index.cshtml new file mode 100644 index 0000000..2500d55 --- /dev/null +++ b/docs/input/docs/index.cshtml @@ -0,0 +1,19 @@ +--- +Title: Documentation +--- +

This user guide, like Cake.AliaSql itself, is under very active development. Some parts of it aren't +documented as completely as they need to be, but we glady accept your contributions.

+ +

We need your help to improve the documentation for Cake.AliaSql, so if there is something that you +would like to add then you can edit the content directly on GitHub.

+ +@foreach(IDocument child in Model.DocumentList(Keys.Children).OrderBy(x => x.Get(DocsKeys.Order, 1000))) +{ +

@(child.String(Keys.Title))

+ if(child.ContainsKey(DocsKeys.Description)) + { +

@Html.Raw(child.String(DocsKeys.Description))

+ } + + @Html.Partial("_ChildPages", child) +} \ No newline at end of file diff --git a/docs/input/docs/usage/examples.md b/docs/input/docs/usage/examples.md new file mode 100644 index 0000000..9fbd68b --- /dev/null +++ b/docs/input/docs/usage/examples.md @@ -0,0 +1,17 @@ +```cake +#tool "AliaSQL" +#addin "Cake.AliaSql" + +... + +Task("RebuildDatabase") + .Does(() => { + AliaSql("Rebuild", new AliaSqlSettings + { + ToolPath = "./tools/AliaSQL/tools/AliaSQL.exe", + ConnectionString = ".\\sqldb", + DatabaseName = "TestDatabase", + ScriptsFolder = "./src/Database/Scripts", + }); + }); +``` \ No newline at end of file diff --git a/docs/input/docs/usage/index.cshtml b/docs/input/docs/usage/index.cshtml new file mode 100644 index 0000000..cae3cbd --- /dev/null +++ b/docs/input/docs/usage/index.cshtml @@ -0,0 +1,7 @@ +--- +Order: 2 +Description: How to obtain, configure, and execute Cake.AliaSql. +--- +

@Html.Raw(Model.String(DocsKeys.Description))

+ +@Html.Partial("_ChildPages") \ No newline at end of file diff --git a/docs/input/index.cshtml b/docs/input/index.cshtml new file mode 100644 index 0000000..3f8f2ec --- /dev/null +++ b/docs/input/index.cshtml @@ -0,0 +1,13 @@ +--- +Title: Cake.AliaSql +NoSidebar: true +NoContainer: false +NoGutter: true +--- + +
+

What is it?

+

+ Cake.AliaSql is an Addin for Cake which allows the executions of the AliaSql command line database change management tool. +

+
\ No newline at end of file diff --git a/setup.cake b/setup.cake index f32a382..53503ec 100644 --- a/setup.cake +++ b/setup.cake @@ -1,72 +1,22 @@ -/////////////////////////////////////////////////////////////////////////////// -// ENVIRONMENT VARIABLE NAMES -/////////////////////////////////////////////////////////////////////////////// +#load nuget:https://www.myget.org/F/cake-contrib/api/v2?package=Cake.Recipe&prerelease -private static string githubUserNameVariable = "GITHUB_USERNAME"; -private static string githubPasswordVariable = "GITHUB_PASSWORD"; -private static string myGetApiKeyVariable = "MYGET_API_KEY"; -private static string myGetSourceUrlVariable = "MYGET_SOURCE"; -private static string nuGetApiKeyVariable = "NUGET_API_KEY"; -private static string nuGetSourceUrlVariable = "NUGET_SOURCE"; -private static string chocolateyApiKeyVariable = "CHOCOLATEY_API_KEY"; -private static string chocolateySourceUrlVariable = "CHOCOLATEY_SOURCE"; -private static string gitterTokenVariable = "GITTER_TOKEN"; -private static string gitterRoomIdVariable = "GITTER_ROOM_ID"; -private static string slackTokenVariable = "SLACK_TOKEN"; -private static string slackChannelVariable = "SLACK_CHANNEL"; -private static string twitterConsumerKeyVariable = "TWITTER_CONSUMER_KEY"; -private static string twitterConsumerSecretVariable = "TWITTER_CONSUMER_SECRET"; -private static string twitterAccessTokenVariable = "TWITTER_ACCESS_TOKEN"; -private static string twitterAccessTokenSecretVariable = "TWITTER_ACCESS_TOKEN_SECRET"; -private static string appVeyorApiTokenVariable = "APPVEYOR_API_TOKEN"; -private static string coverallsRepoTokenVariable = "COVERALLS_REPO_TOKEN"; +Environment.SetVariableNames(); -/////////////////////////////////////////////////////////////////////////////// -// BUILD ACTIONS -/////////////////////////////////////////////////////////////////////////////// +BuildParameters.SetParameters(context: Context, + buildSystem: BuildSystem, + sourceDirectoryPath: "./src", + title: "Cake.AliaSql", + repositoryOwner: "cake-contrib", + repositoryName: "Cake.AliaSql", + appVeyorAccountName: "cakecontrib"); -var sendMessageToGitterRoom = true; -var sendMessageToSlackChannel = true; -var sendMessageToTwitter = true; +BuildParameters.PrintParamters(Context); -/////////////////////////////////////////////////////////////////////////////// -// PROJECT SPECIFIC VARIABLES -/////////////////////////////////////////////////////////////////////////////// +ToolSettings.SetToolSettings(context: Context, + dupFinderExcludePattern: new string[] { + BuildParameters.RootDirectoryPath + "/src/Cake.AliaSql.Tests/*.cs" }, + testCoverageFilter: "+[*]* -[xunit.*]* -[Cake.Core]* -[Cake.Testing]* -[*.Tests]* ", + testCoverageExcludeByAttribute: "*.ExcludeFromCodeCoverage*", + testCoverageExcludeByFile: "*/*Designer.cs;*/*.g.cs;*/*.g.i.cs"); -var rootDirectoryPath = MakeAbsolute(Context.Environment.WorkingDirectory); -var sourceDirectoryPath = "./src"; -var solutionFilePath = "./src/Cake.AliaSql.sln"; -var solutionDirectoryPath = "./src/Cake.AliaSql"; -var title = "Cake.AliaSql"; -var resharperSettingsFileName = "Cake.AliaSql.sln.DotSettings"; -var repositoryOwner = "cake-contrib"; -var repositoryName = "Cake.AliaSql"; -var appVeyorAccountName = "cakecontrib"; -var appVeyorProjectSlug = "cake-aliasql"; - -// NOTE: Only populate this, if required, but leave as is otherwise. -var dupFinderExcludePattern = new string[] { rootDirectoryPath + "/src/Cake.AliaSql.Tests/*.cs" }; -var testCoverageFilter = "+[*]* -[xunit.*]* -[Cake.Core]* -[Cake.Testing]* -[*.Tests]* "; -var testCoverageExcludeByAttribute = "*.ExcludeFromCodeCoverage*"; -var testCoverageExcludeByFile = "*/*Designer.cs;*/*.g.cs;*/*.g.i.cs"; - -/////////////////////////////////////////////////////////////////////////////// -// CAKE FILES TO LOAD IN -/////////////////////////////////////////////////////////////////////////////// - -#l .\Tools\gep13.DefaultBuild\Content\appveyor.cake -#l .\Tools\gep13.DefaultBuild\Content\chocolatey.cake -#l .\Tools\gep13.DefaultBuild\Content\coveralls.cake -#l .\Tools\gep13.DefaultBuild\Content\credentials.cake -#l .\Tools\gep13.DefaultBuild\Content\gitreleasemanager.cake -#l .\Tools\gep13.DefaultBuild\Content\gitter.cake -#l .\Tools\gep13.DefaultBuild\Content\gitversion.cake -#l .\Tools\gep13.DefaultBuild\Content\nuget.cake -#l .\Tools\gep13.DefaultBuild\Content\packages.cake -#l .\Tools\gep13.DefaultBuild\Content\parameters.cake -#l .\Tools\gep13.DefaultBuild\Content\paths.cake -#l .\Tools\gep13.DefaultBuild\Content\resharper.cake -#l .\Tools\gep13.DefaultBuild\Content\slack.cake -#l .\Tools\gep13.DefaultBuild\Content\testing.cake -#l .\Tools\gep13.DefaultBuild\Content\twitter.cake -#l .\Tools\gep13.DefaultBuild\Content\build.cake +Build.Run(); diff --git a/src/Cake.AliaSql.Tests/Cake.AliaSql.Tests.csproj b/src/Cake.AliaSql.Tests/Cake.AliaSql.Tests.csproj index 28fe789..be1c14c 100644 --- a/src/Cake.AliaSql.Tests/Cake.AliaSql.Tests.csproj +++ b/src/Cake.AliaSql.Tests/Cake.AliaSql.Tests.csproj @@ -1,5 +1,5 @@  - + Debug @@ -32,12 +32,12 @@ 4 - - ..\packages\Cake.Core.0.15.2\lib\net45\Cake.Core.dll + + ..\packages\Cake.Core.0.17.0\lib\net45\Cake.Core.dll True - - ..\packages\Cake.Testing.0.15.2\lib\net45\Cake.Testing.dll + + ..\packages\Cake.Testing.0.17.1\lib\net45\Cake.Testing.dll True @@ -93,7 +93,7 @@ -