Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename gradle task java11doc to task java17doc (and add to CI) #8

Merged
merged 4 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/main.yml
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not work in a CI build, because JavaDoc is generated into a sibling project. Actually, automatic publishing of the JavaDoc works differently in all my projects. I've never seen the point in porting it to this one (too few changes). But I might do it anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intention was not to finally publish the JavaDoc/global homepage/..., but provide checks that the task works.

Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ jobs:
run: ./gradlew build
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Build documentation
run: ./gradlew :plantUml9:docs
- name: Prepare generated JavaDoc for artifact upload
run: mv ../jdrupes-taglets.gh-pages .
- uses: actions/upload-artifact@v3
with:
name: docs
path: jdrupes-taglets.gh-pages/plantuml-taglet/javadoc/
46 changes: 23 additions & 23 deletions plantUml9/build.gradle
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't rename the task. The "big change" was from Java 8 to Java 11 (including the new layout). While java11doc is certainly not the best of names (and plain "javadoc" is taken by gradle), changing this with every LTS version is not helpful.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mdoclet requires Java 17, therefore this taglet must be Java 17 at least. To avoid confusion, I also changed 11 to 17 in the task.

I can undo that but comment to the task that 11 is not supported, but the name is kept for reasons mentioned in this PR.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm aware of the problem with using "java11doc". It is confusing. But so would "java17doc" be in a few years.

I was hesitant about "javadocNG" when I initially wrote this ("NG" already being out of fashion), but maybe you have a good idea for a task name without version.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since overview.md is also generated, I opted for the very short "docs".

Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ description = 'A taglet for processing PlantUML in javadoc comments'
archivesBaseName = "plantuml-taglet"

configurations {
mdoclet
mdoclet
}

dependencies {
implementation group:'net.sourceforge.plantuml', name:'plantuml', version:'1.2023.8'
implementation group:'net.sourceforge.plantuml', name:'plantuml', version:'1.2023.8'

// Add this to compile as well for debugging
implementation 'org.jdrupes.mdoclet:doclet:3.0.0'
// mdoclet 'com.github.mnlipp.jdrupes-mdoclet:doclet:master-SNAPSHOT'
// Add this to compile as well for debugging
implementation 'org.jdrupes.mdoclet:doclet:3.0.0'
// mdoclet 'com.github.mnlipp.jdrupes-mdoclet:doclet:master-SNAPSHOT'
}

// Configure sensible layout
Expand All @@ -47,9 +47,9 @@ sourceSets {
java {
srcDir 'src'
}
resources {
srcDir 'resources'
}
resources {
srcDir 'resources'
}
}
}

Expand Down Expand Up @@ -85,7 +85,7 @@ dependencies {
markdownDoclet "org.jdrupes.mdoclet:doclet:3.0.0"
}

task java11doc(type: JavaExec) {
task docs(type: JavaExec) {
dependsOn classes
inputs.file "overview.md"

Expand All @@ -100,7 +100,7 @@ task java11doc(type: JavaExec) {
args = ['-doctitle', 'PlantUML Taglet',
'-use',
'-linksource',
'-link', 'https://docs.oracle.com/en/java/javase/11/docs/api/',
'-link', 'https://docs.oracle.com/en/java/javase/17/docs/api/',
'--add-exports', 'jdk.javadoc/jdk.javadoc.internal.tool=ALL-UNNAMED',
'--add-exports', 'jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED',
'-doclet', 'org.jdrupes.mdoclet.MDoclet',
Expand All @@ -124,32 +124,32 @@ task java11doc(type: JavaExec) {
}

task fatJar(type:Jar) {
from {
configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) }
}
with jar
classifier "all"
from {
configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) }
}
with jar
classifier "all"
}

task sourcesJar(type: Jar) {
from sourceSets.main.allJava
classifier "sources"
from sourceSets.main.allJava
classifier "sources"
}

task javadocJar(type: Jar) {
from java11doc.destinationDir
classifier "javadoc"
from docs.destinationDir
classifier "javadoc"
}

// Allow build without signing information (e.g. travis)
if (project.hasProperty('signing.keyId')) {
signing {
sign configurations.archives
}
signing {
sign configurations.archives
}
}

publishing {
repositories {
maven {
name "snapshot"
Expand Down
Loading