Skip to content

Commit 2cf83c5

Browse files
authored
Merge pull request #108 from openapi-processor/publishing
resolves #106
2 parents 36c6b88 + 3305d58 commit 2cf83c5

3 files changed

Lines changed: 87 additions & 39 deletions

File tree

build.gradle

Lines changed: 23 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@ plugins {
33
id 'groovy'
44
id 'java-library'
55
id 'maven-publish'
6-
id 'com.jfrog.bintray' version '1.8.5'
76
id 'org.jetbrains.kotlin.jvm' version '1.3.72'
87
id 'org.jetbrains.dokka' version '0.10.1'
98
id 'org.unbroken-dome.test-sets' version '3.0.1'
109
id "com.github.ben-manes.versions" version "0.28.0"
1110
}
1211

13-
group 'com.github.hauner.openapi'
14-
version '1.0.0.M14'
12+
group projectGroupId
13+
version projectVersion
1514

1615
java {
1716
sourceCompatibility = JavaVersion.VERSION_1_8
@@ -34,8 +33,25 @@ repositories {
3433
maven {
3534
url "https://oss.sonatype.org/content/repositories/snapshots"
3635
}
36+
37+
maven {
38+
url "https://dl.bintray.com/openapi-processor/primary"
39+
content {
40+
includeGroup "io.openapiprocessor"
41+
}
42+
mavenContent {
43+
releasesOnly()
44+
}
45+
}
46+
3747
maven {
38-
setUrl("https://dl.bintray.com/openapi-processor/primary")
48+
url "https://oss.jfrog.org/artifactory/oss-snapshot-local"
49+
content {
50+
includeGroup "io.openapiprocessor"
51+
}
52+
mavenContent {
53+
snapshotsOnly()
54+
}
3955
}
4056
}
4157

@@ -69,14 +85,14 @@ dependencies {
6985
components.all(KotlinPlatformRule)
7086

7187
compileOnly "io.openapiprocessor:openapi-processor-api:$processorApiVersion"
72-
implementation 'io.openapiprocessor:openapi-processor-core:1.0.0.M1'
88+
implementation 'io.openapiprocessor:openapi-processor-core:1.0.0.M3-SNAPSHOT'
7389

7490
implementation 'org.codehaus.groovy:groovy:2.5.12'
7591
implementation 'org.slf4j:slf4j-api:1.7.30'
7692

7793
testImplementation ("io.openapiprocessor:openapi-processor-api:$processorApiVersion")
7894

79-
testImplementation ('io.openapiprocessor:openapi-processor-test:1.0.0.M1') {
95+
testImplementation ('io.openapiprocessor:openapi-processor-test:1.0.0.M1-SNAPSHOT') {
8096
exclude group: 'com.google.guava'
8197
}
8298

@@ -140,36 +156,4 @@ dokka {
140156
outputDirectory = "$buildDir/docs/kotlin"
141157
}
142158

143-
144-
bintray {
145-
user = bintrayUser
146-
key = bintrayKey
147-
publications = ['processor']
148-
149-
pkg {
150-
repo = 'openapi-processor'
151-
name = 'openapi-processor-spring'
152-
//userOrg = 'openapi-generatr'
153-
licenses = ['Apache-2.0']
154-
vcsUrl = 'https://github.com/hauner/openapi-processor-spring'
155-
156-
version {
157-
name = project.version
158-
}
159-
}
160-
}
161-
162-
163-
publishing {
164-
publications {
165-
processor (MavenPublication) {
166-
from components.java
167-
artifact sourcesJar
168-
artifact javadocJar
169-
170-
groupId project.group
171-
artifactId project.name
172-
version project.version
173-
}
174-
}
175-
}
159+
apply from: "${rootProject.rootDir}/gradle/publishing.gradle"

gradle.properties

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
projectVersion=1.0.0.M15-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-spring
9+
10+
systemProp.org.gradle.internal.publish.checksums.insecure=true

gradle/publishing.gradle

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
publishing {
2+
publications {
3+
OpenApiProcessor (MavenPublication) {
4+
groupId project.group
5+
artifactId project.name
6+
version project.version
7+
8+
from components.java
9+
artifact sourcesJar
10+
artifact javadocJar
11+
12+
pom {
13+
name = project.projectTitle
14+
// description = project.projectDesc
15+
description = "${project.projectTitle} - ${project.projectDesc} - ${project.name} module".toString()
16+
url = project.projectUrl
17+
18+
licenses {
19+
license {
20+
name = 'The Apache Software License, Version 2.0'
21+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
22+
distribution = "repo"
23+
}
24+
}
25+
26+
developers {
27+
developer {
28+
id = 'hauner'
29+
name = 'Martin Hauner'
30+
}
31+
}
32+
33+
scm {
34+
url = "https://github.com/${project.projectGithubRepo}".toString ()
35+
}
36+
}
37+
38+
}
39+
}
40+
41+
repositories {
42+
43+
maven {
44+
def releaseRepository = uri("https://api.bintray.com/maven/openapi-processor/primary/${project.name}/;publish=1;override=0")
45+
def snapshotRepository = uri("https://oss.jfrog.org/oss-snapshot-local/")
46+
url = version.endsWith('SNAPSHOT') ? snapshotRepository : releaseRepository
47+
48+
credentials {
49+
username = bintrayUser
50+
password = bintrayKey
51+
}
52+
}
53+
}
54+
}

0 commit comments

Comments
 (0)