Skip to content

Commit 490d595

Browse files
staktracesvc-squareup-copybara
authored andcommitted
Explicitly set the working directory for running miskweb for
compat across gradle versions GitOrigin-RevId: 83dd4597f7f21c42ca5e897531a989dc17622539
1 parent 07fba22 commit 490d595

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

misk-admin/build.gradle.kts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ abstract class MiskWebBuildTask @Inject constructor(
8686
@get:Internal
8787
abstract val rootDir: RegularFileProperty
8888

89+
@get:Internal
90+
abstract val projectDir: RegularFileProperty
91+
8992
@get:PathSensitive(PathSensitivity.RELATIVE)
9093
@get:InputFiles
9194
abstract val inputFiles: ConfigurableFileCollection
@@ -96,6 +99,7 @@ abstract class MiskWebBuildTask @Inject constructor(
9699
@TaskAction
97100
fun buildTabs() {
98101
val rootFile = rootDir.asFile.get()
102+
val projectDir = projectDir.asFile.get()
99103

100104
logger.lifecycle("Running miskweb build...")
101105

@@ -123,8 +127,9 @@ abstract class MiskWebBuildTask @Inject constructor(
123127
miskWebPath, "ci-build", "-e",
124128
) {
125129
// this should run in one of the parent directories of the one containing the miskTab.json.
126-
// By default, the execOps will run it in the project directory for the current project, which
127-
// in our case will be the "service" directory, and that's just fine.
130+
// What ExecOps does varies by gradle version, it seems, so use the project directory for
131+
// the current project explicitly.
132+
workingDir = projectDir
128133
isIgnoreExitValue = true // we will assert ourselves after dumping stdout
129134
// We need miskweb to be on the PATH. In some environments we have multiple hermit environments
130135
// and the misk hermit env is not the one that is active, so the misk/node_modules/.bin folder
@@ -163,6 +168,7 @@ val buildMiskWeb = tasks.register("buildMiskWeb", MiskWebBuildTask::class.java)
163168
File(tabDir, "lib")
164169
}
165170
rootDir.set(project.rootDir)
171+
projectDir.set(project.projectDir)
166172
inputFiles.setFrom(inputs)
167173
outputFiles.setFrom(outputs)
168174
}

0 commit comments

Comments
 (0)