|
1 | | -buildscript { |
2 | | - repositories { |
3 | | - maven { url 'https://plugins.gradle.org/m2/' } |
4 | | - } |
5 | | - dependencies { |
6 | | - classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' |
7 | | - classpath 'net.ltgt.gradle:gradle-apt-plugin:0.21' |
8 | | - } |
9 | | -} |
10 | | - |
11 | | -rootProject.version = '9.9.0' |
12 | | -group = 'com.spaceshift' |
13 | | - |
14 | | -allprojects { |
15 | | - |
16 | | - repositories { |
17 | | - mavenCentral() |
18 | | - jcenter() |
19 | | - } |
| 1 | +rootProject.version = "9.10.0" |
| 2 | +group = 'javasabr' |
20 | 3 |
|
21 | | - apply plugin: 'java' |
22 | | - apply plugin: 'com.jfrog.bintray' |
23 | | - apply plugin: 'maven-publish' |
24 | | - |
25 | | - sourceCompatibility = JavaVersion.VERSION_11 |
26 | | - targetCompatibility = JavaVersion.VERSION_11 |
27 | | - |
28 | | - ext { |
29 | | - projectreactorVersion = '3.2.9.RELEASE' |
30 | | - sl4jVersion = '1.7.26' |
31 | | - javaxMailVersion = "1.5.0-b01" |
32 | | - testcontainersVersion = '1.11.1' |
33 | | - lombokVersion = '1.18.6' |
34 | | - junitJupiterVersion = "5.4.2" |
35 | | - jetbrainsAnnotation = '17.0.0' |
36 | | - bintrayVersion = version |
37 | | - } |
| 4 | +subprojects { |
38 | 5 |
|
39 | | - javadoc { |
40 | | - failOnError = false |
41 | | - } |
| 6 | + repositories { |
| 7 | + mavenCentral() |
| 8 | + } |
42 | 9 |
|
43 | | - test { |
44 | | - useJUnitPlatform() |
45 | | - } |
| 10 | + apply plugin: "java-library" |
| 11 | + apply plugin: "java-test-fixtures" |
| 12 | + apply plugin: 'maven-publish' |
46 | 13 |
|
47 | | - dependencies { |
48 | | - compileOnly "org.jetbrains:annotations:$jetbrainsAnnotation" |
49 | | - compileOnly "org.projectlombok:lombok:$lombokVersion" |
50 | | - annotationProcessor "org.projectlombok:lombok:$lombokVersion" |
51 | | - |
52 | | - testCompile "org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion" |
53 | | - testCompileOnly "org.projectlombok:lombok:$lombokVersion" |
54 | | - testCompileOnly "org.jetbrains:annotations:$jetbrainsAnnotation" |
55 | | - testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion" |
56 | | - testAnnotationProcessor "org.projectlombok:lombok:$lombokVersion" |
| 14 | + java { |
| 15 | + toolchain { |
| 16 | + languageVersion = JavaLanguageVersion.of(21) |
57 | 17 | } |
58 | | - |
59 | | - /*compileJava { |
60 | | - inputs.property("moduleName", jar.baseName) |
61 | | - doFirst { |
62 | | - options.compilerArgs = [ |
63 | | - '--module-path', classpath.asPath, |
64 | | - ] |
65 | | - classpath = files() |
66 | | - } |
67 | | - }*/ |
68 | | - |
69 | | - task sourcesJar(type: Jar, dependsOn: classes) { |
70 | | - afterEvaluate { |
71 | | - getArchiveClassifier().set("sources") |
72 | | - getArchiveBaseName().set(jar.getArchiveBaseName()) |
73 | | - from sourceSets.main.allSource |
| 18 | + } |
| 19 | + |
| 20 | + javadoc { |
| 21 | + failOnError = false |
| 22 | + } |
| 23 | + |
| 24 | + test { |
| 25 | + useJUnitPlatform() |
| 26 | + failOnNoDiscoveredTests = false |
| 27 | + } |
| 28 | + |
| 29 | + dependencies { |
| 30 | + compileOnly libs.jetbrains.annotations |
| 31 | + compileOnly libs.jspecify |
| 32 | + compileOnly libs.lombok |
| 33 | + annotationProcessor libs.lombok |
| 34 | + |
| 35 | + testImplementation libs.junit.api |
| 36 | + testCompileOnly libs.lombok |
| 37 | + testCompileOnly libs.jetbrains.annotations |
| 38 | + testCompileOnly libs.jspecify |
| 39 | + testRuntimeOnly libs.junit.engine |
| 40 | + testRuntimeOnly libs.junit.platform.launcher |
| 41 | + testAnnotationProcessor libs.lombok |
| 42 | + } |
| 43 | + |
| 44 | + /*compileJava { |
| 45 | + inputs.property("moduleName", jar.baseName) |
| 46 | + doFirst { |
| 47 | + options.compilerArgs = [ |
| 48 | + '--module-path', classpath.asPath, |
| 49 | + ] |
| 50 | + classpath = files() |
| 51 | + } |
| 52 | + }*/ |
| 53 | + |
| 54 | + tasks.withType(JavaCompile).configureEach { |
| 55 | + options.encoding = "UTF-8" |
| 56 | + } |
| 57 | + |
| 58 | + tasks.withType(Javadoc).configureEach { |
| 59 | + options.encoding = "UTF-8" |
| 60 | + } |
| 61 | + |
| 62 | + tasks.register("sourcesJar", Jar) { |
| 63 | + dependsOn "classes" |
| 64 | + group "build" |
| 65 | + archiveClassifier = "sources" |
| 66 | + archiveBaseName = jar.archiveBaseName |
| 67 | + from sourceSets.main.allSource |
| 68 | + } |
| 69 | + |
| 70 | + tasks.register("javadocJar", Jar) { |
| 71 | + dependsOn "javadoc" |
| 72 | + group "build" |
| 73 | + archiveClassifier = "javadoc" |
| 74 | + archiveBaseName = jar.archiveBaseName |
| 75 | + from sourceSets.main.allSource |
| 76 | + } |
| 77 | + |
| 78 | + publishing { |
| 79 | + repositories { |
| 80 | + maven { |
| 81 | + name = "GitlabPackages" |
| 82 | + url = uri("https://gitlab.com/api/v4/projects/37512056/packages/maven") |
| 83 | + credentials(HttpHeaderCredentials) { |
| 84 | + name = "Private-Token" |
| 85 | + value = project.findProperty("gitlab.token") ?: System.getenv("GITLAB_TOKEN") |
74 | 86 | } |
75 | | - } |
76 | | - |
77 | | - task javadocJar(type: Jar, dependsOn: javadoc) { |
78 | | - afterEvaluate { |
79 | | - getArchiveClassifier().set("javadoc") |
80 | | - getArchiveBaseName().set(jar.getArchiveBaseName()) |
81 | | - from sourceSets.main.allSource |
| 87 | + authentication { |
| 88 | + header(HttpHeaderAuthentication) |
82 | 89 | } |
| 90 | + } |
83 | 91 | } |
84 | 92 |
|
85 | | - publishing { |
86 | | - publications { |
87 | | - mavenJava(MavenPublication) { |
88 | | - from components.java |
89 | | - artifact sourcesJar |
90 | | - artifact javadocJar |
91 | | - version = rootProject.version |
92 | | - afterEvaluate { |
93 | | - artifactId = jar.baseName |
94 | | - groupId = rootProject.group |
95 | | - } |
96 | | - } |
97 | | - } |
98 | | - } |
99 | | - |
100 | | - bintray { |
| 93 | + publications { |
| 94 | + mavenJava(MavenPublication) { |
| 95 | + from components.java |
| 96 | + version = rootProject.version |
101 | 97 | afterEvaluate { |
102 | | - user = project.hasProperty("bintrayUser") ? project.property("bintrayUser") : "" |
103 | | - key = project.hasProperty("bintrayKey") ? project.property("bintrayKey") : "" |
104 | | - publications = ['mavenJava'] |
105 | | - pkg { |
106 | | - repo = 'maven' |
107 | | - name = 'com.spaceshift.' + jar.baseName |
108 | | - licenses = ['Apache-2.0'] |
109 | | - websiteUrl = 'https://github.com/JavaSaBr/Rlib' |
110 | | - vcsUrl = 'https://github.com/JavaSaBr/RLib.git' |
111 | | - issueTrackerUrl = 'https://github.com/JavaSaBr/RLib/issues' |
112 | | - githubRepo = 'JavaSaBr/RLib' |
113 | | - githubReleaseNotesFile = 'README.md' |
114 | | - version { |
115 | | - name = rootProject.version |
116 | | - desc = rootProject.version |
117 | | - released = new Date() |
118 | | - } |
119 | | - } |
| 98 | + artifactId = jar.archiveBaseName.get() |
| 99 | + groupId = rootProject.group |
120 | 100 | } |
| 101 | + artifact sourcesJar |
| 102 | + artifact javadocJar |
| 103 | + } |
121 | 104 | } |
| 105 | + } |
122 | 106 |
|
123 | | - configurations { |
124 | | - testArtifacts.extendsFrom testRuntime |
125 | | - } |
| 107 | + configurations { |
| 108 | + testArtifacts.extendsFrom testRuntime |
| 109 | + } |
126 | 110 |
|
127 | | - task testJar(type: Jar) { |
128 | | - getArchiveClassifier().set("test") |
129 | | - from sourceSets.test.output |
130 | | - } |
| 111 | + tasks.register('testJar', Jar) { |
| 112 | + archiveClassifier = "test" |
| 113 | + from sourceSets.test.output |
| 114 | + } |
131 | 115 |
|
132 | | - artifacts { |
133 | | - testArtifacts testJar |
134 | | - } |
| 116 | + artifacts { |
| 117 | + testArtifacts testJar |
| 118 | + } |
135 | 119 |
|
136 | | - tasks.withType(Test) { |
137 | | - maxParallelForks = Runtime.runtime.availableProcessors() |
138 | | - } |
| 120 | + tasks.withType(Test).configureEach { |
| 121 | + maxParallelForks = Runtime.runtime.availableProcessors() |
| 122 | + } |
139 | 123 | } |
140 | 124 |
|
141 | 125 | wrapper { |
142 | | - gradleVersion = '6.0' |
143 | | - distributionType = Wrapper.DistributionType.ALL |
| 126 | + gradleVersion = '9.0.0' |
| 127 | + distributionType = Wrapper.DistributionType.ALL |
144 | 128 | } |
0 commit comments