|
1 | | -buildscript { |
2 | | - repositories { |
3 | | - mavenCentral() |
4 | | - gradlePluginPortal() |
5 | | - } |
6 | | - dependencies { |
7 | | - classpath "io.github.gradle-nexus:publish-plugin:2.0.0" |
8 | | - classpath "org.graceframework:grace-gradle-plugin:$graceVersion" |
9 | | - classpath "org.gradle:test-retry-gradle-plugin:1.6.0" |
10 | | - } |
11 | | -} |
12 | | - |
13 | | -ext { |
14 | | - isReleaseVersion = !project.projectVersion.endsWith('-SNAPSHOT') |
15 | | - graceVersion = project.graceVersion |
16 | | - userOrg = "graceframework" |
| 1 | +plugins { |
| 2 | + id 'java-library' |
| 3 | + id 'groovy' |
| 4 | + id 'maven-publish' |
| 5 | + id 'signing' |
| 6 | + id 'eclipse' |
| 7 | + id 'idea' |
| 8 | + alias libs.plugins.grace.doc |
| 9 | + alias libs.plugins.gradle.nexus.publish |
| 10 | + alias libs.plugins.gradle.test.retry |
17 | 11 | } |
18 | 12 |
|
| 13 | +ext.'signing.keyId' = rootProject.hasProperty('signing.keyId') ? rootProject.getProperty('signing.keyId') : System.getenv('SIGNING_KEY') |
| 14 | +ext.'signing.password' = rootProject.hasProperty('signing.password') ? rootProject.getProperty('signing.password') : System.getenv('SIGNING_PASSPHRASE') |
| 15 | +ext.'signing.secretKeyRingFile' = rootProject.hasProperty('signing.secretKeyRingFile') ? rootProject.getProperty('signing.secretKeyRingFile') : "${System.properties['user.home']}${File.separator}.gnupg${File.separator}secring.gpg" |
| 16 | +ext.isReleaseVersion = !projectVersion.endsWith('SNAPSHOT') |
19 | 17 |
|
20 | 18 | version = project.projectVersion |
| 19 | +group = 'org.graceframework.events' |
21 | 20 |
|
22 | | -apply plugin:'idea' |
23 | | - |
24 | | -apply plugin: 'groovy' |
25 | | -apply plugin: 'maven-publish' |
26 | | -apply plugin: "io.github.gradle-nexus.publish-plugin" |
27 | | -apply plugin: 'org.graceframework.grace-doc' |
28 | | - |
29 | | -nexusPublishing { |
30 | | - repositories { |
31 | | - sonatype { |
32 | | - def mavenUser = System.getenv("MAVEN_CENTRAL_USER") ?: project.hasProperty("mavenCentralUsername") ? project.mavenCentralUsername : '' |
33 | | - def mavenPass = System.getenv("MAVEN_CENTRAL_PASSWORD") ?: project.hasProperty("mavenCentralPassword") ? project.mavenCentralPassword : '' |
34 | | - nexusUrl = uri("https://ossrh-staging-api.central.sonatype.com/service/local/") |
35 | | - snapshotRepositoryUrl = uri("https://central.sonatype.com/repository/maven-snapshots/") |
36 | | - username = mavenUser |
37 | | - password = mavenPass |
38 | | - } |
39 | | - } |
| 21 | +configurations { |
| 22 | + documentation |
40 | 23 | } |
41 | 24 |
|
42 | | -allprojects { |
43 | | - repositories { |
44 | | - mavenCentral() |
45 | | - if (project.projectVersion.endsWith('-SNAPSHOT')) { |
46 | | - maven { |
47 | | - url = "https://s01.oss.sonatype.org/content/repositories/snapshots/" |
48 | | - } |
| 25 | +tasks.withType(Test) { |
| 26 | + useJUnitPlatform() |
| 27 | + testLogging { |
| 28 | + showStandardStreams = true |
| 29 | + exceptionFormat = 'full' |
| 30 | + } |
| 31 | + configure { |
| 32 | + retry { |
| 33 | + maxRetries = 2 |
| 34 | + maxFailures = 20 |
| 35 | + failOnPassedAfterRetry = true |
49 | 36 | } |
50 | 37 | } |
51 | | - |
52 | | - configurations { |
53 | | - documentation |
54 | | - } |
55 | | - |
56 | | - dependencies { |
57 | | - documentation "com.github.javaparser:javaparser-core:$javaParserCoreVersion" |
58 | | - documentation "org.apache.groovy:groovy:$groovyVersion" |
59 | | - documentation "org.apache.groovy:groovy-ant:$groovyVersion" |
60 | | - documentation "org.apache.groovy:groovy-dateutil:$groovyVersion" |
61 | | - } |
62 | 38 | } |
63 | 39 |
|
64 | | -subprojects { project-> |
65 | | - if (project.name.startsWith('grace-plugin')) { |
66 | | - group = "org.graceframework.plugins" |
67 | | - } |
68 | | - else { |
69 | | - group = "org.graceframework.events" |
70 | | - } |
71 | | - version = project.projectVersion |
72 | | - |
73 | | - nexusPublishing { |
74 | | - if (project.name.startsWith('grace-plugin')) { |
75 | | - packageGroup = 'org.graceframework.plugins' |
76 | | - } |
77 | | - else { |
78 | | - packageGroup = "org.graceframework.events" |
79 | | - } |
80 | | - } |
81 | | - |
82 | | - if (project.name.startsWith('examples') || project.name.endsWith('docs')) { |
83 | | - return |
84 | | - } |
85 | | - |
86 | | - apply plugin: 'eclipse' |
87 | | - apply plugin: 'idea' |
88 | | - apply plugin: 'java-library' |
89 | | - apply plugin: 'groovy' |
90 | | - apply plugin: 'maven-publish' |
91 | | - apply plugin: 'signing' |
92 | | - apply plugin: "org.gradle.test-retry" |
93 | | - |
94 | | - if (project.name.startsWith('grace-plugin')) { |
95 | | - apply plugin: 'org.graceframework.grace-plugin' |
96 | | - } |
97 | | - else { |
98 | | - apply plugin: "io.spring.dependency-management" |
99 | | - |
100 | | - dependencyManagement { |
101 | | - imports { |
102 | | - mavenBom "org.graceframework:grace-bom:$graceVersion" |
103 | | - } |
104 | | - applyMavenExclusions false |
105 | | - generatedPomCustomization { |
106 | | - enabled = false |
107 | | - } |
108 | | - } |
109 | | - } |
110 | | - |
111 | | - if (project.name.startsWith('grace-')) { |
112 | | - dependencies { |
113 | | - api "org.apache.groovy:groovy" |
114 | | - api "org.slf4j:slf4j-api" |
115 | | - |
116 | | - testImplementation "org.slf4j:slf4j-simple" |
117 | | - testImplementation "org.spockframework:spock-core", { |
118 | | - exclude group: "org.junit.platform", module: "junit-platform-engine" |
119 | | - } |
120 | | - testImplementation "net.bytebuddy:byte-buddy" |
121 | | - testImplementation "org.objenesis:objenesis:$objenesisVersion" |
122 | | - testImplementation "org.apache.groovy:groovy-test-junit5", { |
123 | | - exclude group: "org.junit.platform", module: "junit-platform-launcher" |
124 | | - exclude group: "org.junit.jupiter", module: "junit-jupiter-engine" |
125 | | - } |
126 | | - testImplementation "org.junit.jupiter:junit-jupiter-api" |
127 | | - testImplementation "org.junit.platform:junit-platform-runner" |
128 | | - testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine" |
129 | | - } |
130 | | - |
131 | | - java { |
132 | | - toolchain { |
133 | | - languageVersion = JavaLanguageVersion.of(17) |
134 | | - } |
135 | | - withJavadocJar() |
136 | | - withSourcesJar() |
137 | | - } |
138 | | - |
139 | | - tasks.withType(Test) { |
140 | | - useJUnitPlatform() |
141 | | - testLogging { |
142 | | - showStandardStreams = true |
143 | | - exceptionFormat = 'full' |
144 | | - } |
145 | | - configure { |
146 | | - retry { |
147 | | - maxRetries = 2 |
148 | | - maxFailures = 20 |
149 | | - failOnPassedAfterRetry = true |
150 | | - } |
151 | | - } |
152 | | - } |
153 | | - |
154 | | - tasks.named('compileJava') { |
155 | | - inputs.files(tasks.named('processResources')) |
156 | | - } |
157 | | - } |
158 | | - |
159 | | - apply from: '../publishing/mavenCentral.gradle' |
160 | | -} |
161 | | - |
162 | | - |
163 | 40 | def cleanTask = project.tasks.findByName('clean') |
164 | 41 | if (cleanTask == null) { |
165 | 42 | task clean(type: Delete) { |
@@ -198,3 +75,16 @@ docs { |
198 | 75 | dependsOn groovydoc |
199 | 76 | sourceDir = project.file('src/main/docs') |
200 | 77 | } |
| 78 | + |
| 79 | +nexusPublishing { |
| 80 | + repositories { |
| 81 | + sonatype { |
| 82 | + def mavenUser = System.getenv('MAVEN_CENTRAL_USER') ?: project.hasProperty('mavenCentralUsername') ? project.mavenCentralUsername : '' |
| 83 | + def mavenPass = System.getenv('MAVEN_CENTRAL_PASSWORD') ?: project.hasProperty('mavenCentralPassword') ? project.mavenCentralPassword : '' |
| 84 | + nexusUrl = uri('https://ossrh-staging-api.central.sonatype.com/service/local/') |
| 85 | + snapshotRepositoryUrl = uri('https://central.sonatype.com/repository/maven-snapshots/') |
| 86 | + username = mavenUser |
| 87 | + password = mavenPass |
| 88 | + } |
| 89 | + } |
| 90 | +} |
0 commit comments