|
1 | | -rootProject.version = '9.9.1' |
2 | | -group = 'com.spaceshift' |
| 1 | +rootProject.version = '9.9.2' |
| 2 | +group = 'javasabr' |
3 | 3 |
|
4 | 4 | allprojects { |
5 | 5 |
|
6 | | - repositories { |
7 | | - mavenCentral() |
| 6 | + repositories { |
| 7 | + mavenCentral() |
| 8 | + } |
| 9 | + |
| 10 | + apply plugin: "java-library" |
| 11 | + apply plugin: "java-test-fixtures" |
| 12 | + apply plugin: 'maven-publish' |
| 13 | + |
| 14 | + sourceCompatibility = JavaVersion.VERSION_17 |
| 15 | + targetCompatibility = JavaVersion.VERSION_17 |
| 16 | + |
| 17 | + javadoc { |
| 18 | + failOnError = false |
| 19 | + } |
| 20 | + |
| 21 | + test { |
| 22 | + useJUnitPlatform() |
| 23 | + } |
| 24 | + |
| 25 | + dependencies { |
| 26 | + compileOnly libs.jetbrains.annotations |
| 27 | + compileOnly libs.lombok |
| 28 | + annotationProcessor libs.lombok |
| 29 | + |
| 30 | + testImplementation libs.junit.api |
| 31 | + testCompileOnly libs.lombok |
| 32 | + testCompileOnly libs.jetbrains.annotations |
| 33 | + testRuntimeOnly libs.junit.engine |
| 34 | + testAnnotationProcessor libs.lombok |
| 35 | + } |
| 36 | + |
| 37 | + /*compileJava { |
| 38 | + inputs.property("moduleName", jar.baseName) |
| 39 | + doFirst { |
| 40 | + options.compilerArgs = [ |
| 41 | + '--module-path', classpath.asPath, |
| 42 | + ] |
| 43 | + classpath = files() |
| 44 | + } |
| 45 | + }*/ |
| 46 | + |
| 47 | + compileJava { |
| 48 | + options.encoding = "UTF-8" |
| 49 | + } |
| 50 | + |
| 51 | + compileTestJava { |
| 52 | + options.encoding = "UTF-8" |
| 53 | + } |
| 54 | + |
| 55 | + tasks.withType(Javadoc).configureEach { |
| 56 | + options.encoding = "UTF-8" |
| 57 | + } |
| 58 | + |
| 59 | + task sourcesJar(type: Jar, dependsOn: classes) { |
| 60 | + afterEvaluate { |
| 61 | + getArchiveClassifier().set("sources") |
| 62 | + getArchiveBaseName().set(jar.getArchiveBaseName()) |
| 63 | + from sourceSets.main.allSource |
8 | 64 | } |
| 65 | + } |
9 | 66 |
|
10 | | - apply plugin: "java-library" |
11 | | - apply plugin: "java-test-fixtures" |
12 | | - apply plugin: 'maven-publish' |
13 | | - |
14 | | - sourceCompatibility = JavaVersion.VERSION_11 |
15 | | - targetCompatibility = JavaVersion.VERSION_11 |
16 | | - |
17 | | - javadoc { |
18 | | - failOnError = false |
| 67 | + task javadocJar(type: Jar, dependsOn: javadoc) { |
| 68 | + afterEvaluate { |
| 69 | + getArchiveClassifier().set("javadoc") |
| 70 | + getArchiveBaseName().set(jar.getArchiveBaseName()) |
| 71 | + from sourceSets.main.allSource |
19 | 72 | } |
| 73 | + } |
20 | 74 |
|
21 | | - test { |
22 | | - useJUnitPlatform() |
23 | | - } |
24 | | - |
25 | | - dependencies { |
26 | | - compileOnly libs.jetbrains.annotations |
27 | | - compileOnly libs.lombok |
28 | | - annotationProcessor libs.lombok |
29 | | - |
30 | | - testImplementation libs.junit.api |
31 | | - testCompileOnly libs.lombok |
32 | | - testCompileOnly libs.jetbrains.annotations |
33 | | - testRuntimeOnly libs.junit.engine |
34 | | - testAnnotationProcessor libs.lombok |
35 | | - } |
36 | | - |
37 | | - /*compileJava { |
38 | | - inputs.property("moduleName", jar.baseName) |
39 | | - doFirst { |
40 | | - options.compilerArgs = [ |
41 | | - '--module-path', classpath.asPath, |
42 | | - ] |
43 | | - classpath = files() |
| 75 | + publishing { |
| 76 | + repositories { |
| 77 | + maven { |
| 78 | + name = "GitlabPackages" |
| 79 | + url = uri("https://gitlab.com/api/v4/projects/37512056/packages/maven") |
| 80 | + credentials(HttpHeaderCredentials) { |
| 81 | + name = "Private-Token" |
| 82 | + value = project.findProperty("gitlab.token") ?: System.getenv("GITLAB_TOKEN") |
44 | 83 | } |
45 | | - }*/ |
46 | | - |
47 | | - compileJava { |
48 | | - options.encoding = "UTF-8" |
49 | | - } |
50 | | - |
51 | | - compileTestJava { |
52 | | - options.encoding = "UTF-8" |
53 | | - } |
54 | | - |
55 | | - tasks.withType(Javadoc) { |
56 | | - options.encoding = "UTF-8" |
57 | | - } |
58 | | - |
59 | | - task sourcesJar(type: Jar, dependsOn: classes) { |
60 | | - afterEvaluate { |
61 | | - getArchiveClassifier().set("sources") |
62 | | - getArchiveBaseName().set(jar.getArchiveBaseName()) |
63 | | - from sourceSets.main.allSource |
| 84 | + authentication { |
| 85 | + header(HttpHeaderAuthentication) |
64 | 86 | } |
| 87 | + } |
65 | 88 | } |
66 | 89 |
|
67 | | - task javadocJar(type: Jar, dependsOn: javadoc) { |
| 90 | + publications { |
| 91 | + mavenJava(MavenPublication) { |
| 92 | + from components.java |
| 93 | + version = rootProject.version |
68 | 94 | afterEvaluate { |
69 | | - getArchiveClassifier().set("javadoc") |
70 | | - getArchiveBaseName().set(jar.getArchiveBaseName()) |
71 | | - from sourceSets.main.allSource |
72 | | - } |
73 | | - } |
74 | | - |
75 | | - publishing { |
76 | | - repositories { |
77 | | - maven { |
78 | | - name = "GitlabPackages" |
79 | | - url = uri("https://gitlab.com/api/v4/projects/37512056/packages/maven") |
80 | | - credentials(HttpHeaderCredentials) { |
81 | | - name = "Private-Token" |
82 | | - value = project.findProperty("gitlab.token") ?: System.getenv("GITLAB_TOKEN") |
83 | | - } |
84 | | - authentication { |
85 | | - header(HttpHeaderAuthentication) |
86 | | - } |
87 | | - } |
88 | | - } |
89 | | - |
90 | | - publications { |
91 | | - mavenJava(MavenPublication) { |
92 | | - from components.java |
93 | | - artifact sourcesJar |
94 | | - artifact javadocJar |
95 | | - version = rootProject.version |
96 | | - afterEvaluate { |
97 | | - artifactId = jar.baseName |
98 | | - groupId = rootProject.group |
99 | | - } |
100 | | - } |
| 95 | + artifactId = jar.archiveBaseName.get() |
| 96 | + groupId = rootProject.group |
101 | 97 | } |
| 98 | + artifact sourcesJar |
| 99 | + artifact javadocJar |
| 100 | + } |
102 | 101 | } |
| 102 | + } |
103 | 103 |
|
104 | | - configurations { |
105 | | - testArtifacts.extendsFrom testRuntime |
106 | | - } |
| 104 | + configurations { |
| 105 | + testArtifacts.extendsFrom testRuntime |
| 106 | + } |
107 | 107 |
|
108 | | - task testJar(type: Jar) { |
109 | | - getArchiveClassifier().set("test") |
110 | | - from sourceSets.test.output |
111 | | - } |
| 108 | + tasks.register('testJar', Jar) { |
| 109 | + getArchiveClassifier().set("test") |
| 110 | + from sourceSets.test.output |
| 111 | + } |
112 | 112 |
|
113 | | - artifacts { |
114 | | - testArtifacts testJar |
115 | | - } |
| 113 | + artifacts { |
| 114 | + testArtifacts testJar |
| 115 | + } |
116 | 116 |
|
117 | | - tasks.withType(Test) { |
118 | | - maxParallelForks = Runtime.runtime.availableProcessors() |
| 117 | + tasks.withType(Test).tap { |
| 118 | + configureEach { |
| 119 | + maxParallelForks = Runtime.runtime.availableProcessors() |
119 | 120 | } |
| 121 | + } |
120 | 122 | } |
121 | 123 |
|
122 | 124 | wrapper { |
123 | | - gradleVersion = '7.4.2' |
124 | | - distributionType = Wrapper.DistributionType.ALL |
| 125 | + gradleVersion = '8.11.1' |
| 126 | + distributionType = Wrapper.DistributionType.ALL |
125 | 127 | } |
0 commit comments