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

Publish Gradle plugin to https://plugins.gradle.org #56

Closed
jonnyzzz opened this issue Feb 17, 2019 · 7 comments · May be fixed by #205
Closed

Publish Gradle plugin to https://plugins.gradle.org #56

jonnyzzz opened this issue Feb 17, 2019 · 7 comments · May be fixed by #205
Assignees
Labels

Comments

@jonnyzzz
Copy link
Member

Gradle plugin repository https://plugins.gradle.org allows using the new plugin DSL in Gradle without any additional configuration, e.g.

plugins {
 id("the plugin id") version "1.2.3"
}

Right now we may only use the older buildscript{..} approach

@revintec
Copy link

when would we published to the Gradle Plugin Portal? I'd really like the simplified plugin grammar

@NikkyAI
Copy link

NikkyAI commented Oct 1, 2021

add this to your setting.gradle(.kts)

pluginManagement {
	repositories {
		gradlePluginPortal()
	}
	resolutionStrategy {
		eachPlugin {
			val module = when(requested.id.id) {
				"kotlinx-atomicfu" -> "org.jetbrains.kotlinx:atomicfu-gradle-plugin:${requested.version}"
				else -> null
			}
			if(module != null) {
				useModule(module)
			}
		}
	}
}

it can bridge it .. but having it published properly as a gradle plugin would make this easier to use and integrate better with version management plguins like refresVersions

https://docs.gradle.org/current/userguide/publishing_gradle_plugins.html

@volo-droid
Copy link

volo-droid commented Mar 22, 2023

@NikkyAI do we still need to do it? I've just added the plugin via id("kotlinx-atomicfu") then updated the buildscript block with:

buildscript {
    dependencies {
        classpath("org.jetbrains.kotlinx:atomicfu-gradle-plugin:0.20.0")
    }
}

and everything seems to work, although I cannot find the kotlin-atomicfu plugin on the Gradle Plugin Portal, but there's org.jetbrains.kotlin.plugin.atomicfu with the latest version of 1.8.20-RC

UPDATE

It works if I add the plugin to the subproject, but fails if I do it in the top level build.gradle

@NikkyAI
Copy link

NikkyAI commented Mar 24, 2023

well this is what we needed.. https://plugins.gradle.org/plugin/org.jetbrains.kotlin.plugin.atomicfu

maybe update the README to show how to apply the plugin ?

then this issue can be closed as far as i am concerned...

@evilcat-x
Copy link

Any potential error or naming with the new not-in-readme plugin?

Trying to use the plugin dsl

plugins {
  id("org.jetbrains.kotlin.plugin.atomicfu") version "1.8.20"
}

The plugin resolved but

import kotlinx.atomicfu.atomic

would have a Unresolved reference: atomicfu Error and upon checking External Libraries I couldn't find any relating to atomicfu

When I switch back to the legacy plugin

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath("org.jetbrains.kotlinx:atomicfu-gradle-plugin:0.20.1")
    }
}
apply(plugin = "kotlinx-atomicfu")

The org.jetbrains.kotlinx:atomicfu-jvm:0.20.1 would show up and correctly added.

@vdshb
Copy link

vdshb commented Oct 29, 2023

It seems org.jetbrains.kotlin.plugin.atomicfu is not a new publication but a new plugin. The experimental one or a replacement for currently mentioned in the documentation. I'd actually prefer to try it instead of current stable. Does anyone know what is its status and is it even working?

@nedtwigg
Copy link

nedtwigg commented Feb 5, 2024

It seems org.jetbrains.kotlin.plugin.atomicfu is not a new publication but a new plugin. Does anyone know what is its status and is it even working?

I am applying it in my settings.gradle:

  id 'org.jetbrains.kotlin.plugin.atomicfu' version '1.9.22' apply false

And when I apply it in a non-root project:

plugins {
  id 'org.jetbrains.kotlin.multiplatform'
  id 'org.jetbrains.kotlin.plugin.atomicfu'
}

nothing at all happens so far as I can tell.

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

Successfully merging a pull request may close this issue.

8 participants