I have a multiplatform build script that runs on windows and linux systems, and prior to any compilation activity, I want to run a task that generates a file that will be included in compilation.
I’m hoping that I can do this in a one-liner within the build script, but I can’t seem to find just one task on which to hang a
dependsOn relationship. There are different binaries and variants that are produced, and I just want this task to run before any of these other tasks runs. The
assemble task has these dependencies:
assemble - Assembles the outputs of this project. [myComponentWindows_x86DebugStaticLibrary, myComponentWindows_x86ReleaseStaticLibrary, myComponentTestWindows_x86DebugExecutable, myComponentTestWindows_x86ReleaseExecutable]
Can I do this by setting up task dependencies in
build.gradle, or do I have to run the task explicitly before the
build task on the gradle command line as below?
./gradlew myPrecompileTask build
build.dependsOn myPrecompileTask is insufficient, as a whole bunch of tasks get run before