Skip to content

Commit b7e75ff

Browse files
author
bnasslahsen
committed
review gradle configuration
1 parent cd7ef96 commit b7e75ff

File tree

2 files changed

+28
-20
lines changed

2 files changed

+28
-20
lines changed

build.gradle

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
plugins {
22
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
33
id 'org.jetbrains.kotlin.jvm' version '1.3.72' apply false
4+
id 'org.sonarqube' version '2.8'
5+
id 'net.researchgate.release' version '2.8.1'
46
id 'java'
5-
id "org.sonarqube" version "2.8"
6-
}
7-
8-
allprojects {
9-
group = 'org.springdoc'
10-
version = '1.4.2-SNAPSHOT'
11-
}
12-
13-
repositories {
14-
mavenLocal()
15-
mavenCentral()
7+
id 'signing'
168
}
179

1810
ext {
@@ -22,11 +14,15 @@ ext {
2214
}
2315

2416
subprojects {
25-
26-
apply plugin: 'java'
2717
apply plugin: 'java-library'
2818
apply plugin: 'maven-publish'
2919
apply plugin: 'io.spring.dependency-management'
20+
apply plugin: 'signing'
21+
22+
sourceCompatibility = JavaVersion.VERSION_1_8
23+
targetCompatibility = JavaVersion.VERSION_1_8
24+
compileJava.options.encoding = "UTF-8"
25+
compileTestJava.options.encoding = "UTF-8"
3026

3127
configurations {
3228
testImplementation.extendsFrom compileOnly
@@ -68,11 +64,14 @@ subprojects {
6864
useJUnitPlatform()
6965
}
7066

71-
sourceCompatibility = '1.8'
67+
task sourcesJar(type: Jar) {
68+
from sourceSets.main.allJava
69+
archiveClassifier = "sources"
70+
}
7271

73-
java {
74-
withSourcesJar()
75-
withJavadocJar()
72+
task javadocJar(type: Jar) {
73+
from sourceSets.main.allJava
74+
archiveClassifier = "javadoc"
7675
}
7776

7877
publishing {
@@ -104,13 +103,20 @@ subprojects {
104103
}
105104
}
106105

107-
tasks.withType(JavaCompile) {
108-
options.encoding = 'UTF-8'
106+
signing {
107+
sign publishing.publications.mavenJava
109108
}
110109
}
111110

112111
sonarqube {
113112
properties {
114113
property("sonar.projectKey", "springdoc_springdoc-openapi")
115114
}
116-
}
115+
}
116+
117+
118+
release {
119+
tagTemplate = 'v$version'
120+
}
121+
122+
afterReleaseBuild.dependsOn subprojects.publish

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
group = org.springdoc
2+
version = 1.4.2-SNAPSHOT

0 commit comments

Comments
 (0)