-
Notifications
You must be signed in to change notification settings - Fork 0
Generate plugin spec #12
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
base: master
Are you sure you want to change the base?
Conversation
@bentsherman Let's aim moving this to "Ready" |
I am testing the entire flow with the registry locally. Before we merge this PR, we need to:
|
You should be able to test everything in the local dev. Check this for using unreleased plugin https://github.com/nextflow-io/nextflow/blob/a5c19b895a5d64ef4ae76907b5f38dc7074df22e/settings.gradle#L17-L19 |
ff9f074
to
7b62479
Compare
7b62479
to
2bfc7dc
Compare
b5bb1f9
to
716dc2d
Compare
716dc2d
to
8b413b3
Compare
@pditommaso this is ready to merge, tested with registry-dev and Nextflow 25.09.0-edge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting this using Gradle 9
startup failed:
/Users/pditommaso/Projects/nextflow-plugin-gradle/src/main/groovy/io/nextflow/gradle/BuildIndexTask.groovy: 12: Can't have an abstract method in a non-abstract class. The class 'io.nextflow.gradle.BuildIndexTask' must be declared abstract or the method 'org.gradle.api.model.ObjectFactory getObjectFactory()' must be implemented.
@ line 12, column 1.
class BuildIndexTask extends JavaExec {
^
/Users/pditommaso/Projects/nextflow-plugin-gradle/src/main/groovy/io/nextflow/gradle/BuildIndexTask.groovy: 12: Can't have an abstract method in a non-abstract class. The class 'io.nextflow.gradle.BuildIndexTask' must be declared abstract or the method 'org.gradle.api.internal.provider.PropertyFactory getPropertyFactory()' must be implemented.
@ line 12, column 1.
class BuildIndexTask extends JavaExec {
^
/Users/pditommaso/Projects/nextflow-plugin-gradle/src/main/groovy/io/nextflow/gradle/BuildIndexTask.groovy: 12: Can't have an abstract method in a non-abstract class. The class 'io.nextflow.gradle.BuildIndexTask' must be declared abstract or the method 'org.gradle.process.internal.ExecActionFactory getExecActionFactory()' must be implemented.
@ line 12, column 1.
class BuildIndexTask extends JavaExec {
^
/Users/pditommaso/Projects/nextflow-plugin-gradle/src/main/groovy/io/nextflow/gradle/BuildIndexTask.groovy: 12: Can't have an abstract method in a non-abstract class. The class 'io.nextflow.gradle.BuildIndexTask' must be declared abstract or the method 'org.gradle.jvm.toolchain.JavaToolchainService getJavaToolchainService()' must be implemented.
@ line 12, column 1.
class BuildIndexTask extends JavaExec {
^
/Users/pditommaso/Projects/nextflow-plugin-gradle/src/main/groovy/io/nextflow/gradle/BuildIndexTask.groovy: 12: Can't have an abstract method in a non-abstract class. The class 'io.nextflow.gradle.BuildIndexTask' must be declared abstract or the method 'org.gradle.api.provider.ProviderFactory getProviderFactory()' must be implemented.
@ line 12, column 1.
class BuildIndexTask extends JavaExec {
^
5 errors
I had the sam issue, for other tasks, the solution was to mark as abstract
It looks like your local clone is out of date. |
Correct, but the problem is still the same
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added the abstract
but now I've this problem
» ./gradlew releasePluginToRegistryIfNotExists
[Incubating] Problems report is available at: file:///Users/pditommaso/Projects/nextflow/build/reports/problems/problems-report.html
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/pditommaso/Projects/nextflow/plugins/nf-amazon/build.gradle' line: 17
* What went wrong:
An exception occurred applying plugin request [id: 'io.nextflow.nextflow-plugin', version: '1.0.0-beta.10']
> Failed to apply plugin 'io.nextflow.nextflow-plugin'.
> Cannot add a configuration with name 'specFileImplementation' as a configuration with that name already exists.
What's more concerning this PR introduces a circular dependencies with nextflow main runtime makes difficult to this plugin with nextflow itself, because when releasing a new nextflow version, the plugin will try to pull a nextflow dependency that does not yet exist.
I'm starting to think the spec should not be generated by this plugin, but instead it should be defined by each plugin itself. The build process should only invoked a well defined plugin interface
I'm confused. This project doesn't even use Gradle 9:
I think that's why I'm not getting a build error |
As far as I can tell there is no circular dependency:
In other words the plugin JAR is built before the spec file, and the same nextflow runtime specified by the plugin is used to build the spec. For this reason it only builds the spec if the nextflow version is >=25.09.0-edge |
The problem arise when using from nextflow build |
I see. Well, this is a good example where mavenLocal works better 😄 |
it remains a mess, for example when trying to make |
You mean for core plugins? The core plugins don't need to generate plugin specs, for that case we could just disable it |
@pditommaso I added a flag to not build the plugin spec, which should be used by the core plugins. I also fixed the issues with Gradle 9 with some help from Claude. Let me know if it works for you |
b7b8e92
to
5a03964
Compare
IMO it would be preferable a solution that works the same both for "internal" and external plugins. Exploring the annotation processor i've ended up with this solution. Have a look. |
It looks like your solution is more or less the same. You still use a class loader with the Nextflow runtime and the plugin JAR, only now you are loading all of the annotation classes by name instead of just the plugin spec entrypoint ( The problem here is that now the code for generating the JSON metadata is duplicated in Nextflow and the Gradle plugin. You still need this code in the Nextflow runtime to generate this metadata for the language server So if you want something that works for both core plugins and community plugins, the solution is what we merged in nextflow-io/nextflow#6361 in combination with this PR.
Let me know if you encounter any more issues using this PR |
Another option could be moving this project into the nextflow repo. That would allow the plugin to stay in sync core codebase. |
I'm not sure how that would work. The Gradle plugin is intended to be used with any version of Nextflow, but moving it into the Nextflow codebase would tie it to a specific Nextflow version |
In the codebase it uses the "inline" version. Other plugins the canonical distribution |
That's essentially what I have achieved in this PR -- the core plugins should just use |
This PR adds a
buildSpec
task which generates a plugin spec using a custom entrypoint in the Nextflow runtimeIt is a Java task that loads the Nextflow runtime (requires 25.08.0-edge or later) and the plugin that was just built, so that it can load the plugin extension points and generate the index file using the
PluginSpecWriter
class in the Nextflow runtime.Depends on nextflow-io/nextflow#6361