Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support applying gradle plugin inside Groovy script #5

Closed
ArTemmey opened this issue Jan 26, 2024 · 5 comments
Closed

Support applying gradle plugin inside Groovy script #5

ArTemmey opened this issue Jan 26, 2024 · 5 comments

Comments

@ArTemmey
Copy link

Hello. Our app uses Groovy Gradle scripts. When we apply com.vk.vkompose plugin we have the following exception during the sync:
Снимок экрана 2024-01-26 в 17 53 49

@0xera
Copy link
Contributor

0xera commented Jan 26, 2024

Seems strange. I will investigate it

@0xera
Copy link
Contributor

0xera commented Jan 26, 2024

Could you share the example of build.gradle file with vkompose plugin? Have you applied kotlin jvm or kotlin android plugins before vkompose?

@0xera
Copy link
Contributor

0xera commented Jan 27, 2024

So, i think you apply plugin like this:
Снимок экрана 2024-01-27 в 16 24 58

But implementation, api and other configurations, which are supplied by java plugin, cannot be used until java plugin is applied.

To apply vkompose plugin you should:

  1. add classpath dependency in your root build.gradle.kts
buildscript {
    ext {
        compose_version = '1.5.4'
        kotlin_version = "1.9.10"
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:8.3.0-beta02'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "com.vk.vkompose:com.vk.vkompose.gradle.plugin:0.3.2" // see here

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
  1. apply vkompose plugin after kotlin and android plugins
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.vk.vkompose'
  1. configure vkompose plugin
vkompose {

    setSkippabilityCheck(project, true)
    // or
    skippabilityCheck(project) {
        // For more see
        // https://android-review.googlesource.com/c/platform/frameworks/support/+/2668595
        // https://issuetracker.google.com/issues/309765121
//        it.stabilityConfigurationPath = "/path/file.config"
    }

    recompose(project) {
        it.isHighlighterEnabled = true
        it.isLoggerEnabled = true
    }

    testTag(project) {
        it.isApplierEnabled = true
        it.isDrawerEnabled = false
        it.isCleanerEnabled = false
    }

    setSourceInformationClean(project, true)
}

As soon as possible i will try to fix so that the order of plugins doesn't matter

@0xera
Copy link
Contributor

0xera commented Jan 27, 2024

fixed in 0.4

@ArTemmey
Copy link
Author

@0xera Thank you very much! Now it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants