all repos — hastysite @ 0bcab10fa39e7c7db36bef1c43d800951a9a668a

A high-performance static site generator.

hastysite.nimble

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
import config

# Package
version       = pkgVersion
author        = pkgAuthor
description   = pkgDescription
license       = "MIT"
bin           = @["hastysite"]

# Deps
requires: "nim >= 1.4.4, zippy >= 0.5.6"

before install:
  exec "nimble install -y nifty"
  exec "nifty remove -f"
  exec "nifty install"

# Tasks
const
  compile = "nim c -d:release"
  linux_x64 = "--cpu:amd64 --os:linux"
  windows_x64 = "--cpu:amd64 --os:windows"
  macosx_x64 = ""
  #parallel = "--parallelBuild:1 --verbosity:3"
  hs = "hastysite"
  hs_file = "hastysite.nim"
  zip = "zip -X"

proc shell(command, args: string, dest = "") =
  exec command & " " & args & " " & dest

proc filename_for(os: string, arch: string): string =
  return "hastysite" & "_v" & version & "_" & os & "_" & arch & ".zip"

task windows_x64_build, "Build hastysite for Windows (x64)":
  shell compile, windows_x64, hs_file

task linux_x64_build, "Build hastysite for Linux (x64)":
  shell compile, linux_x64,  hs_file
  
task macosx_x64_build, "Build hastysite for Mac OS X (x64)":
  shell compile, macosx_x64, hs_file

task release, "Release hastysite":
  echo "\n\n\n WINDOWS - x64:\n\n"
  windows_x64_buildTask()
  shell zip, filename_for("windows", "x64"), hs & ".exe"
  shell "rm", hs & ".exe"
  echo "\n\n\n LINUX - x64:\n\n"
  linux_x64_buildTask()
  shell zip, filename_for("linux", "x64"), hs 
  shell "rm", hs 
  echo "\n\n\n MAC OS X - x64:\n\n"
  macosx_x64_buildTask()
  shell zip, filename_for("macosx", "x64"), hs 
  shell "rm", hs 
  echo "\n\n\n ALL DONE!"