Error using gradle-profiler using Bazel with an iOS Project
narlei opened this issue · 0 comments
narlei commented
We're currently using gradle.profiler
in our Android projects and we're migrating our iOS project to work with Bazel.
Seeing the success of Android project benchmarking build using this tool, we tried to use it in our iOS project too, but I'm receiving this error:
❯ gradle-profiler --benchmark --bazel build_some_target
* Writing results to /Users/narlei.moreira/ifood-consumer-ios/profile-out-34
* Settings
Project dir: /Users/narlei.moreira/ifood-consumer-ios
Output dir: /Users/narlei.moreira/ifood-consumer-ios/profile-out-34
Profiler: none
Benchmark: true
Versions: []
Gradle User Home: /Users/narlei.moreira/ifood-consumer-ios/gradle-user-home
Targets: [build_some_target]
* Inspecting the build using its default Gradle version
* Stopping daemons
java.lang.ClassCastException: class org.gradle.profiler.BuildInvoker$1 cannot be cast to class org.gradle.profiler.GradleBuildInvoker (org.gradle.profiler.BuildInvoker$1 and org.gradle.profiler.GradleBuildInvoker are in unnamed module of loader 'app')
at org.gradle.profiler.ScenarioLoader.adhocScenarios(ScenarioLoader.java:195)
at org.gradle.profiler.ScenarioLoader.doLoadScenarios(ScenarioLoader.java:177)
at org.gradle.profiler.ScenarioLoader.loadScenarios(ScenarioLoader.java:156)
at org.gradle.profiler.Main.run(Main.java:56)
at org.gradle.profiler.Main.main(Main.java:25)
I used the example of Readme:
build_some_target {
tasks = ["assemble"]
bazel {
home = "MY_HOME"
targets = ["build" "//MY_TARGET"]
}
}
The iOS project doesn't use Gradle, then I created an empty settings.gradle
.
❯ gradle-profiler --version
Gradle Profiler version 0.19.0
I deleted the .conf
file and the error is the same. I believe that it's a pre-requisite missed. Maybe it doesn't works with iOS project.