poeditor-android-gradle-plugin icon indicating copy to clipboard operation
poeditor-android-gradle-plugin copied to clipboard

How can I add the plugin with the new gradle format

Open jobernas opened this issue 2 years ago • 1 comments

Hi there,

Im trying to import the plugin with the new Gradle format like bellow,

plugins {
    id 'com.android.application' version "$gradlePluginVersion" apply false
    id 'com.android.library' version "$gradlePluginVersion" apply false
    id 'org.jetbrains.kotlin.android' version "$kotlinPluginVersion" apply false
  
    id 'com.github.hyperdevs-team.poeditor-android-gradle-plugin' version "$poEditorPluginVersion" apply false
}

But Im always getting the bellow error:

Plugin [id: 'com.github.hyperdevs-team.poeditor-android-gradle-plugin', version: '3.4.0', apply: false] was not found in any of the following sources:

What is the correct ID?

Thank you,

Best regards, Bernardo

jobernas avatar Aug 05 '23 13:08 jobernas

Hi @jobernas!

Sorry for the late reply. I've updated the documentation to better address how to import the plug-in using the plugins syntax.

You need to add this to your project (if you're using Kotlin DSL you can copy directly, it should have a similar syntax for Groovy):

  • Top-level settings.gradle.kts
pluginManagement {
    repositories {
        maven { url = java.net.URI("https://jitpack.io") }
    }
    resolutionStrategy {
        eachPlugin {
            // Add custom plugin ID for the PoEditor plugin.
            // This is required because the plugin is not published in the Gradle plugin portal.
            if (requested.id.id == "com.hyperdevs.poeditor") {
                useModule("com.github.hyperdevs-team:poeditor-android-gradle-plugin:${requested.version}")
            }
        }
    }
}
  • Top-level build.gradle.kts
plugins {
    id("com.hyperdevs.poeditor") version "<latest_version>" apply false
}
  • App's build.gradle.kts
plugins {
    id("com.hyperdevs.poeditor")
}

adriangl avatar Oct 12 '23 22:10 adriangl