Skip to content

Commit 37be373

Browse files
committed
simpler publishing
1 parent 58bc1a6 commit 37be373

1 file changed

Lines changed: 14 additions & 50 deletions

File tree

build.gradle.kts

Lines changed: 14 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ plugins {
22
groovy
33
id("java-library")
44
id("maven-publish")
5-
id("com.jfrog.bintray") version ("1.8.5")
6-
id("com.jfrog.artifactory") version ("4.15.2")
75
id("com.github.ben-manes.versions") version ("0.28.0")
86
}
97

@@ -88,18 +86,14 @@ publishing {
8886
artifactId = project.name
8987
version = project.version.toString()
9088

91-
with(pom) {
92-
93-
withXml {
94-
val root = asNode()
95-
root.appendNode("name", projectTitle)
96-
root.appendNode("description", projectDesc)
97-
root.appendNode("url", projectUrl)
98-
}
89+
pom {
90+
name.set(projectTitle)
91+
description.set("${projectTitle} - ${projectDesc} - ${project.name} module")
92+
url.set(projectUrl)
9993

10094
licenses {
10195
license {
102-
name.set("The Apache Software License, Version 2.0")
96+
name.set("The Apache License, Version 2.0")
10397
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
10498
distribution.set("repo")
10599
}
@@ -118,47 +112,17 @@ publishing {
118112
}
119113
}
120114
}
121-
}
122-
123115

124-
artifactory {
125-
setContextUrl("https://oss.jfrog.org")
116+
repositories {
117+
maven {
118+
val releasesRepoUrl = "https://api.bintray.com/maven/openapi-processor/primary/${project.name}/;publish=1;override=0"
119+
val snapshotsRepoUrl = "https://oss.jfrog.org/oss-snapshot-local/"
120+
url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl)
126121

127-
publish(delegateClosureOf<org.jfrog.gradle.plugin.artifactory.dsl.PublisherConfig> {
128-
repository(delegateClosureOf<groovy.lang.GroovyObject> {
129-
setProperty("repoKey", "oss-snapshot-local")
130-
setProperty("username", bintrayUser)
131-
setProperty("password", bintrayKey)
132-
})
133-
134-
defaults(delegateClosureOf<groovy.lang.GroovyObject> {
135-
invokeMethod("publications", arrayOf("projectArtifacts"))
136-
setProperty("publishArtifacts", true)
137-
setPublishPom(true)
138-
})
139-
})
140-
141-
resolve(delegateClosureOf<org.jfrog.gradle.plugin.artifactory.dsl.ResolverConfig> {
142-
setProperty("repoKey", "jcenter")
143-
})
144-
}
145-
146-
147-
bintray {
148-
user = project.ext.get("bintrayUser").toString()
149-
key = project.ext.get("bintrayKey").toString()
150-
151-
setPublications("projectArtifacts")
152-
153-
pkg.apply {
154-
repo = "primary"
155-
name = "openapi-processor-test"
156-
userOrg = "openapi-processor"
157-
setLicenses("Apache-2.0")
158-
vcsUrl = "https://github.com/${projectGithubRepo}"
159-
160-
version.apply {
161-
name = project.version.toString()
122+
credentials {
123+
username = project.ext.get("bintrayUser").toString()
124+
password = project.ext.get("bintrayKey").toString()
125+
}
162126
}
163127
}
164128
}

0 commit comments

Comments
 (0)