Open wsargent opened 5 years ago
This project relies on itself to provide all the features it needs. Please take a look at https://github.com/aalmiray/kordamp-gradle-plugins/blob/master/build.gradle
Related to project properties, you may want to have a look at http://andresalmiray.com/newsletter/issue001/
The gradle project is configured for a gradle plugin though, not a library. I'm looking for an actual example, like the kind you see in https://github.com/playframework/play-java-hello-world-tutorial for example.
I've created a pull request so you can see my progress -- I'll be working on this through the weekend:
Understood. The build I pointed to can still be used as a basis, you only have to apply the org.kordamp.gradle.project
plugin and use the config
block. However in the future the guide will include a section on small examples 😄
@wsargent just sent you a PR with updates to the PR you linked above. Hope this helps
Thanks! This helps a lot. I added bintray publishing and got it pushed to bintray successfuly -- now I'm currently working through how to increment the version number, and incorporating signing with the Yubikey.
I have signing and publishing working with Travis working now, and I'm on to getting javadoc and an asciidoctor site working: https://github.com/tersesystems/terse-logback/pull/15
Not quite sure how to aggregate javadoc but this is good for now.
@wsargent you can call the aggregateJavadocs
task from the root project. This task is added by the apidocs
plugin which is configured by default when applying the project
plugin. Please refer to https://aalmiray.github.io/kordamp-gradle-plugins/#_org_kordamp_gradle_apidoc
Is there an easy way to get at the project's list of library dependencies? I want to auto-add them based off their resolver if possible:
On Thu, Mar 7, 2019 at 3:54 AM Andres Almiray notifications@github.com wrote:
@wsargent https://github.com/wsargent you can call the aggregateJavadocs task from the root project. This task is added by the apidocs plugin which is configured by default when applying the project plugin. Please refer to https://aalmiray.github.io/kordamp-gradle-plugins/#_org_kordamp_gradle_apidoc
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aalmiray/kordamp-gradle-plugins/issues/77#issuecomment-470497975, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEWRDHyguJUaTLtPbHRyJzJHWW0dcs0ks5vUP4TgaJpZM4bacrw .
You can query dependencies with configurations, for example project.configurations.runtime.each { dep -> }
.
I have automatic external javadoc working with a basic OOTB gradle project:
https://gist.github.com/wsargent/33126a35d7a02ab9a265af1ad996e7b3
But when I try it with 'subproj' in the kordamp style, the dependencies are always an empty list. Is there something different between the kordamp javadoc plugin and the out of the box gradle one?
I'm afraid I don't follow, do you mean this doesn't work for you?
subprojects {
config {
javadoc {
options {
links([jvmToJavadoc(project.targetCompatibility)] + javadocFromDependencies(project.configurations.compile))
}
}
}
}
I'm afraid I don't follow, do you mean this doesn't work for you?
Yeah, it always prints out [].
If I define the javadoc in the subproject, i.e. https://github.com/tersesystems/terse-logback/pull/31/files#diff-6f798219f69a7b5170beb582c0b11272R13
dependencies {
compile "org.slf4j:slf4j-api:$slf4jVersion"
compile "net.bytebuddy:byte-buddy:$bytebuddyVersion"
compile "net.bytebuddy:byte-buddy-agent:$bytebuddyVersion"
compile 'net.logstash.logback:logstash-logback-encoder:5.2'
}
javadoc {
options.charSet = 'UTF-8'
options.encoding = 'UTF-8'
options.docEncoding = 'UTF-8'
options.use = true
options.links = [jvmToJavadoc(targetCompatibility)] + javadocFromDependencies(configurations.compile)
}
Then I can see the dependencies do get printed out in the println:
> Configure project :logback-bytebuddy
javadocs = [https://oss.sonatype.org/service/local/repositories/releases/archive/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25-javadoc.jar/!/, https://oss.sonatype.org/service/local/repositories/releases/archive/net/bytebuddy/byte-buddy/1.9.9/byte-buddy-1.9.9-javadoc.jar/!/, https://oss.sonatype.org/service/local/repositories/releases/archive/net/bytebuddy/byte-buddy-agent/1.9.9/byte-buddy-agent-1.9.9-javadoc.jar/!/, https://oss.sonatype.org/service/local/repositories/releases/archive/net/logstash/logback/logstash-logback-encoder/5.2/logstash-logback-encoder-5.2-javadoc.jar/!/]
but they don't show up in the build/tmp/javadoc options:
-Xdoclint:none '-quiet'
-author
-charset 'UTF-8'
-classpath '/home/wsargent/work/terse-logback/logback-bytebuddy/build/classes/java/main:/home/wsargent/work/terse-logback/logback-bytebuddy/build/resources/main:/home/wsargent/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.25/da76ca59f6a57ee3102f8f9bd9cee742973efa8a/slf4j-api-1.7.25.jar:/home/wsargent/.gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy/1.9.9/9c9a52d3837585460153ff502e0835347b7b191f/byte-buddy-1.9.9.jar:/home/wsargent/.gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy-agent/1.9.9/dc04dfea5e21931640b86c6ff29bd13cec5d773e/byte-buddy-agent-1.9.9.jar:/home/wsargent/.gradle/caches/modules-2/files-2.1/net.logstash.logback/logstash-logback-encoder/5.2/52c79b374e57ff09a9a366323f9946de811afe1e/logstash-logback-encoder-5.2.jar:/home/wsargent/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.9.6/cfa4f316351a91bfd95cb0644c6a2c95f52db1fc/jackson-databind-2.9.6.jar:/home/wsargent/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.9.0/7c10d545325e3a6e72e06381afe469fd40eb701/jackson-annotations-2.9.0.jar:/home/wsargent/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.9.6/4e393793c37c77e042ccc7be5a914ae39251b365/jackson-core-2.9.6.jar'
-d '/home/wsargent/work/terse-logback/logback-bytebuddy/build/docs/javadoc'
-docencoding 'UTF-8'
-doctitle 'logback-bytebuddy 0.0.0'
-encoding 'UTF-8'
-footer 'Copyright © 2018-2019 Will Sargent. All rights reserved.'
-header 'logback-bytebuddy 0.0.0'
-link 'https://docs.oracle.com/javase/8/docs/api/'
-quiet
-splitindex
-use
-version
-windowtitle 'logback-bytebuddy 0.0.0'
'/home/wsargent/work/terse-logback/logback-bytebuddy/src/main/java/com/tersesystems/logback/bytebuddy/ClassAdviceRewriter.java'
'/home/wsargent/work/terse-logback/logback-bytebuddy/src/main/java/com/tersesystems/logback/bytebuddy/ThreadLocalLogger.java'
'/home/wsargent/work/terse-logback/logback-bytebuddy/src/main/java/com/tersesystems/logback/bytebuddy/InfoLoggingInterceptor.java'
I tried setting up the intellij idea debug option, and it appears like it's running in the "configure" task, but I don't get why the link is an "http" to java 8 docs since that's not the default.
I fixed it! I needed to have the following in my subprojects, so the javadoc section was under the config section:
dependencies {
compile "org.slf4j:slf4j-api:$slf4jVersion"
compile "net.bytebuddy:byte-buddy:$bytebuddyVersion"
compile "net.bytebuddy:byte-buddy-agent:$bytebuddyVersion"
compile 'net.logstash.logback:logstash-logback-encoder:5.2'
}
config {
javadoc {
options.charSet = 'UTF-8'
options.encoding = 'UTF-8'
options.docEncoding = 'UTF-8'
options.use = true
options.links = [jvmToJavadoc(targetCompatibility)] + javadocFromDependencies(configurations.compile)
}
}
@wsargent Great! do you find the URL https://oss.sonatype.org/service/local/repositories/releases/archive
to work consistently? I get warnings when generating javadocs for some of the dependencies you linked in your example. I'm thinking in adding this feature to the Kordamp plugin suite, thus reducing the amount of extra configuration needed. WDYT?
Not all of the javadocs use that URL, but most of the ones that you can resolve with maven will.
Some of the exceptions are listed here from the Play Docs.scala task:
https://github.com/playframework/playframework/blob/master/project/Docs.scala#L215
and there's also useful tips scattered throughout, like using an user-agent with external docs:
https://github.com/playframework/playframework/blob/master/project/Docs.scala#L179
I'm thinking in adding this feature to the Kordamp plugin suite, thus reducing the amount of extra configuration needed.
Sounds good, I have to admit I've winged a bunch of this.
@wsargent FWIW #103 and #104 will help you in the future
@aalmiray Is there a way to make the build compilable even if the bintray settings aren't there?
Right now if I don't have bintray settings ~/.gradle/gradle.properties
bintrayUsername=tersesystems
# https://bintray.com/profile/edit (API key is at the bottom)
bintrayApiKey=[CENSORED]
Then it won't compile anything because the settings are missing. How do I make them optional?
You can either supply dummy values or disable the bintray plugin
config {
bintray { enabled = false }
}
I have set up an example java project with 2 submodules and a guide module to use as a template for new projects. It's not complete - I want to add more reporting setup and more to the guide so its easy to run with.
https://github.com/prule/kordamp-template-project
If I've done anything wrong, I'd love feedback (I had issues with gradle 7 so I've left it at gradle 6.9 at the moment)
@prule Gradle 7 is not yet fully supported, some things might still break. This project uses itself for its build, and so do many of the projects in the https://github.com/kordamp and https://github.com/jreleaser organizations.
Is there an example project of kordamp plugins in Github anywhere? I'm using the "joecool" setup from https://aalmiray.github.io/kordamp-gradle-plugins/#_project_structure but I don't know where to put my
bintrayUsername
andbintrayApiKey
settings.I am completely new to Gradle, so I don't know all that much about settings -- is this relevant? http://andresalmiray.com/gaining-insight-into-a-gradle-build/