Hylke Bron
04/23/2024, 3:03 PMassemble
on the root project fails, its a multiplatform project which uses composeResources and I get some unresolved references in the generated Drawable code. Nothing bad because just building one of the targets works just fine. Also it seems assemble doesnt compile anything, so it doesnt give me guarantees that my codebase is still compilable.
However I want make sure my project keeps compiling by running a compilation script on the build server.
When I run Command + F9 (Build Project) from IntelliJ everything is compiled, somehow IntelliJ figured out which tasks to run, it runs a large array of tasks, probably dependent on the plugins I've applied and submodules I've added. (this build project action also doesnt encounter the issues that I have when I just run assemble)
I would like something like what happens when you build the project from intellij but then on the build server, but without the maintenance of making sure the array of tasks is up to date whenever I add or remove a submodule or change something in the plugins.
Is there some gradle command that I can use to figure out which tasks I should run, just as Command + F9 seems to do?
The list of tasks that is run with Build Project:
16:38:42: Executing ':my-project:linkIosSimulatorArm64 :my-project:linkIosX64 :my-project:linkIosArm64 :my-project-catalog:iosX64TestBinaries :my-project-brand:wasmJsMainClasses :my-project:iosArm64MainBinaries :my-project:wasmJsTestClasses :my-project-catalog:iosSimulatorArm64MainBinaries :my-project:metadataMainClasses :my-project-catalog:iosArm64TestBinaries :my-project-brand:iosArm64TestBinaries :my-project-brand:iosSimulatorArm64MainBinaries :my-project-catalog:iosArm64MainBinaries :my-project-catalog:wasmJsTestClasses :my-project:jvmMainClasses :my-project-brand:iosX64TestBinaries :my-project-catalog:desktopMainClasses :my-project:iosX64MainBinaries :my-project-brand:jvmTestClasses :my-project-catalog:metadataMainClasses :my-project:iosSimulatorArm64TestBinaries :my-project:iosSimulatorArm64MainBinaries :my-project-brand:wasmJsTestClasses :my-project-brand:metadataMainClasses :my-project:iosArm64TestBinaries :my-project-catalog:iosX64MainBinaries :my-project-brand:iosArm64MainBinaries :my-project-catalog:iosSimulatorArm64TestBinaries :my-project:wasmJsMainClasses :my-project-brand:linkIosSimulatorArm64 :my-project-brand:linkIosX64 :my-project-brand:linkIosArm64 :my-project-catalog:linkIosSimulatorArm64 :my-project-catalog:linkIosX64 :my-project-catalog:linkIosArm64 :my-project-catalog:desktopTestClasses :my-project-brand:iosSimulatorArm64TestBinaries :my-project-brand:iosX64MainBinaries :my-project:jvmTestClasses :my-project-brand:jvmMainClasses :my-project-catalog:wasmJsMainClasses :my-project:iosX64TestBinaries'...
tapchicoma
04/23/2024, 9:03 PM./gradlew tasks
or in IDEA Gradle panel should show all available tasks in the project.
Task assemble
should trigger build for all targets, you could check which exact tasks it is depends on by running ./gradlew assemble -m
tapchicoma
04/23/2024, 9:05 PM--scan
, if you don't like to check console/build log)CLOVIS
04/23/2024, 10:53 PMI'm trying to figure out which gradle command to run to compile all my targets.The lifecycle tasks are: •
assemble
: compile everything that can be compiled, generate everything that can be generated, bundle everything that can be bundled…
• check
: do anything that could be considered a quality check: unit tests, integration tests, coverage checks, linters…
• build
: both together
If your repository doesn't behave like this, then check the tasks you have configured / the plugins you use.CLOVIS
04/23/2024, 10:54 PM[IntelliJ] runs a large array of tasksThe very first line of the output should be the exact command IntelliJ is running. Otherwise, you can run with
--scan
and look in the header to see which tasks are started.Hylke Bron
04/24/2024, 8:38 AMlazy
and setOf
(and probably more) standard functions were not available in the commonMain sourceset. I fixed that by going to kotlin 1.9.23. Now I also see that assemble seems to assemble everything, it even does ios linking etc. exactly as I want.
Thanks again 👍CLOVIS
04/24/2024, 10:49 AMHylke Bron
04/24/2024, 10:51 AMCLOVIS
04/24/2024, 10:56 AMHylke Bron
04/24/2024, 10:59 AMAndroid App
configuration and 5 gradle configurations, based on the last gradle scripts I ran from the gradle window, if that is what you mean.CLOVIS
04/24/2024, 11:00 AM