Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ nextflowPlugin {
```

This will add some useful tasks to your Gradle build:
* `assemble` - compile the Nextflow plugin code and assemble it into a zip file
* `installPlugin` - copy the assembled plugin into your local Nextflow plugins dir
* `releasePlugin` - publish the assembled plugin to the plugin registry
* `assemble` - Compile the Nextflow plugin code and assemble it into a zip file
* `installPlugin` - Copy the assembled plugin into your local Nextflow plugins dir
* `releasePlugin` - Release the assembled plugin to the plugin registry

You should also ensure that your project's `settings.gradle` declares the plugin name, eg:
```gradle
Expand Down
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ dependencies {
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'org.apache.httpcomponents:httpclient:4.5.14'
implementation 'org.apache.httpcomponents:httpmime:4.5.14'

testImplementation('org.spockframework:spock-core:2.3-groovy-3.0')
}

test {
useJUnitPlatform()
}

shadowJar {
Expand Down
35 changes: 5 additions & 30 deletions src/main/groovy/io/nextflow/gradle/NextflowPlugin.groovy
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package io.nextflow.gradle

import io.nextflow.gradle.github.GithubUploadTask
import io.nextflow.gradle.github.PluginMetadataTask
import io.nextflow.gradle.github.UpdateJsonIndexTask
import io.nextflow.gradle.registry.RegistryUploadTask
import org.gradle.api.Plugin
import org.gradle.api.Project
Expand Down Expand Up @@ -132,41 +129,19 @@ class NextflowPlugin implements Plugin<Project> {

// add registry publish task, if configured
if (config.publishing.registry) {
// publishPluginToRegistry - publishes plugin to a plugin registry
project.tasks.register('publishPluginToRegistry', RegistryUploadTask)
project.tasks.publishPluginToRegistry.dependsOn << project.tasks.packagePlugin
publishTasks << project.tasks.publishPluginToRegistry
// releasePluginToRegistry - publishes plugin to a plugin registry
project.tasks.register('releasePluginToRegistry', RegistryUploadTask)
project.tasks.releasePluginToRegistry.dependsOn << project.tasks.packagePlugin
publishTasks << project.tasks.releasePluginToRegistry
}

// add github publish task(s), if configured
if (config.publishing.github) {
// generateGithubMeta - creates the meta.json file
project.tasks.register('generateGithubMeta', PluginMetadataTask)
project.tasks.generateGithubMeta.dependsOn << project.tasks.packagePlugin
project.tasks.assemble.dependsOn << project.tasks.generateGithubMeta

// publishPluginToGithub - publishes plugin assets to a github repo
project.tasks.register('publishPluginToGithub', GithubUploadTask)
project.tasks.publishPluginToGithub.dependsOn << [
project.tasks.packagePlugin,
project.tasks.generateGithubMeta
]
publishTasks << project.tasks.publishPluginToGithub

// updateGithubIndex - updates the central plugins.json index
if (config.publishing.github.updateIndex) {
project.tasks.register('updateGithubIndex', UpdateJsonIndexTask)
project.tasks.updateGithubIndex.dependsOn << project.tasks.generateGithubMeta
publishTasks << project.tasks.updateGithubIndex
}
}

// finally, configure the destination-agnostic 'release' task
if (!publishTasks.isEmpty()) {
// releasePlugin - all the release/publishing actions
project.tasks.register('releasePlugin', {
group = 'Nextflow Plugin'
description = 'publish plugin to configured destinations'
description = 'Release plugin to configured destination'
})
for (task in publishTasks) {
project.tasks.releasePlugin.dependsOn << task
Expand Down
12 changes: 0 additions & 12 deletions src/main/groovy/io/nextflow/gradle/PluginPublishConfig.groovy
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.nextflow.gradle

import groovy.transform.CompileStatic
import io.nextflow.gradle.github.GithubPublishConfig
import io.nextflow.gradle.registry.RegistryPublishConfig
import org.gradle.api.Project

Expand All @@ -13,11 +12,6 @@ import org.gradle.api.Project
class PluginPublishConfig {
private final Project project

/**
* Configuration for publishing to github
*/
GithubPublishConfig github

/**
* Configuration for publishing to a registry
*/
Expand All @@ -29,12 +23,6 @@ class PluginPublishConfig {

def validate() {}

// initialises the 'github' sub-config
def github(Closure config) {
github = new GithubPublishConfig(project)
project.configure(github, config)
}

def registry(Closure config) {
registry = new RegistryPublishConfig(project)
project.configure(registry, config)
Expand Down
235 changes: 0 additions & 235 deletions src/main/groovy/io/nextflow/gradle/github/GithubClient.groovy

This file was deleted.

Loading