Skip to content

Commit

Permalink
Merge pull request #19 from mnlipp/wip/copy-and-adapt
Browse files Browse the repository at this point in the history
Adapt to Java-21
  • Loading branch information
mnlipp committed Sep 25, 2023
2 parents 85011ec + 39ae2a1 commit 299a89c
Show file tree
Hide file tree
Showing 280 changed files with 86,534 additions and 124 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
build:
strategy:
matrix:
java-version: [ '17' ]
java-version: [ '21' ]
runs-on: ubuntu-latest

steps:
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ from markdown to HTML.
See the [javadoc overview](https://mnlipp.github.io/jdrupes-mdoclet/javadoc/)
for details.

* Version 4.0.0 supports/requires JDK 21.

* Version 3.0.0 supports/requires JDK 17.

* Version 2.2.0 avoids a warning when using @see tags with quoted strings.
Expand Down
36 changes: 6 additions & 30 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,46 +17,22 @@
*/

plugins {
id "com.gradle.plugin-publish" version "0.20.0"
id "com.gradle.plugin-publish" version "0.20.0"
id 'org.ajoberstar.grgit' version '4.1.0'
}

apply plugin: 'mdoclet.java-library-conventions'

allprojects {

group = 'org.jdrupes.mdoclet'
version = '4.0.0-SNAPSHOT'
version = '4.0.0-SNAPSHOT'

description = 'A doclet for processing javadoc comments written with Markup'
description = 'A doclet for processing javadoc comments written with Markup'

// Makes Eclipse-groovy handle *.gradle file properly
// Makes Eclipse-groovy handle *.gradle file properly
apply plugin:'groovy'

// (Known thanks to applying groovy plugin)
archivesBaseName = project.name
}

subprojects {

apply from: "${project.rootDir}/gradle/eclipse.gradle"

repositories {
mavenCentral()
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}

ext {
libs = [
markdown: [group: 'com.vladsch.flexmark', name: 'flexmark-all', version: '0.64.0']
]
docletProject = project(':mdoclet')
}

}

apply plugin: 'eclipse'
tasks.eclipse.dependsOn(cleanEclipse)
12 changes: 10 additions & 2 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
plugins {
// Support convention plugins written in Groovy. Convention plugins
// are build scripts in 'src/main' that automatically become available
// as plugins in the main build.
id 'groovy-gradle-plugin'

// Apply eclipse plugin
id 'eclipse'
}

dependencies {
implementation gradleApi()
implementation localGroovy()
Expand All @@ -24,8 +34,6 @@ sourceSets {
}
}

apply plugin: 'eclipse'

eclipse {
project {
buildCommand 'bndtools.core.bndbuilder'
Expand Down
13 changes: 13 additions & 0 deletions buildSrc/src/mdoclet.java-application-conventions.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This project uses @Incubating APIs which are subject to change.
*/

plugins {
// Apply the common convention plugin for shared build configuration between library and application projects.
id 'mdoclet.java-common-conventions'

// Apply the application plugin to add support for building a CLI application in Java.
id 'application'
}
104 changes: 104 additions & 0 deletions buildSrc/src/mdoclet.java-common-conventions.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This project uses @Incubating APIs which are subject to change.
*/

plugins {
// Apply the java Plugin to add support for Java.
id 'java'

// Apply eclipse plugin
id 'eclipse'
}

repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
mavenLocal()
}

dependencies {
constraints {
// Define dependency versions as constraints
// implementation 'org.apache.commons:commons-text:1.9'
}
}

// Configure sensible layout
sourceSets {
main {
java {
srcDirs = ['src']
}
resources {
srcDirs = ['resources']
}
}

test {
java {
srcDirs = ['test']
}
resources {
srcDirs = ['test-resources']
}
}
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}

eclipse {

project {
file {
// closure executed after .project content is loaded from existing file
// and before gradle build information is merged
beforeMerged { project ->
project.natures.clear()
project.buildCommands.clear()
}

project.natures += 'org.eclipse.buildship.core.gradleprojectnature'
project.buildCommand 'org.eclipse.buildship.core.gradleprojectbuilder'

if (plugins.hasPlugin('java')) {
project.buildCommand 'org.eclipse.jdt.core.javabuilder'
// project.natures += 'net.sf.eclipsecs.core.CheckstyleNature'
// project.buildCommand 'net.sf.eclipsecs.core.CheckstyleBuilder'
// project.natures += 'ch.acanda.eclipse.pmd.builder.PMDNature'
// project.buildCommand 'ch.acanda.eclipse.pmd.builder.PMDBuilder'
}
}
}

classpath {
downloadJavadoc = true
downloadSources = true
}

jdt {
file {
withProperties { properties ->
def formatterPrefs = new Properties()
rootProject.file("gradle/org.eclipse.jdt.core.formatter.prefs")
.withInputStream { formatterPrefs.load(it) }
properties.putAll(formatterPrefs)
}
}
}
}

testing {
suites {
// Configure the built-in test suite
test {
// Use JUnit Jupiter test framework
useJUnitJupiter('5.9.1')
}
}
}
13 changes: 13 additions & 0 deletions buildSrc/src/mdoclet.java-library-conventions.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This project uses @Incubating APIs which are subject to change.
*/

plugins {
// Apply the common convention plugin for shared build configuration between library and application projects.
id 'mdoclet.java-common-conventions'

// Apply the java-library plugin for API and implementation separation.
id 'java-library'
}
19 changes: 0 additions & 19 deletions gradle/eclipse.gradle

This file was deleted.

20 changes: 0 additions & 20 deletions mdoclet/MDoclet-Test (Java 17).launch

This file was deleted.

12 changes: 6 additions & 6 deletions mdoclet/MDoclet-Test (Java 21).launch
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<booleanAttribute key="org.eclipse.debug.core.ATTR_FORCE_SYSTEM_CONSOLE_ENCODING" value="false"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/mdoclet"/>
<listEntry value="/mdoclet/src/org/jdrupes/mdoclet/internal/tool/Main.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
<listEntry value="1"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE" value="false"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_SHOW_CODEDETAILS_IN_EXCEPTION_MESSAGES" value="true"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-20/"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="jdk.javadoc.internal.tool.Main"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21/"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.jdrupes.mdoclet.internal.tool.Main"/>
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="mdoclet"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="--add-exports=jdk.javadoc/jdk.javadoc.internal.tool=ALL-UNNAMED&#10;--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED&#10;-doclet org.jdrupes.mdoclet.MDoclet --disable-auto-highlight -Xdoclint:-html&#10;-overview testfiles/overview.md -d build/testfiles testfiles/test/Test.java testfiles/test/MDocletExample.java"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="--add-exports=jdk.javadoc/org.jdrupes.mdoclet.internal.tool=ALL-UNNAMED&#10;--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED&#10;-doclet org.jdrupes.mdoclet.MDoclet --disable-auto-highlight -Xdoclint:-html&#10;-overview testfiles/overview.md -d build/testfiles testfiles/test/Test.java testfiles/test/MDocletExample.java"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="mdoclet"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="--add-exports=jdk.javadoc/jdk.javadoc.internal.tool=ALL-UNNAMED&#10;--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="--add-exports=jdk.javadoc/org.jdrupes.mdoclet.internal.tool=ALL-UNNAMED&#10;--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED"/>
</launchConfiguration>

0 comments on commit 299a89c

Please sign in to comment.