Skip to content

Commit 360cd24

Browse files
committed
Add publish task and provide properties to setup deployment repository
1 parent 3c15470 commit 360cd24

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

kotlinx-collections-immutable/build.gradle

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ description 'Kotlin experimental immutable collection interfaces and implementat
1515
allprojects {
1616
apply plugin: 'kotlin'
1717
group = 'org.jetbrains.kotlinx'
18-
version = '0.1-SNAPSHOT'
18+
version = project.properties["deployVersion"] ?: '0.1-SNAPSHOT'
1919

2020
repositories {
2121
mavenCentral()
22-
maven { url 'http://dl.bintray.com/kotlin/kotlin-eap-1.1' }
22+
jcenter()
2323
}
2424

2525
dependencies {
@@ -88,22 +88,24 @@ artifacts {
8888
}
8989

9090
signing {
91-
required { signatory != null }
91+
required { (project.properties["signingRequired"] ?: false) }
9292
sign configurations.archives
9393
}
9494

95+
signArchives {
96+
enabled signing.required
97+
}
98+
9599
uploadArchives {
96100
repositories {
97101
mavenDeployer {
98102
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
99-
repository(url: "file://${buildDir}/repo")
100-
// repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
101-
// authentication(userName: ossrhUsername, password: ossrhPassword)
102-
// }
103-
//
104-
// snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
105-
// authentication(userName: ossrhUsername, password: ossrhPassword)
106-
// }
103+
repository(url: project.properties["deployRepoUrl"] ?: "file://${rootProject.buildDir}/repo") {
104+
authentication(
105+
userName: project.properties["deployRepoUsername"],
106+
password: project.properties["deployRepoPassword"]
107+
)
108+
}
107109
pom.project {
108110
name "${project.group}:${project.name}"
109111
packaging 'jar'
@@ -133,6 +135,8 @@ uploadArchives {
133135
}
134136
}
135137
}
138+
139+
task publish(dependsOn: uploadArchives)
136140
/*
137141
138142
// extract signature file and give them proper name

0 commit comments

Comments
 (0)