Skip to content

Commit d4e9d1e

Browse files
author
Brian Pontarelli
committed
Fixing build file to use the standard naming convention and run an init step for npm install
1 parent 3015c5d commit d4e9d1e

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

build.savant

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,23 @@ file = loadPlugin(id: "org.savantbuild.plugin:file:${savantVersion}")
3636
idea = loadPlugin(id: "org.savantbuild.plugin:idea:1.0.1")
3737
release = loadPlugin(id: "org.savantbuild.plugin:release-git:${savantVersion}")
3838

39-
target(name: "clean", description: "Cleans build directory") {
39+
target(name: "init", description: "Initializes the project") {
40+
def proc = 'npm install'.execute()
41+
proc.consumeProcessOutput(System.out, System.err)
42+
proc.waitFor()
43+
if (proc.exitValue() != 0) {
44+
fail("Failed to run npm install")
45+
}
46+
}
47+
48+
target(name: "clean", description: "Cleans build directory", dependsOn: ["init"]) {
4049
file.prune(dir: "build")
4150
file.delete {
4251
fileSet(dir: ".", includePatterns: [~/.+\.zip/])
4352
}
4453
}
4554

46-
target(name: "build", description: "Builds the js files") {
55+
target(name: "compile", description: "Builds the js files", dependsOn: ["init"]) {
4756
def proc = 'npm ci'.execute()
4857
proc.consumeProcessOutput(System.out, System.err)
4958
proc.waitFor()
@@ -66,7 +75,7 @@ target(name: "build", description: "Builds the js files") {
6675
}
6776
}
6877

69-
target(name: "int", description: "Releases a local integration build of the project", dependsOn: ["build"]) {
78+
target(name: "int", description: "Releases a local integration build of the project", dependsOn: ["compile"]) {
7079
file.delete {
7180
fileSet(dir: "build", includePatterns: [~/fusionauth-typescript-client.+\.zip/])
7281
}
@@ -84,7 +93,7 @@ target(name: "idea", description: "Updates the IntelliJ IDEA module file") {
8493
idea.iml()
8594
}
8695

87-
target(name: "test", description: "Runs the tests", dependsOn: ["build"]) {
96+
target(name: "test", description: "Runs the tests", dependsOn: ["compile"]) {
8897
if (new ProcessBuilder('npm', 'test').inheritIO().start().waitFor() != 0) {
8998
fail("Tests failed")
9099
}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)