Skip to content

Commit

Permalink
Gradle plugin 8.5.1
Browse files Browse the repository at this point in the history
Gradle wrapper 8.7-bin.
Refactor gradle build files.
Improve javadoc for maven artifact.
  • Loading branch information
pranavpandey committed Jul 19, 2024
1 parent e6669a6 commit 754fada
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 23 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2018-2022 Pranav Pandey
Copyright 2018-2024 Pranav Pandey

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Pranav Pandey

## License

Copyright 2018-2023 Pranav Pandey
Copyright 2018-2024 Pranav Pandey

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018-2023 Pranav Pandey
* Copyright 2018-2024 Pranav Pandey
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,7 +32,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:8.0.2'
classpath 'com.android.tools.build:gradle:8.5.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
}
}
Expand All @@ -48,8 +48,8 @@ allprojects {
}
}

task clean(type: Delete) {
delete rootProject.buildDir
tasks.register('clean', Delete) {
delete rootProject.layout.buildDirectory
}

ext {
Expand Down
6 changes: 4 additions & 2 deletions dynamic-motion/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018-2023 Pranav Pandey
* Copyright 2018-2024 Pranav Pandey
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -62,7 +62,9 @@ project.afterEvaluate {
destinationDir = new File(destinationDir, variant.baseName)

source = variant.sourceSets.collect {
it.java.sourceFiles }.inject { m, i -> m + i
it.java.sourceFiles
}.inject {
m, i -> m + i
}
doFirst {
classpath = project.files(variant.javaCompileProvider.get().classpath.files,
Expand Down
48 changes: 34 additions & 14 deletions dynamic-motion/maven.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018-2023 Pranav Pandey
* Copyright 2018-2024 Pranav Pandey
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,28 +22,45 @@ version = mavenVersion

// Android libraries
if (project.hasProperty("android")) {
task sourcesJar(type: Jar) {
tasks.register('sourcesJar', Jar) {
archiveClassifier.set("sources")
from android.sourceSets.main.java.srcDirs
}

task javadoc(type: Javadoc) {
dependsOn("generateReleaseRFile")
tasks.register('javadoc', Javadoc) {
dependsOn "generateReleaseRFile"
title "${referenceTitle}<h4>${versionDesc}</h4><h5>${mavenVersion}</h5>"
failOnError = false

source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
source = android.sourceSets.main.java.sourceFiles
doNotTrackState("Javadoc needs to be generated every time.")

failOnError = false
if (JavaVersion.current().isJava8Compatible()) {
options.addStringOption('Xdoclint:none', '-quiet')
}

options.memberLevel = JavadocMemberLevel.PROTECTED
exclude "**/R", "**/R.**", "**/R\$**", "**/BuildConfig*"

options.windowTitle = "${referenceTitle}"
options.links('http://docs.oracle.com/javase/8/docs/api',
'http://docs.oracle.com/javase/17/docs/api')
options.links('https://developer.android.com/reference')
options.linksOffline('https://developer.android.com/reference',
'https://developer.android.com/reference/androidx')
}
} else { // Java libraries
task sourcesJar(type: Jar, dependsOn: classes) {
tasks.register('sourcesJar', Jar) {
dependsOn classes

archiveClassifier.set("sources")
from sourceSets.main.allSource
}
}

task javadocJar(type: Jar, dependsOn: javadoc) {
tasks.register('javadocJar', Jar) {
dependsOn javadoc

archiveClassifier.set("javadoc")
from javadoc.destinationDir
}
Expand Down Expand Up @@ -86,7 +103,7 @@ publishing {

// SCM
def scm = asNode().appendNode('scm')
scm.appendNode('connection', "${gitUrl}.git")
scm.appendNode('connection', "scm:git:${gitUrl}.git")
scm.appendNode('developerConnection', gitUrl)
scm.appendNode('url', siteUrl)

Expand All @@ -96,7 +113,7 @@ publishing {
dependenciesNode = asNode().appendNode('dependencies')
}

// Add all that are 'compile'
// Add all that are 'compile' dependencies.
configurations.api.allDependencies.each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
Expand All @@ -117,13 +134,16 @@ signing {
}

afterEvaluate { project ->
// Fix javadoc generation
// Fix javadoc generation.
javadoc.classpath += files(android.libraryVariants.collect { variant ->
variant.javaCompileProvider.get().classpath.files
})

def pomTask = "generatePomFileForLibraryPublication"
def dependencies = [javadocJar, sourcesJar, assembleRelease, pomTask]

// Convenience task to prepare everything we need for releases
task prepareArtifacts(dependsOn: [javadocJar, sourcesJar, assembleRelease, pomTask]) { }
// Convenience task to prepare everything we need for releases.
tasks.register('prepareArtifacts') {
dependsOn dependencies
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip

0 comments on commit 754fada

Please sign in to comment.