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