@@ -18,65 +18,19 @@ package io.github.gradlenexus.publishplugin
18
18
19
19
import io.github.gradlenexus.publishplugin.internal.NexusClient
20
20
import io.codearte.gradle.nexus.NexusStagingExtension
21
- import org.gradle.api.DefaultTask
22
21
import org.gradle.api.GradleException
23
22
import org.gradle.api.artifacts.repositories.MavenArtifactRepository
24
23
import org.gradle.api.model.ObjectFactory
25
- import org.gradle.api.provider.Property
26
24
import org.gradle.api.publish.PublishingExtension
27
- import org.gradle.api.tasks.Input
28
- import org.gradle.api.tasks.Internal
29
- import org.gradle.api.tasks.Optional
30
25
import org.gradle.api.tasks.TaskAction
31
- import org.gradle.kotlin.dsl.property
32
26
import org.gradle.kotlin.dsl.the
33
27
import java.net.URI
34
- import java.time.Duration
35
28
import javax.inject.Inject
36
29
37
30
@Suppress(" UnstableApiUsage" )
38
31
open class InitializeNexusStagingRepository @Inject
39
- constructor (objects: ObjectFactory , extension: NexusPublishExtension , repository: NexusRepository , private val serverUrlToStagingRepoUrl: MutableMap <URI , URI >) : DefaultTask () {
40
-
41
- @get:Input
42
- val serverUrl: Property <URI > = objects.property()
43
-
44
- @get:Optional
45
- @get:Input
46
- val username: Property <String > = objects.property()
47
-
48
- @get:Optional
49
- @get:Input
50
- val password: Property <String > = objects.property()
51
-
52
- @get:Optional
53
- @get:Input
54
- val packageGroup: Property <String > = objects.property()
55
-
56
- @get:Optional
57
- @get:Input
58
- val stagingProfileId: Property <String > = objects.property()
59
-
60
- @get:Input
61
- val repositoryName: Property <String > = objects.property()
62
-
63
- @get:Internal
64
- val clientTimeout: Property <Duration > = objects.property()
65
-
66
- @get:Internal
67
- val connectTimeout: Property <Duration > = objects.property()
68
-
69
- init {
70
- serverUrl.set(repository.nexusUrl)
71
- username.set(repository.username)
72
- password.set(repository.password)
73
- packageGroup.set(extension.packageGroup)
74
- stagingProfileId.set(repository.stagingProfileId)
75
- repositoryName.set(repository.name)
76
- clientTimeout.set(extension.clientTimeout)
77
- connectTimeout.set(extension.connectTimeout)
78
- this .onlyIf { extension.useStaging.getOrElse(false ) }
79
- }
32
+ constructor (objects: ObjectFactory , extension: NexusPublishExtension , repository: NexusRepository , private val serverUrlToStagingRepoUrl: MutableMap <URI , URI >) :
33
+ BaseOperationOnNexusStagingRepository (objects, extension, repository) {
80
34
81
35
@TaskAction
82
36
fun createStagingRepoAndReplacePublishingRepoUrl () {
0 commit comments