From 7cde3d4bdbe454c3a5cb31daa4aa90bdd7562095 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 20 Mar 2013 08:58:27 +0200 Subject: [PATCH] Put binaries into yesod-bin (fixes #514) --- sources.txt | 1 + {yesod => yesod-bin}/AddHandler.hs | 0 {yesod => yesod-bin}/Build.hs | 0 {yesod => yesod-bin}/Devel.hs | 0 {yesod => yesod-bin}/GhcBuild.hs | 0 {yesod => yesod-bin}/Keter.hs | 0 yesod-bin/LICENSE | 20 ++++ {yesod => yesod-bin}/Options.hs | 0 .../Scaffolding/Scaffolder.hs | 0 yesod-bin/Setup.lhs | 7 ++ {yesod => yesod-bin}/ghcwrapper.hs | 0 {yesod => yesod-bin}/hsfiles/mongo.hsfiles | 0 {yesod => yesod-bin}/hsfiles/mysql.hsfiles | 0 .../hsfiles/postgres-fay.hsfiles | 0 {yesod => yesod-bin}/hsfiles/postgres.hsfiles | 0 {yesod => yesod-bin}/hsfiles/simple.hsfiles | 0 {yesod => yesod-bin}/hsfiles/sqlite.hsfiles | 0 {yesod => yesod-bin}/input/database.cg | 0 {yesod => yesod-bin}/input/done.cg | 0 {yesod => yesod-bin}/input/welcome.cg | 0 {yesod => yesod-bin}/main.hs | 7 +- {yesod => yesod-bin}/update-hsfiles.sh | 0 yesod-bin/yesod-bin.cabal | 103 ++++++++++++++++++ yesod-platform/make-cabal.sh | 2 +- yesod/static/script.js | 3 - yesod/static/style.css | 12 -- yesod/static/style2.css | 3 - yesod/test/mongodb-input.txt | 4 - yesod/test/mysql-input.txt | 3 - yesod/test/postgresql-input.txt | 3 - yesod/test/run.sh | 12 -- yesod/test/scaffold.sh | 19 ---- yesod/test/scaffold.shelltest | 33 ------ yesod/test/scaffold_test.sh | 6 - yesod/test/sqlite-input.txt | 3 - yesod/test/tiny-input.txt | 4 - yesod/yesod.cabal | 83 -------------- 37 files changed, 134 insertions(+), 194 deletions(-) rename {yesod => yesod-bin}/AddHandler.hs (100%) rename {yesod => yesod-bin}/Build.hs (100%) rename {yesod => yesod-bin}/Devel.hs (100%) rename {yesod => yesod-bin}/GhcBuild.hs (100%) rename {yesod => yesod-bin}/Keter.hs (100%) create mode 100644 yesod-bin/LICENSE rename {yesod => yesod-bin}/Options.hs (100%) rename {yesod => yesod-bin}/Scaffolding/Scaffolder.hs (100%) create mode 100755 yesod-bin/Setup.lhs rename {yesod => yesod-bin}/ghcwrapper.hs (100%) rename {yesod => yesod-bin}/hsfiles/mongo.hsfiles (100%) rename {yesod => yesod-bin}/hsfiles/mysql.hsfiles (100%) rename {yesod => yesod-bin}/hsfiles/postgres-fay.hsfiles (100%) rename {yesod => yesod-bin}/hsfiles/postgres.hsfiles (100%) rename {yesod => yesod-bin}/hsfiles/simple.hsfiles (100%) rename {yesod => yesod-bin}/hsfiles/sqlite.hsfiles (100%) rename {yesod => yesod-bin}/input/database.cg (100%) rename {yesod => yesod-bin}/input/done.cg (100%) rename {yesod => yesod-bin}/input/welcome.cg (100%) rename {yesod => yesod-bin}/main.hs (96%) rename {yesod => yesod-bin}/update-hsfiles.sh (100%) create mode 100644 yesod-bin/yesod-bin.cabal delete mode 100644 yesod/static/script.js delete mode 100644 yesod/static/style.css delete mode 100644 yesod/static/style2.css delete mode 100644 yesod/test/mongodb-input.txt delete mode 100644 yesod/test/mysql-input.txt delete mode 100644 yesod/test/postgresql-input.txt delete mode 100755 yesod/test/run.sh delete mode 100755 yesod/test/scaffold.sh delete mode 100644 yesod/test/scaffold.shelltest delete mode 100644 yesod/test/scaffold_test.sh delete mode 100644 yesod/test/sqlite-input.txt delete mode 100644 yesod/test/tiny-input.txt diff --git a/sources.txt b/sources.txt index f07f1d52..415fc37e 100644 --- a/sources.txt +++ b/sources.txt @@ -7,4 +7,5 @@ ./yesod-auth ./yesod-sitemap ./yesod-test +./yesod-bin ./yesod diff --git a/yesod/AddHandler.hs b/yesod-bin/AddHandler.hs similarity index 100% rename from yesod/AddHandler.hs rename to yesod-bin/AddHandler.hs diff --git a/yesod/Build.hs b/yesod-bin/Build.hs similarity index 100% rename from yesod/Build.hs rename to yesod-bin/Build.hs diff --git a/yesod/Devel.hs b/yesod-bin/Devel.hs similarity index 100% rename from yesod/Devel.hs rename to yesod-bin/Devel.hs diff --git a/yesod/GhcBuild.hs b/yesod-bin/GhcBuild.hs similarity index 100% rename from yesod/GhcBuild.hs rename to yesod-bin/GhcBuild.hs diff --git a/yesod/Keter.hs b/yesod-bin/Keter.hs similarity index 100% rename from yesod/Keter.hs rename to yesod-bin/Keter.hs diff --git a/yesod-bin/LICENSE b/yesod-bin/LICENSE new file mode 100644 index 00000000..d9f04179 --- /dev/null +++ b/yesod-bin/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2012 Michael Snoyman, http://www.yesodweb.com/ + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/yesod/Options.hs b/yesod-bin/Options.hs similarity index 100% rename from yesod/Options.hs rename to yesod-bin/Options.hs diff --git a/yesod/Scaffolding/Scaffolder.hs b/yesod-bin/Scaffolding/Scaffolder.hs similarity index 100% rename from yesod/Scaffolding/Scaffolder.hs rename to yesod-bin/Scaffolding/Scaffolder.hs diff --git a/yesod-bin/Setup.lhs b/yesod-bin/Setup.lhs new file mode 100755 index 00000000..06e2708f --- /dev/null +++ b/yesod-bin/Setup.lhs @@ -0,0 +1,7 @@ +#!/usr/bin/env runhaskell + +> module Main where +> import Distribution.Simple + +> main :: IO () +> main = defaultMain diff --git a/yesod/ghcwrapper.hs b/yesod-bin/ghcwrapper.hs similarity index 100% rename from yesod/ghcwrapper.hs rename to yesod-bin/ghcwrapper.hs diff --git a/yesod/hsfiles/mongo.hsfiles b/yesod-bin/hsfiles/mongo.hsfiles similarity index 100% rename from yesod/hsfiles/mongo.hsfiles rename to yesod-bin/hsfiles/mongo.hsfiles diff --git a/yesod/hsfiles/mysql.hsfiles b/yesod-bin/hsfiles/mysql.hsfiles similarity index 100% rename from yesod/hsfiles/mysql.hsfiles rename to yesod-bin/hsfiles/mysql.hsfiles diff --git a/yesod/hsfiles/postgres-fay.hsfiles b/yesod-bin/hsfiles/postgres-fay.hsfiles similarity index 100% rename from yesod/hsfiles/postgres-fay.hsfiles rename to yesod-bin/hsfiles/postgres-fay.hsfiles diff --git a/yesod/hsfiles/postgres.hsfiles b/yesod-bin/hsfiles/postgres.hsfiles similarity index 100% rename from yesod/hsfiles/postgres.hsfiles rename to yesod-bin/hsfiles/postgres.hsfiles diff --git a/yesod/hsfiles/simple.hsfiles b/yesod-bin/hsfiles/simple.hsfiles similarity index 100% rename from yesod/hsfiles/simple.hsfiles rename to yesod-bin/hsfiles/simple.hsfiles diff --git a/yesod/hsfiles/sqlite.hsfiles b/yesod-bin/hsfiles/sqlite.hsfiles similarity index 100% rename from yesod/hsfiles/sqlite.hsfiles rename to yesod-bin/hsfiles/sqlite.hsfiles diff --git a/yesod/input/database.cg b/yesod-bin/input/database.cg similarity index 100% rename from yesod/input/database.cg rename to yesod-bin/input/database.cg diff --git a/yesod/input/done.cg b/yesod-bin/input/done.cg similarity index 100% rename from yesod/input/done.cg rename to yesod-bin/input/done.cg diff --git a/yesod/input/welcome.cg b/yesod-bin/input/welcome.cg similarity index 100% rename from yesod/input/welcome.cg rename to yesod-bin/input/welcome.cg diff --git a/yesod/main.hs b/yesod-bin/main.hs similarity index 96% rename from yesod/main.hs rename to yesod-bin/main.hs index 2188ebf3..e8c5637e 100755 --- a/yesod/main.hs +++ b/yesod-bin/main.hs @@ -8,13 +8,11 @@ import Options.Applicative import System.Exit (ExitCode (ExitSuccess), exitWith) import System.Process (rawSystem) -import Yesod.Core (yesodVersion) - import AddHandler (addHandler) import Devel (DevelOpts (..), devel) import Keter (keter) import Options (injectDefaults) -import qualified Paths_yesod +import qualified Paths_yesod_bin import Scaffolding.Scaffolder import Options.Applicative.Builder.Internal (Mod, OptionFields) @@ -96,8 +94,7 @@ main = do Touch -> touch' Devel da s f r b _ig es p t -> devel (DevelOpts (optCabalPgm o == CabalDev) da (optVerbose o) r s f b p t) es Keter noRebuild -> keter (cabalCommand o) noRebuild - Version -> do putStrLn ("yesod-core version:" ++ yesodVersion) - putStrLn ("yesod version:" ++ showVersion Paths_yesod.version) + Version -> do putStrLn ("yesod-bin version: " ++ showVersion Paths_yesod_bin.version) AddHandler -> addHandler Test -> do touch' cabal ["configure", "--enable-tests", "-flibrary-only"] diff --git a/yesod/update-hsfiles.sh b/yesod-bin/update-hsfiles.sh similarity index 100% rename from yesod/update-hsfiles.sh rename to yesod-bin/update-hsfiles.sh diff --git a/yesod-bin/yesod-bin.cabal b/yesod-bin/yesod-bin.cabal new file mode 100644 index 00000000..b4257db9 --- /dev/null +++ b/yesod-bin/yesod-bin.cabal @@ -0,0 +1,103 @@ +name: yesod-bin +version: 1.2.0 +license: MIT +license-file: LICENSE +author: Michael Snoyman +maintainer: Michael Snoyman +synopsis: The yesod helper executable. +description: Provides scaffolding, devel server, and some simple code generation helpers. +category: Web, Yesod +stability: Stable +cabal-version: >= 1.6 +build-type: Simple +homepage: http://www.yesodweb.com/ + +extra-source-files: + input/*.cg + hsfiles/mongo.hsfiles + hsfiles/mysql.hsfiles + hsfiles/postgres.hsfiles + hsfiles/postgres-fay.hsfiles + hsfiles/simple.hsfiles + hsfiles/sqlite.hsfiles + +executable yesod-ghc-wrapper + main-is: ghcwrapper.hs + build-depends: + base >= 4 && < 5 + , Cabal + +executable yesod-ld-wrapper + main-is: ghcwrapper.hs + cpp-options: -DLDCMD + build-depends: + base >= 4 && < 5 + , Cabal +executable yesod-ar-wrapper + main-is: ghcwrapper.hs + cpp-options: -DARCMD + build-depends: + base >= 4 && < 5 + , Cabal + +executable yesod + if os(windows) + cpp-options: -DWINDOWS + build-depends: base >= 4.3 && < 5 + , ghc >= 7.0.3 && < 7.8 + , ghc-paths >= 0.1 + , parsec >= 2.1 && < 4 + , text >= 0.11 + , shakespeare-text >= 1.0 && < 1.1 + , shakespeare >= 1.0.2 && < 1.1 + , shakespeare-js >= 1.0.2 && < 1.2 + , shakespeare-css >= 1.0.2 && < 1.1 + , bytestring >= 0.9.1.4 + , time >= 1.1.4 + , template-haskell + , directory >= 1.0 + , Cabal + , unix-compat >= 0.2 && < 0.5 + , containers >= 0.2 + , attoparsec >= 0.10 + , http-types >= 0.7 + , blaze-builder >= 0.2.1.4 && < 0.4 + , filepath >= 1.1 + , process + , zlib >= 0.5 && < 0.6 + , tar >= 0.4 && < 0.5 + , system-filepath >= 0.4 && < 0.5 + , system-fileio >= 0.3 && < 0.4 + , unordered-containers + , yaml >= 0.8 && < 0.9 + , optparse-applicative >= 0.5 + , fsnotify >= 0.0 && < 0.1 + , split >= 0.2 && < 0.3 + , file-embed + , conduit >= 0.5 && < 1.1 + , resourcet >= 0.3 && < 0.5 + , base64-bytestring + , lifted-base + , http-reverse-proxy >= 0.1.1 + , network + , http-conduit + , network-conduit + , project-template >= 0.1.1 + , transformers + , warp >= 1.3.7.5 + , wai >= 1.4 + + ghc-options: -Wall -threaded + main-is: main.hs + other-modules: Scaffolding.Scaffolder + Devel + Build + GhcBuild + Keter + AddHandler + Paths_yesod_bin + Options + +source-repository head + type: git + location: https://github.com/yesodweb/yesod diff --git a/yesod-platform/make-cabal.sh b/yesod-platform/make-cabal.sh index 3525dd94..7ba1d387 100755 --- a/yesod-platform/make-cabal.sh +++ b/yesod-platform/make-cabal.sh @@ -7,4 +7,4 @@ then cabal install cabal-nirvana -fgenerate fi -cabal-nirvana-generate yesod yesod-static yesod-default hjsmin blaze-html yesod-test | runghc to-cabal.hs > yesod-platform.cabal +cabal-nirvana-generate yesod yesod-static yesod-default yesod-bin hjsmin blaze-html yesod-test | runghc to-cabal.hs > yesod-platform.cabal diff --git a/yesod/static/script.js b/yesod/static/script.js deleted file mode 100644 index 43c21a53..00000000 --- a/yesod/static/script.js +++ /dev/null @@ -1,3 +0,0 @@ -$(function(){ - $("p.noscript").hide(); -}); diff --git a/yesod/static/style.css b/yesod/static/style.css deleted file mode 100644 index d09c6b08..00000000 --- a/yesod/static/style.css +++ /dev/null @@ -1,12 +0,0 @@ -body { - font-family: sans-serif; - background: #eee; -} - -#wrapper { - width: 760px; - margin: 1em auto; - border: 2px solid #000; - padding: 0.5em; - background: #fff; -} diff --git a/yesod/static/style2.css b/yesod/static/style2.css deleted file mode 100644 index 853ac29a..00000000 --- a/yesod/static/style2.css +++ /dev/null @@ -1,3 +0,0 @@ -body { - font-family: sans-serif; -} diff --git a/yesod/test/mongodb-input.txt b/yesod/test/mongodb-input.txt deleted file mode 100644 index f0f40400..00000000 --- a/yesod/test/mongodb-input.txt +++ /dev/null @@ -1,4 +0,0 @@ -Michael -foobar -Foobar -mongo diff --git a/yesod/test/mysql-input.txt b/yesod/test/mysql-input.txt deleted file mode 100644 index 6e49d571..00000000 --- a/yesod/test/mysql-input.txt +++ /dev/null @@ -1,3 +0,0 @@ -Michael -foobar -mysql diff --git a/yesod/test/postgresql-input.txt b/yesod/test/postgresql-input.txt deleted file mode 100644 index 5689ebb3..00000000 --- a/yesod/test/postgresql-input.txt +++ /dev/null @@ -1,3 +0,0 @@ -Michael -foobar -p diff --git a/yesod/test/run.sh b/yesod/test/run.sh deleted file mode 100755 index 7095acda..00000000 --- a/yesod/test/run.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -cat << EOF - -You're using the deprecated ./test/run.sh. This file will be removed -soon in favor of ../scripts/runtests. - -Running ../scripts/runtests... - -EOF - -../scripts/runtests "$@" diff --git a/yesod/test/scaffold.sh b/yesod/test/scaffold.sh deleted file mode 100755 index 92210188..00000000 --- a/yesod/test/scaffold.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -ex - -runghc -i. -idist/build/autogen main.hs init - -( - cd foobar - cabal configure --disable-optimization || cabal install - cabal build - cabal clean - cabal configure -fdev --disable-optimization - cabal build - cabal clean - cabal configure -flibrary-only --disable-optimization - cabal build - cabal clean - cabal configure --enable-tests - cabal build - cabal test -) diff --git a/yesod/test/scaffold.shelltest b/yesod/test/scaffold.shelltest deleted file mode 100644 index 39ccefd9..00000000 --- a/yesod/test/scaffold.shelltest +++ /dev/null @@ -1,33 +0,0 @@ -# Not using this currently! -# -# Important! run with test/run.sh - -rm -rf foobar && runghc main.hs init && cd foobar && cabal install && cabal install -fdevel && cd .. -<<< -Michael -foobar - -Foobar -t ->>> /.*Registering foobar-0.0.0.*/ ->>>= 0 - -rm -rf foobar && runghc main.hs init && cd foobar && cabal install && cabal install -fdevel && cd .. -<<< -Michael -foobar - -Foobar -s ->>> /.*Registering foobar-0.0.0.*/ ->>>= 0 - -rm -rf foobar && runghc main.hs init && cd foobar && cabal install && cabal install -fdevel && cd .. && rm -rf foobar -<<< -Michael -foobar - -Foobar -p ->>> /.*Registering foobar-0.0.0.*/ ->>>= 0 diff --git a/yesod/test/scaffold_test.sh b/yesod/test/scaffold_test.sh deleted file mode 100644 index f30bfb12..00000000 --- a/yesod/test/scaffold_test.sh +++ /dev/null @@ -1,6 +0,0 @@ -setup() { rm -rf foobar; } -teardown() { rm -rf foobar; ghc-pkg unregister foobar &>/dev/null; } - -test_sqlite() { ../test/scaffold.sh < ../test/sqlite-input.txt ; } -test_postgresql() { ../test/scaffold.sh < ../test/postgresql-input.txt; } -test_mongodb() { ../test/scaffold.sh < ../test/mongodb-input.txt ; } diff --git a/yesod/test/sqlite-input.txt b/yesod/test/sqlite-input.txt deleted file mode 100644 index 32257967..00000000 --- a/yesod/test/sqlite-input.txt +++ /dev/null @@ -1,3 +0,0 @@ -Michael -foobar -s diff --git a/yesod/test/tiny-input.txt b/yesod/test/tiny-input.txt deleted file mode 100644 index fb1fe817..00000000 --- a/yesod/test/tiny-input.txt +++ /dev/null @@ -1,4 +0,0 @@ -Michael -foobar -Foobar -t diff --git a/yesod/yesod.cabal b/yesod/yesod.cabal index f5c2dcbf..91dd4ef2 100644 --- a/yesod/yesod.cabal +++ b/yesod/yesod.cabal @@ -17,15 +17,6 @@ cabal-version: >= 1.6 build-type: Simple homepage: http://www.yesodweb.com/ -extra-source-files: - input/*.cg - hsfiles/mongo.hsfiles - hsfiles/mysql.hsfiles - hsfiles/postgres.hsfiles - hsfiles/postgres-fay.hsfiles - hsfiles/simple.hsfiles - hsfiles/sqlite.hsfiles - library build-depends: base >= 4.3 && < 5 , yesod-core >= 1.2 && < 1.3 @@ -56,80 +47,6 @@ library if !os(windows) build-depends: unix -executable yesod-ghc-wrapper - main-is: ghcwrapper.hs - build-depends: - base >= 4 && < 5 - , Cabal - -executable yesod-ld-wrapper - main-is: ghcwrapper.hs - cpp-options: -DLDCMD - build-depends: - base >= 4 && < 5 - , Cabal -executable yesod-ar-wrapper - main-is: ghcwrapper.hs - cpp-options: -DARCMD - build-depends: - base >= 4 && < 5 - , Cabal - -executable yesod - if os(windows) - cpp-options: -DWINDOWS - build-depends: base >= 4.3 && < 5 - , ghc >= 7.0.3 && < 7.8 - , ghc-paths >= 0.1 - , parsec >= 2.1 && < 4 - , text >= 0.11 - , shakespeare-text >= 1.0 && < 1.1 - , shakespeare >= 1.0.2 && < 1.1 - , shakespeare-js >= 1.0.2 && < 1.2 - , shakespeare-css >= 1.0.2 && < 1.1 - , bytestring >= 0.9.1.4 - , time >= 1.1.4 - , template-haskell - , directory >= 1.0 - , Cabal - , unix-compat >= 0.2 && < 0.5 - , containers >= 0.2 - , attoparsec >= 0.10 - , http-types >= 0.7 - , blaze-builder >= 0.2.1.4 && < 0.4 - , filepath >= 1.1 - , process - , zlib >= 0.5 && < 0.6 - , tar >= 0.4 && < 0.5 - , system-filepath >= 0.4 && < 0.5 - , system-fileio >= 0.3 && < 0.4 - , unordered-containers - , yaml >= 0.8 && < 0.9 - , optparse-applicative >= 0.5 - , fsnotify >= 0.0 && < 0.1 - , split >= 0.2 && < 0.3 - , file-embed - , conduit >= 0.5 && < 1.1 - , resourcet >= 0.3 && < 0.5 - , base64-bytestring - , lifted-base - , http-reverse-proxy >= 0.1.1 - , network - , http-conduit - , network-conduit - , project-template >= 0.1.1 - - ghc-options: -Wall -threaded - main-is: main.hs - other-modules: Scaffolding.Scaffolder - Devel - Build - GhcBuild - Keter - AddHandler - Paths_yesod - Options - source-repository head type: git location: https://github.com/yesodweb/yesod