Permalink
Browse files

Initial commit

  • Loading branch information...
jystic committed Sep 25, 2011
0 parents commit bd572675350e65f1a241ad2339a7a56e70516eb2
Showing with 111 additions and 0 deletions.
  1. +6 −0 .gitignore
  2. +30 −0 LICENSE
  3. +2 −0 Setup.hs
  4. +22 −0 quick-version.cabal
  5. +47 −0 rakefile
  6. +4 −0 src/Main.hs
@@ -0,0 +1,6 @@
+/dist/
+*.aux
+*.hp
+*.prof
+*.ps
+*.swp
30 LICENSE
@@ -0,0 +1,30 @@
+Copyright (c) 2011, Jacob Stanley
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+
+ * Neither the name of Jacob Stanley <jacob@stanley.io> nor the names of other
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,2 @@
+import Distribution.Simple
+main = defaultMain
@@ -0,0 +1,22 @@
+name: quick-version
+version: 0.1
+synopsis: Summarises a package's semantics using QuickCheck to test its functions.
+description: Summarises a package's semantics using QuickCheck to test its functions.
+
+homepage: http://github.com/jystic/quick-version
+license: BSD3
+license-file: LICENSE
+author: Jacob Stanley
+maintainer: Jacob Stanley <jacob@stanley.io>
+copyright: Copyright (c) 2011, Jacob Stanley
+category: Testing
+build-type: Simple
+cabal-version: >=1.2
+
+executable quickver
+ hs-source-dirs: src
+ main-is: Main.hs
+
+ build-depends:
+ base == 4.*
+ , QuickCheck == 2.4.*
@@ -0,0 +1,47 @@
+Dir.chdir File.dirname(__FILE__)
+
+CABAL = "quick-version.cabal"
+CFG = 'dist/setup-config'
+
+APP = "dist/build/quickver/quickver"
+SRC = FileList['src/**/*.hs', 'benchmark/**/*.hs']
+OBJ = FileList['src/**/*.hi', 'benchmark/**/*.hi', 'src/**/*.o', 'benchmark/**/*.o']
+
+
+########################################################################
+# Build
+
+task :default => :build
+
+task :deps do
+ sh 'cabal update'
+ sh 'cabal install -fbench --only-dependencies'
+end
+
+task :clean do
+ sh 'cabal clean'
+ rm_rf OBJ
+ rm_rf "#{APP}*"
+end
+
+file CFG => CABAL do
+ rm_rf CFG
+ sh "cabal configure"
+end
+
+file APP => SRC + [CFG] do
+ sh 'cabal build'
+end
+
+task :build => APP
+
+task :docs => CFG do
+ system 'cabal haddock --executables'
+
+ index = FileList['dist/doc/html/**/index.html'][0]
+ system "xdg-open #{index}"
+end
+
+task :run, :path, :needs => :build do |_, args|
+ system APP, args[:path]
+end
@@ -0,0 +1,4 @@
+module Main (main) where
+
+main :: IO ()
+main = putStrLn "Quick Version 0.1"

0 comments on commit bd57267

Please sign in to comment.