Morfly / airin

Airin is a tool for the automated migration of Gradle Android projects to Bazel
Apache License 2.0
37 stars 5 forks source link

BUILD Files Not Generated #6

Open paulhundal opened 7 months ago

paulhundal commented 7 months ago

Repository: https://github.com/federicoiosue/Omni-Notes -> Using this OSS project as a way to test migration from Gradle -> Bazel.

Problem After running ./gradlew omniNotes:migrateToBazel --no-configure-on-demand no bazel files generated, even with task success.

OUTPUT:

Omni-Notes develop * ./gradlew omniNotes:migrateToBazel --no-configure-on-demand

> Configure project :omniNotes
BUILD SUCCESSFUL in 486ms
1 actionable task: 1 up-to-date

Change to root build.gradle

classpath "io.morfly.airin:airin-gradle-android:0.5.2"
...

apply plugin: "io.morfly.airin.android"
airin {
    targets += [":omniNotes"]
}

Expected

the task generates a set of Bazel files for a migration target, all its dependencies and the root module. Consequently, all of them can be built with Bazel.

Morfly commented 6 months ago

Hi @paulhundal , Thank you for reaching out!

Please make sure to register Module/Feature components in the airin block. The components handle the generation of BUILD files.

Airin ships with a couple of default components for Android modules. However, in many cases, you would be required to create your own components to define a logic that generates Bazel scripts needed for your project. The components provide an API that helps you to get details about your Gradle modules. Moreover, they provide a DSL that helps you to generate corresponding Bazel scripts based on this data.

Please refer to this video for a live demo to learn more: https://youtu.be/xkGcrLn2yIs?si=guCn1Q3CfSDtX9jF&t=1608 There is a live demo at 26:48 but the rest of the video could be also helpful for more context about components. Let me know if you have any questions.