diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c38a847dfa..3222a0467a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,4 +27,4 @@ jobs: java-version: ${{ matrix.java }} - name: Build with mvnw run: | - ./mvnw clean install + ./mvnw -V clean install diff --git a/.travis.yml b/.travis.yml index 5ff4e3b8b8..34758b8d66 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,13 +34,6 @@ jobs: dist: bionic env: BUILD=coveralls if: "type = push && repo = pmd/pmd && fork = false" - - name: "macosx - mvn verify" - os: osx - env: BUILD=deploy - - name: "windows - mvn verify" - os: windows - env: BUILD=deploy - language: shell - stage: publish name: "Release Build - Publish" os: linux @@ -49,7 +42,7 @@ jobs: env: BUILD=publish before_install: - - bash .travis/before_install.sh "11.0.8+10" + - bash .travis/before_install.sh "11" - source ${HOME}/java.env install: true before_script: true diff --git a/.travis/before_install.sh b/.travis/before_install.sh index c0f9c55853..c58c93d09d 100644 --- a/.travis/before_install.sh +++ b/.travis/before_install.sh @@ -13,30 +13,36 @@ bash .travis/configure-maven.sh bash .travis/install-openjdk.sh $OPENJDK_VERSION +function install_jdk() { + LOCAL_DIR=$1 + TARGET_DIR=$2 + DOWNLOAD_URL=$3 + ARCHIVE=$(basename $DOWNLOAD_URL) + + mkdir -p ${LOCAL_DIR} + mkdir -p ${TARGET_DIR} + if [ ! -e ${LOCAL_DIR}/${ARCHIVE} ]; then + log_info "Downloading from ${DOWNLOAD_URL} to ${LOCAL_DIR}" + wget --directory-prefix ${LOCAL_DIR} --timestamping --continue ${DOWNLOAD_URL} + else + log_info "Skipped download, file ${LOCAL_DIR}/${ARCHIVE} already exists" + fi + log_info "Extracting to ${TARGET_DIR}" + tar --extract --file ${LOCAL_DIR}/${ARCHIVE} -C ${TARGET_DIR} --strip-components=1 +} + if travis_isLinux; then + change_ruby_version gem install bundler bundle config set --local path vendor/bundle bundle config set --local with release_notes_preprocessing bundle install - # install openjdk8 for integration test - LOCAL_DIR=${HOME}/.cache/jdk8 - TARGET_DIR=${HOME}/openjdk8 - OPENJDK8_ARCHIVE=OpenJDK8U-jdk_x64_linux_hotspot_8u265b01.tar.gz - DOWNLOAD_URL=https://pmd-code.org/openjdk/jdk-8u265b01/${OPENJDK8_ARCHIVE} - mkdir -p ${LOCAL_DIR} - mkdir -p ${TARGET_DIR} - if [ ! -e ${LOCAL_DIR}/${OPENJDK8_ARCHIVE} ]; then - log_info "Downloading from ${DOWNLOAD_URL} to ${LOCAL_DIR}" - wget --directory-prefix ${LOCAL_DIR} --timestamping --continue ${DOWNLOAD_URL} - else - log_info "Skipped download, file ${LOCAL_DIR}/${OPENJDK8_ARCHIVE} already exists" - fi - log_info "Extracting to ${TARGET_DIR}" - tar --extract --file ${LOCAL_DIR}/${OPENJDK8_ARCHIVE} -C ${TARGET_DIR} --strip-components=1 - log_info "OpenJDK8 can be used via -Djava8.home=${TARGET_DIR}" - + # install openjdk8 for integration test and pmd-regression-tests + install_jdk "${HOME}/.cache/openjdk" "${HOME}/openjdk8" "https://pmd-code.org/openjdk/latest/jdk-8-linux64.tar.gz" + log_info "OpenJDK8 can be used via -Djava8.home=${HOME}/openjdk8" + log_info "OpenJDK8 can be used from ${HOME}/openjdk8" else - log_info "Not setting up ruby for ${TRAVIS_OS_NAME}." + log_info "Not setting up ruby and additional jvms for ${TRAVIS_OS_NAME}." exit 0 fi diff --git a/.travis/common-functions.sh b/.travis/common-functions.sh index 3148dd9796..c217bb3c6f 100755 --- a/.travis/common-functions.sh +++ b/.travis/common-functions.sh @@ -57,3 +57,8 @@ function travis_isWindows() { function get_pom_version() { echo $(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:3.0.0:exec) } + +function change_ruby_version() { + source "$HOME/.rvm/scripts/rvm" + rvm use ruby-2.7 +} diff --git a/.travis/install-openjdk.sh b/.travis/install-openjdk.sh index 1e07be76e9..af59870c50 100644 --- a/.travis/install-openjdk.sh +++ b/.travis/install-openjdk.sh @@ -2,36 +2,38 @@ set -e # -# AdoptOpenJDK Builds from: -# https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/tag/jdk-11.0.4%2B11 +# Downloads AdoptOpenJDK Builds from +# https://pmd-code.org/openjdk/latest/jdk-11-linux64.tar.gz +# https://pmd-code.org/openjdk/latest/jdk-11-windows64.zip +# https://pmd-code.org/openjdk/latest/jdk-11-mac64.tar.gz +# +# The Build are originally from: +# https://github.com/AdoptOpenJDK/openjdk11-binaries/releases # source .travis/logger.sh source .travis/common-functions.sh -# VERSION_TAG e.g. "11.0.4+11" or "13+33" -VERSION_TAG=$1 -OPENJDK_MAJOR=${VERSION_TAG/.*/} -OPENJDK_MAJOR=${OPENJDK_MAJOR/+*/} -#BASE_URL=https://github.com/AdoptOpenJDK/openjdk${OPENJDK_MAJOR}-binaries/releases/download -BASE_URL=https://pmd-code.org/openjdk +# OPENJDK_VERSION e.g. "11" +OPENJDK_VERSION=$1 +BASE_URL=https://pmd-code.org/openjdk/latest/jdk-${OPENJDK_VERSION}- -log_info "Installing OpenJDK${OPENJDK_MAJOR}U ${VERSION_TAG} for ${TRAVIS_OS_NAME}" +log_info "Installing OpenJDK${OPENJDK_VERSION} for ${TRAVIS_OS_NAME}" if travis_isOSX; then - DOWNLOAD_URL=${BASE_URL}/jdk-${VERSION_TAG/+/%2B}/OpenJDK${OPENJDK_MAJOR}U-jdk_x64_mac_hotspot_${VERSION_TAG/+/_}.tar.gz + DOWNLOAD_URL=${BASE_URL}mac64.tar.gz COMPONENTS_TO_STRIP=3 # e.g. jdk-11.0.3+7/Contents/Home/bin/java elif travis_isWindows; then - DOWNLOAD_URL=${BASE_URL}/jdk-${VERSION_TAG/+/%2B}/OpenJDK${OPENJDK_MAJOR}U-jdk_x64_windows_hotspot_${VERSION_TAG/+/_}.zip + DOWNLOAD_URL=${BASE_URL}windows64.zip else - DOWNLOAD_URL=${BASE_URL}/jdk-${VERSION_TAG/+/%2B}/OpenJDK${OPENJDK_MAJOR}U-jdk_x64_linux_hotspot_${VERSION_TAG/+/_}.tar.gz + DOWNLOAD_URL=${BASE_URL}linux64.tar.gz COMPONENTS_TO_STRIP=1 # e.g. openjdk-11.0.3+7/bin/java fi OPENJDK_ARCHIVE=$(basename $DOWNLOAD_URL) LOCAL_DIR=${HOME}/.cache/openjdk -TARGET_DIR=${HOME}/openjdk${OPENJDK_MAJOR} +TARGET_DIR=${HOME}/openjdk${OPENJDK_VERSION} mkdir -p ${LOCAL_DIR} mkdir -p ${TARGET_DIR} diff --git a/.travis/project-list.xml b/.travis/project-list.xml index 0fb0f58023..600061f674 100644 --- a/.travis/project-list.xml +++ b/.travis/project-list.xml @@ -1,23 +1,67 @@ +xsi:noNamespaceSchemaLocation="projectlist_1_1_0.xsd"> Standard Projects checkstyle git - - https://github.com/pmd/checkstyle - checkstyle-8.10-pmd-regression + https://github.com/checkstyle/checkstyle + checkstyle-8.10 + + .*/target/test-classes/com/puppycrawl/tools/checkstyle/.* + .*/target/generated-sources/.* + + + echo -n "$(pwd)/target/classes:$(pwd)/target/test-classes:"; cat classpath.txt spring-framework git - - https://github.com/pmd/spring-framework - v5.0.6.RELEASE-pmd-regression + https://github.com/spring-projects/spring-framework + v5.0.6.RELEASE + + > build.gradle < classpath.txt +]]> + cat classpath.txt - dokka + javadocJar - - org.apache.maven.plugins - maven-jar-plugin - - - kotlin-javadoc - package - - jar - - - ${project.build.directory}/dokka/pmd-lang-test - javadoc - - - - diff --git a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/IntelliMarker.kt b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/IntelliMarker.kt new file mode 100644 index 0000000000..d7ad20eea0 --- /dev/null +++ b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/IntelliMarker.kt @@ -0,0 +1,21 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.ast.test + + +import org.junit.jupiter.api.TestFactory +import org.junit.jupiter.api.condition.EnabledIfSystemProperty + +/** + * This is to trick Intellij into making subclasses executable (because of @TestFactory). + * But Junit does not use it because of the unsatisfiable condition. This comes from + * Kotest, but was removed in 4.2.0 without explanation. + */ +interface IntelliMarker { + @EnabledIfSystemProperty(named = "wibble", matches = "wobble") + @TestFactory + fun primer() { + } +} diff --git a/pom.xml b/pom.xml index 96c3774d56..603bdbaea7 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ https://pmd.github.io/ - https://travis-ci.org/pmd/pmd + https://travis-ci.com/pmd/pmd 2002 @@ -85,9 +85,9 @@ ${maven.compiler.test.target} - 1.3.72 - 4.1.2 - 0.10.1 + 1.4.10 + 4.3.0 + 1.4.10.2 5.0