1- plugins {
2- id ' java-library'
3- id ' maven-publish'
4- id ' signing'
5- id " com.diffplug.gradle.spotless" version " 4.3.0"
1+ buildscript {
2+ repositories {
3+ maven { url " https://plugins.gradle.org/m2/" }
4+ jcenter()
5+ }
6+ dependencies {
7+ classpath " com.diffplug.spotless:spotless-plugin-gradle:3.27.1"
8+ }
69}
710
8- group = ' com.formkiq'
9- version = ' 1.1'
10-
11- sourceCompatibility = JavaVersion . VERSION_1_8
12- targetCompatibility = JavaVersion . VERSION_1_8
13-
14- repositories {
15- jcenter()
11+ plugins {
12+ id " com.github.spotbugs" version " 4.5.0"
1613}
1714
18- dependencies {
19- implementation group : ' com.amazonaws' , name : ' aws-lambda-java-core' , version : ' 1.2.0'
20- implementation group : ' com.google.code.gson' , name : ' gson' , version : ' 2.8.6'
21- testImplementation group : ' junit' , name : ' junit' , version :' 4.+'
22- }
15+ allprojects {
2316
24- java {
25- withJavadocJar()
26- withSourcesJar()
27- }
17+ apply plugin : ' java-library'
18+ apply plugin : ' maven-publish'
19+ apply plugin : ' checkstyle'
20+ apply plugin : ' signing'
21+ apply plugin : ' com.diffplug.gradle.spotless'
2822
29- spotless {
30- java {
31- googleJavaFormat()
32- }
33- }
23+ sourceCompatibility = JavaVersion . VERSION_11
24+ targetCompatibility = JavaVersion . VERSION_11
3425
35- publishing {
36- publications {
37- mavenJava(MavenPublication ) {
38- artifactId = ' lambda-runtime-graalvm'
39- from components. java
40-
41- pom {
42- name = ' FormKiQ Lambda Runtime Graalvm'
43- description = ' Lambda Runtime Graalvm'
44- url = ' https://github.com/formkiq/lambda-runtime-graalvm'
45- licenses {
46- license {
47- name = ' The Apache License, Version 2.0'
48- url = ' http://www.apache.org/licenses/LICENSE-2.0.txt'
49- }
50- }
51- developers {
52- developer {
53- id = ' mfriesen'
54- name = ' Mike Friesen'
55- email = ' mike@formkiq.com'
56- }
57- }
58- scm {
59- connection = ' scm:git:git://github.com/formkiq/lambda-runtime-graalvm.git'
60- developerConnection = ' scm:git:ssh://github.com/formkiq/lambda-runtime-graalvm.git'
61- url = ' https://github.com/formkiq/lambda-runtime-graalvm.git'
62- }
63- }
26+ group ' com.formkiq'
27+ version ' 2.0'
28+
29+ spotless {
30+ java {
31+ googleJavaFormat()
32+ }
33+ }
34+
35+ spotbugsMain {
36+ reports {
37+ html {
38+ enabled = true
39+ destination = file(" $buildDir /reports/spotbugs/main/spotbugs.html" )
40+ stylesheet = ' fancy-hist.xsl'
41+ }
42+ }
43+ }
44+
45+ checkstyle {
46+ toolVersion ' 8.29'
47+ configFile file(" config/checkstyle/checkstyle.xml" )
48+ configProperties = [project_loc : " ${ projectDir} " ]
49+ }
50+
51+ tasks. withType(Checkstyle ). each { checkstyleTask ->
52+ checkstyleTask. doLast {
53+ reports. all { report ->
54+ def outputFile = report. destination
55+ if (outputFile. exists() && outputFile. text. contains(" <error " )) {
56+ throw new GradleException (" There were checkstyle warnings! For more info check $outputFile " )
57+ }
58+ }
6459 }
6560 }
61+
6662 repositories {
67- maven {
68- credentials {
69- username project. repoUser
70- password project. repoPassword
71- }
72- url " https://oss.sonatype.org/service/local/staging/deploy/maven2/"
73- }
63+ jcenter()
64+ }
65+
66+ java {
67+ withJavadocJar()
68+ withSourcesJar()
69+ }
70+
71+ javadoc {
72+ if (JavaVersion . current(). isJava9Compatible()) {
73+ options. addBooleanOption(' html5' , true )
74+ }
7475 }
75- }
76-
77- javadoc {
78- if (JavaVersion . current(). isJava9Compatible()) {
79- options. addBooleanOption(' html5' , true )
80- }
81- }
82-
83- artifacts {
84- archives jar
8576
86- archives javadocJar
87- archives sourcesJar
88- }
89-
90- signing {
91- sign publishing . publications . mavenJava
92- }
77+ artifacts {
78+ archives jar
79+
80+ archives javadocJar
81+ archives sourcesJar
82+ }
83+ }
0 commit comments