12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- # Package
- version = "0.1.0"
- author = "NerdRat"
- description = "A reservoir of useful karax components for SPA's."
- license = "GPL-3.0"
- srcDir = "src"
- bin = @["karax_components"]
- # Dependencies
- requires "nim >= 1.0.0", "karax >= 1.1.0", "jester >= 0.4.3"
- proc logMessage(message: string) =
- echo "\e[1;37m[\e[m\e[1;32mINFO\e[m\e[1;37m]\e[m: $1." % [message]
- task clean, "Clean all produced files and directories.":
- logMessage("Cleaning build files")
- if dirExists("public"):
- rmDir("public")
- logMessage("Removed dir public")
-
- if fileExists(bin[0]):
- rmFile(bin[0])
- logMessage("Removed binary $1" % [bin[0]])
- if fileExists("assets"):
- rmFile("assets")
- logMessage("Removed assets")
- task getAssets, "Install external frontend assets.":
- logMessage("Getting external assets")
- exec "nimble c src/assets.nim -d:ssl -o:./assets"
- exec "./assets"
- logMessage("Finished downloading assets")
- task buildFrontend, "Build frontend files.":
- logMessage("Building frontend")
- if not dirExists("public"):
- getAssetsTask()
- # Build frontend files in src dir.
- exec "nimble js --o:public/js/app.js src/client/index.nim"
- logMessage("Finished building frontend")
- task buildAll, "Build backend and frontend.":
- logMessage("Building everything")
- cleanTask()
- buildFrontendTask()
- exec("nimble build")
- logMessage("Built everything")
|