|
1 | 1 | plugins {
|
2 |
| - id "java-library" |
3 |
| - |
4 |
| - id "base-information" |
5 |
| - |
6 |
| - id "checkstyle" |
7 |
| - id "jacoco" |
8 |
| - |
9 |
| - id "maven-publish" |
10 |
| - id "io.github.gradle-nexus.publish-plugin" version "2.0.0" |
11 |
| - id "publishing-config" |
12 |
| - id "signing-config" |
13 |
| - id "release-process" |
| 2 | + id "io.github.gradle-nexus.publish-plugin" |
14 | 3 | }
|
15 | 4 |
|
16 |
| -dependencies { |
17 |
| - implementation libs.jandex |
18 |
| - implementation libs.logging |
19 |
| - |
20 |
| - compileOnly libs.loggingAnnotations |
21 |
| - |
22 |
| - annotationProcessor libs.loggingProcessor |
23 |
| - annotationProcessor libs.logging |
24 |
| - annotationProcessor libs.loggingAnnotations |
25 |
| - |
26 |
| - testImplementation jakartaLibs.jpa |
27 |
| - testImplementation testLibs.junit5Api |
28 |
| - testImplementation testLibs.assertjCore |
29 |
| - |
30 |
| - testRuntimeOnly testLibs.junit5Engine |
31 |
| - testRuntimeOnly testLibs.log4j |
32 |
| -} |
33 |
| - |
34 |
| - |
35 | 5 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
36 |
| -// Java handling |
| 6 | +// OSSRH publishing |
37 | 7 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
38 | 8 |
|
39 |
| -// To force the build produce the same byte-for-byte archives and hence make Hibernate Models build reproducible. |
40 |
| -// See also https://docs.gradle.org/current/userguide/working_with_files.html#sec:reproducible_archives |
41 |
| -tasks.withType(AbstractArchiveTask).configureEach { |
42 |
| - preserveFileTimestamps = false |
43 |
| - reproducibleFileOrder = true |
44 |
| -} |
45 |
| - |
46 |
| -java { |
47 |
| - sourceCompatibility = jdks.versions.baseline.get() as int |
48 |
| - targetCompatibility = jdks.versions.baseline.get() as int |
49 |
| - |
50 |
| - withJavadocJar() |
51 |
| - withSourcesJar() |
52 |
| -} |
53 |
| - |
54 |
| -test { |
55 |
| - useJUnitPlatform() |
56 |
| -} |
| 9 | +String hibernatePublishUsername = project.hasProperty( 'hibernatePublishUsername' ) |
| 10 | + ? project.property( 'hibernatePublishUsername' ) |
| 11 | + : null |
| 12 | +String hibernatePublishPassword = project.hasProperty( 'hibernatePublishPassword' ) |
| 13 | + ? project.property( 'hibernatePublishPassword' ) |
| 14 | + : null |
57 | 15 |
|
58 |
| -// create a single "compile" task |
59 |
| -tasks.register( "compile" ).configure { |
60 |
| - dependsOn tasks.withType( JavaCompile ) |
61 |
| -} |
62 |
| - |
63 |
| -tasks.withType( JavaCompile ).configureEach {javaCompile-> |
64 |
| - options.encoding = "UTF-8" |
65 |
| - options.warnings false |
66 |
| -} |
67 |
| - |
68 |
| - |
69 |
| -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
70 |
| -// Javadoc |
71 |
| -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
72 |
| - |
73 |
| -tasks.named( "javadoc", Javadoc ) { |
74 |
| - options { |
75 |
| - use = true |
76 |
| - encoding = "UTF-8" |
77 |
| - |
78 |
| - addStringOption( "Xdoclint:none", "-quiet" ) |
79 |
| - |
80 |
| - tags( |
81 |
| - "todo:X", |
82 |
| - "apiNote:a:API Note:", |
83 |
| - "implSpec:a:Implementation Specification:", |
84 |
| - "implNote:a:Implementation Note:" |
85 |
| - ) |
| 16 | +nexusPublishing { |
| 17 | + repositories { |
| 18 | + sonatype { |
| 19 | + username = hibernatePublishUsername |
| 20 | + password = hibernatePublishPassword |
| 21 | + } |
86 | 22 | }
|
87 | 23 | }
|
88 |
| - |
89 |
| - |
90 |
| -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
91 |
| -// Checkstyle |
92 |
| -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
93 |
| - |
94 |
| -checkstyle { |
95 |
| - sourceSets = [ project.sourceSets.main ] |
96 |
| - showViolations = false |
97 |
| -} |
98 |
| - |
99 |
| - |
100 |
| -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
101 |
| -// JaCoCo |
102 |
| -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
103 |
| - |
104 |
| -def jacocoReportTask = tasks.named( "jacocoTestReport" ) { |
105 |
| - dependsOn tasks.named( "test" ) |
106 |
| -} |
107 |
| - |
108 |
| -jacocoTestReport { |
109 |
| - reports { |
110 |
| - xml.required = false |
111 |
| - csv.required = false |
112 |
| - html.outputLocation = layout.buildDirectory.dir( "jacocoHtml" ) |
113 |
| - } |
114 |
| -} |
115 |
| - |
116 |
| -tasks.named( "check" ) { |
117 |
| - dependsOn jacocoReportTask |
118 |
| -} |
0 commit comments