Skip to content

Commit

Permalink
[#318] Support 8.6.5, use 8.6.5 (#332)
Browse files Browse the repository at this point in the history
Resolves #318
  • Loading branch information
vrom911 authored and chshersh committed Jul 12, 2019
1 parent 09e51e9 commit 6aea05e
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 39 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ matrix:
# Cabal, linux
- ghc: 8.2.2
- ghc: 8.4.4
- ghc: 8.6.4
- ghc: 8.6.5

# Stack, linux

- ghc: 8.6.4
- ghc: 8.6.5
env: STACK_YAML="$TRAVIS_BUILD_DIR/stack.yaml" DEPLOY=yes

# Disabled because of Travis bugs
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ Here is the list of the options that can be configured to suit your needs. If op
| `fullName` | Text | Full name. |
| `email` | Text | E-mail address. |
| `license` | License | One of: `MIT`, `BSD2`, `BSD3`, `GPL-2`, `GPL-3`, `LGPL-2.1`, `LGPL-3`, `AGPL-3`, `Apache-2.0`, `MPL-2.0`, `None`. |
| `ghcVersions` | [GHC] | `summoner` uses default `GHC-8.6.4`. However, additionally you can specify other versions. For each version `x.y.z` the `stack-x.y.z.yaml` will be created. |
| `ghcVersions` | [GHC] | `summoner` uses default `GHC-8.6.5`. However, additionally you can specify other versions. For each version `x.y.z` the `stack-x.y.z.yaml` will be created. |
| `github` | Bool | Turn on `GitHub` integration by default? |
| `gitignore` | [Text] | List of files you want added to the default `.gitignore`. (Ignored if `github = false`) |
| `noUpload` | Bool | Do not upload to GitHub, but create all GitHub related files if specified (Ignored if `github = false`) |
Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resolver: lts-13.19
resolver: lts-13.27

packages:
- summoner-cli/
Expand Down
4 changes: 4 additions & 0 deletions summoner-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ The changelog is available [on GitHub][2].
* [#328](https://github.com/kowainik/summoner/issues/328):
Upgrade `tomland` bounds to allow `1.1.0.0`.
* Add `stack.yaml.lock` to `.gitignore` file in the generated project.
* [#318](https://github.com/kowainik/summoner/issues/318):
Support GHC `8.6.5` in generated projects. Use GHC `8.6.5` in Summoner.
* Remove support of GHC `8.6.4`, `8.6.3`, `8.4.3`. Leave only the latest
versions of each major release.

## 1.3.0.1 — Apr 10, 2019

Expand Down
20 changes: 4 additions & 16 deletions summoner-cli/src/Summoner/GhcVer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,20 @@ import qualified Text.Show as Show
-- | Represents some selected set of GHC versions.
data GhcVer
= Ghc7103
| Ghc801
| Ghc802
| Ghc822
| Ghc843
| Ghc844
| Ghc863
| Ghc864
| Ghc865
deriving (Eq, Ord, Show, Enum, Bounded)

-- | Converts 'GhcVer' into dot-separated string.
showGhcVer :: GhcVer -> Text
showGhcVer = \case
Ghc7103 -> "7.10.3"
Ghc801 -> "8.0.1"
Ghc802 -> "8.0.2"
Ghc822 -> "8.2.2"
Ghc843 -> "8.4.3"
Ghc844 -> "8.4.4"
Ghc863 -> "8.6.3"
Ghc864 -> "8.6.4"
Ghc865 -> "8.6.5"

-- | These are old GHC versions that are not working with default GHC versions when using Stack.
oldGhcs :: [GhcVer]
Expand All @@ -54,13 +48,10 @@ parseGhcVer = inverseMap showGhcVer
latestLts :: GhcVer -> Text
latestLts = \case
Ghc7103 -> "6.35"
Ghc801 -> "7.24"
Ghc802 -> "9.21"
Ghc822 -> "11.22"
Ghc843 -> "12.14"
Ghc844 -> "12.26"
Ghc863 -> "13.11"
Ghc864 -> "13.16"
Ghc865 -> "13.27"

-- | Represents PVP versioning (4 numbers).
data Pvp = Pvp
Expand All @@ -78,13 +69,10 @@ instance Show Pvp where
baseVerPvp :: GhcVer -> Pvp
baseVerPvp = \case
Ghc7103 -> Pvp 4 8 0 2
Ghc801 -> Pvp 4 9 0 0
Ghc802 -> Pvp 4 9 1 0
Ghc822 -> Pvp 4 10 1 0
Ghc843 -> Pvp 4 11 1 0
Ghc844 -> Pvp 4 11 1 0
Ghc863 -> Pvp 4 12 0 0
Ghc864 -> Pvp 4 12 0 0
Ghc865 -> Pvp 4 12 0 0

-- | Returns corresponding @base@ version of the given GHC version.
baseVer :: GhcVer -> Text
Expand Down
9 changes: 6 additions & 3 deletions summoner-cli/src/Summoner/Template/Cabal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ cabalFile Settings{..} = File (toString settingsRepo ++ ".cabal") cabalFileConte
libModuleName = packageToModule settingsRepo

testedGhcs :: Text
testedGhcs = intercalateMap ", " (mappend "GHC == " . showGhcVer) settingsTestedVersions
testedGhcs = intercalateMap
("\n" <> T.replicate 19 " " <> ", ")
(mappend "GHC == " . showGhcVer)
settingsTestedVersions

sourceRepository :: Text
sourceRepository =
Expand Down Expand Up @@ -188,11 +191,11 @@ cabalFile Settings{..} = File (toString settingsRepo ++ ".cabal") cabalFileConte

versionGhcOptions :: Text
versionGhcOptions
= memptyIfFalse (settingsTestedVersions `hasLeast` Ghc801)
= memptyIfFalse (settingsTestedVersions `hasLeast` Ghc802)
"-Wredundant-constraints\n"
<> memptyIfFalse (settingsTestedVersions `hasLeast` Ghc822)
"-fhide-source-paths\n"
<> memptyIfFalse (settingsTestedVersions `hasLeast` Ghc843)
<> memptyIfFalse (settingsTestedVersions `hasLeast` Ghc844)
[text|
-Wmissing-export-lists
-Wpartial-fields
Expand Down
8 changes: 4 additions & 4 deletions summoner-cli/src/Summoner/Template/Doc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ docFiles Settings{..} =
readme = unlines $
[ "# " <> settingsRepo
, ""
, hackage
]
++ [licenseBadge | hasLicense]
++ [stackLtsBadge | settingsStack]
++ [stackNightlyBadge | settingsStack]
++ [travisBadge | settingsTravis]
++ [appVeyorBadge | settingsAppVeyor]
++ [hackage]
++ [stackLtsBadge | settingsStack]
++ [stackNightlyBadge | settingsStack]
++ [licenseBadge | hasLicense]
++ [""
, settingsDescription
]
Expand Down
2 changes: 1 addition & 1 deletion summoner-cli/summoner.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ extra-doc-files: README.md
, CHANGELOG.md
tested-with: GHC == 8.2.2
, GHC == 8.4.4
, GHC == 8.6.4
, GHC == 8.6.5
extra-source-files:
test/golden/fullProject/*.yml
test/golden/fullProject/*.yaml
Expand Down
4 changes: 2 additions & 2 deletions summoner-cli/test/Test/Script.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ scriptSpec = describe "script golden tests" $ do
it "correctly creates cabal script" $
scriptFile Ghc844 Cabal `shouldBe` cabalScript
it "correctly creates stack script" $
scriptFile Ghc864 Stack `shouldBe` stackScript
scriptFile Ghc865 Stack `shouldBe` stackScript

cabalScript :: Text
cabalScript = [text|
Expand All @@ -35,7 +35,7 @@ stackScript :: Text
stackScript = [text|
#!/usr/bin/env stack
{- stack
--resolver lts-13.16
--resolver lts-13.27
script
--package base
-}
Expand Down
4 changes: 2 additions & 2 deletions summoner-cli/test/golden/fullProject/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ matrix:
- ghc: 8.0.2
- ghc: 8.2.2
- ghc: 8.4.4
- ghc: 8.6.4
- ghc: 8.6.5

- ghc: 8.2.2
env: STACK_YAML="$TRAVIS_BUILD_DIR/stack-8.2.2.yaml"

- ghc: 8.4.4
env: STACK_YAML="$TRAVIS_BUILD_DIR/stack-8.4.4.yaml"

- ghc: 8.6.4
- ghc: 8.6.5
env: STACK_YAML="$TRAVIS_BUILD_DIR/stack.yaml"

install:
Expand Down
6 changes: 3 additions & 3 deletions summoner-cli/test/golden/fullProject/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# fullProject

[![Build status](https://img.shields.io/travis/kowainik/fullProject.svg?logo=travis)](https://travis-ci.org/kowainik/fullProject)
[![Windows build status](https://ci.appveyor.com/api/projects/status/github/kowainik/fullProject?branch=master&svg=true)](https://ci.appveyor.com/project/kowainik/fullProject)
[![Hackage](https://img.shields.io/hackage/v/fullProject.svg?logo=haskell)](https://hackage.haskell.org/package/fullProject)
[![MIT license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![Stackage Lts](http://stackage.org/package/fullProject/badge/lts)](http://stackage.org/lts/package/fullProject)
[![Stackage Nightly](http://stackage.org/package/fullProject/badge/nightly)](http://stackage.org/nightly/package/fullProject)
[![Build status](https://img.shields.io/travis/kowainik/fullProject.svg?logo=travis)](https://travis-ci.org/kowainik/fullProject)
[![Windows build status](https://ci.appveyor.com/api/projects/status/github/kowainik/fullProject?branch=master&svg=true)](https://ci.appveyor.com/project/kowainik/fullProject)
[![MIT license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

Full test project
5 changes: 4 additions & 1 deletion summoner-cli/test/golden/fullProject/fullProject.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ category: Testing
build-type: Simple
extra-doc-files: README.md
, CHANGELOG.md
tested-with: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.4
tested-with: GHC == 8.0.2
, GHC == 8.2.2
, GHC == 8.4.4
, GHC == 8.6.5

source-repository head
type: git
Expand Down
2 changes: 1 addition & 1 deletion summoner-cli/test/golden/fullProject/stack.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resolver: lts-13.16
resolver: lts-13.27

extra-deps: [base-noprelude-4.12.0.0]

Expand Down
2 changes: 1 addition & 1 deletion summoner-cli/test/golden/smallProject/smallProject.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ copyright: 2018 Kowainik
build-type: Simple
extra-doc-files: README.md
, CHANGELOG.md
tested-with: GHC == 8.6.4
tested-with: GHC == 8.6.5

executable smallProject
hs-source-dirs: app
Expand Down
2 changes: 1 addition & 1 deletion summoner-tui/summoner-tui.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ extra-doc-files: README.md
, CHANGELOG.md
tested-with: GHC == 8.2.2
, GHC == 8.4.4
, GHC == 8.6.4
, GHC == 8.6.5

source-repository head
type: git
Expand Down

0 comments on commit 6aea05e

Please sign in to comment.