Skip to content

Commit

Permalink
fix build function
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Mar 15, 2024
1 parent 93340fe commit d756e40
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fluentci/rust",
"version": "0.9.1",
"version": "0.9.2",
"exports": "./mod.ts",
"importMap": "import_map.json",
"tasks": {
Expand Down
7 changes: 4 additions & 3 deletions example/.fluentci/src/dagger/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @description This module provides a set of functions to build, test, and run clippy on a Rust project 🦀
*/

import { dag, Directory, DirectoryID, File } from "../../sdk/client.gen.ts";
import { dag, env, Directory, DirectoryID, File } from "../../deps.ts";

export enum Job {
clippy = "clippy",
Expand Down Expand Up @@ -185,13 +185,13 @@ export async function build(
.withMountedCache("/app/target", dag.cacheVolume("target"))
.withMountedCache("/root/cargo/registry", dag.cacheVolume("registry"))
.withExec(
packageName
env.has("PACKAGE_NAME") || packageName
? [
"cargo",
"build",
"--release",
"-p",
packageName,
env.get("PACKAGE_NAME") || packageName!,
"--target",
target,
...options,
Expand All @@ -203,6 +203,7 @@ export async function build(
const result = await ctr.stdout();

console.log(result);
await ctr.directory(`/${target}`).export("./target");
return ctr.directory(`/${target}`).id();
}

Expand Down
7 changes: 4 additions & 3 deletions src/dagger/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @description This module provides a set of functions to build, test, and run clippy on a Rust project 🦀
*/

import { dag, Directory, DirectoryID, File } from "../../sdk/client.gen.ts";
import { dag, env, Directory, DirectoryID, File } from "../../deps.ts";

export enum Job {
clippy = "clippy",
Expand Down Expand Up @@ -185,13 +185,13 @@ export async function build(
.withMountedCache("/app/target", dag.cacheVolume("target"))
.withMountedCache("/root/cargo/registry", dag.cacheVolume("registry"))
.withExec(
packageName
env.has("PACKAGE_NAME") || packageName
? [
"cargo",
"build",
"--release",
"-p",
packageName,
env.get("PACKAGE_NAME") || packageName!,
"--target",
target,
...options,
Expand All @@ -203,6 +203,7 @@ export async function build(
const result = await ctr.stdout();

console.log(result);
await ctr.directory(`/${target}`).export("./target");
return ctr.directory(`/${target}`).id();
}

Expand Down

0 comments on commit d756e40

Please sign in to comment.