├── .github └── workflows │ └── gradle-ci.yml ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── src └── main └── resources ├── main.gradle ├── npm-java-runner-index.js ├── npm-java-runner-package.json ├── pmd.xml └── spotbugs-exclude.xml /.github/workflows/gradle-ci.yml: -------------------------------------------------------------------------------- 1 | name: Call Gradle CI 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | call-workflow: 7 | uses: tomasbjerre/.github/.github/workflows/gradle-ci.yml@master 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .okhttpcache 2 | .vscode 3 | bin 4 | .classpath 5 | .project 6 | .settings 7 | .gradle 8 | build 9 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # gradle-scripts changelog 2 | 3 | Changelog of gradle-scripts. 4 | 5 | ## 2.28.2 (2024-09-08) 6 | 7 | ### Bug Fixes 8 | 9 | - build it with java 11 ([e4197](https://github.com/tomasbjerre/gradle-scripts/commit/e41979c0e01dc10) Tomas Bjerre) 10 | 11 | ## 2.28.0 (2024-07-06) 12 | 13 | ### Features 14 | 15 | - defaulting to java 17 ([a33e8](https://github.com/tomasbjerre/gradle-scripts/commit/a33e892a3eafeaf) Tomas Bjerre) 16 | 17 | ## 2.27.3 (2024-04-30) 18 | 19 | ### Bug Fixes 20 | 21 | - shadow jar ([87a90](https://github.com/tomasbjerre/gradle-scripts/commit/87a907d594bfaf4) Tomas Bjerre) 22 | 23 | ## 2.27.2 (2024-04-30) 24 | 25 | ### Bug Fixes 26 | 27 | - logging ([77bd4](https://github.com/tomasbjerre/gradle-scripts/commit/77bd4ae2c206c63) Tomas Bjerre) 28 | 29 | ## 2.27.1 (2024-04-30) 30 | 31 | ### Bug Fixes 32 | 33 | - pom dependencies were not removed in fat jars ([952ec](https://github.com/tomasbjerre/gradle-scripts/commit/952ec983f180c06) Tomas Bjerre) 34 | 35 | ## 2.27.0 (2024-04-24) 36 | 37 | ### Features 38 | 39 | - ignoring NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE ([f3aee](https://github.com/tomasbjerre/gradle-scripts/commit/f3aee9a1126b265) Tomas Bjerre) 40 | 41 | ## 2.26.9 (2024-02-25) 42 | 43 | ### Bug Fixes 44 | 45 | - gradle 8, shadow ([7f31e](https://github.com/tomasbjerre/gradle-scripts/commit/7f31eefba6bf669) Tomas Bjerre) 46 | 47 | ## 2.26.8 (2024-02-25) 48 | 49 | ### Bug Fixes 50 | 51 | - gradle 8, command line jar ([50160](https://github.com/tomasbjerre/gradle-scripts/commit/50160930cb3b7b9) Tomas Bjerre) 52 | 53 | ## 2.26.7 (2024-02-25) 54 | 55 | ### Bug Fixes 56 | 57 | - gradle 8, command line jar ([a1c79](https://github.com/tomasbjerre/gradle-scripts/commit/a1c79b0281cee6a) Tomas Bjerre) 58 | 59 | ## 2.26.5 (2024-02-25) 60 | 61 | ### Bug Fixes 62 | 63 | - building gradle plugin with Gradle 8 ([e04cf](https://github.com/tomasbjerre/gradle-scripts/commit/e04cf9a7880db42) Tomas Bjerre) 64 | 65 | ## 2.26.4 (2024-02-25) 66 | 67 | ### Bug Fixes 68 | 69 | - sourcejar javadocjar ([f382c](https://github.com/tomasbjerre/gradle-scripts/commit/f382ce6d9bdb493) Tomas Bjerre) 70 | 71 | ## 2.26.2 (2024-02-25) 72 | 73 | ### Bug Fixes 74 | 75 | - gradle plugin ([1ef7e](https://github.com/tomasbjerre/gradle-scripts/commit/1ef7e5233308afa) Tomas Bjerre) 76 | 77 | ## 2.26.1 (2024-02-25) 78 | 79 | ### Bug Fixes 80 | 81 | - exlcuding patterns from formatting ([e3192](https://github.com/tomasbjerre/gradle-scripts/commit/e3192367ad2150e) Tomas Bjerre) 82 | 83 | ## 2.26.0 (2024-02-25) 84 | 85 | ### Features 86 | 87 | - Gradle 8 ([b9df5](https://github.com/tomasbjerre/gradle-scripts/commit/b9df59884bced96) Tomas Bjerre) 88 | 89 | ## 2.25.16 (2024-01-29) 90 | 91 | ### Bug Fixes 92 | 93 | - pmd static code analysis ([6a356](https://github.com/tomasbjerre/gradle-scripts/commit/6a3563d583529a4) Tomas Bjerre) 94 | 95 | ## 2.25.15 (2024-01-29) 96 | 97 | ### Bug Fixes 98 | 99 | - pmd static code analysis ([9eb66](https://github.com/tomasbjerre/gradle-scripts/commit/9eb666df6fe2cb9) Tomas Bjerre) 100 | 101 | ## 2.25.14 (2024-01-29) 102 | 103 | ### Bug Fixes 104 | 105 | - pmd static code analysis ([d8e61](https://github.com/tomasbjerre/gradle-scripts/commit/d8e61eee24dd9ef) Tomas Bjerre) 106 | 107 | ## 2.25.13 (2024-01-29) 108 | 109 | ### Bug Fixes 110 | 111 | - pmd static code analysis ([5fa0d](https://github.com/tomasbjerre/gradle-scripts/commit/5fa0d83c1191fb7) Tomas Bjerre) 112 | 113 | ## 2.25.12 (2024-01-29) 114 | 115 | ### Bug Fixes 116 | 117 | - pmd static code analysis ([fe4f2](https://github.com/tomasbjerre/gradle-scripts/commit/fe4f2aad6228d0d) Tomas Bjerre) 118 | 119 | ## 2.25.11 (2024-01-29) 120 | 121 | ### Bug Fixes 122 | 123 | - pmd static code analysis ([54e5c](https://github.com/tomasbjerre/gradle-scripts/commit/54e5c9e16310d5e) Tomas Bjerre) 124 | 125 | ## 2.25.10 (2024-01-29) 126 | 127 | ### Bug Fixes 128 | 129 | - pmd static code analysis ([fedae](https://github.com/tomasbjerre/gradle-scripts/commit/fedaeb7985f70f3) Tomas Bjerre) 130 | 131 | ## 2.25.8 (2024-01-29) 132 | 133 | ### Bug Fixes 134 | 135 | - pmd static code analysis ([f5fd5](https://github.com/tomasbjerre/gradle-scripts/commit/f5fd5042b520d1b) Tomas Bjerre) 136 | 137 | ## 2.25.7 (2024-01-29) 138 | 139 | ### Bug Fixes 140 | 141 | - pmd static code analysis ([bc0e3](https://github.com/tomasbjerre/gradle-scripts/commit/bc0e3e433ae41cc) Tomas Bjerre) 142 | 143 | ## 2.25.6 (2024-01-29) 144 | 145 | ### Bug Fixes 146 | 147 | - pmd static code analysis ([82f08](https://github.com/tomasbjerre/gradle-scripts/commit/82f0817d93fdc05) Tomas Bjerre) 148 | 149 | ## 2.25.5 (2024-01-29) 150 | 151 | ### Bug Fixes 152 | 153 | - pmd static code analysis ([05179](https://github.com/tomasbjerre/gradle-scripts/commit/0517961a9b66cfd) Tomas Bjerre) 154 | 155 | ## 2.25.4 (2024-01-29) 156 | 157 | ### Bug Fixes 158 | 159 | - pmd static code analysis ([d8068](https://github.com/tomasbjerre/gradle-scripts/commit/d8068dca05aac85) Tomas Bjerre) 160 | 161 | ## 2.25.3 (2024-01-29) 162 | 163 | ### Bug Fixes 164 | 165 | - pmd static code analysis ([d354f](https://github.com/tomasbjerre/gradle-scripts/commit/d354f8d195b6dab) Tomas Bjerre) 166 | 167 | ## 2.25.2 (2024-01-29) 168 | 169 | ### Bug Fixes 170 | 171 | - pmd static code analysis ([f528b](https://github.com/tomasbjerre/gradle-scripts/commit/f528bd91d2d6852) Tomas Bjerre) 172 | 173 | ## 2.25.1 (2024-01-29) 174 | 175 | ### Bug Fixes 176 | 177 | - pmd static code analysis ([92e19](https://github.com/tomasbjerre/gradle-scripts/commit/92e19113272775b) Tomas Bjerre) 178 | 179 | ## 2.25.0 (2024-01-29) 180 | 181 | ### Features 182 | 183 | - pmd static code analysis ([01142](https://github.com/tomasbjerre/gradle-scripts/commit/0114238a062563f) Tomas Bjerre) 184 | 185 | ## 2.24.1 (2024-01-27) 186 | 187 | ### Other changes 188 | 189 | **spotbugs 4.5.3** 190 | 191 | 192 | [6d146](https://github.com/tomasbjerre/gradle-scripts/commit/6d146effe7d9727) Tomas Bjerre *2024-01-27 07:39:02* 193 | 194 | 195 | ## 2.24.0 (2024-01-27) 196 | 197 | ### Features 198 | 199 | - building with java 11 ([8ecc0](https://github.com/tomasbjerre/gradle-scripts/commit/8ecc0139d1b6b6a) Tomas Bjerre) 200 | 201 | ## 2.23.0 (2023-11-09) 202 | 203 | ### Features 204 | 205 | - only including stable releases in update notification ([f46b5](https://github.com/tomasbjerre/gradle-scripts/commit/f46b5b20e411809) Tomas Bjerre) 206 | 207 | ## 2.22.9 (2023-07-30) 208 | 209 | ### Bug Fixes 210 | 211 | - skip verifyGoogleJavaFormat on java 17 ([d6379](https://github.com/tomasbjerre/gradle-scripts/commit/d637962a28d4a63) Tomas Bjerre) 212 | 213 | ## 2.22.8 (2023-07-30) 214 | 215 | ### Bug Fixes 216 | 217 | - skip verifyGoogleJavaFormat on java 17 ([80b2a](https://github.com/tomasbjerre/gradle-scripts/commit/80b2a8bed980912) Tomas Bjerre) 218 | 219 | ## 2.22.7 (2023-07-30) 220 | 221 | ### Bug Fixes 222 | 223 | - googleJavaFormat first ([6c382](https://github.com/tomasbjerre/gradle-scripts/commit/6c3826f1a1c18c2) Tomas Bjerre) 224 | 225 | ## 2.22.6 (2023-07-30) 226 | 227 | ### Bug Fixes 228 | 229 | - only skip verifyGoogleJavaFormat on Java 17 ([347cb](https://github.com/tomasbjerre/gradle-scripts/commit/347cbc3257ef39c) Tomas Bjerre) 230 | 231 | ## 2.22.5 (2023-07-30) 232 | 233 | ### Bug Fixes 234 | 235 | - exclude CRLF_INJECTION_LOGS URLCONNECTION_SSRF_FD PATH_TRAVERSAL_IN ([61b32](https://github.com/tomasbjerre/gradle-scripts/commit/61b3271bbeb3ab7) Tomas Bjerre) 236 | 237 | ## 2.22.4 (2023-07-30) 238 | 239 | ### Bug Fixes 240 | 241 | - exclude REC_CATCH_EXCEPTION ([296ff](https://github.com/tomasbjerre/gradle-scripts/commit/296ffb0502c15b1) Tomas Bjerre) 242 | 243 | ## 2.22.3 (2023-07-29) 244 | 245 | ## 2.22.2 (2023-07-29) 246 | 247 | ### Bug Fixes 248 | 249 | - stepping dependencies and enabling java 17 formatting ([f632b](https://github.com/tomasbjerre/gradle-scripts/commit/f632bcd8a6988fd) Tomas Bjerre) 250 | 251 | ## 2.22.1 (2023-07-04) 252 | 253 | ### Bug Fixes 254 | 255 | - handle project descriptions that are strings ([cb5fc](https://github.com/tomasbjerre/gradle-scripts/commit/cb5fc1907a13314) Tomas Bjerre) 256 | 257 | ## 2.22.0 (2023-03-12) 258 | 259 | ### Features 260 | 261 | - black list slf4j from updating ([2ae2e](https://github.com/tomasbjerre/gradle-scripts/commit/2ae2ec43d78c9c3) Tomas Bjerre) 262 | 263 | ## 2.21.0 (2023-03-12) 264 | 265 | ### Features 266 | 267 | - black list slf4j from updating ([692b9](https://github.com/tomasbjerre/gradle-scripts/commit/692b9139476b838) Tomas Bjerre) 268 | 269 | ## 2.20.3 (2022-12-28) 270 | 271 | ### Bug Fixes 272 | 273 | - default changelog-file and git-repo ([cbcc9](https://github.com/tomasbjerre/gradle-scripts/commit/cbcc9820ecfc556) Tomas Bjerre) 274 | 275 | ## 2.20.2 (2022-12-12) 276 | 277 | ### Bug Fixes 278 | 279 | - changelog ([8e2ef](https://github.com/tomasbjerre/gradle-scripts/commit/8e2ef063a72d638) Tomas Bjerre) 280 | 281 | ## 2.20.1 (2022-12-12) 282 | 283 | ### Bug Fixes 284 | 285 | - copy file ([996de](https://github.com/tomasbjerre/gradle-scripts/commit/996de72002262fe) Tomas Bjerre) 286 | 287 | ## 2.20.0 (2022-12-03) 288 | 289 | ### Features 290 | 291 | - adjusting to new git-changelog-gradle-plugin ([77304](https://github.com/tomasbjerre/gradle-scripts/commit/7730453897d3453) Tomas Bjerre) 292 | 293 | ## 2.19.1 (2022-12-03) 294 | 295 | ### Bug Fixes 296 | 297 | - adjusting to Gradle 7.6 ([c3438](https://github.com/tomasbjerre/gradle-scripts/commit/c3438b03e9e6008) Tomas Bjerre) 298 | 299 | ## 2.19.0 (2022-12-03) 300 | 301 | ### Features 302 | 303 | - adjusting to Gradle 7.6 ([e7e89](https://github.com/tomasbjerre/gradle-scripts/commit/e7e89208ebd048d) Tomas Bjerre) 304 | 305 | ## 2.18.0 (2022-09-24) 306 | 307 | ### Features 308 | 309 | - blacklist jgit ([1ed38](https://github.com/tomasbjerre/gradle-scripts/commit/1ed38eeba0eba47) Tomas Bjerre) 310 | 311 | ## 2.17.0 (2022-09-10) 312 | 313 | ### Features 314 | 315 | - ignore DCN_NULLPOINTER_EXCEPTION ([314fc](https://github.com/tomasbjerre/gradle-scripts/commit/314fc5acb1368d5) Tomas Bjerre) 316 | 317 | ## 2.16.0 (2022-08-27) 318 | 319 | ### Features 320 | 321 | - adjusting spotbugs rules ([0878b](https://github.com/tomasbjerre/gradle-scripts/commit/0878b0c99b73901) Tomas Bjerre) 322 | 323 | ## 2.15.3 (2022-08-05) 324 | 325 | ### Bug Fixes 326 | 327 | - versions plugin ([476d6](https://github.com/tomasbjerre/gradle-scripts/commit/476d6fff5bc602f) Tomas Bjerre) 328 | 329 | ## 2.15.2 (2022-08-05) 330 | 331 | ### Bug Fixes 332 | 333 | - versions plugin ([45693](https://github.com/tomasbjerre/gradle-scripts/commit/4569357c12e3c37) Tomas Bjerre) 334 | 335 | ## 2.15.1 (2022-08-05) 336 | 337 | ### Bug Fixes 338 | 339 | - versions plugin ([6cccf](https://github.com/tomasbjerre/gradle-scripts/commit/6cccf192723aa37) Tomas Bjerre) 340 | 341 | ## 2.15.0 (2022-08-05) 342 | 343 | ### Features 344 | 345 | - versions plugin ([043c9](https://github.com/tomasbjerre/gradle-scripts/commit/043c9153e35e3b0) Tomas Bjerre) 346 | 347 | ## 2.14.8 (2022-04-03) 348 | 349 | ### Bug Fixes 350 | 351 | - producing spotbugs report ([26875](https://github.com/tomasbjerre/gradle-scripts/commit/26875091eb73ed4) Tomas Bjerre) 352 | 353 | ## 2.14.7 (2022-04-03) 354 | 355 | ### Bug Fixes 356 | 357 | - correcting violations paths ([f6ecb](https://github.com/tomasbjerre/gradle-scripts/commit/f6ecb198b516d0e) Tomas Bjerre) 358 | 359 | ## 2.14.3 (2022-02-26) 360 | 361 | ### Bug Fixes 362 | 363 | - skipping google java format for java 17 ([c325d](https://github.com/tomasbjerre/gradle-scripts/commit/c325d01074f0e41) Tomas Bjerre) 364 | 365 | ## 2.14.2 (2022-02-26) 366 | 367 | ### Bug Fixes 368 | 369 | - skipping google java format for java 17 ([0f263](https://github.com/tomasbjerre/gradle-scripts/commit/0f26317c2594962) Tomas Bjerre) 370 | 371 | ## 2.14.1 (2022-02-26) 372 | 373 | ### Bug Fixes 374 | 375 | - skipping google java format for java 17 ([7aba2](https://github.com/tomasbjerre/gradle-scripts/commit/7aba2bee41e49d5) Tomas Bjerre) 376 | 377 | ## 2.14.0 (2022-02-26) 378 | 379 | ### Features 380 | 381 | - stepping google java format ([23771](https://github.com/tomasbjerre/gradle-scripts/commit/23771839c13d47a) Tomas Bjerre) 382 | 383 | ## 2.13.0 (2022-02-26) 384 | 385 | ### Features 386 | 387 | - stepping spotbugs-gradle-plugin ([2183e](https://github.com/tomasbjerre/gradle-scripts/commit/2183e1e121faccd) Tomas Bjerre) 388 | 389 | ## 2.12.12 (2022-02-26) 390 | 391 | ### Bug Fixes 392 | 393 | - avoid spotbugs annotations on java 7 ([43854](https://github.com/tomasbjerre/gradle-scripts/commit/4385448aa81434d) Tomas Bjerre) 394 | 395 | ## 2.12.11 (2022-02-26) 396 | 397 | ### Bug Fixes 398 | 399 | - avoid spotbugs annotations on java 7 ([d7c3b](https://github.com/tomasbjerre/gradle-scripts/commit/d7c3b0d019c83a3) Tomas Bjerre) 400 | 401 | ## 2.12.10 (2022-01-16) 402 | 403 | ## 2.12.9 (2021-11-21) 404 | 405 | ### Bug Fixes 406 | 407 | - multiline in npm ([5fe44](https://github.com/tomasbjerre/gradle-scripts/commit/5fe4498b76b8d34) Tomas Bjerre) 408 | 409 | ## 2.12.8 (2021-11-21) 410 | 411 | ### Bug Fixes 412 | 413 | - multiline in COMMAND type ([9eab8](https://github.com/tomasbjerre/gradle-scripts/commit/9eab85f2254072d) Tomas Bjerre) 414 | 415 | ## 2.12.7 (2021-11-21) 416 | 417 | ### Bug Fixes 418 | 419 | - skip googleJavaFormat for JDK8 ([e5f15](https://github.com/tomasbjerre/gradle-scripts/commit/e5f155bf696df0e) Tomas Bjerre) 420 | 421 | ## 2.12.6 (2021-11-21) 422 | 423 | ### Bug Fixes 424 | 425 | - skip googleJavaFormat for JDK8 ([44b00](https://github.com/tomasbjerre/gradle-scripts/commit/44b0041cfbfa395) Tomas Bjerre) 426 | 427 | ## 2.12.5 (2021-11-20) 428 | 429 | ### Bug Fixes 430 | 431 | - COMMAND type ([fe51f](https://github.com/tomasbjerre/gradle-scripts/commit/fe51f1c6cde1f1b) Tomas Bjerre) 432 | 433 | ## 2.12.4 (2021-11-20) 434 | 435 | ### Bug Fixes 436 | 437 | - COMMAND type ([160b8](https://github.com/tomasbjerre/gradle-scripts/commit/160b86da91ba22a) Tomas Bjerre) 438 | 439 | ## 2.12.3 (2021-11-20) 440 | 441 | ### Bug Fixes 442 | 443 | - COMMAND type ([69844](https://github.com/tomasbjerre/gradle-scripts/commit/6984473143d7f1c) Tomas Bjerre) 444 | 445 | ## 2.12.2 (2021-11-20) 446 | 447 | ### Bug Fixes 448 | 449 | - COMMAND type ([4ff81](https://github.com/tomasbjerre/gradle-scripts/commit/4ff8149d9671241) Tomas Bjerre) 450 | 451 | ## 2.12.1 (2021-11-20) 452 | 453 | ### Bug Fixes 454 | 455 | - COMMAND type ([a84c7](https://github.com/tomasbjerre/gradle-scripts/commit/a84c764c01eda0f) Tomas Bjerre) 456 | 457 | ## 2.12.0 (2021-11-20) 458 | 459 | ### Features 460 | 461 | - COMMAND type ([f3694](https://github.com/tomasbjerre/gradle-scripts/commit/f3694ce378af2bc) Tomas Bjerre) 462 | 463 | ## 2.11.1 (2021-11-08) 464 | 465 | ### Bug Fixes 466 | 467 | - spotbugs compile only ([66124](https://github.com/tomasbjerre/gradle-scripts/commit/66124b38eec8fdd) Tomas Bjerre) 468 | 469 | ## 2.11.0 (2021-11-08) 470 | 471 | ### Features 472 | 473 | - attempts ([9ab21](https://github.com/tomasbjerre/gradle-scripts/commit/9ab216734d10652) Tomas Bjerre) 474 | 475 | ## 2.10.0 (2021-11-08) 476 | 477 | ### Features 478 | 479 | - source/target compatibility ([55072](https://github.com/tomasbjerre/gradle-scripts/commit/550722cc0832a3e) Tomas Bjerre) 480 | 481 | ## 2.9.2 (2021-10-17) 482 | 483 | ### Bug Fixes 484 | 485 | - using method to get version ([735ba](https://github.com/tomasbjerre/gradle-scripts/commit/735baea640c3a32) Tomas Bjerre) [#104](https://github.com/tomasbjerre/gradle-scripts/issues/104) 486 | 487 | ## 2.9.1 (2021-10-17) 488 | 489 | ### Bug Fixes 490 | 491 | - correcting version ([73381](https://github.com/tomasbjerre/gradle-scripts/commit/7338110c49ce80b) Tomas Bjerre) [#104](https://github.com/tomasbjerre/gradle-scripts/issues/104) 492 | 493 | ## 2.9.0 (2021-09-04) 494 | 495 | ### Features 496 | 497 | - renaming test to tests ([b734a](https://github.com/tomasbjerre/gradle-scripts/commit/b734a10400aa671) Tomas Bjerre) 498 | 499 | ## 2.8.0 (2021-09-04) 500 | 501 | ### Features 502 | 503 | - include ([d550e](https://github.com/tomasbjerre/gradle-scripts/commit/d550e6bf79574b4) Tomas Bjerre) 504 | 505 | ## 2.7.0 (2021-07-13) 506 | 507 | ### Features 508 | 509 | - extra new line in changelog ([e145f](https://github.com/tomasbjerre/gradle-scripts/commit/e145fe14b26acfe) Tomas Bjerre) 510 | 511 | ## 2.6.0 (2021-06-03) 512 | 513 | ### Features 514 | 515 | - chaning versioning pattern ([2203b](https://github.com/tomasbjerre/gradle-scripts/commit/2203bc471480162) Tomas Bjerre) 516 | 517 | ## 2.5.3 (2021-06-03) 518 | 519 | ### Features 520 | 521 | - automate versioning with conventional commits ([b10c5](https://github.com/tomasbjerre/gradle-scripts/commit/b10c5226525530f) Tomas Bjerre) 522 | 523 | ## 2.5.2 (2021-06-03) 524 | 525 | ### Bug Fixes 526 | 527 | - tweaking changelog ([7dc0d](https://github.com/tomasbjerre/gradle-scripts/commit/7dc0d9cd6fc9de3) Tomas Bjerre) 528 | 529 | ## 2.5.1 (2021-06-03) 530 | 531 | ### Bug Fixes 532 | 533 | - tweaking changelog ([ce180](https://github.com/tomasbjerre/gradle-scripts/commit/ce1805660592c8d) Tomas Bjerre) 534 | 535 | ## 2.5.0 (2021-06-03) 536 | 537 | ### Features 538 | 539 | - tweaking changelog template ([cf0df](https://github.com/tomasbjerre/gradle-scripts/commit/cf0df59434f67dc) Tomas Bjerre) 540 | - tweaking changelog ([c26bd](https://github.com/tomasbjerre/gradle-scripts/commit/c26bdfb23c90f40) Tomas Bjerre) 541 | 542 | ## 2.4.6 (2021-06-01) 543 | 544 | ### Bug Fixes 545 | 546 | - setting fromRepo in git-changelog config ([168af](https://github.com/tomasbjerre/gradle-scripts/commit/168af21df30758a) Tomas Bjerre) 547 | 548 | ## 2.4.4 (2021-06-01) 549 | 550 | ### Features 551 | 552 | - google-java-format-gradle-plugin 0.9 ([25fdd](https://github.com/tomasbjerre/gradle-scripts/commit/25fdd37449e2a1e) Tomas Bjerre) 553 | 554 | ## 2.4.2 (2021-06-01) 555 | 556 | ## 2.4.1 (2021-06-01) 557 | 558 | ### Features 559 | 560 | - adding changelog generation again after release ([53fee](https://github.com/tomasbjerre/gradle-scripts/commit/53feedb3348aa9f) Tomas Bjerre) 561 | 562 | ### Bug Fixes 563 | 564 | - temporary removing plugins not working with Gradle 7 ([20db4](https://github.com/tomasbjerre/gradle-scripts/commit/20db4a868608dfb) Tomas Bjerre) 565 | 566 | ## 2.3.0 (2021-06-01) 567 | 568 | ### Features 569 | 570 | - support Gradle 7 ([67d48](https://github.com/tomasbjerre/gradle-scripts/commit/67d4897dd590181) Tomas Bjerre) 571 | 572 | ## 2.2.20 (2021-05-31) 573 | 574 | ### Bug Fixes 575 | 576 | - indentation in changelog ([e90dd](https://github.com/tomasbjerre/gradle-scripts/commit/e90dde8f75adc4c) Tomas Bjerre) 577 | 578 | ## 2.2.19 (2021-05-31) 579 | 580 | ### Features 581 | 582 | - conventional commits when releasing ([56712](https://github.com/tomasbjerre/gradle-scripts/commit/567128116058123) Tomas Bjerre) 583 | 584 | ## 2.2.18 (2021-05-25) 585 | 586 | ### Features 587 | 588 | - publishToMavenLocal ([b3f98](https://github.com/tomasbjerre/gradle-scripts/commit/b3f98bf5618501b) Tomas Bjerre) 589 | 590 | ## 2.2.17 (2021-04-05) 591 | 592 | ### Other changes 593 | 594 | **only allow SNAPSHOT-dependency if project is a SNAPSHOT** 595 | 596 | 597 | [67cc4](https://github.com/tomasbjerre/gradle-scripts/commit/67cc449994208b3) Tomas Bjerre *2021-04-05 15:32:11* 598 | 599 | 600 | ## 2.2.16 (2021-04-05) 601 | 602 | ## 2.2.15 (2021-04-05) 603 | 604 | ### Other changes 605 | 606 | **only allow SNAPSHOT-dependency if project is a SNAPSHOT** 607 | 608 | 609 | [5c4e5](https://github.com/tomasbjerre/gradle-scripts/commit/5c4e5f1726725ee) Tomas Bjerre *2021-04-05 15:14:29* 610 | 611 | 612 | ## 2.2.14 (2021-04-05) 613 | 614 | ### Other changes 615 | 616 | **generated source folders** 617 | 618 | 619 | [51f46](https://github.com/tomasbjerre/gradle-scripts/commit/51f469c66fa9ef7) Tomas Bjerre *2021-04-05 07:55:33* 620 | 621 | **doc** 622 | 623 | 624 | [64822](https://github.com/tomasbjerre/gradle-scripts/commit/648224e88cad93b) Tomas Bjerre *2021-04-05 05:15:50* 625 | 626 | 627 | ## 2.2.13 (2021-04-04) 628 | 629 | ### Other changes 630 | 631 | **removing merge services** 632 | 633 | 634 | [3477f](https://github.com/tomasbjerre/gradle-scripts/commit/3477fdc428c83ba) Tomas Bjerre *2021-04-04 18:12:53* 635 | 636 | **doc** 637 | 638 | 639 | [7841a](https://github.com/tomasbjerre/gradle-scripts/commit/7841aa48b18103b) Tomas Bjerre *2021-04-04 17:02:14* 640 | 641 | 642 | ## 2.2.12 (2021-04-04) 643 | 644 | ### Other changes 645 | 646 | **manifest support** 647 | 648 | 649 | [d3921](https://github.com/tomasbjerre/gradle-scripts/commit/d3921a34cd3bb7d) Tomas Bjerre *2021-04-04 15:58:03* 650 | 651 | 652 | ## 2.2.11 (2021-04-04) 653 | 654 | ### Other changes 655 | 656 | **removing violations repoType** 657 | 658 | 659 | [5764c](https://github.com/tomasbjerre/gradle-scripts/commit/5764ceabcfc19e3) Tomas Bjerre *2021-04-04 14:07:20* 660 | 661 | 662 | ## 2.2.10 (2021-04-04) 663 | 664 | ### Other changes 665 | 666 | **github api token** 667 | 668 | 669 | [dc3ea](https://github.com/tomasbjerre/gradle-scripts/commit/dc3eae710d7cec6) Tomas Bjerre *2021-04-04 06:01:36* 670 | 671 | 672 | ## 2.2.9 (2021-04-04) 673 | 674 | ### Other changes 675 | 676 | **dont sign when doing publishToMavenLocal** 677 | 678 | 679 | [284b9](https://github.com/tomasbjerre/gradle-scripts/commit/284b9102a5596dd) Tomas Bjerre *2021-04-04 05:50:42* 680 | 681 | 682 | ## 2.2.8 (2021-04-03) 683 | 684 | ### Other changes 685 | 686 | **missing push** 687 | 688 | 689 | [43a27](https://github.com/tomasbjerre/gradle-scripts/commit/43a2791ddfe2efd) Tomas Bjerre *2021-04-03 20:22:56* 690 | 691 | 692 | ## 2.2.7 (2021-04-03) 693 | 694 | ### Other changes 695 | 696 | **more post attempts** 697 | 698 | 699 | [1665d](https://github.com/tomasbjerre/gradle-scripts/commit/1665d3df6c9d5a5) Tomas Bjerre *2021-04-03 20:15:16* 700 | 701 | 702 | ## 2.2.6 (2021-04-03) 703 | 704 | ### Other changes 705 | 706 | **correcting attempts** 707 | 708 | 709 | [aaec2](https://github.com/tomasbjerre/gradle-scripts/commit/aaec2bb028835dd) Tomas Bjerre *2021-04-03 20:12:22* 710 | 711 | 712 | ## 2.2.5 (2021-04-03) 713 | 714 | ### Other changes 715 | 716 | **Allow empty changelog** 717 | 718 | 719 | [0ca2a](https://github.com/tomasbjerre/gradle-scripts/commit/0ca2a75ddd87c55) Tomas Bjerre *2021-04-03 20:06:41* 720 | 721 | 722 | ## 2.2.4 (2021-04-03) 723 | 724 | ### Other changes 725 | 726 | **gradle displayName cleanup** 727 | 728 | 729 | [8c36c](https://github.com/tomasbjerre/gradle-scripts/commit/8c36c963376bde3) Tomas Bjerre *2021-04-03 19:18:42* 730 | 731 | 732 | ## 2.2.3 (2021-04-03) 733 | 734 | ### Other changes 735 | 736 | **attempts in nexus promotion** 737 | 738 | 739 | [0f820](https://github.com/tomasbjerre/gradle-scripts/commit/0f82085470232df) Tomas Bjerre *2021-04-03 19:08:43* 740 | 741 | 742 | ## 2.2.2 (2021-04-03) 743 | 744 | ### Other changes 745 | 746 | **gradle publish fix** 747 | 748 | 749 | [cdffe](https://github.com/tomasbjerre/gradle-scripts/commit/cdffe2ce5662756) Tomas Bjerre *2021-04-03 18:59:30* 750 | 751 | 752 | ## 2.2.1 (2021-04-03) 753 | 754 | ### Other changes 755 | 756 | **gradle displayName** 757 | 758 | 759 | [c5a0a](https://github.com/tomasbjerre/gradle-scripts/commit/c5a0aa6d4cc10b5) Tomas Bjerre *2021-04-03 18:49:46* 760 | 761 | **doc** 762 | 763 | 764 | [a5c90](https://github.com/tomasbjerre/gradle-scripts/commit/a5c9018f1e5f150) Tomas Bjerre *2021-04-03 18:33:53* 765 | 766 | 767 | ## 2.2.0 (2021-04-03) 768 | 769 | ### Other changes 770 | 771 | **logging** 772 | 773 | 774 | [27447](https://github.com/tomasbjerre/gradle-scripts/commit/2744736465279e3) Tomas Bjerre *2021-04-03 18:30:50* 775 | 776 | 777 | ## 2.1.6 (2021-04-03) 778 | 779 | ### Other changes 780 | 781 | **Spelling #3** 782 | 783 | 784 | [606f9](https://github.com/tomasbjerre/gradle-scripts/commit/606f9c7de184060) Tomas Bjerre *2021-04-03 18:25:55* 785 | 786 | 787 | ## 2.1.5 (2021-04-03) 788 | 789 | ### Other changes 790 | 791 | **Spelling #3** 792 | 793 | 794 | [1c8a8](https://github.com/tomasbjerre/gradle-scripts/commit/1c8a82946c5923b) Tomas Bjerre *2021-04-03 18:24:34* 795 | 796 | 797 | ## 2.1.4 (2021-04-03) 798 | 799 | ### Other changes 800 | 801 | **Spelling #3** 802 | 803 | 804 | [5ffe4](https://github.com/tomasbjerre/gradle-scripts/commit/5ffe442fb8f8963) Tomas Bjerre *2021-04-03 18:21:48* 805 | 806 | **Polling for nexus promotion done #3** 807 | 808 | 809 | [6e73c](https://github.com/tomasbjerre/gradle-scripts/commit/6e73c1497572a72) Tomas Bjerre *2021-04-03 18:19:52* 810 | 811 | 812 | ## 2.1.3 (2021-04-03) 813 | 814 | ### Other changes 815 | 816 | **Spelling #3** 817 | 818 | 819 | [46abb](https://github.com/tomasbjerre/gradle-scripts/commit/46abb261d2c0775) Tomas Bjerre *2021-04-03 18:04:19* 820 | 821 | 822 | ## 2.1.2 (2021-04-03) 823 | 824 | ### Other changes 825 | 826 | **Spelling #3** 827 | 828 | 829 | [48966](https://github.com/tomasbjerre/gradle-scripts/commit/48966b0908daa0e) Tomas Bjerre *2021-04-03 18:01:39* 830 | 831 | 832 | ## 2.1.1 (2021-04-03) 833 | 834 | ### Other changes 835 | 836 | **Auto close and release #3** 837 | 838 | 839 | [cd460](https://github.com/tomasbjerre/gradle-scripts/commit/cd4603aba40c76e) Tomas Bjerre *2021-04-03 18:00:04* 840 | 841 | 842 | ## 2.1.0 (2021-04-03) 843 | 844 | ### Other changes 845 | 846 | **restoring gradle.properties on build failure #4** 847 | 848 | 849 | [5bf33](https://github.com/tomasbjerre/gradle-scripts/commit/5bf3396406a30a8) Tomas Bjerre *2021-04-03 17:09:42* 850 | 851 | **store new version after publish successful #4** 852 | 853 | 854 | [3f928](https://github.com/tomasbjerre/gradle-scripts/commit/3f9288b8b2a3c0a) Tomas Bjerre *2021-04-03 16:59:13* 855 | 856 | **publish resolved versions #5** 857 | 858 | 859 | [aec77](https://github.com/tomasbjerre/gradle-scripts/commit/aec77b3f056a0d2) Tomas Bjerre *2021-04-03 16:53:02* 860 | 861 | **doc** 862 | 863 | 864 | [15e69](https://github.com/tomasbjerre/gradle-scripts/commit/15e69a8f8d3b78b) Tomas Bjerre *2021-04-02 19:20:02* 865 | 866 | 867 | ## 2.0.4 (2021-04-02) 868 | 869 | ### Other changes 870 | 871 | **Ignoreing commits from script in changelog** 872 | 873 | 874 | [5f5f5](https://github.com/tomasbjerre/gradle-scripts/commit/5f5f5a2c13f7d34) Tomas Bjerre *2021-04-02 17:59:11* 875 | 876 | 877 | ## 2.0.2 (2021-04-02) 878 | 879 | ### Other changes 880 | 881 | **Ignoreing commits from script in changelog** 882 | 883 | 884 | [d8964](https://github.com/tomasbjerre/gradle-scripts/commit/d896442051076c5) Tomas Bjerre *2021-04-02 17:54:33* 885 | 886 | **doc** 887 | 888 | 889 | [2fe0b](https://github.com/tomasbjerre/gradle-scripts/commit/2fe0b7819ff16ce) Tomas Bjerre *2021-04-02 17:51:36* 890 | 891 | **Updating changelog with 2.0.1** 892 | 893 | 894 | [493df](https://github.com/tomasbjerre/gradle-scripts/commit/493df493260e0bb) Tomas Bjerre *2021-04-02 17:28:35* 895 | 896 | 897 | ## 2.0.1 (2021-04-02) 898 | 899 | ### Other changes 900 | 901 | **New version: 2.0.1** 902 | 903 | 904 | [958ac](https://github.com/tomasbjerre/gradle-scripts/commit/958ac45650b2970) Tomas Bjerre *2021-04-02 17:28:31* 905 | 906 | **pushin tag** 907 | 908 | 909 | [140a2](https://github.com/tomasbjerre/gradle-scripts/commit/140a2a9bdbdff46) Tomas Bjerre *2021-04-02 17:27:48* 910 | 911 | **doc** 912 | 913 | 914 | [8f248](https://github.com/tomasbjerre/gradle-scripts/commit/8f248d6830ee605) Tomas Bjerre *2021-04-02 17:20:55* 915 | 916 | **Updating changelog with 2.0.0** 917 | 918 | 919 | [1756a](https://github.com/tomasbjerre/gradle-scripts/commit/1756a1e1b6914cf) Tomas Bjerre *2021-04-02 17:08:58* 920 | 921 | 922 | ## 2.0.0 (2021-04-02) 923 | 924 | ### Other changes 925 | 926 | **New version: 2.0.0** 927 | 928 | 929 | [eb8ee](https://github.com/tomasbjerre/gradle-scripts/commit/eb8eec87d7a0113) Tomas Bjerre *2021-04-02 17:08:54* 930 | 931 | **Pretty much complete rewrite** 932 | 933 | 934 | [82cfd](https://github.com/tomasbjerre/gradle-scripts/commit/82cfddc503c3cef) Tomas Bjerre *2021-04-02 17:07:28* 935 | 936 | 937 | ## 1.17 (2021-01-29) 938 | 939 | ### Other changes 940 | 941 | **changelog filter** 942 | 943 | 944 | [9ce1e](https://github.com/tomasbjerre/gradle-scripts/commit/9ce1ed4c2cd6d8d) Tomas Bjerre *2021-01-29 19:11:50* 945 | 946 | 947 | ## 1.16 (2021-01-29) 948 | 949 | ### Other changes 950 | 951 | **changelog filter** 952 | 953 | 954 | [35369](https://github.com/tomasbjerre/gradle-scripts/commit/35369da8ef644e3) Tomas Bjerre *2021-01-29 19:05:02* 955 | 956 | 957 | ## 1.15 (2021-01-29) 958 | 959 | ### Other changes 960 | 961 | **changelog filter** 962 | 963 | 964 | [52c40](https://github.com/tomasbjerre/gradle-scripts/commit/52c40362a0624f2) Tomas Bjerre *2021-01-29 18:45:54* 965 | 966 | 967 | ## 1.13 (2021-01-29) 968 | 969 | ### Other changes 970 | 971 | **changelog filter** 972 | 973 | 974 | [f5fe9](https://github.com/tomasbjerre/gradle-scripts/commit/f5fe9f82f39f0b9) Tomas Bjerre *2021-01-29 18:40:24* 975 | 976 | 977 | ## 1.12 (2021-01-29) 978 | 979 | ### Other changes 980 | 981 | **changelog filter** 982 | 983 | 984 | [2c0c9](https://github.com/tomasbjerre/gradle-scripts/commit/2c0c9953cb7cae4) Tomas Bjerre *2021-01-29 18:05:40* 985 | 986 | **google-java-format 0.8** 987 | 988 | 989 | [a3df3](https://github.com/tomasbjerre/gradle-scripts/commit/a3df39dc84c4973) Tomas Bjerre *2020-06-12 18:10:01* 990 | 991 | 992 | ## sec (2020-05-20) 993 | 994 | ### Other changes 995 | 996 | **findbugssec** 997 | 998 | 999 | [b7e42](https://github.com/tomasbjerre/gradle-scripts/commit/b7e42a62aade155) Tomas Bjerre *2020-05-20 13:47:58* 1000 | 1001 | 1002 | ## ny (2020-04-28) 1003 | 1004 | ### Other changes 1005 | 1006 | **publish 0.11.0** 1007 | 1008 | 1009 | [1e392](https://github.com/tomasbjerre/gradle-scripts/commit/1e3928782c4d98a) Tomas Bjerre *2020-04-28 17:21:11* 1010 | 1011 | **mavenLocal** 1012 | 1013 | 1014 | [219e1](https://github.com/tomasbjerre/gradle-scripts/commit/219e1ec1a4f04c3) Tomas Bjerre *2020-03-16 16:24:41* 1015 | 1016 | **Shadow 5.2** 1017 | 1018 | 1019 | [b8228](https://github.com/tomasbjerre/gradle-scripts/commit/b82285a3a7ef9c2) Tomas Bjerre *2020-02-16 09:23:12* 1020 | 1021 | 1022 | ## 1.11 (2019-10-10) 1023 | 1024 | ### Other changes 1025 | 1026 | **Turning off central sync by default, sonatype is having problems!** 1027 | 1028 | 1029 | [a4793](https://github.com/tomasbjerre/gradle-scripts/commit/a479313f214779c) Tomas Bjerre *2019-10-10 14:39:57* 1030 | 1031 | 1032 | ## 1.10 (2019-10-09) 1033 | 1034 | ### Other changes 1035 | 1036 | **Formatting on check** 1037 | 1038 | 1039 | [45bd4](https://github.com/tomasbjerre/gradle-scripts/commit/45bd40b0ad402b3) Tomas Bjerre *2019-10-09 18:12:49* 1040 | 1041 | **Using default max columns** 1042 | 1043 | 1044 | [672b3](https://github.com/tomasbjerre/gradle-scripts/commit/672b3246adbf15f) Tomas Bjerre *2019-10-09 16:20:47* 1045 | 1046 | 1047 | ## 1.9 (2019-10-08) 1048 | 1049 | ### Other changes 1050 | 1051 | **Less width of message** 1052 | 1053 | 1054 | [591d4](https://github.com/tomasbjerre/gradle-scripts/commit/591d4b96c0f69d6) Tomas Bjerre *2019-10-08 19:34:41* 1055 | 1056 | **Less width of message** 1057 | 1058 | 1059 | [5e54f](https://github.com/tomasbjerre/gradle-scripts/commit/5e54f2b940c82a8) Tomas Bjerre *2019-10-08 19:03:18* 1060 | 1061 | **Spotbugs exclude** 1062 | 1063 | 1064 | [b37b3](https://github.com/tomasbjerre/gradle-scripts/commit/b37b36ba9f1b9d5) Tomas Bjerre *2019-10-08 17:26:18* 1065 | 1066 | 1067 | ## 1.8 (2019-10-08) 1068 | 1069 | ### Other changes 1070 | 1071 | **Spotbugs exclude** 1072 | 1073 | 1074 | [309ea](https://github.com/tomasbjerre/gradle-scripts/commit/309ea92a4718f99) Tomas Bjerre *2019-10-08 17:21:39* 1075 | 1076 | 1077 | ## 1.7 (2019-10-08) 1078 | 1079 | ### Other changes 1080 | 1081 | **Spotbugs exclude** 1082 | 1083 | 1084 | [11934](https://github.com/tomasbjerre/gradle-scripts/commit/1193463b645cafe) Tomas Bjerre *2019-10-08 17:17:52* 1085 | 1086 | 1087 | ## 1.6 (2019-10-08) 1088 | 1089 | ### Other changes 1090 | 1091 | **Spotbugs exclude** 1092 | 1093 | 1094 | [278b8](https://github.com/tomasbjerre/gradle-scripts/commit/278b8462e219710) Tomas Bjerre *2019-10-08 17:12:52* 1095 | 1096 | 1097 | ## 1.5 (2019-10-08) 1098 | 1099 | ### Other changes 1100 | 1101 | **Spotbugs exclude** 1102 | 1103 | 1104 | [9ba44](https://github.com/tomasbjerre/gradle-scripts/commit/9ba4486a8277cae) Tomas Bjerre *2019-10-08 17:09:46* 1105 | 1106 | 1107 | ## 1.4 (2019-10-08) 1108 | 1109 | ### Other changes 1110 | 1111 | **Spotbugs exclude** 1112 | 1113 | 1114 | [93797](https://github.com/tomasbjerre/gradle-scripts/commit/93797d3c21b2f64) Tomas Bjerre *2019-10-08 17:06:15* 1115 | 1116 | **Wider message** 1117 | 1118 | 1119 | [2e1f1](https://github.com/tomasbjerre/gradle-scripts/commit/2e1f148cfbd9ad6) Tomas Bjerre *2019-10-08 16:39:20* 1120 | 1121 | 1122 | ## 1.2 (2019-10-07) 1123 | 1124 | ### Other changes 1125 | 1126 | **Verify Google Java Format on build #2** 1127 | 1128 | 1129 | [4bbca](https://github.com/tomasbjerre/gradle-scripts/commit/4bbca5682cebbdd) Tomas Bjerre *2019-10-07 18:25:43* 1130 | 1131 | **removing test code** 1132 | 1133 | 1134 | [51003](https://github.com/tomasbjerre/gradle-scripts/commit/51003549720c292) Tomas Bjerre *2019-10-07 15:28:50* 1135 | 1136 | 1137 | ## 1.1 (2019-10-05) 1138 | 1139 | ### Other changes 1140 | 1141 | **spotbugs** 1142 | 1143 | 1144 | [4b7b8](https://github.com/tomasbjerre/gradle-scripts/commit/4b7b8ccef60b75f) Tomas Bjerre *2019-10-05 05:58:14* 1145 | 1146 | **spotbugs** 1147 | 1148 | 1149 | [4d35a](https://github.com/tomasbjerre/gradle-scripts/commit/4d35aa4950236f8) Tomas Bjerre *2019-10-05 05:38:14* 1150 | 1151 | **spotbugs** 1152 | 1153 | 1154 | [88425](https://github.com/tomasbjerre/gradle-scripts/commit/884253f36c8f0fe) Tomas Bjerre *2019-10-05 05:35:16* 1155 | 1156 | **Create FUNDING.yml** 1157 | 1158 | 1159 | [bd2ce](https://github.com/tomasbjerre/gradle-scripts/commit/bd2ce534720c585) Tomas Bjerre *2019-09-28 07:07:14* 1160 | 1161 | **Correcting vcsUrl to allow jcenter publish** 1162 | 1163 | 1164 | [50d62](https://github.com/tomasbjerre/gradle-scripts/commit/50d6266a88b546d) Tomas Bjerre *2019-06-04 05:50:31* 1165 | 1166 | **syncCentral** 1167 | 1168 | 1169 | [cc67a](https://github.com/tomasbjerre/gradle-scripts/commit/cc67aeb1f85e32f) Tomas Bjerre *2019-05-30 05:52:51* 1170 | 1171 | **work** 1172 | 1173 | 1174 | [09f8a](https://github.com/tomasbjerre/gradle-scripts/commit/09f8ae9fdf5dd69) Tomas Bjerre *2019-05-20 14:53:52* 1175 | 1176 | **work** 1177 | 1178 | 1179 | [0d935](https://github.com/tomasbjerre/gradle-scripts/commit/0d9357a46a00cc5) Tomas Bjerre *2019-05-20 14:46:11* 1180 | 1181 | **removing wrapper** 1182 | 1183 | 1184 | [36294](https://github.com/tomasbjerre/gradle-scripts/commit/36294f3eecabb20) Tomas Bjerre *2019-05-20 14:26:23* 1185 | 1186 | **removing wrapper** 1187 | 1188 | 1189 | [ab288](https://github.com/tomasbjerre/gradle-scripts/commit/ab2884b1ca367a6) Tomas Bjerre *2019-05-20 14:20:11* 1190 | 1191 | **plugin-publish-plugin 0.10.1** 1192 | 1193 | 1194 | [ddee8](https://github.com/tomasbjerre/gradle-scripts/commit/ddee83cfdc3a4d7) Tomas Bjerre *2019-05-20 14:12:14* 1195 | 1196 | **jcenter** 1197 | 1198 | 1199 | [1d9ad](https://github.com/tomasbjerre/gradle-scripts/commit/1d9add9ca7187a5) Tomas Bjerre *2019-04-28 07:36:08* 1200 | 1201 | **jcenter** 1202 | 1203 | 1204 | [f2be4](https://github.com/tomasbjerre/gradle-scripts/commit/f2be47a63b1acb5) Tomas Bjerre *2019-04-28 07:33:28* 1205 | 1206 | 1207 | ## 1.0 (2019-01-08) 1208 | 1209 | ### Other changes 1210 | 1211 | **Disabling Spotbugs, not compiling** 1212 | 1213 | 1214 | [c784b](https://github.com/tomasbjerre/gradle-scripts/commit/c784b383cac944d) Tomas Bjerre *2018-12-13 15:51:32* 1215 | 1216 | **changelog** 1217 | 1218 | 1219 | [d862d](https://github.com/tomasbjerre/gradle-scripts/commit/d862dada14bbb26) Tomas Bjerre *2018-09-25 07:22:17* 1220 | 1221 | **Automating reporters in readme** 1222 | 1223 | 1224 | [f9706](https://github.com/tomasbjerre/gradle-scripts/commit/f970641bcbbb42e) Tomas Bjerre *2018-09-23 11:50:08* 1225 | 1226 | **distributionType = Wrapper.DistributionType.ALL** 1227 | 1228 | 1229 | [c0072](https://github.com/tomasbjerre/gradle-scripts/commit/c00720f1976ead9) Tomas Bjerre *2018-09-18 09:32:09* 1230 | 1231 | **Java 8** 1232 | 1233 | 1234 | [5dc4b](https://github.com/tomasbjerre/gradle-scripts/commit/5dc4b0aca5b2e28) Tomas Bjerre *2018-09-18 06:44:50* 1235 | 1236 | **reverting wrapper, to make release work again** 1237 | 1238 | 1239 | [dc12d](https://github.com/tomasbjerre/gradle-scripts/commit/dc12dbaa1853d03) Tomas Bjerre *2018-09-15 07:25:35* 1240 | 1241 | **errorprone** 1242 | 1243 | 1244 | [8deef](https://github.com/tomasbjerre/gradle-scripts/commit/8deeffef7101a83) Tomas Bjerre *2018-09-15 07:03:32* 1245 | 1246 | **errorprone** 1247 | 1248 | 1249 | [c3ed2](https://github.com/tomasbjerre/gradle-scripts/commit/c3ed221c052e3b0) Tomas Bjerre *2018-09-15 07:02:27* 1250 | 1251 | **errorprone** 1252 | 1253 | 1254 | [3a4ed](https://github.com/tomasbjerre/gradle-scripts/commit/3a4ed2b25986097) Tomas Bjerre *2018-09-15 06:59:45* 1255 | 1256 | **errorprone** 1257 | 1258 | 1259 | [35dca](https://github.com/tomasbjerre/gradle-scripts/commit/35dcad016ec1595) Tomas Bjerre *2018-09-15 06:58:33* 1260 | 1261 | **errorprone** 1262 | 1263 | 1264 | [5c19a](https://github.com/tomasbjerre/gradle-scripts/commit/5c19a4465a96700) Tomas Bjerre *2018-09-15 06:57:42* 1265 | 1266 | **Gradle Wrapper 4.10.1** 1267 | 1268 | 1269 | [d728f](https://github.com/tomasbjerre/gradle-scripts/commit/d728f1d62411fba) Tomas Bjerre *2018-09-15 06:53:47* 1270 | 1271 | **wrapper** 1272 | 1273 | 1274 | [bdda0](https://github.com/tomasbjerre/gradle-scripts/commit/bdda0ba7fd0ca6e) Tomas Bjerre *2018-09-15 05:52:31* 1275 | 1276 | **errorprone** 1277 | 1278 | 1279 | [ccf74](https://github.com/tomasbjerre/gradle-scripts/commit/ccf7403d4775a1f) Tomas Bjerre *2018-09-15 05:32:49* 1280 | 1281 | **errorprone** 1282 | 1283 | 1284 | [6e106](https://github.com/tomasbjerre/gradle-scripts/commit/6e1063320fa7d41) Tomas Bjerre *2018-09-15 05:30:25* 1285 | 1286 | **net.ltgt.errorprone-javacplugin** 1287 | 1288 | 1289 | [8eafa](https://github.com/tomasbjerre/gradle-scripts/commit/8eafae4d19b4011) Tomas Bjerre *2018-09-15 05:25:02* 1290 | 1291 | **net.ltgt.errorprone-javacplugin** 1292 | 1293 | 1294 | [03b98](https://github.com/tomasbjerre/gradle-scripts/commit/03b98bccf75840d) Tomas Bjerre *2018-09-15 05:20:52* 1295 | 1296 | **Spotbugs** 1297 | 1298 | 1299 | [a0759](https://github.com/tomasbjerre/gradle-scripts/commit/a0759f77681c0e2) Tomas Bjerre *2018-09-12 15:56:01* 1300 | 1301 | **buildinfo** 1302 | 1303 | 1304 | [edee4](https://github.com/tomasbjerre/gradle-scripts/commit/edee4295b692e8e) Tomas Bjerre *2018-02-10 07:47:54* 1305 | 1306 | **Revert Junit 5** 1307 | 1308 | 1309 | [8fcad](https://github.com/tomasbjerre/gradle-scripts/commit/8fcad990c514fff) Tomas Bjerre *2018-01-21 08:03:19* 1310 | 1311 | **Junit 5** 1312 | 1313 | 1314 | [b621a](https://github.com/tomasbjerre/gradle-scripts/commit/b621a967826ef21) Tomas Bjerre *2018-01-21 07:55:52* 1315 | 1316 | **Updating README.md #1** 1317 | 1318 | 1319 | [e896d](https://github.com/tomasbjerre/gradle-scripts/commit/e896d4b73fafc45) Tomas Bjerre *2018-01-17 04:59:48* 1320 | 1321 | **Google Error Prone** 1322 | 1323 | 1324 | [4a2fd](https://github.com/tomasbjerre/gradle-scripts/commit/4a2fd920c99bda0) Tomas Bjerre *2018-01-14 11:42:18* 1325 | 1326 | **Google Error Prone** 1327 | 1328 | 1329 | [bfb91](https://github.com/tomasbjerre/gradle-scripts/commit/bfb91179409b459) Tomas Bjerre *2018-01-14 09:02:09* 1330 | 1331 | **print** 1332 | 1333 | 1334 | [16e9f](https://github.com/tomasbjerre/gradle-scripts/commit/16e9fb531ada3d9) Tomas Bjerre *2018-01-13 21:18:51* 1335 | 1336 | **latest** 1337 | 1338 | 1339 | [b3fba](https://github.com/tomasbjerre/gradle-scripts/commit/b3fbaf051d7d939) Tomas Bjerre *2017-12-31 11:39:30* 1340 | 1341 | **Avoiding install** 1342 | 1343 | 1344 | [cda7e](https://github.com/tomasbjerre/gradle-scripts/commit/cda7e08843d405e) Tomas Bjerre *2017-12-31 08:37:56* 1345 | 1346 | **Safe** 1347 | 1348 | 1349 | [71702](https://github.com/tomasbjerre/gradle-scripts/commit/7170295413c8f8d) Tomas Bjerre *2017-12-30 18:30:55* 1350 | 1351 | **Gradle 4.4.1** 1352 | 1353 | 1354 | [68663](https://github.com/tomasbjerre/gradle-scripts/commit/68663b87e7514c8) Tomas Bjerre *2017-12-30 14:22:44* 1355 | 1356 | **Removing reference to violations** 1357 | 1358 | 1359 | [2fc55](https://github.com/tomasbjerre/gradle-scripts/commit/2fc5501c75a3d3b) Tomas Bjerre *2017-12-30 13:30:19* 1360 | 1361 | **Violations Gradle Plugin 1.3** 1362 | 1363 | 1364 | [98ba0](https://github.com/tomasbjerre/gradle-scripts/commit/98ba04560d9142f) Tomas Bjerre *2017-12-27 19:56:18* 1365 | 1366 | **Limiting width** 1367 | 1368 | 1369 | [01cb6](https://github.com/tomasbjerre/gradle-scripts/commit/01cb6d4e192cd9b) Tomas Bjerre *2017-12-25 19:27:52* 1370 | 1371 | **Report level low** 1372 | 1373 | 1374 | [33aca](https://github.com/tomasbjerre/gradle-scripts/commit/33acabe656b3cba) Tomas Bjerre *2017-12-25 08:43:47* 1375 | 1376 | **Violations** 1377 | 1378 | 1379 | [dd07d](https://github.com/tomasbjerre/gradle-scripts/commit/dd07d32a1986e5e) Tomas Bjerre *2017-12-24 21:45:29* 1380 | 1381 | **Skipping the all classifier and packaging fat jar as main jar** 1382 | 1383 | 1384 | [23728](https://github.com/tomasbjerre/gradle-scripts/commit/23728f896454b73) Tomas Bjerre *2017-12-22 20:13:22* 1385 | 1386 | **Optionally use shadow jar** 1387 | 1388 | 1389 | [5f819](https://github.com/tomasbjerre/gradle-scripts/commit/5f8190b9ed07d39) Tomas Bjerre *2017-12-22 15:48:19* 1390 | 1391 | **Adding shadowJar** 1392 | 1393 | 1394 | [faf1b](https://github.com/tomasbjerre/gradle-scripts/commit/faf1bdcd234e40a) Tomas Bjerre *2017-12-22 10:57:48* 1395 | 1396 | **Moving Shadow into release** 1397 | 1398 | 1399 | [69856](https://github.com/tomasbjerre/gradle-scripts/commit/69856c65b804551) Tomas Bjerre *2017-12-22 10:48:56* 1400 | 1401 | **Shaddow** 1402 | 1403 | 1404 | [db45f](https://github.com/tomasbjerre/gradle-scripts/commit/db45f0c202fd2c0) Tomas Bjerre *2017-12-22 10:26:18* 1405 | 1406 | **Only JENKINS-jiras** 1407 | 1408 | 1409 | [17d28](https://github.com/tomasbjerre/gradle-scripts/commit/17d280d040d0b79) Tomas Bjerre *2017-12-20 20:20:02* 1410 | 1411 | **gradle-plugin** 1412 | 1413 | 1414 | [d74a8](https://github.com/tomasbjerre/gradle-scripts/commit/d74a84e5aca5903) Tomas Bjerre *2017-12-07 17:30:50* 1415 | 1416 | **Initial** 1417 | 1418 | 1419 | [ba692](https://github.com/tomasbjerre/gradle-scripts/commit/ba6925bad6c65b1) Tomas Bjerre *2017-12-07 15:46:36* 1420 | 1421 | 1422 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This functionality moved to: 2 | 3 | - 4 | - 5 | - 6 | 7 | # Gradle Scripts 8 | 9 | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/se.bjurr.gradle/gradle-scripts/badge.svg)](https://search.maven.org/artifact/se.bjurr.gradle/gradle-scripts) 10 | 11 | This is a gradle script, written in a highly configurable way, much like I've [blogged about in Jenkins](https://www.jenkins.io/blog/2020/10/21/a-sustainable-pattern-with-shared-library/). It contains a bunch of features that I use in my Gradle projects. 12 | 13 | Example usage can be found in: 14 | 15 | - [Git Changelog Lib](https://github.com/tomasbjerre/git-changelog-lib/blob/master/build.gradle) 16 | - [Git Changelog Command Line](https://github.com/tomasbjerre/git-changelog-command-line/blob/master/build.gradle) 17 | - [Violations Lib](https://github.com/tomasbjerre/violations-lib/blob/master/build.gradle) 18 | - [Violations Gradle Plugin](https://github.com/tomasbjerre/violations-gradle-plugin/blob/master/build.gradle) 19 | 20 | ## How does it work? 21 | 22 | It packages a `jar`. Uploads it to a Maven repository. Users can add the `jar` to their classpath and apply the `main.gradle` script from that `jar`. 23 | 24 | The behaviour of the script is highly configurable by supplying a `project.ext.buildConfig`. The given config will be merged with the [defaultConfig](src/main/resources/main.gradle). 25 | 26 | ```groovy 27 | apply plugin: 'java-library' 28 | 29 | buildscript { 30 | repositories { 31 | mavenCentral() 32 | mavenLocal() 33 | } 34 | dependencies { 35 | classpath 'se.bjurr.gradle:gradle-scripts:2.+' 36 | } 37 | } 38 | project.ext.buildConfig = [ 39 | // Your can supply a given config here, a subset of defaultConfig. 40 | ] 41 | apply from: project.buildscript.classLoader.getResource('main.gradle').toURI() 42 | ``` 43 | 44 | ## Features 45 | 46 | Missing something? Pull requests are welcome =) 47 | 48 | All configuration options are documented in the [defaultConfig](src/main/resources/main.gradle). 49 | 50 | 51 | ```groovy 52 | 53 | def defaultConfig = [ 54 | /** 55 | * "DEFAULT" - Works for most Java projects. 56 | * "GRADLE" - A Gradle plugin. 57 | * "COMMAND" - Runnable JAR, distributed in Central and NPM. 58 | */ 59 | repoType: "DEFAULT", 60 | sourceCompatibility: 17, 61 | targetCompatibility: 17, 62 | staticCodeAnalysis: [ 63 | /** 64 | * Maximum number of violations to accept from static code analysis. 65 | */ 66 | maxViolations: 9999, 67 | ], 68 | publishing: [ 69 | website: 'https://github.com/tomasbjerre/' + project.name, 70 | vcsUrl: 'https://github.com/tomasbjerre/'+project.name, 71 | licenseName: 'The Apache Software License, Version 2.0', 72 | licenseUrl: 'http://www.apache.org/licenses/LICENSE-2.0.txt', 73 | developerId: 'tomasbjerre', 74 | developerName: 'Tomas Bjerre', 75 | developerEmail: 'tomas.bjerre85@gmail.com', 76 | /** 77 | * If using PasswordCredentials and repository name "nexus", you will 78 | * need to supply username/password properties named "nexusUsername" 79 | * and "nexusPassword". Perhaps in ~/.gradle/gradle.properties 80 | */ 81 | mavenRepositoryName: "nexus", 82 | mavenRepositoryUrl: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/', 83 | /** 84 | * true, if you want the repository in Nexus to be closed and pomoted to Release. 85 | */ 86 | nexusCloseAndRelease: true, 87 | /** 88 | * If using signing you will need to supply signing properties. 89 | * Perhaps in ~/.gradle/gradle.properties 90 | * https://docs.gradle.org/current/userguide/signing_plugin.html 91 | */ 92 | sign: true, 93 | /** 94 | * If not empty: creates a fat jar with relocated packages. 95 | * Example: [ "com.google", "a.b:se.bjurr.a.b" ] 96 | * Will make up a relocation target for "com.google" and will use "se.bjurr.a.b" as target for "a.b". 97 | */ 98 | relocate: [], 99 | ], 100 | gradlePlugin: [ 101 | tags: [] 102 | ], 103 | changelog: [ 104 | enabled: true, 105 | githubTokenEnvVariableName: 'GITHUB_OAUTH2TOKEN', 106 | githubOrganization: 'tomasbjerre', 107 | jiraIssuePattern: "\\bJENKINS-([0-9]+)\\b", 108 | ignoreCommitsIfMessageMatches: "^\\[maven-release-plugin\\].*|^\\[Gradle Release Plugin\\].*|^Merge.*|.*\\[GRADLE SCRIPT\\].*" 109 | ], 110 | violations: [ 111 | /** 112 | * Update README.md with table of parsers and reporters. 113 | */ 114 | updateReadme: false 115 | ], 116 | manifest: [ 117 | mainClass: '' 118 | ], 119 | /** 120 | * Will be configured if they exist. 121 | */ 122 | generatedSourceFolders: [ 123 | "src/gen/java", 124 | "src/generated/java" 125 | ], 126 | formattingExcludedPatterns: [ 127 | "**/gen/**", 128 | "**/generated/**" 129 | ], 130 | /** 131 | * Will be configured if they exist. 132 | */ 133 | extraTestSourceFolders: [ 134 | "src/test/generated" 135 | ], 136 | /** 137 | * Used as "from" in jar if it exists. Can be used to do annotation processing. 138 | */ 139 | jarResourcesFolder: 'src/jar/resources' 140 | ] 141 | 142 | ``` 143 | 144 | 145 | ### Publishing releases 146 | 147 | It can: 148 | 149 | - Step version 150 | - Package release 151 | - Sign release 152 | - Publish release to repository (like Nexus or Maven Central) 153 | - Create a changelog 154 | - Commit/tag/push to Git 155 | - Close and promote release in Nexus 156 | 157 | With: 158 | 159 | ```sh 160 | ./gradlew releasePatch 161 | ./gradlew releaseMinor 162 | ./gradlew releaseMajor 163 | ``` 164 | 165 | Or by relying on [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) and just doing: 166 | 167 | ```sh 168 | ./gradlew release 169 | ``` 170 | 171 | ### Static code analysis 172 | 173 | It has `Spotbugs` configured in combination with [Violations Gradle Plugin](https://github.com/tomasbjerre/violations-gradle-plugin). Any violations will be printed nicely in the build log. And build can optionally be failed based on number of violations. 174 | 175 | ### Other features 176 | 177 | - Automated changelog 178 | - Code formatting, with Google Java Format. 179 | - Shadowing, producing fat-jar 180 | - Signing artifacts with PGP 181 | - ... 182 | 183 | ## Requirements 184 | 185 | Gradle wrapper can be downloaded with: 186 | 187 | ```sh 188 | cat > gradle/wrapper/gradle-wrapper.properties << EOL 189 | distributionBase=GRADLE_USER_HOME 190 | distributionPath=wrapper/dists 191 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip 192 | networkTimeout=10000 193 | zipStoreBase=GRADLE_USER_HOME 194 | zipStorePath=wrapper/dists 195 | EOL 196 | 197 | ./gradlew wrapper \ 198 | --gradle-version=8.6 \ 199 | --distribution-type=bin 200 | ``` 201 | 202 | In many cases you can just run the `gradlew wrapper` task. But there are cases where this does not work. On such case is if you are using Java version X and the current wrapper only support version Y, the current wrapper cannot run. Se example error below: 203 | 204 | ```sh 205 | $ java -version 206 | 207 | openjdk version "21.0.2" 2024-01-16 208 | OpenJDK Runtime Environment (build 21.0.2+13-Ubuntu-122.04.1) 209 | OpenJDK 64-Bit Server VM (build 21.0.2+13-Ubuntu-122.04.1, mixed mode, sharing) 210 | ``` 211 | 212 | ```sh 213 | $ ./gradlew wrapper --gradle-version=8.6 --distribution-type=bin 214 | 215 | Downloading https://X/distributions/gradle-6.8.3-bin.zip 216 | 217 | ... 218 | 219 | FAILURE: Build failed with an exception. 220 | 221 | * Where: 222 | Build file 'X/build.gradle' 223 | 224 | * What went wrong: 225 | Could not compile build file 'X/build.gradle'. 226 | > startup failed: 227 | General error during semantic analysis: Unsupported class file major version 65 228 | 229 | java.lang.IllegalArgumentException: Unsupported class file major version 65 230 | at groovyjarjarasm.asm.ClassReader.(ClassReader.java:196) 231 | ``` 232 | 233 | ## Developer instructions 234 | 235 | You can fiddle with the script localy by installning it with: 236 | 237 | ```sh 238 | ./gradlew publishToMavenLocal -Pversion=latest-SNAPSHOT 239 | ``` 240 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java-library' 2 | 3 | def mainGradle = 'src/main/resources/main.gradle' 4 | 5 | def mainGradleContent = file(mainGradle).text 6 | def defaultConfigStart = "// ---- start of default config ----" 7 | def defaultConfigEnd = "// ---- end of default config ----" 8 | def defaultConfig = mainGradleContent.substring(mainGradleContent.indexOf(defaultConfigStart)+defaultConfigStart.size()) 9 | defaultConfig = defaultConfig.substring(0, defaultConfig.indexOf(defaultConfigEnd)) 10 | 11 | def readmeContent = file('README.md').text 12 | def readmeContentStart = "" 13 | def readmeContentEnd = "" 14 | def readmeContentFirstPart = readmeContent.split(readmeContentStart)[0] 15 | def readmeContentSecondPart = readmeContent.split(readmeContentEnd)[1] 16 | def newReadmeContent = """${readmeContentFirstPart}${readmeContentStart} 17 | ```groovy 18 | ${defaultConfig} 19 | ``` 20 | ${readmeContentEnd}${readmeContentSecondPart}""" 21 | file('README.md').write(newReadmeContent) 22 | 23 | /** 24 | * See README.md for usage in a project. 25 | */ 26 | /* 27 | // This is just use for testing purposes when fiddling with this script 28 | dependencies { 29 | api 'se.bjurr.violations:violations-lib:1.156.7' 30 | } 31 | project.ext.buildConfig = [ 32 | publishing: [ 33 | relocate: [ 34 | " se:se" 35 | ] 36 | ] 37 | ] 38 | */ 39 | 40 | project.ext.buildConfig = [ 41 | sourceCompatibility: 11, 42 | targetCompatibility: 11 43 | ] 44 | apply from: mainGradle 45 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | #Sun Sep 08 07:53:31 CEST 2024 2 | description=A collection of scripts 3 | version=2.28.2 4 | group=se.bjurr.gradle 5 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasbjerre/gradle-scripts/abe70176c064c45d108b6a592ee7dd88f1da7e95/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip 4 | networkTimeout=10000 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | # This is normally unused 84 | # shellcheck disable=SC2034 85 | APP_BASE_NAME=${0##*/} 86 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit 87 | 88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 90 | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. 92 | MAX_FD=maximum 93 | 94 | warn () { 95 | echo "$*" 96 | } >&2 97 | 98 | die () { 99 | echo 100 | echo "$*" 101 | echo 102 | exit 1 103 | } >&2 104 | 105 | # OS specific support (must be 'true' or 'false'). 106 | cygwin=false 107 | msys=false 108 | darwin=false 109 | nonstop=false 110 | case "$( uname )" in #( 111 | CYGWIN* ) cygwin=true ;; #( 112 | Darwin* ) darwin=true ;; #( 113 | MSYS* | MINGW* ) msys=true ;; #( 114 | NONSTOP* ) nonstop=true ;; 115 | esac 116 | 117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 118 | 119 | 120 | # Determine the Java command to use to start the JVM. 121 | if [ -n "$JAVA_HOME" ] ; then 122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 123 | # IBM's JDK on AIX uses strange locations for the executables 124 | JAVACMD=$JAVA_HOME/jre/sh/java 125 | else 126 | JAVACMD=$JAVA_HOME/bin/java 127 | fi 128 | if [ ! -x "$JAVACMD" ] ; then 129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 130 | 131 | Please set the JAVA_HOME variable in your environment to match the 132 | location of your Java installation." 133 | fi 134 | else 135 | JAVACMD=java 136 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | 142 | # Increase the maximum file descriptors if we can. 143 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 144 | case $MAX_FD in #( 145 | max*) 146 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 147 | # shellcheck disable=SC3045 148 | MAX_FD=$( ulimit -H -n ) || 149 | warn "Could not query maximum file descriptor limit" 150 | esac 151 | case $MAX_FD in #( 152 | '' | soft) :;; #( 153 | *) 154 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 155 | # shellcheck disable=SC3045 156 | ulimit -n "$MAX_FD" || 157 | warn "Could not set maximum file descriptor limit to $MAX_FD" 158 | esac 159 | fi 160 | 161 | # Collect all arguments for the java command, stacking in reverse order: 162 | # * args from the command line 163 | # * the main class name 164 | # * -classpath 165 | # * -D...appname settings 166 | # * --module-path (only if needed) 167 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 168 | 169 | # For Cygwin or MSYS, switch paths to Windows format before running java 170 | if "$cygwin" || "$msys" ; then 171 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 172 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 173 | 174 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 175 | 176 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 177 | for arg do 178 | if 179 | case $arg in #( 180 | -*) false ;; # don't mess with options #( 181 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 182 | [ -e "$t" ] ;; #( 183 | *) false ;; 184 | esac 185 | then 186 | arg=$( cygpath --path --ignore --mixed "$arg" ) 187 | fi 188 | # Roll the args list around exactly as many times as the number of 189 | # args, so each arg winds up back in the position where it started, but 190 | # possibly modified. 191 | # 192 | # NB: a `for` loop captures its iteration list before it begins, so 193 | # changing the positional parameters here affects neither the number of 194 | # iterations, nor the values presented in `arg`. 195 | shift # remove old arg 196 | set -- "$@" "$arg" # push replacement arg 197 | done 198 | fi 199 | 200 | # Collect all arguments for the java command; 201 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of 202 | # shell script including quotes and variable substitutions, so put them in 203 | # double quotes to make sure that they get re-expanded; and 204 | # * put everything else in single quotes, so that it's not re-expanded. 205 | 206 | set -- \ 207 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 208 | -classpath "$CLASSPATH" \ 209 | org.gradle.wrapper.GradleWrapperMain \ 210 | "$@" 211 | 212 | # Stop when "xargs" is not available. 213 | if ! command -v xargs >/dev/null 2>&1 214 | then 215 | die "xargs is not available" 216 | fi 217 | 218 | # Use "xargs" to parse quoted args. 219 | # 220 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 221 | # 222 | # In Bash we could simply go: 223 | # 224 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 225 | # set -- "${ARGS[@]}" "$@" 226 | # 227 | # but POSIX shell has neither arrays nor command substitution, so instead we 228 | # post-process each arg (as a line of input to sed) to backslash-escape any 229 | # character that might be a shell metacharacter, then use eval to reverse 230 | # that process (while maintaining the separation between arguments), and wrap 231 | # the whole thing up as a single "set" statement. 232 | # 233 | # This will of course break if any of these variables contains a newline or 234 | # an unmatched quote. 235 | # 236 | 237 | eval "set -- $( 238 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 239 | xargs -n1 | 240 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 241 | tr '\n' ' ' 242 | )" '"$@"' 243 | 244 | exec "$JAVACMD" "$@" 245 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 48 | echo. 49 | echo Please set the JAVA_HOME variable in your environment to match the 50 | echo location of your Java installation. 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 62 | echo. 63 | echo Please set the JAVA_HOME variable in your environment to match the 64 | echo location of your Java installation. 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72 | 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega 93 | -------------------------------------------------------------------------------- /src/main/resources/main.gradle: -------------------------------------------------------------------------------- 1 | def configureChangelog() { 2 | def configuredGitHubToken = System.getenv(effectiveConfig.changelog.githubTokenEnvVariableName) 3 | task gitChangelogTask(type: se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask) { 4 | if (configuredGitHubToken != null) { 5 | gitHubApi = "https://api.github.com/repos/" + effectiveConfig.changelog.githubOrganization + "/" + project.name; 6 | gitHubToken = configuredGitHubToken; 7 | logger.lifecycle("Using Github API ${gitHubApi}") 8 | } else { 9 | logger.lifecycle("Did not find Github token ${effectiveConfig.changelog.githubTokenEnvVariableName} env variable.") 10 | } 11 | jiraIssuePattern = effectiveConfig.changelog.jiraIssuePattern; 12 | ignoreCommitsIfMessageMatches = effectiveConfig.changelog.ignoreCommitsIfMessageMatches; 13 | } 14 | } 15 | 16 | def findResource(String name, classLoader = project.buildscript.classLoader) { 17 | URL resource = classLoader.getResource(name) 18 | if (resource == null) { 19 | logger.lifecycle("Cannot find resource \"${name}\"") 20 | return null; 21 | } 22 | return resource 23 | } 24 | 25 | def copyResourceToFile(URL resource, String copyTo, classLoader = project.buildscript.classLoader) { 26 | logger.lifecycle("Copying ${resource} to ${copyTo}") 27 | def content = resource.text 28 | def parentFile = new File(copyTo).getParentFile() 29 | if (parentFile != null) { 30 | parentFile.mkdirs() 31 | } 32 | FileWriter fw = new FileWriter(copyTo) 33 | BufferedWriter bw = new BufferedWriter(fw) 34 | bw.write(content) 35 | bw.close() 36 | } 37 | 38 | def copyIfFound(String name, String target=null, classLoader = project.buildscript.classLoader) { 39 | URL resource = findResource(name, classLoader) 40 | if (resource != null) { 41 | logger.lifecycle("Found resource ${name} as ${resource}") 42 | def newFilename = target == null ? "$buildDir/$name" : target 43 | copyResourceToFile(resource, newFilename) 44 | return new File(newFilename) 45 | } 46 | } 47 | 48 | def File getFile(String name) { 49 | def f = new File(name) 50 | if (!f.exists()) { 51 | logger.lifecycle("Cannot find file \"${name}\"") 52 | } else { 53 | logger.lifecycle("Found file \"${name}\"") 54 | } 55 | return f 56 | } 57 | 58 | def File getResourceAsFile(String name, classLoader = project.buildscript.classLoader) { 59 | def f = getFile(name) 60 | if (f.exists()) { 61 | return f 62 | } 63 | 64 | f = getFile("src/main/resources/"+name) 65 | if (f.exists()) { 66 | return f 67 | } 68 | 69 | throw new RuntimeException("Cannot find resource ${name}") 70 | } 71 | 72 | def configureStaticCodeAnalysis() { 73 | apply plugin: com.github.spotbugs.snom.SpotBugsPlugin 74 | apply plugin: se.bjurr.violations.gradle.plugin.ViolationsGradlePlugin 75 | apply plugin: 'pmd' 76 | 77 | assemble.doLast { 78 | copyIfFound("spotbugs-exclude.xml") 79 | copyIfFound("pmd.xml") 80 | } 81 | 82 | dependencies { 83 | spotbugs 'com.github.spotbugs:spotbugs:4.8.3' 84 | compileOnly "com.github.spotbugs:spotbugs-annotations:${spotbugs.toolVersion.get()}" 85 | } 86 | 87 | tasks.withType(com.github.spotbugs.snom.SpotBugsTask) { 88 | enabled = false 89 | } 90 | 91 | spotbugsMain { 92 | enabled = true 93 | ignoreFailures = true 94 | effort = com.github.spotbugs.snom.Effort.MAX 95 | showProgress = true 96 | showStackTraces = false 97 | excludeFilter = new File("$buildDir/spotbugs-exclude.xml") 98 | reportsDir = new File("$buildDir/reports/spotbugs/") 99 | reports { 100 | xml { 101 | enabled true 102 | } 103 | } 104 | } 105 | 106 | dependencies { 107 | spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.12.0' 108 | } 109 | 110 | pmd { 111 | sourceSets = [sourceSets.main] 112 | toolVersion = '6.55.0' 113 | ruleSets = [] // Gradle has some defaults that needs to be cleared 114 | ruleSetFiles = files("$buildDir/pmd.xml") 115 | } 116 | pmdMain { 117 | source = "src/main/java" 118 | ignoreFailures = true 119 | reports { 120 | xml.required = true 121 | html.required = true 122 | } 123 | } 124 | 125 | 126 | task violations(type: se.bjurr.violations.gradle.plugin.ViolationsTask) { 127 | minSeverity = 'INFO' 128 | detailLevel = 'VERBOSE' // PER_FILE_COMPACT, COMPACT or VERBOSE 129 | maxViolations = effectiveConfig.staticCodeAnalysis.maxViolations 130 | printViolations = true 131 | 132 | // Many more formats available, see: https://github.com/tomasbjerre/violations-lib 133 | violations = [ 134 | ["FINDBUGS", ".", ".*/build/reports/findbugs/.*\\.xml\$","Findbugs"], 135 | ["FINDBUGS", ".", ".*/build/reports/spotbugs/.*\\.xml\$","Spotbugs"], 136 | ["PMD", ".", ".*/build/reports/pmd/.*\\.xml\$","Pmd"], 137 | ["GOOGLEERRORPRONE", ".", ".*/build/googleErrorProne.*\\.log\$","Error Prone"] 138 | ] 139 | } 140 | 141 | check.finalizedBy violations 142 | } 143 | 144 | def configureFormatting() { 145 | apply plugin: com.diffplug.gradle.spotless.SpotlessPlugin 146 | 147 | check.dependsOn spotlessApply 148 | 149 | spotless { 150 | java { 151 | target '**/*.java' 152 | googleJavaFormat() 153 | targetExclude effectiveConfig.formattingExcludedPatterns 154 | } 155 | } 156 | } 157 | 158 | def addSourceFolderIfExists(String folder) { 159 | if (new File(folder).exists()) { 160 | logger.lifecycle("Detected ${folder}, adding it as source folder") 161 | sourceSets.main.java.srcDirs += [ folder ] 162 | } 163 | } 164 | 165 | def addTestSourceFolderIfExists(String folder) { 166 | if (new File(folder).exists()) { 167 | logger.lifecycle("Detected ${folder}, adding it as test source folder") 168 | sourceSets.test.java.srcDirs += [ folder ] 169 | } 170 | } 171 | 172 | def configureJava() { 173 | apply plugin: 'java-library' 174 | apply plugin: 'eclipse' 175 | 176 | sourceCompatibility = effectiveConfig.sourceCompatibility 177 | targetCompatibility = effectiveConfig.targetCompatibility 178 | 179 | repositories { 180 | mavenLocal() 181 | mavenCentral() 182 | } 183 | 184 | effectiveConfig.generatedSourceFolders.each { 185 | addSourceFolderIfExists(it) 186 | } 187 | 188 | effectiveConfig.extraTestSourceFolders.each { 189 | addTestSourceFolderIfExists(it) 190 | } 191 | 192 | test { 193 | if (System.getProperty('DEBUG', 'false') == 'true') { 194 | jvmArgs '-Xdebug', 195 | '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=9009', 196 | '-parameters' 197 | } 198 | } 199 | 200 | if (JavaVersion.current().isJava8Compatible()) { 201 | allprojects { 202 | tasks.withType(Javadoc) { 203 | options.addStringOption('Xdoclint:none', '-quiet') 204 | } 205 | } 206 | } 207 | 208 | eclipse { 209 | classpath { 210 | downloadSources = true 211 | downloadJavadoc = true 212 | } 213 | } 214 | 215 | java { 216 | withSourcesJar() 217 | withJavadocJar() 218 | } 219 | 220 | if (effectiveConfig.manifest.mainClass != '') { 221 | jar { 222 | manifest { 223 | attributes 'Main-Class': effectiveConfig.manifest.mainClass 224 | } 225 | if (new File(effectiveConfig.jarResourcesFolder).exists()) { 226 | from effectiveConfig.jarResourcesFolder 227 | } 228 | } 229 | } 230 | } 231 | 232 | def getNewVersion(String oldVersionName, String bump) { 233 | def (major, minor, patch) = oldVersionName 234 | .replaceAll("[^0-9\\.]","") 235 | .concat(".0.0") 236 | .tokenize('.') 237 | major = major.toInteger() 238 | minor = minor.toInteger() 239 | patch = patch.toInteger() 240 | if (bump == "Major") { major++; minor = 0; patch = 0; } 241 | if (bump == "Minor") { minor++; patch = 0; } 242 | if (bump == "Patch") { patch++ } 243 | def newVersionName = "$major.$minor.$patch" 244 | logger.lifecycle("$oldVersionName → $newVersionName") 245 | return newVersionName 246 | } 247 | 248 | def bumpVersionTo(version) { 249 | def propertyFile = new File("$projectDir/gradle.properties") 250 | def gradleProps = new Properties() 251 | propertyFile.withReader { gradleProps.load(it) } 252 | gradleProps.setProperty('version', version) 253 | propertyFile.withWriter { gradleProps.store(it, null) } 254 | gradle.buildFinished { result -> 255 | if (result.failure) { 256 | [ 257 | "gradle.properties" 258 | ].each { 259 | logger.lifecycle("Restoring ${it} because of failure") 260 | runCommand(["git", "checkout", it]) 261 | } 262 | } 263 | } 264 | } 265 | 266 | def bumpVersion(type) { 267 | logger.lifecycle("Bumping ${type.toLowerCase()} version…") 268 | String oldVersionName = project.version 269 | version = getNewVersion(oldVersionName, type) 270 | bumpVersionTo(version) 271 | } 272 | 273 | def runCommand(args, int attempts = 5) { 274 | logger.lifecycle("Executing ${args.join(' ')}") 275 | def stdout = new ByteArrayOutputStream() 276 | try { 277 | exec { 278 | commandLine args 279 | standardOutput = stdout 280 | } 281 | return stdout.toString().trim() 282 | } catch (e) { 283 | def err = stdout.toString().trim() + "\n" + "Command: ${args.join(' ')}" + "\n" + "Trying ${attempts} more times" 284 | logger.lifecycle(err) 285 | if (attempts == 0) { 286 | throw new RuntimeException(err, e) 287 | } 288 | sleep(5 * 1000) 289 | return runCommand(args, attempts - 1) 290 | } 291 | } 292 | 293 | def doPost(String url, String authString, String payload, Integer attempts = 20) { 294 | logger.lifecycle("> POST ${url} ${payload}") 295 | def responseCode = 0 296 | def content = "" 297 | def responseMessage = "" 298 | try { 299 | def conn = url.toURL().openConnection() 300 | conn.setRequestMethod("POST") 301 | conn.setRequestProperty("Authorization", "Basic ${authString}") 302 | conn.setRequestProperty("Accept", "application/json") 303 | conn.setRequestProperty("Content-Type", "application/json; charset=UTF-8") 304 | conn.setDoOutput( true ) 305 | 306 | Writer wr = new OutputStreamWriter(conn.outputStream) 307 | wr.write(payload); 308 | wr.flush() 309 | wr.close() 310 | conn.connect() 311 | responseCode = conn.responseCode 312 | content = conn.content 313 | responseMessage = conn.responseMessage 314 | } catch (e) { 315 | // Ignore 316 | } 317 | 318 | if(responseCode == 201){ 319 | logger.lifecycle("OK") 320 | } else { 321 | logger.error("Content: "+content) 322 | def msg = "There was an error with repositories: ${responseCode} ${responseMessage}" 323 | if (attempts == 0) { 324 | throw new Exception(msg) 325 | } else { 326 | logger.lifecycle(msg+". ${attempts} left.") 327 | sleep(5000) 328 | doPost(url, authString, payload, attempts - 1) 329 | } 330 | } 331 | } 332 | 333 | List getNexusOpenRepositories(String url, String authString) { 334 | def conn = url.toURL().openConnection() 335 | conn.setRequestProperty("Authorization", "Basic ${authString}") 336 | conn.setRequestProperty("Accept", "application/json") 337 | 338 | if(conn.responseCode != 200){ 339 | try { logger.lifecycle("Content: "+conn.content) } catch(Exception e) {} 340 | throw new Exception("There was an error while retrieving the repositories from Nexus: ${conn.responseCode} ${conn.responseMessage}") 341 | } 342 | return new groovy.json.JsonSlurper() 343 | .parseText( conn.content.text ) 344 | .data 345 | .findAll { it.type=="open" && it.userId==nexusUsername } 346 | .collect { it.repositoryId } 347 | } 348 | 349 | /** 350 | * Inspired by: https://github.com/adaptivecomputing/plugins-gradle 351 | */ 352 | task nexusCloseAndRelease() { 353 | doLast { 354 | def authString = "${nexusUsername}:${nexusPassword}".getBytes().encodeBase64().toString() 355 | URL urlObj = effectiveConfig.publishing.mavenRepositoryUrl.toURL() 356 | def baseUrl = urlObj.getProtocol()+"://"+urlObj.getAuthority()+"/" 357 | def listStagingUrl = baseUrl + "service/local/staging/profile_repositories" 358 | def closeStagingUrl = baseUrl + "service/local/staging/bulk/close" 359 | def promoteStagingUrl = baseUrl + "service/local/staging/bulk/promote" 360 | 361 | def repositoryIdsToClose = getNexusOpenRepositories(listStagingUrl, authString) 362 | if (repositoryIdsToClose.isEmpty()) { 363 | logger.lifecycle("No open repositories to close/promote") 364 | return 365 | } 366 | 367 | logger.lifecycle("Closing ${repositoryIdsToClose}") 368 | doPost( 369 | closeStagingUrl, 370 | authString, 371 | "{'data':{'stagedRepositoryIds':[${repositoryIdsToClose.collect { "'"+it+"'" }.join(",")}],'description':''}}" 372 | ) 373 | 374 | def attempts = 40 375 | sleep(10000) 376 | while (getNexusOpenRepositories(listStagingUrl, authString).size() > 0 && attempts != 0) { 377 | attempts-- 378 | logger.lifecycle("Waiting for ${repositoryIdsToClose} to be closed... ${attempts} attempts left.") 379 | sleep(10000) 380 | } 381 | 382 | logger.lifecycle("Promoting (releasing) ${repositoryIdsToClose}") 383 | doPost( 384 | promoteStagingUrl, 385 | authString, 386 | "{'data':{'stagedRepositoryIds':[${repositoryIdsToClose.collect { "'"+it+"'" }.join(",")}],'description':''}}" 387 | ) 388 | 389 | logger.lifecycle("Nexus promotion done.") 390 | } 391 | } 392 | 393 | def configureRelease() { 394 | def useShadowJar = !effectiveConfig.publishing.relocate.isEmpty() 395 | apply plugin: "maven-publish" 396 | apply plugin: 'signing' 397 | if (useShadowJar) { 398 | apply plugin: com.github.jengelman.gradle.plugins.shadow.ShadowPlugin 399 | } 400 | 401 | tasks.addRule("Pattern: bump") { String taskName -> 402 | if (taskName.matches("bump(Major|Minor|Patch)")) { 403 | task(taskName) { 404 | doLast { 405 | String type = (taskName - 'bump') 406 | bumpVersion(type) 407 | } 408 | } 409 | } 410 | } 411 | 412 | tasks.addRule("Pattern: release") { String taskName -> 413 | if (taskName.matches("release(Major|Minor|Patch)")) { 414 | task(taskName) { 415 | doFirst { 416 | String type = (taskName - 'release') 417 | bumpVersion(type) 418 | } 419 | finalizedBy "releaseAfterMath" 420 | } 421 | } 422 | } 423 | 424 | // Release with version from conventional commits 425 | task release() { 426 | doFirst { 427 | def nextVersion = se.bjurr.gitchangelog.api.GitChangelogApi.gitChangelogApiBuilder() 428 | .withFromRepo(file('.')) 429 | .withSemanticMajorVersionPattern("^[Bb]reak") 430 | .withSemanticMinorVersionPattern("^[Ff]eat") 431 | .getNextSemanticVersion() 432 | .getVersion(); 433 | logger.lifecycle("Releasing version ${nextVersion}...") 434 | bumpVersionTo(nextVersion) 435 | } 436 | finalizedBy "releaseAfterMath" 437 | } 438 | 439 | task commitNewVersionTask() { 440 | doLast { 441 | runCommand(['git', 'commit', '-a', '-m', "chore(release): ${version} [GRADLE SCRIPT]"]) 442 | runCommand(['git', 'push']) 443 | runCommand(['git', 'tag', "${version}"]) 444 | runCommand(['git', 'push', 'origin', "${version}"]) 445 | } 446 | } 447 | 448 | task commitChangelogTask() { 449 | doLast { 450 | try { 451 | runCommand(['git', 'commit', '-a', '-m', "chore(release): Updating changelog with ${version} [GRADLE SCRIPT]"]) 452 | runCommand(['git', 'push']) 453 | } catch (e) { 454 | logger.error("Unable commit/push changelog, skipping that.",e.getMessage()) 455 | } 456 | } 457 | } 458 | 459 | task publishNpm() { 460 | doLast { 461 | runCommand(['npm', 'publish']) 462 | } 463 | } 464 | 465 | task setupNpmJavaRunnerFiles() { 466 | doLast { 467 | shouldGitIgnore('index.js') 468 | copyIfFound("npm-java-runner-index.js", "index.js") 469 | shouldGitIgnore('package.json') 470 | shouldGitIgnore('package-lock.json') 471 | shouldGitIgnore('node_modules') 472 | copyIfFound("npm-java-runner-package.json", "package.json") 473 | ant.replace(file: new File("package.json"), token: "PKG_NAME", value: project.name) 474 | ant.replace(file: new File("package.json"), token: "PKG_VERSION", value: version) 475 | ant.replace(file: new File("package.json"), token: "PKG_WEBSITE", value: effectiveConfig.publishing.website) 476 | ant.replace(file: new File("package.json"), token: "PKG_GIT", value: effectiveConfig.publishing.vcsUrl) 477 | ant.replace(file: new File("package.json"), token: "PKG_AUTHOR", value: effectiveConfig.publishing.developerName) 478 | ant.replace(file: new File("package.json"), token: "PKG_DESCRIPTION", value: project.description.replaceAll("[\"']","")) 479 | } 480 | } 481 | 482 | task releaseAfterMath(type: GradleBuild) { 483 | if (effectiveConfig.repoType == "GRADLE") { 484 | tasks = [ 485 | 'clean', 486 | 'build', 487 | "publishPlugins", 488 | 'commitNewVersionTask', 489 | 'gitChangelogTask', 490 | 'commitChangelogTask' 491 | ] 492 | } else { 493 | tasks = [ 494 | 'clean', 495 | 'build', 496 | 'publish', 497 | 'publishToMavenLocal', 498 | 'commitNewVersionTask', 499 | 'gitChangelogTask', 500 | 'commitChangelogTask' 501 | ] + 502 | (effectiveConfig.publishing.nexusCloseAndRelease ? [ "nexusCloseAndRelease" ] : []) + 503 | (effectiveConfig.repoType == "COMMAND" ? [ "setupNpmJavaRunnerFiles", "publishNpm" ] : []) 504 | } 505 | } 506 | 507 | if (useShadowJar) { 508 | effectiveConfig.publishing.relocate.each { it -> 509 | def relocateFrom = "" 510 | def relocateTo = "" 511 | if (it.contains(":")) { 512 | relocateFrom = it.split(":")[0] 513 | relocateTo = it.split(":")[1] 514 | } else { 515 | relocateFrom = it 516 | relocateTo = (project.group + '.' + project.name + '.' + relocateFrom) 517 | .replaceAll('[^a-zA-Z\\.]','') 518 | } 519 | logger.lifecycle("Relocating ${relocateFrom} to ${relocateTo}") 520 | shadowJar { 521 | relocate relocateFrom, relocateTo 522 | } 523 | } 524 | shadowJar { 525 | archiveBaseName.set(project.name) 526 | archiveClassifier.set('') 527 | archiveVersion.set(project.version) 528 | } 529 | build.dependsOn shadowJar 530 | } else { 531 | logger.lifecycle("Not including shadow jar.") 532 | } 533 | 534 | def pomConfig = { 535 | scm { 536 | url effectiveConfig.publishing.website 537 | connection effectiveConfig.publishing.vcsUrl 538 | developerConnection effectiveConfig.publishing.vcsUrl 539 | } 540 | 541 | licenses { 542 | license { 543 | name effectiveConfig.publishing.licenseName 544 | url effectiveConfig.publishing.licenseUrl 545 | distribution 'repo' 546 | } 547 | } 548 | 549 | developers { 550 | developer { 551 | id effectiveConfig.publishing.developerId 552 | name effectiveConfig.publishing.developerName 553 | email effectiveConfig.publishing.developerEmail 554 | } 555 | } 556 | } 557 | 558 | publishing { 559 | publications { 560 | gradleScriptsPublication(MavenPublication) { publication -> 561 | if (useShadowJar) { 562 | logger.lifecycle("shadow jar in maven publication") 563 | project.shadow.component(publication) 564 | } else { 565 | logger.lifecycle("not using shadow jar in maven publication") 566 | from project.components.java 567 | } 568 | logger.lifecycle("group: ${project.group} name: ${project.name}") 569 | groupId project.group.replaceAll("[\"']","") 570 | artifactId project.name.replaceAll("[\"']","") 571 | version version 572 | pom.withXml { 573 | def root = asNode() 574 | root.appendNode('description', project.description.replaceAll("[\"']","")) 575 | root.appendNode('name', project.name) 576 | root.appendNode('url', effectiveConfig.publishing.website) 577 | root.appendNode('inceptionYear', new Date().getYear() + 1900) 578 | root.children().last() + pomConfig 579 | } 580 | 581 | versionMapping { 582 | allVariants { 583 | fromResolutionResult() 584 | } 585 | } 586 | } 587 | 588 | if (useShadowJar) { 589 | logger.lifecycle("shadow jar in maven publication") 590 | shadow(MavenPublication) { publication -> 591 | project.shadow.component(publication) 592 | artifact javadocJar 593 | artifact sourcesJar 594 | 595 | logger.lifecycle("group: ${project.group} name: ${project.name}") 596 | groupId project.group.replaceAll("[\"']","") 597 | artifactId project.name.replaceAll("[\"']","") 598 | version version 599 | pom.withXml { 600 | def root = asNode() 601 | root.appendNode('description', project.description.replaceAll("[\"']","")) 602 | root.appendNode('name', project.name) 603 | root.appendNode('url', effectiveConfig.publishing.website) 604 | root.appendNode('inceptionYear', new Date().getYear() + 1900) 605 | root.children().last() + pomConfig 606 | } 607 | 608 | versionMapping { 609 | allVariants { 610 | fromResolutionResult() 611 | } 612 | } 613 | } 614 | } 615 | } 616 | repositories { 617 | maven { 618 | name = effectiveConfig.publishing.mavenRepositoryName 619 | credentials(PasswordCredentials) 620 | url = effectiveConfig.publishing.mavenRepositoryUrl 621 | } 622 | } 623 | } 624 | 625 | signing { 626 | required { effectiveConfig.publishing.sign && gradle.taskGraph.hasTask("publish") } 627 | sign publishing.publications.gradleScriptsPublication 628 | if (useShadowJar) { 629 | sign publishing.publications.shadow 630 | } 631 | } 632 | 633 | tasks.withType(AbstractPublishToMaven) { publishTask -> 634 | tasks.withType(Sign) { signTask -> 635 | logger.lifecycle("${publishTask} must run after ${signTask}") 636 | publishTask.mustRunAfter(signTask) 637 | } 638 | } 639 | 640 | tasks.withType(Sign) { signTask -> 641 | tasks.withType(Jar) { jarTask -> 642 | logger.lifecycle("${signTask} must run after ${jarTask}") 643 | signTask.mustRunAfter(jarTask) 644 | } 645 | } 646 | } 647 | 648 | def getUpdatableDependencies(dependencies) { 649 | dependencies 650 | .findAll { 651 | !([ 652 | "com.github.spotbugs", 653 | "com.diffplug.durian", 654 | "com.google.googlejavaformat", 655 | "com.ibm.icu", 656 | "commons-collections", 657 | "commons-io", 658 | "dev.equo.ide", 659 | "jakarta.annotation", 660 | "jakarta.inject", 661 | "jakarta.servlet", 662 | "net.java.dev.jna", 663 | "org.apache.felix", 664 | "org.bouncycastle", 665 | "org.eclipse", 666 | "com.h3xstream.findsecbugs", 667 | "org.slf4j" 668 | ].contains(it.group)) 669 | } 670 | .collect { 671 | [ 672 | d: it, 673 | newVersion: it.available.release ?: (it.available.milestone ?: it.available.integration) 674 | ] 675 | } 676 | .collect { 677 | [ 678 | prettyPrint: "${it.d.group}:${it.d.name}:${it.d.version} -> ${it.newVersion}", 679 | newVersion: it.newVersion, 680 | compactFrom: "[\"']${it.d.group}:${it.d.name}:${it.d.version}[\"']", 681 | compactTo: "'${it.d.group}:${it.d.name}:${it.newVersion}'", 682 | verboseFrom: "group:\s*[\"']${it.d.group}[\"'],\s*name:\s*[\"']${it.d.name}[\"'],\s*version:\s*[\"']${it.d.version}[\"']" 683 | ] 684 | } 685 | } 686 | 687 | def isNonStable(v) { 688 | def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> v.candidate.version.toUpperCase().contains(it) } 689 | def stableVersion = v.candidate.version ==~ /^[0-9,.v-]+(-r)?$/ 690 | return !stableKeyword && !stableVersion 691 | } 692 | 693 | def configureVersions() { 694 | apply plugin: com.github.benmanes.gradle.versions.VersionsPlugin 695 | 696 | task showUpdateableDependencies(type: com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask) { 697 | checkForGradleUpdate = false 698 | dependencyUpdates.gradleReleaseChannel = "current" 699 | rejectVersionIf { isNonStable(it) } 700 | outputFormatter = { result -> 701 | def updatable = getUpdatableDependencies(result.outdated.dependencies) 702 | if (updatable.isEmpty()) { 703 | println """\ 704 | 705 | All dependencies are up-to-date. 706 | """.stripIndent() 707 | } else { 708 | println "\nThere are dependencies that can be updated:\n" 709 | updatable.each { dependency-> 710 | println " ${dependency.prettyPrint}" 711 | } 712 | println """\ 713 | 714 | Update dependencies with: 715 | 716 | ./gradlew updateDependencies 717 | """.stripIndent() 718 | } 719 | } 720 | } 721 | 722 | task updateDependencies(type: com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask) { 723 | checkForGradleUpdate = false 724 | dependencyUpdates.gradleReleaseChannel = "current" 725 | rejectVersionIf { isNonStable(it) } 726 | outputFormatter = { result -> 727 | def updatable = getUpdatableDependencies(result.outdated.dependencies) 728 | if (!updatable.isEmpty()) { 729 | def buildGradleFile = new File("$rootDir/build.gradle") 730 | def buildGradleContent = buildGradleFile.text 731 | println "\nStepping dependencies:\n" 732 | updatable.each { dependency-> 733 | println " ${dependency.prettyPrint}" 734 | [dependency.compactFrom, dependency.verboseFrom].each { from -> 735 | buildGradleContent = java.util.regex.Pattern.compile(from, java.util.regex.Pattern.DOTALL) 736 | .matcher(buildGradleContent) 737 | .replaceAll(dependency.compactTo) 738 | } 739 | } 740 | println "\nWriting ${buildGradleFile}" 741 | buildGradleFile.text = buildGradleContent 742 | } 743 | } 744 | } 745 | 746 | tasks.named("build") { finalizedBy("showUpdateableDependencies") } 747 | } 748 | 749 | def shouldGitIgnore(filename) { 750 | if (!file('.gitignore').text.contains(filename)) { 751 | throw new RuntimeException("The .gitignore should include '${filename}'") 752 | } 753 | logger.lifecycle("${filename} is ignored") 754 | } 755 | 756 | def configureDefault() { 757 | configureChangelog() 758 | configureJava() 759 | configureFormatting() 760 | configureStaticCodeAnalysis() 761 | configureRelease() 762 | configureVersions() 763 | if (effectiveConfig.violations.updateReadme) { 764 | logger.lifecycle("Updating README with reporters") 765 | se.bjurr.violations.lib.util.Utils.updateReadmeWithReporters() 766 | } 767 | } 768 | 769 | def configureCommand() { 770 | configureDefault() 771 | } 772 | 773 | def configureGradle() { 774 | configureDefault() 775 | 776 | apply plugin: com.gradle.publish.PublishPlugin 777 | 778 | dependencies { 779 | implementation gradleApi() 780 | } 781 | 782 | def pluginId = (project.group + '.' + project.name) 783 | .replaceAll("[\"']","") 784 | def displayNameValue = (name.substring(0, 1).toUpperCase() + name.substring(1)) 785 | .replaceAll('-',' ') 786 | .replaceAll("[\"']","") 787 | logger.lifecycle("pluginId ${pluginId} displayName ${displayNameValue}") 788 | gradlePlugin { 789 | website = effectiveConfig.publishing.website 790 | vcsUrl = effectiveConfig.publishing.vcsUrl 791 | description = project.description.replaceAll("[\"']","") 792 | 793 | plugins { 794 | thePlugin { 795 | tags.set(effectiveConfig.gradlePlugin.tags) 796 | description = project.description.replaceAll("[\"']","") 797 | id = pluginId 798 | displayName = displayNameValue 799 | implementationClass = effectiveConfig.gradlePlugin.implementationClass 800 | } 801 | } 802 | } 803 | } 804 | 805 | def mergeMaps(Map defaultMap, Map overrideWith) { 806 | return overrideWith.inject(defaultMap.clone()) { map, entry -> 807 | if (map[entry.key] instanceof Map && entry.value instanceof Map) { 808 | map[entry.key] = mergeMaps(map[entry.key], entry.value) 809 | } else { 810 | map[entry.key] = entry.value 811 | } 812 | return map 813 | } 814 | } 815 | 816 | def pretty(it) { 817 | groovy.json.JsonOutput.prettyPrint(groovy.json.JsonOutput.toJson(it)) 818 | } 819 | 820 | // ---- start of default config ---- 821 | def defaultConfig = [ 822 | /** 823 | * "DEFAULT" - Works for most Java projects. 824 | * "GRADLE" - A Gradle plugin. 825 | * "COMMAND" - Runnable JAR, distributed in Central and NPM. 826 | */ 827 | repoType: "DEFAULT", 828 | sourceCompatibility: 17, 829 | targetCompatibility: 17, 830 | staticCodeAnalysis: [ 831 | /** 832 | * Maximum number of violations to accept from static code analysis. 833 | */ 834 | maxViolations: 9999, 835 | ], 836 | publishing: [ 837 | website: 'https://github.com/tomasbjerre/' + project.name, 838 | vcsUrl: 'https://github.com/tomasbjerre/'+project.name, 839 | licenseName: 'The Apache Software License, Version 2.0', 840 | licenseUrl: 'http://www.apache.org/licenses/LICENSE-2.0.txt', 841 | developerId: 'tomasbjerre', 842 | developerName: 'Tomas Bjerre', 843 | developerEmail: 'tomas.bjerre85@gmail.com', 844 | /** 845 | * If using PasswordCredentials and repository name "nexus", you will 846 | * need to supply username/password properties named "nexusUsername" 847 | * and "nexusPassword". Perhaps in ~/.gradle/gradle.properties 848 | */ 849 | mavenRepositoryName: "nexus", 850 | mavenRepositoryUrl: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/', 851 | /** 852 | * true, if you want the repository in Nexus to be closed and pomoted to Release. 853 | */ 854 | nexusCloseAndRelease: true, 855 | /** 856 | * If using signing you will need to supply signing properties. 857 | * Perhaps in ~/.gradle/gradle.properties 858 | * https://docs.gradle.org/current/userguide/signing_plugin.html 859 | */ 860 | sign: true, 861 | /** 862 | * If not empty: creates a fat jar with relocated packages. 863 | * Example: [ "com.google", "a.b:se.bjurr.a.b" ] 864 | * Will make up a relocation target for "com.google" and will use "se.bjurr.a.b" as target for "a.b". 865 | */ 866 | relocate: [], 867 | ], 868 | gradlePlugin: [ 869 | tags: [] 870 | ], 871 | changelog: [ 872 | enabled: true, 873 | githubTokenEnvVariableName: 'GITHUB_OAUTH2TOKEN', 874 | githubOrganization: 'tomasbjerre', 875 | jiraIssuePattern: "\\bJENKINS-([0-9]+)\\b", 876 | ignoreCommitsIfMessageMatches: "^\\[maven-release-plugin\\].*|^\\[Gradle Release Plugin\\].*|^Merge.*|.*\\[GRADLE SCRIPT\\].*" 877 | ], 878 | violations: [ 879 | /** 880 | * Update README.md with table of parsers and reporters. 881 | */ 882 | updateReadme: false 883 | ], 884 | manifest: [ 885 | mainClass: '' 886 | ], 887 | /** 888 | * Will be configured if they exist. 889 | */ 890 | generatedSourceFolders: [ 891 | "src/gen/java", 892 | "src/generated/java" 893 | ], 894 | formattingExcludedPatterns: [ 895 | "**/gen/**", 896 | "**/generated/**" 897 | ], 898 | /** 899 | * Will be configured if they exist. 900 | */ 901 | extraTestSourceFolders: [ 902 | "src/test/generated" 903 | ], 904 | /** 905 | * Used as "from" in jar if it exists. Can be used to do annotation processing. 906 | */ 907 | jarResourcesFolder: 'src/jar/resources' 908 | ] 909 | // ---- end of default config ---- 910 | 911 | logger.lifecycle("----------- tomasbjerre/gradle-scripts ----------------") 912 | logger.lifecycle("Default config:\n\n" + pretty(defaultConfig) + "\n") 913 | def buildConfig = project.hasProperty('buildConfig') ? buildConfig : [:] 914 | logger.lifecycle("Given config:\n\n" + pretty(buildConfig) + "\n") 915 | ext.effectiveConfig = mergeMaps(defaultConfig, buildConfig) 916 | logger.lifecycle("Effective config:\n\n" + pretty(effectiveConfig) + "\n") 917 | logger.lifecycle("-------------------------------------------------------") 918 | 919 | buildscript { 920 | repositories { 921 | maven { url "https://plugins.gradle.org/m2/" } 922 | mavenCentral() 923 | mavenLocal() 924 | } 925 | dependencies { 926 | classpath 'se.bjurr.violations:violations-lib:+' 927 | classpath 'com.google.guava:guava:16.0.1' 928 | classpath "gradle.plugin.se.bjurr.gitchangelog:git-changelog-gradle-plugin:+" 929 | classpath 'se.bjurr.gitchangelog:git-changelog-lib:1.+' 930 | classpath "com.gradle.publish:plugin-publish-plugin:1.2.1" 931 | classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.25.0' 932 | classpath 'se.bjurr.violations:violations-gradle-plugin:1.+' 933 | classpath 'gradle.plugin.com.github.ksoichiro:gradle-build-info-plugin:0.+' 934 | classpath "com.github.spotbugs.snom:spotbugs-gradle-plugin:6.0.7" 935 | classpath 'com.github.johnrengelman:shadow:8.1.1' 936 | classpath 'com.github.ben-manes:gradle-versions-plugin:0.42.0' 937 | } 938 | } 939 | 940 | if (effectiveConfig.repoType == "COMMAND") { 941 | configureCommand() 942 | } else if (effectiveConfig.repoType == "GRADLE") { 943 | configureGradle() 944 | } else if (effectiveConfig.repoType == "DEFAULT") { 945 | configureDefault() 946 | } else { 947 | throw new RuntimeException('No such repoType: ' + effectiveConfig.repoType) 948 | } 949 | -------------------------------------------------------------------------------- /src/main/resources/npm-java-runner-index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require('npm-java-runner/lib/index').run(__dirname); 3 | -------------------------------------------------------------------------------- /src/main/resources/npm-java-runner-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "PKG_VERSION", 3 | "name": "PKG_NAME", 4 | "homepage": "PKG_WEBSITE", 5 | "repository": "PKG_GIT", 6 | "author": "PKG_AUTHOR", 7 | "description": "PKG_DESCRIPTION", 8 | "runnable-jar-regexp": ".*build/libs/.*\\d+\\.\\d+\\.\\d+\\.jar$", 9 | "files": [ 10 | "build/libs" 11 | ], 12 | "bin": "./index.js", 13 | "license": "Apache 2", 14 | "dependencies": { 15 | "npm-java-runner": "0.0.17" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/resources/pmd.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | Nada 10 | 11 | 12 | .*/(generated-source|generated|test)/.* 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /src/main/resources/spotbugs-exclude.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | --------------------------------------------------------------------------------