Repository navigation
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
78 lines (65 loc) 路 2.28 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
78 lines (65 loc) 路 2.28 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import org.gradle.internal.os.OperatingSystem
tasks {
val uvwPath = if (OperatingSystem.current().isWindows) {
"cmd /c uvw.bat"
} else {
"./uvw"
}
val copyNativeArtifacts by register<CopyNativeArtifactsTask>("copyNativeArtifacts") {
dependsOn(":kson-lib:buildWithGraalVmNativeImage")
}
val build by register<Task>("build") {
dependsOn(copyNativeArtifacts)
}
val test by register<Exec>("test") {
dependsOn(build)
group = "verification"
commandLine = "$uvwPath run pytest".split(" ")
standardOutput = System.out
errorOutput = System.err
isIgnoreExitValue = false
}
val validateReadme by register<Exec>("validateReadme") {
dependsOn(build)
group = "verification"
description = "Validates Python code blocks in readme.md"
commandLine = "$uvwPath run pytest --codeblocks readme.md".split(" ")
standardOutput = System.out
errorOutput = System.err
isIgnoreExitValue = false
}
val typeCheck by register<Exec>("typeCheck") {
group = "verification"
commandLine = "$uvwPath run pyright".split(" ")
standardOutput = System.out
errorOutput = System.err
isIgnoreExitValue = false
}
register<Task>("check") {
dependsOn(test)
dependsOn(validateReadme)
dependsOn(typeCheck)
}
register<Exec>("buildSdist") {
dependsOn("copyLicense")
group = "build"
description = "Build the source distribution, which carries no native library and so builds no wheel"
commandLine = "$uvwPath build --sdist".split(" ")
}
register<Copy>("copyLicense") {
from(rootProject.file("LICENSE"))
into(project.projectDir)
}
register<Exec>("buildWheel") {
dependsOn(copyNativeArtifacts, "copyLicense")
group = "build"
description = "Build platform-specific wheel distribution with cibuildwheel"
commandLine = "$uvwPath run cibuildwheel --platform auto --output-dir dist .".split(" ")
standardOutput = System.out
errorOutput = System.err
isIgnoreExitValue = false
doLast {
println("Successfully built platform-specific wheel using cibuildwheel")
}
}
}