1- /*
2- * This file was generated by the Gradle 'init' task.
3- *
4- * This generated file contains a sample Java Library project to get you started.
5- * For more details take a look at the Java Libraries chapter in the Gradle
6- * User Manual available at https://docs.gradle.org/6.6/userguide/java_library_plugin.html
7- */
8-
91plugins {
102 // Apply the java-library plugin to add support for Java Library
113 id ' java-library'
@@ -20,12 +12,15 @@ plugins {
2012
2113java {
2214 modularity. inferModulePath = true
15+ withSourcesJar()
16+ withJavadocJar()
2317}
2418
2519test {
2620 useJUnitPlatform()
2721 finalizedBy jacocoTestReport // report is always generated after tests run
2822}
23+
2924jacocoTestReport {
3025 dependsOn test // tests are required to run before generating the report
3126}
@@ -39,7 +34,7 @@ spotbugsMain {
3934 reports {
4035 html {
4136 required
42- destination = file(" $buildDir /reports/spotbugs/main/spotbugs.html" )
37+ outputLocation = file(" $buildDir /reports/spotbugs/main/spotbugs.html" )
4338 stylesheet = ' fancy-hist.xsl'
4439 }
4540 }
@@ -50,7 +45,7 @@ spotbugsTest {
5045 reports {
5146 html {
5247 required
53- destination = file(" $buildDir /reports/spotbugs/test/spotbugs.html" )
48+ outputLocation = file(" $buildDir /reports/spotbugs/test/spotbugs.html" )
5449 stylesheet = ' fancy-hist.xsl'
5550 }
5651 }
@@ -107,16 +102,6 @@ tasks.jar {
107102 }
108103}
109104
110- task sourceJar (type : Jar ) {
111- from sourceSets. main. allJava
112- archiveClassifier = ' sources'
113- }
114-
115- task javadocJar (type : Jar , dependsOn : javadoc) {
116- from javadoc. destinationDir
117- archiveClassifier = ' javadoc'
118- }
119-
120105publishing {
121106
122107 publications {
@@ -126,8 +111,6 @@ publishing {
126111 artifactId project. property(' mavenArtifactId' )
127112 version " ${ mavenMajorVersion} .${ mavenMinorVersion} .${ mavenPatchVersion}${ mavenArtifactSuffix} "
128113 from components. java
129- artifact sourceJar
130- artifact javadocJar
131114 pom. withXml {
132115 def root = asNode()
133116 root. appendNode(' name' , ' Microsoft Graph Core SDK for Java' )
@@ -148,8 +131,6 @@ publishing {
148131 def pomFile = file(" ${ project.buildDir} /generated-pom.xml" )
149132 writeTo(pomFile)
150133 }
151- artifact sourceJar
152- artifact javadocJar
153134 }
154135
155136 mavenCentralRelease(MavenPublication ) {
@@ -162,8 +143,6 @@ publishing {
162143 def pomFile = file(" ${ project.buildDir} /generated-pom.xml" )
163144 writeTo(pomFile)
164145 }
165- artifact sourceJar
166- artifact javadocJar
167146 }
168147 }
169148 repositories {
@@ -211,8 +190,9 @@ def fixAscNames = { name ->
211190}
212191
213192compileJava {
214- sourceCompatibility = 1.8
215- targetCompatibility = 1.8
193+ options. compilerArgs << " -parameters"
194+ sourceCompatibility = ' 1.8'
195+ targetCompatibility = ' 1.8'
216196}
217197
218198def getVersionCode () {
@@ -225,8 +205,6 @@ def getVersionName() {
225205
226206artifacts {
227207 archives jar
228- archives sourceJar
229- archives javadocJar
230208}
231209
232210def customizePom (pom ) {
0 commit comments