add native to build
This commit is contained in:
parent
2e2c9bc615
commit
e3df3ef450
1 changed files with 49 additions and 0 deletions
49
build.py
49
build.py
|
@ -108,6 +108,39 @@ def package_uberjar(project):
|
|||
)
|
||||
|
||||
|
||||
@task
|
||||
def package_native(project):
|
||||
run(
|
||||
"mkdir -p target/graalvm",
|
||||
shell=True,
|
||||
check=True,
|
||||
)
|
||||
run(
|
||||
"native-image " +
|
||||
"--native-image-info " +
|
||||
"--report-unsupported-elements-at-runtime " +
|
||||
"--no-server " +
|
||||
"--no-fallback " +
|
||||
"--features=clj_easy.graal_build_time.InitClojureClasses " +
|
||||
f"-jar target/uberjar/{project.name}-standalone.jar " +
|
||||
"-H:IncludeResources=.*.yaml " +
|
||||
"-H:Log=registerResource:verbose " +
|
||||
f"-H:Name=target/graalvm/{project.name}",
|
||||
shell=True,
|
||||
check=True,
|
||||
)
|
||||
run(
|
||||
f"sha256sum target/graalvm/{project.name} > target/graalvm/{project.name}.sha256",
|
||||
shell=True,
|
||||
check=True,
|
||||
)
|
||||
run(
|
||||
f"sha512sum target/graalvm/{project.name} > target/graalvm/{project.name}.sha512",
|
||||
shell=True,
|
||||
check=True,
|
||||
)
|
||||
|
||||
|
||||
@task
|
||||
def upload_clj(project):
|
||||
run("lein deploy", shell=True, check=True)
|
||||
|
@ -127,6 +160,22 @@ def lint(project):
|
|||
)
|
||||
|
||||
|
||||
@task
|
||||
def inst(project):
|
||||
package_uberjar(project)
|
||||
package_native(project)
|
||||
run(
|
||||
f"sudo install -m=755 target/uberjar/{project.name}-standalone.jar /usr/local/bin/{project.name}-standalone.jar",
|
||||
shell=True,
|
||||
check=True,
|
||||
)
|
||||
run(
|
||||
f"sudo install -m=755 target/graalvm/{project.name} /usr/local/bin/{project.name}",
|
||||
shell=True,
|
||||
check=True,
|
||||
)
|
||||
|
||||
|
||||
@task
|
||||
def patch(project):
|
||||
linttest(project, "PATCH")
|
||||
|
|
Loading…
Reference in a new issue