-
Notifications
You must be signed in to change notification settings - Fork 0
/
xgboost.nimble
59 lines (47 loc) · 1.48 KB
/
xgboost.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
58
59
# Package
version = "0.1.3"
author = "Jack Tang"
description = "Nim wrapper for libxgboost"
license = "MIT"
srcDir = "src"
# Dependencies
requires "nim >= 1.4.0"
task clone_xgboost, "clone xgboost":
exec "git clone --depth 1 --branch v1.4.1 https://github.com/dmlc/xgboost.git xgboost"
withDir "xgboost":
exec "git submodule init"
exec "git submodule update"
task build_xgboost, "build xgboost":
exec "mkdir -p xgboost/build"
withDir "xgboost/build":
exec "cmake .."
exec "make"
proc updateNimbleVersion(ver: string) =
let fname = currentSourcePath()
let txt = readFile(fname)
var lines = txt.split("\n")
for i, line in lines:
if line.startsWith("version"):
let s = line.find('"')
let e = line.find('"', s+1)
lines[i] = line[0..s] & ver & line[e..<line.len]
break
writeFile(fname, lines.join("\n"))
task version, "update version":
# last params as version
let ver = paramStr( paramCount() )
if ver == "version":
# print current version
echo version
else:
withDir thisDir():
updateNimbleVersion(ver)
task gendoc, "generate docs":
exec "nim doc --out:docs --project src/xgboost.nim"
mvFile "docs/theindex.html", "docs/index.html"
task release_patch, "release with patch increment":
exec "release-it --ci -i patch"
task release_minor, "releaes with minor increment":
exec "release-it --ci -i minor"
task release_major, "release with major increment":
exec "release-it --ci -i major"