diff --git a/.travis.yml b/.travis.yml
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,64 +1,100 @@
-sudo: false
+# This Travis job script has been generated by a script via
+#
+#   make_travis_yml_2.hs 'twitter-conduit.cabal'
+#
+# For more information, see https://github.com/hvr/multi-ghc-travis
+#
 language: c
+sudo: false
 
+git:
+  submodules: false  # whether to recursively clone submodules
+
+cache:
+  directories:
+    - $HOME/.cabal/packages
+    - $HOME/.cabal/store
+
+before_cache:
+  - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
+  # remove files that are regenerated by 'cabal update'
+  - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*
+  - rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
+  - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache
+  - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
+  - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx
+
 matrix:
   include:
-    - env: GHCVER=7.8.4 STACK_LTS=lts-2 STACK_TEMPLATE=stack-lts-2.yaml
-      addons:
-        apt:
-          sources: [ hvr-ghc ]
-          packages: [ ghc-7.8.4 ]
-    - env: GHCVER=7.10.2 STACK_LTS=lts-3 STACK_TEMPLATE=stack-lts-3.yaml
-      addons:
-        apt:
-          sources: [ hvr-ghc ]
-          packages: [ ghc-7.10.2 ]
-    - env: GHCVER=7.10.3 STACK_LTS=lts-5 STACK_TEMPLATE=stack-lts-5.yaml
-      addons:
-        apt:
-          sources: [ hvr-ghc ]
-          packages: [ ghc-7.10.3 ]
-    - env: GHCVER=7.10.3 STACK_LTS=lts-6 STACK_TEMPLATE=stack-lts-6.yaml
-      addons:
-        apt:
-          sources: [ hvr-ghc ]
-          packages: [ ghc-7.10.3 ]
-    - env: GHCVER=8.0.2 STACK_LTS=lts-8 STACK_TEMPLATE=stack-lts-8.yaml
-      addons:
-        apt:
-          sources: [ hvr-ghc ]
-          packages: [ ghc-8.0.2 ]
-    - env: GHCVER=8.0.2 STACK_LTS=nightly STACK_TEMPLATE=stack-nightly.yaml
-      addons:
-        apt:
-          sources: [ hvr-ghc ]
-          packages: [ ghc-8.0.2 ]
-  allow_failures:
-    - env: GHCVER=8.0.2 STACK_LTS=nightly STACK_TEMPLATE=stack-nightly.yaml
+    - compiler: "ghc-7.8.4"
+    # env: TEST=--disable-tests BENCH=--disable-benchmarks
+      addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.8.4], sources: [hvr-ghc]}}
+    - compiler: "ghc-7.10.3"
+    # env: TEST=--disable-tests BENCH=--disable-benchmarks
+      addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.10.3], sources: [hvr-ghc]}}
+    - compiler: "ghc-8.0.2"
+    # env: TEST=--disable-tests BENCH=--disable-benchmarks
+      addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.2], sources: [hvr-ghc]}}
+    - compiler: "ghc-8.2.1"
+    # env: TEST=--disable-tests BENCH=--disable-benchmarks
+      addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.1], sources: [hvr-ghc]}}
 
 before_install:
-  # Download and unpack the stack executable
-  - mkdir -p ~/.local/bin
-  - export PATH=$HOME/.local/bin:$PATH
-  - travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
-  - export PATH=/opt/ghc/$GHCVER/bin:$PATH
-  # stack searches .cabal file based on STACK_YAML directory.
-  - m4 -D__RESOLVER__=$(curl -sL https://www.stackage.org/download/snapshots.json | jq '."'$STACK_LTS'"' -r) .travis/$STACK_TEMPLATE > stack.yaml
+ - HC=${CC}
+ - HCPKG=${HC/ghc/ghc-pkg}
+ - unset CC
+ - PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$PATH
+ - PKGNAME='twitter-conduit'
 
 install:
-  - travis_wait stack --no-terminal --skip-ghc-check setup
-  - travis_wait stack --no-terminal --skip-ghc-check test --only-snapshot
+ - cabal --version
+ - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
+ - BENCH=${BENCH---enable-benchmarks}
+ - TEST=${TEST---enable-tests}
+ - HADDOCK=${HADDOCK-true}
+ - INSTALLED=${INSTALLED-true}
+ - travis_retry cabal update -v
+ - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
+ - rm -fv cabal.project.local
+ - "echo 'packages: .' > cabal.project"
+ - rm -f cabal.project.freeze
+ - cabal new-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all
+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all
 
+# Here starts the actual work to be performed for the package under test;
+# any command which exits with a non-zero exit code causes the build to fail.
 script:
-  - travis_wait stack --no-terminal --skip-ghc-check test
-  - cat .stack-work/logs/twitter-conduit-*-test.log
+ - if [ -f configure.ac ]; then autoreconf -i; fi
+ - rm -rf .ghc.environment.* dist/
+ - cabal sdist # test that a source-distribution can be generated
+ - cd dist/
+ - SRCTAR=(${PKGNAME}-*.tar.gz)
+ - SRC_BASENAME="${SRCTAR/%.tar.gz}"
+ - tar -xvf "./$SRC_BASENAME.tar.gz"
+ - cd "$SRC_BASENAME/"
+## from here on, CWD is inside the extracted source-tarball
+ - rm -fv cabal.project.local
+ - "echo 'packages: .' > cabal.project"
+ # this builds all libraries and executables (without tests/benchmarks)
+ - rm -f cabal.project.freeze
+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
+ # this builds all libraries and executables (including tests/benchmarks)
+ # - rm -rf ./dist-newstyle
 
-  # tests source distribution package
-  - .travis/check-sdist.sh twitter-conduit
+ # Build with installed constraints for packages in global-db
+ - if $INSTALLED; then
+     ${HCPKG} list --global --simple-output --names-only | sed -r 's/([a-zA-Z0-9-]+*) */--constraint=\1 installed;/g' | sed 's/;$/;all/' | xargs -d ';' cabal new-build -w ${HC} --disable-tests --disable-benchmarks;
+   else echo "Not building with installed constraints"; fi
 
-cache:
-  directories:
-    - ~/.stack
+ # build & run tests, build benchmarks
+ - cabal new-build -w ${HC} ${TEST} ${BENCH} all
+ - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} all; fi
+
+ # haddock
+ - rm -rf ./dist-newstyle
+ - if $HADDOCK; then cabal new-haddock -w ${HC} --disable-tests --disable-benchmarks all; else echo "Skipping haddock generation";fi
+
+# EOF
 
 notifications:
   slack:
