Skip to content

Commit fde7d0a

Browse files
pditommasoclaude
andcommitted
Resolve merge conflicts and maintain releasePlugin task naming
- Keep releasePlugin and releasePluginToRegistry task names - Remove duplicate registry configuration tests from merge - Update README to use releasePlugin consistently in examples - All tests passing with resolved conflicts 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
2 parents f90cb3c + d956da2 commit fde7d0a

File tree

3 files changed

+25
-156
lines changed

3 files changed

+25
-156
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ Using environment variables:
7979
```bash
8080
export NPR_API_URL=https://my-custom-registry.com/api
8181
export NPR_API_KEY=your-secret-api-key
82-
./gradlew publishPlugin
82+
./gradlew releasePlugin
8383
```
8484

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

9090
You should also ensure that your project's `settings.gradle` declares the plugin name, eg:
9191
```gradle
@@ -129,5 +129,5 @@ Then use this command:
129129

130130

131131
```
132-
./gradlew publishPlugins
132+
./gradlew releasePlugins
133133
```

src/main/groovy/io/nextflow/gradle/NextflowPlugin.groovy

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,22 +129,22 @@ class NextflowPlugin implements Plugin<Project> {
129129

130130
// add registry publish task, if configured
131131
if (config.publishing.registry) {
132-
// publishPluginToRegistry - publishes plugin to a plugin registry
133-
project.tasks.register('publishPluginToRegistry', RegistryUploadTask)
134-
project.tasks.publishPluginToRegistry.dependsOn << project.tasks.packagePlugin
135-
publishTasks << project.tasks.publishPluginToRegistry
132+
// releasePluginToRegistry - publishes plugin to a plugin registry
133+
project.tasks.register('releasePluginToRegistry', RegistryUploadTask)
134+
project.tasks.releasePluginToRegistry.dependsOn << project.tasks.packagePlugin
135+
publishTasks << project.tasks.releasePluginToRegistry
136136
}
137137

138138

139-
// finally, configure the destination-agnostic 'publish' task
139+
// finally, configure the destination-agnostic 'release' task
140140
if (!publishTasks.isEmpty()) {
141-
// publishPlugin - all the release/publishing actions
142-
project.tasks.register('publishPlugin', {
141+
// releasePlugin - all the release/publishing actions
142+
project.tasks.register('releasePlugin', {
143143
group = 'Nextflow Plugin'
144-
description = 'publish plugin to configured destinations'
144+
description = 'Release plugin to configured destination'
145145
})
146146
for (task in publishTasks) {
147-
project.tasks.publishPlugin.dependsOn << task
147+
project.tasks.releasePlugin.dependsOn << task
148148
}
149149
}
150150
}
Lines changed: 11 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package io.nextflow.gradle
22

3-
import io.nextflow.gradle.registry.RegistryPublishConfig
43
import org.gradle.api.Project
54
import org.gradle.testfixtures.ProjectBuilder
65
import spock.lang.Specification
@@ -20,7 +19,7 @@ class NextflowPluginTest extends Specification {
2019
project.pluginManager.apply('io.nextflow.nextflow-plugin')
2120
}
2221

23-
def "should register publishPlugin task when publishing is configured"() {
22+
def "should register releasePlugin task when publishing is configured"() {
2423
given:
2524
project.nextflowPlugin {
2625
description = 'A test plugin'
@@ -39,13 +38,13 @@ class NextflowPluginTest extends Specification {
3938
project.evaluate()
4039

4140
then:
42-
project.tasks.findByName('publishPlugin') != null
43-
project.tasks.publishPlugin.group == 'Nextflow Plugin'
44-
project.tasks.publishPlugin.description == 'publish plugin to configured destinations'
41+
project.tasks.findByName('releasePlugin') != null
42+
project.tasks.releasePlugin.group == 'Nextflow Plugin'
43+
project.tasks.releasePlugin.description == 'Release plugin to configured destination'
4544
}
4645

4746

48-
def "should make publishPlugin depend on registry publishing task"() {
47+
def "should make releasePlugin depend on registry publishing task"() {
4948
given:
5049
project.nextflowPlugin {
5150
description = 'A test plugin'
@@ -64,13 +63,13 @@ class NextflowPluginTest extends Specification {
6463
project.evaluate()
6564

6665
then:
67-
def publishPlugin = project.tasks.publishPlugin
68-
def publishToRegistry = project.tasks.publishPluginToRegistry
69-
publishPlugin.taskDependencies.getDependencies(publishPlugin).contains(publishToRegistry)
66+
def releasePlugin = project.tasks.releasePlugin
67+
def releaseToRegistry = project.tasks.releasePluginToRegistry
68+
releasePlugin.taskDependencies.getDependencies(releasePlugin).contains(releaseToRegistry)
7069
}
7170

7271

73-
def "should not register publishPlugin task when no publishing is configured"() {
72+
def "should not register releasePlugin task when no publishing is configured"() {
7473
given:
7574
project.nextflowPlugin {
7675
description = 'A test plugin'
@@ -84,137 +83,7 @@ class NextflowPluginTest extends Specification {
8483
project.evaluate()
8584

8685
then:
87-
project.tasks.findByName('publishPlugin') == null
86+
project.tasks.findByName('releasePlugin') == null
8887
}
8988

90-
def "should resolve registry URL from explicit configuration"() {
91-
given:
92-
def config = new RegistryPublishConfig(project)
93-
config.url = 'https://custom-registry.com/api'
94-
95-
when:
96-
def resolvedUrl = config.getResolvedUrl()
97-
98-
then:
99-
resolvedUrl == 'https://custom-registry.com/api'
100-
}
101-
102-
def "should resolve registry URL from gradle property"() {
103-
given:
104-
project.ext.set('npr.apiUrl', 'https://gradle-prop-registry.com/api')
105-
def config = new RegistryPublishConfig(project)
106-
107-
when:
108-
def resolvedUrl = config.getResolvedUrl()
109-
110-
then:
111-
resolvedUrl == 'https://gradle-prop-registry.com/api'
112-
}
113-
114-
def "should resolve registry URL from environment variable"() {
115-
given:
116-
def config = new RegistryPublishConfig(project) {
117-
@Override
118-
String getResolvedUrl() {
119-
// If explicitly set, use it
120-
if (url) {
121-
return url
122-
}
123-
124-
// Try gradle property
125-
def gradleProp = project.findProperty('npr.apiUrl')
126-
if (gradleProp) {
127-
return gradleProp.toString()
128-
}
129-
130-
// Mock environment variable for test (NPR_API_URL)
131-
return 'https://env-registry.com/api'
132-
}
133-
}
134-
135-
when:
136-
def resolvedUrl = config.getResolvedUrl()
137-
138-
then:
139-
resolvedUrl == 'https://env-registry.com/api'
140-
}
141-
142-
def "should use default registry URL when none provided"() {
143-
given:
144-
def config = new RegistryPublishConfig(project)
145-
146-
when:
147-
def resolvedUrl = config.getResolvedUrl()
148-
149-
then:
150-
resolvedUrl == 'https://plugin-registry.seqera.io/api'
151-
}
152-
153-
def "should resolve API key from explicit configuration"() {
154-
given:
155-
def config = new RegistryPublishConfig(project)
156-
config.apiKey = 'explicit-api-key'
157-
158-
when:
159-
def resolvedApiKey = config.getResolvedApiKey()
160-
161-
then:
162-
resolvedApiKey == 'explicit-api-key'
163-
}
164-
165-
def "should resolve API key from gradle property"() {
166-
given:
167-
project.ext.set('npr.apiKey', 'gradle-prop-api-key')
168-
def config = new RegistryPublishConfig(project)
169-
170-
when:
171-
def resolvedApiKey = config.getResolvedApiKey()
172-
173-
then:
174-
resolvedApiKey == 'gradle-prop-api-key'
175-
}
176-
177-
def "should resolve API key from environment variable"() {
178-
given:
179-
def config = new RegistryPublishConfig(project) {
180-
@Override
181-
String getResolvedApiKey() {
182-
// If explicitly set, use it
183-
if (apiKey) {
184-
return apiKey
185-
}
186-
187-
// Try gradle property
188-
def gradleProp = project.findProperty('npr.apiKey')
189-
if (gradleProp) {
190-
return gradleProp.toString()
191-
}
192-
193-
// Mock environment variable for test
194-
return 'env-api-key'
195-
}
196-
}
197-
198-
when:
199-
def resolvedApiKey = config.getResolvedApiKey()
200-
201-
then:
202-
resolvedApiKey == 'env-api-key'
203-
}
204-
205-
def "should throw error when no API key provided"() {
206-
given:
207-
def config = new RegistryPublishConfig(project)
208-
209-
when:
210-
config.getResolvedApiKey()
211-
212-
then:
213-
def ex = thrown(RuntimeException)
214-
ex.message.contains('Registry API key not provided')
215-
ex.message.contains('nextflowPlugin.publishing.registry.apiKey')
216-
ex.message.contains('npr.apiKey')
217-
ex.message.contains('NPR_API_KEY')
218-
}
219-
220-
}
89+
}

0 commit comments

Comments
 (0)