skrugly / mirakle

Gradle plugin to move build process to remote machine.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build fails when building the dependency project of a composite build

marcorighini opened this issue · comments

Let's assume that project composite is a composite build, with the dependency on project dependency
Project structure is:
/composite/...
/composite/setting.gradle
/composite/dependency/...
/composite/dependency/setting.gradle.kts
Build is working as expected when building the whole composite build, i.e. launching the build from the composite folder.

But when we try to build just the dependency project, i.e. launching the build from composite/dependency folder, the build fails with

Project directory '...../composite/dependency' is not part of the build defined by settings file '...../composite/settings.gradle.kts'. If this is an unrelated build, it must have its own settings file

Disabling mirakle dependency project builds as expected.

From logs I see
Settings evaluated using settings file '.../composite/settings.gradle'.
It seems that the wrong setting file is taken into consideration

From a deeper investigation it seems that settings file with extension kts (common case today) are not recognized

@Adambl4 do you have some ideas on where to look at for fixing it?

Hey @marcorighini, sorry for the long replay. It seems it is not about the settinga.gradle.kts.
It would be very helpful if you can provide a repo with that gradle structure where I can reproduce this issue.

https://github.com/marcorighini/KMM-Composite-Build
Executing ./gradlew assembleDebug inside sample-kmm (composite build dependency project) results in
Project directory '/Users/marcox/projects/KMM-Composite-Build/sample-kmm' is not part of the build defined by settings file '/Users/marcox/projects/KMM-Composite-Build/settings.gradle'. If this is an unrelated build, it must have its own settings file.
This is happening using mirakle 1.5.0.

Important notes (not related to this issue)
For me

  • 1.5.1 is not usable: for every project I try to run with mirakle it results in e.g. bash: ~/mirakle/KMM-Composite-Build/gradlew: No such file or directory
  • 1.5.2 is not usable: for every project I try to run with mirakle it results in e.g. The specified project directory '/Users/marcox/projects/KMM-Composite-Build' does not exist.. It seems like that mirakle is trying to using the local path instead of the remote one.

Thanks, will look into it

Thanks @Adambl4, let me know if you want me to test something

Could you try io.github.adambl4:mirakle:1.5.3-RC-1 and let me know does it work please.

From the sample, running :app:assembleDebug or :sample-kmm:shared:assembleDebug are both failing with
bash: line 1: cd: ~/mirakle/KMM-Composite-Build: No such file or directory
but the folder is present in the remote machine

Could you try to declare mirakle remote folder like this and try again:

mirakle {
    remoteFolder = "mirakle"
}

It seems fixed, thanks! Will start using 1.5.3 as soon as released.

Yay, glad to hear this. Could you also try mirakle 1.5.1 and 1.5.2 with remoteFolder = "mirakle" and let me know does it work in your environment

With remoteFolder = "mirakle" both 1.5.1 and 1.5.2 are working (no more No such file or directory error)