Skip to content

Commit

Permalink
Use managed properties in AbstractNexusStagingRepositoryTask
Browse files Browse the repository at this point in the history
  • Loading branch information
3flex committed Jul 5, 2023
1 parent 3b1266e commit 02b43fc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package io.github.gradlenexus.publishplugin

import org.gradle.api.DefaultTask
import org.gradle.api.model.ObjectFactory
import org.gradle.api.provider.Property
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.Nested
Expand All @@ -29,23 +30,23 @@ import javax.inject.Inject
abstract class AbstractNexusStagingRepositoryTask @Inject
constructor(objects: ObjectFactory, repository: NexusRepository) : DefaultTask() {

@Internal
val clientTimeout = objects.property<Duration>()
@get:Internal
abstract val clientTimeout: Property<Duration>

@Internal
val connectTimeout = objects.property<Duration>()
@get:Internal
abstract val connectTimeout: Property<Duration>

// TODO: Expose externally as interface with getters only
@Nested
val repository = objects.property<NexusRepository>().apply {
set(repository)
}

@Input
val repositoryDescription = objects.property<String>()
@get:Input
abstract val repositoryDescription: Property<String>

@get:Internal
internal val useStaging = objects.property<Boolean>()
internal abstract val useStaging: Property<Boolean>

init {
this.onlyIf { useStaging.getOrElse(false) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import org.gradle.kotlin.dsl.property
import javax.inject.Inject

@Incubating
open class FindStagingRepository @Inject constructor(
abstract class FindStagingRepository @Inject constructor(
objects: ObjectFactory,
extension: NexusPublishExtension,
repository: NexusRepository,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import org.gradle.kotlin.dsl.property
import javax.inject.Inject

@Suppress("UnstableApiUsage")
open class InitializeNexusStagingRepository @Inject constructor(
abstract class InitializeNexusStagingRepository @Inject constructor(
objects: ObjectFactory,
extension: NexusPublishExtension,
repository: NexusRepository,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import javax.inject.Inject
* Diagnostic task for retrieving the [NexusRepository.stagingProfileId] for the [packageGroup] from the provided [NexusRepository] and logging it
*/
@Incubating
open class RetrieveStagingProfile @Inject constructor(
abstract class RetrieveStagingProfile @Inject constructor(
objects: ObjectFactory,
extension: NexusPublishExtension,
repository: NexusRepository
Expand Down

0 comments on commit 02b43fc

Please sign in to comment.