Skip to content

Commit 7e6a7c7

Browse files
committed
change group id, publish snapshots
1 parent 3c48c33 commit 7e6a7c7

2 files changed

Lines changed: 98 additions & 20 deletions

File tree

build.gradle.kts

Lines changed: 90 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ plugins {
33
id("java-library")
44
id("maven-publish")
55
id("com.jfrog.bintray") version ("1.8.5")
6+
id("com.jfrog.artifactory") version ("4.15.2")
67
id("com.github.ben-manes.versions") version ("0.28.0")
78
}
89

9-
group = "com.github.hauner.openapi"
10-
version = "1.0.0.M1"
10+
val projectGroupId: String by project
11+
val projectVersion: String by project
12+
13+
group = projectGroupId
14+
version = projectVersion
1115

1216
java {
1317
sourceCompatibility = JavaVersion.VERSION_1_8
@@ -22,6 +26,10 @@ ext {
2226
repositories {
2327
mavenCentral()
2428
maven {
29+
setUrl("https://dl.bintray.com/openapi-processor/primary")
30+
}
31+
maven {
32+
// deprecated but still used
2533
setUrl("https://dl.bintray.com/hauner/openapi-processor")
2634
}
2735
}
@@ -60,35 +68,97 @@ artifacts {
6068
archives(javadocJar)
6169
}
6270

63-
bintray {
64-
user = project.ext.get("bintrayUser").toString()
65-
key = project.ext.get("bintrayKey").toString()
66-
67-
setPublications("processor")
68-
69-
pkg.apply {
70-
repo = "openapi-processor"
71-
name = "openapi-processor-test"
72-
//userOrg = 'openapi-processor'
73-
setLicenses("Apache-2.0")
74-
vcsUrl = "https://github.com/hauner/openapi-processor-test"
71+
//apply(from = "${rootProject.rootDir}/gradle/publishing.gradle.kts")
7572

76-
version.apply {
77-
name = project.version.toString()
78-
}
79-
}
80-
}
73+
val projectTitle: String by project
74+
val projectDesc: String by project
75+
val projectUrl: String by project
76+
val projectGithubRepo: String by project
77+
val bintrayUser: String by project.ext
78+
val bintrayKey: String by project.ext
8179

8280
publishing {
8381
publications {
84-
create<MavenPublication>("processor") {
82+
create<MavenPublication>("projectArtifacts") {
8583
from(components["java"])
8684
artifact(sourcesJar.get())
8785
artifact(javadocJar.get())
8886

8987
groupId = project.group.toString()
9088
artifactId = project.name
9189
version = project.version.toString()
90+
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+
}
99+
100+
licenses {
101+
license {
102+
name.set("The Apache Software License, Version 2.0")
103+
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
104+
distribution.set("repo")
105+
}
106+
}
107+
108+
developers {
109+
developer {
110+
id.set("hauner")
111+
name.set("Martin Hauner")
112+
}
113+
}
114+
115+
scm {
116+
url.set("https://github.com/${projectGithubRepo}")
117+
}
118+
}
119+
}
120+
}
121+
}
122+
123+
124+
artifactory {
125+
setContextUrl("https://oss.jfrog.org")
126+
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()
92162
}
93163
}
94164
}

gradle.properties

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
projectVersion=1.0.0.M1-SNAPSHOT
2+
projectGroupId=io.openapiprocessor
3+
4+
projectUrl=http://openapiprocessor.io
5+
projectTitle=openapi-processor
6+
projectDesc=converts OpenAPI yaml descriptions to a target format, e.g. Java code (Spring) or json
7+
8+
projectGithubRepo=openapi-processor/openapi-processor-test

0 commit comments

Comments
 (0)