Sublime Forum

Can ST model build system inter-target dependencies?

#1

VScode has this key “dependsOn” in the build system syntax that ensures that say Foo is built before Bar is built.

Does ST have such a thing ?

0 Likes

#2

No it doesn’t. I suggest using an editor-independant build system if you’re dealing with dependencies.

3 Likes

#3

The underlying build system is xcodebuild. I call xcodebuild with the target name and some other options from sublime.
I could’ve used post install step for the shell script, but I don’t always want to run it.
Guess I’ll copy the install target’s command in my shell script invocation step.

0 Likes

#4

You can define build system variants for the different targets?

0 Likes

#5

The goal is to not duplicate the install’s information like shell_cmd etc.

{
  "shell_cmd": "xcrun xcodebuild -target install -configuration Debug | xcpretty",
  "working_dir": "${project_path}",
  "name": "install",
},
{
  "shell_cmd": "/Users/p/coverage.sh ${project_path}",
  "working_dir": "${project_path}",
  "name": "LLVM",
}

How do you suggest I make LLVM depend on install ?

0 Likes

#6

I don’t understand what you’re asking. What do you mean by

0 Likes

#7

install target’s shell_cmd is complex and I don’t want to repeat it.
If it had environment variables too, I’ll have to copy that too in LLVM target.
I want to avoid it. Specify a target once, and then use it by its name later on.

0 Likes

#8

Look into custom targets for a build system: https://www.sublimetext.com/docs/3/build_systems.html

0 Likes

#9

If you’re suggesting writing a python script… then not today. I’ll manage with copy-paste.

0 Likes