diff --git a/.travis/stack-lts-2.yaml b/.travis/stack-lts-2.yaml
--- a/.travis/stack-lts-2.yaml
+++ b/.travis/stack-lts-2.yaml
@@ -3,6 +3,7 @@
 - '.'
 - 'sample'
 extra-deps:
+- cabal-doctest-1.0.2
 - twitter-types-0.7.2.1
 - twitter-types-lens-0.7.2
 resolver: __RESOLVER__
diff --git a/.travis/stack-lts-3.yaml b/.travis/stack-lts-3.yaml
--- a/.travis/stack-lts-3.yaml
+++ b/.travis/stack-lts-3.yaml
@@ -5,6 +5,7 @@
 - '.'
 - 'sample'
 extra-deps:
+- cabal-doctest-1.0.2
 - twitter-types-0.7.2.1
 - twitter-types-lens-0.7.2
 resolver: __RESOLVER__
diff --git a/.travis/stack-lts-5.yaml b/.travis/stack-lts-5.yaml
--- a/.travis/stack-lts-5.yaml
+++ b/.travis/stack-lts-5.yaml
@@ -2,5 +2,6 @@
 packages:
 - '.'
 - 'sample'
-extra-deps: []
+extra-deps:
+- cabal-doctest-1.0.2
 resolver: __RESOLVER__
diff --git a/.travis/stack-lts-6.yaml b/.travis/stack-lts-6.yaml
--- a/.travis/stack-lts-6.yaml
+++ b/.travis/stack-lts-6.yaml
@@ -2,5 +2,6 @@
 packages:
 - '.'
 - 'sample'
-extra-deps: []
+extra-deps:
+- cabal-doctest-1.0.2
 resolver: __RESOLVER__
