-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
127 lines (115 loc) · 4.41 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
plugins {
id("com.gradle.plugin-publish") version "1.2.1"
id 'java-gradle-plugin'
id 'maven-publish'
id 'signing'
}
group 'pro.axenix-innovation'
sourceCompatibility = '11'
String repoURL = ""
String sonatypeRepoURL = ""
if (version.endsWith('-SNAPSHOT')) {
repoURL = System.getenv('NEXUS_SERVER_URL_SNAPSHOT').toString()
sonatypeRepoURL = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
} else {
repoURL = System.getenv('NEXUS_SERVER_URL_RELEASE').toString()
sonatypeRepoURL = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
}
String nexus_user = System.getenv('NEXUS_USER')
String nexus_password = System.getenv('NEXUS_PASSWORD')
String sonatype_nexus_user = System.getenv('SONATYPE_NEXUS_USER')
String sonatype_nexus_password = System.getenv('SONATYPE_NEXUS_PASSWORD')
gradlePlugin {
website = "https://github.com/AxenAPI/"
vcsUrl = "https://github.com/AxenAPI/axenapi-gradle-plugin"
plugins {
create("axenapi-generator-gradle-plugin"){
id = 'pro.axenix-innovation.axenapi.generator'
description = "AxenAPI Generator allows generation of async API (Kafka, Rabbit etc) client libraries (SDK generation), server stubs, and configuration automatically given an OpenAPI Spec (v2, v3)."
displayName = "AxenAPI Generator Gradle Plugin"
implementationClass = 'KafkaCodegenPlugin'
version = version
tags.addAll("openapi-3.0", "openapi-2.0", "openapi", "swagger", "codegen", "sdk")
}
}
}
repositories {
mavenLocal()
mavenCentral()
maven {
allowInsecureProtocol = true
url repoURL
credentials.setUsername(nexus_user)
credentials.setPassword(nexus_password)
}
}
boolean isReleaseVersion = !version.endsWith("SNAPSHOT")
java {
withJavadocJar()
withSourcesJar()
}
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("publish") }
sign(publishing.publications)
}
afterEvaluate {
publishing {
publications {
pluginMaven {
pom {
name = "Axenix API Generator Gradle Plugin"
description = "bla bla bla AxenAPI Generator allows generation of async API (Kafka, Rabbit etc) client libraries (SDK generation), server stubs, and configuration automatically given an OpenAPI Spec (v2, v3)."
url = "https://github.com/AxenAPI/axenapi-generator-plugin"
organization {
name = "pro.axenix-innovation"
url = "https://github.com/AxenAPI"
}
licenses {
license {
name = "The Apache Software License, Version 2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
distribution = "repo"
}
}
developers {
developer {
id = "axenix-innovation"
name = "AxenAPI-Generator Contributors"
email = "axenapi-info@axenix.pro"
}
}
scm {
url = "https://github.com/AxenAPI/axenapi-generator"
connection = "scm:git:git://github.com/AxenAPI/axenapi-generator.git"
developerConnection = "scm:git:ssh://git@github.com:AxenAPI/axenapi-generator.git"
}
issueManagement {
system = "GitHub"
url = "https://github.com/AxenAPI/axenapi-generator/issues"
}
}
}
}
repositories {
maven {
allowInsecureProtocol = true
url repoURL
credentials.setUsername(nexus_user)
credentials.setPassword(nexus_password)
}
maven {
allowInsecureProtocol = true
url sonatypeRepoURL
credentials.setUsername(sonatype_nexus_user)
credentials.setPassword(sonatype_nexus_password)
}
}
}
}
dependencies {
implementation 'org.openapitools:openapi-generator:6.4.0'
implementation 'pro.axenix-innovation:axenapi-generator:2.0.0'
}
test {
useJUnitPlatform()
}