-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial version.
- Loading branch information
Showing
14 changed files
with
434 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# DO NOT MODIFY: Generated by Stutter plugin. | ||
4.10.3 | ||
5.0 | ||
5.6.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,4 @@ | ||
# DO NOT MODIFY: Generated by Stutter plugin. | ||
4.10.3 | ||
5.0 | ||
5.1.1 | ||
5.2.1 | ||
5.3.1 | ||
5.4.1 | ||
5.5.1 | ||
5.6.2 | ||
5.6.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/main/kotlin/io/github/gradlenexus/publishplugin/CloseNexusStagingRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright 2019 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.github.gradlenexus.publishplugin | ||
|
||
import io.github.gradlenexus.publishplugin.internal.NexusClient | ||
import org.gradle.api.model.ObjectFactory | ||
import org.gradle.api.provider.Property | ||
import org.gradle.api.tasks.Input | ||
import org.gradle.api.tasks.TaskAction | ||
import org.gradle.kotlin.dsl.property | ||
import javax.inject.Inject | ||
|
||
@Suppress("UnstableApiUsage") | ||
open class CloseNexusStagingRepository @Inject | ||
constructor(objects: ObjectFactory, extension: NexusPublishExtension, repository: NexusRepository) : | ||
BaseOperationOnNexusStagingRepository(objects, extension, repository) { | ||
|
||
@get:Input | ||
val stagingRepositoryId: Property<String> = objects.property() | ||
|
||
init { | ||
stagingRepositoryId.set(repository.stagingRepositoryId) | ||
} | ||
|
||
@TaskAction | ||
fun closeStagingRepo() { | ||
val client = NexusClient(serverUrl.get(), username.orNull, password.orNull, clientTimeout.orNull, connectTimeout.orNull) | ||
val stagingProfileId = determineStagingProfileId(client) | ||
logger.info("Closing staging repository with id '{}' for stagingProfileId '{}'", stagingRepositoryId.get(), stagingProfileId) | ||
client.closeStagingRepository(stagingRepositoryId.get()) | ||
// TODO: Broken with real Nexus - waiting for effective execution is also required https://github.com/gradle-nexus/publish-plugin/issues/7 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.