diff --git a/Setup.hs b/Setup.hs
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,46 +1,23 @@
-#!/usr/bin/env runhaskell
-
--- This code is mostly borrowed from
--- https://github.com/ekmett/lens/blob/4b032a0047f9ecf687947541211487c9d6244f3e/Setup.lhs
-
-import Data.List (nub)
-import Data.Version (showVersion)
-import Distribution.Package (PackageName(PackageName), PackageId, InstalledPackageId, packageVersion, packageName)
-import Distribution.PackageDescription (PackageDescription(), TestSuite(..))
-import Distribution.Simple (defaultMainWithHooks, UserHooks(..), simpleUserHooks)
-import Distribution.Simple.Utils (rewriteFile, createDirectoryIfMissingVerbose)
-import Distribution.Simple.BuildPaths (autogenModulesDir)
-import Distribution.Simple.Setup (BuildFlags(buildVerbosity), fromFlag)
-import Distribution.Simple.LocalBuildInfo (withLibLBI, withTestLBI, LocalBuildInfo(), ComponentLocalBuildInfo(componentPackageDeps))
-import Distribution.Verbosity (Verbosity)
-import System.FilePath ((</>))
-
+{-# LANGUAGE CPP #-}
+module Main (main) where
+#ifndef MIN_VERSION_cabal_doctest
+#define MIN_VERSION_cabal_doctest(x,y,z) 0
+#endif
+#if MIN_VERSION_cabal_doctest(1,0,0)
+import Distribution.Extra.Doctest ( defaultMainWithDoctests )
 main :: IO ()
-main = defaultMainWithHooks hooks
-
-hooks :: UserHooks
-hooks =
-    simpleUserHooks
-    { buildHook = \pkg lbi hooks flags -> do
-           generateBuildModule (fromFlag (buildVerbosity flags)) pkg lbi
-           buildHook simpleUserHooks pkg lbi hooks flags
-    }
-
-generateBuildModule :: Verbosity -> PackageDescription -> LocalBuildInfo -> IO ()
-generateBuildModule verbosity pkg lbi = do
-  let dir = autogenModulesDir lbi
-  createDirectoryIfMissingVerbose verbosity True dir
-  withLibLBI pkg lbi $ \_ libcfg ->
-    withTestLBI pkg lbi $ \suite suitecfg ->
-      rewriteFile (dir </> "Build_" ++ testName suite ++ ".hs") $ unlines
-        [ "module Build_" ++ testName suite ++ " where"
-        , "deps :: [String]"
-        , "deps = " ++ show (formatdeps (testDeps libcfg suitecfg))
-        ]
-  where
-    formatdeps = map (formatone . snd)
-    formatone p = case packageName p of
-      PackageName n -> n ++ "-" ++ showVersion (packageVersion p)
+main = defaultMainWithDoctests "doctests"
+#else
+#ifdef MIN_VERSION_Cabal
+-- If the macro is defined, we have new cabal-install,
+-- but for some reason we don't have cabal-doctest in package-db
+--
+-- Probably we are running cabal sdist, when otherwise using new-build
+-- workflow
+import Warning ()
+#endif
+import Distribution.Simple
+main :: IO ()
+main = defaultMain
+#endif
 
-testDeps :: ComponentLocalBuildInfo -> ComponentLocalBuildInfo -> [(InstalledPackageId, PackageId)]
-testDeps xs ys = nub $ componentPackageDeps xs ++ componentPackageDeps ys
diff --git a/tests/doctests.hs b/tests/doctests.hs
--- a/tests/doctests.hs
+++ b/tests/doctests.hs
@@ -1,19 +1,12 @@
 module Main where
 
-import Build_doctests (deps)
-import Test.DocTest
-import Data.Maybe
-import System.Environment
+import Build_doctests (flags, pkgs, module_sources)
+import Data.Foldable (traverse_)
+import Test.DocTest (doctest)
 
+main :: IO ()
 main = do
-  env <- getEnvironment
-  let dist = fromMaybe "dist" $ lookup "HASKELL_DIST_DIR" env
-      autogenDir = dist ++ "/build/autogen"
-      args = [ "-i."
-             , "-i" ++ autogenDir
-             , "-optP-include"
-             , "-optP" ++ autogenDir ++ "/cabal_macros.h"
-             , "-hide-all-packages"
-             ] ++ map ("-package=" ++) deps
-      sources = ["Web/Twitter/Conduit.hs"]
-  doctest $ args ++ sources
+    traverse_ putStrLn args -- optionally print arguments
+    doctest args
+  where
+    args = flags ++ pkgs ++ module_sources
diff --git a/twitter-conduit.cabal b/twitter-conduit.cabal
--- a/twitter-conduit.cabal
+++ b/twitter-conduit.cabal
@@ -1,5 +1,5 @@
 name:              twitter-conduit
-version:           0.2.2.1
+version:           0.2.2.2
 license:           BSD3
 license-file:      LICENSE
 author:            HATTORI Hiroki, Hideyuki Tanaka, Takahiro HIMURA
@@ -7,10 +7,12 @@
 synopsis:          Twitter API package with conduit interface and Streaming API support.
 category:          Web, Conduit
 stability:         Experimental
-cabal-version:     >= 1.8
+cabal-version:     >= 1.10
 build-type:        Custom
 homepage:          https://github.com/himura/twitter-conduit
 
+tested-with:       GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.1
+
 description:
   This package provides bindings to Twitter's APIs (see <https://dev.twitter.com/>).
   .
@@ -98,6 +100,8 @@
     Web.Twitter.Conduit.Parameters
     Web.Twitter.Conduit.Parameters.TH
 
+  default-language: Haskell2010
+
 test-suite hlint
   type: exitcode-stdio-1.0
   main-is: hlint.hs
@@ -107,6 +111,8 @@
       base
     , hlint >= 1.7
 
+  default-language: Haskell2010
+
 test-suite doctests
   type: exitcode-stdio-1.0
   main-is: doctests.hs
@@ -116,6 +122,8 @@
       base
     , doctest
 
+  default-language: Haskell2010
+
 test-suite spec_main
   type: exitcode-stdio-1.0
   main-is: spec_main.hs
@@ -124,6 +132,7 @@
   if flag(run-integrated-test)
     CPP-Options: -DRUN_INTEGRATED_TEST
 
+  build-tool-depends: hspec-discover:hspec-discover >= 2.3.0 && < 2.5
   build-depends:
       base >= 4.5 && < 5
     , template-haskell
@@ -162,3 +171,11 @@
     BaseSpec
     StatusSpec
     TestUtils
+
+  default-language: Haskell2010
+
+custom-setup
+  setup-depends:
+    base >= 4.5 && <5,
+    Cabal >= 1.24,
+    cabal-doctest >= 1 && < 1.1
