[apex] Remove module pmd-apex-jorje

This commit is contained in:
Andreas Dangel
2024-02-13 19:18:16 +01:00
parent a4280011a3
commit dbe6053af4
9 changed files with 2 additions and 264 deletions

View File

@ -263,6 +263,8 @@ The following previously deprecated classes have been removed:
* The method `getNameSpace()` in {%jdoc apex::lang.apex.ast.ApexQualifiedName %} has been removed.
* The class `net.sourceforge.pmd.lang.apex.ast.ASTBridgeMethodCreator` has been removed. This was a node that has
been generated by the old Jorje parser only.
* pmd-apex-jorje
* With the switch from Jorje to Summit AST, this maven module is no longer needed and has been removed.
* pmd-java
* The interface `FinalizableNode` (introduced in 7.0.0-rc1) has been removed.
Its method `isFinal()` has been moved down to the

View File

@ -1,130 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>pmd-apex-jorje</artifactId>
<name>PMD Apex Jorje Parser Library</name>
<packaging>pom</packaging>
<parent>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd</artifactId>
<version>7.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<properties>
<apex.jorje.version>2023-06-05-c27a5d</apex.jorje.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>attach-apex-jorje</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>${basedir}/repo/apex/apex-jorje-lsp-minimized/${apex.jorje.version}/apex-jorje-lsp-minimized-${apex.jorje.version}.jar</file>
<type>jar</type>
<classifier>lib</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<!-- transitive dependencies of apex-jorje -->
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>3.3.0</version> <!-- apex jorje actually depends on 3.2.0 (https://github.com/forcedotcom/salesforcedx-vscode/commit/c27a5d6c91b494f4797e3c1d8782152b091e6233) -->
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<!-- apex jorje actually depends on 2.7 (https://github.com/forcedotcom/salesforcedx-vscode/commit/c27a5d6c91b494f4797e3c1d8782152b091e6233) -->
</dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
<version>2.1.3</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<!-- apex jorje actually depends on 26.0-jre (https://github.com/forcedotcom/salesforcedx-vscode/commit/c27a5d6c91b494f4797e3c1d8782152b091e6233) -->
</dependency>
<dependency>
<groupId>com.google.j2objc</groupId>
<artifactId>j2objc-annotations</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr-runtime</artifactId>
<!-- old antlr version used by apex-jorje -->
<version>3.5.2</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>stringtemplate</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-annotations</artifactId>
<version>1.14</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<!-- apex jorje actually depends on 1.7.20 (https://github.com/forcedotcom/salesforcedx-vscode/commit/c27a5d6c91b494f4797e3c1d8782152b091e6233) -->
</dependency>
<!-- apex jorje actually depends on 1.17 (https://github.com/forcedotcom/salesforcedx-vscode/commit/c27a5d6c91b494f4797e3c1d8782152b091e6233)
however, it is not really needed, so we don't add it here as a dependency,
so that it doesn't end up in pmd-dist
-->
<!--<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</dependency>
-->
<dependency>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>5.0.3</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</project>

View File

@ -1,14 +0,0 @@
# Local Maven Repo for the Apex Jorje Parser library
You can download the needed libraries from:
<https://github.com/forcedotcom/salesforcedx-vscode/tree/develop/packages/salesforcedx-vscode-apex/out>
Apex Reference:
<https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_reference.htm>
<https://resources.docs.salesforce.com/sfdc/pdf/salesforce_apex_language_reference.pdf>
In order to download the jar file, minimize it and add the jar files to the local repo, use the following script:
./create-local-repo.sh

View File

@ -1,4 +0,0 @@
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
#Sat Jun 24 18:50:10 CEST 2023
apex-jorje-lsp-minimized-2023-06-05-c27a5d.jar>=
apex-jorje-lsp-minimized-2023-06-05-c27a5d.pom>=

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>apex</groupId>
<artifactId>apex-jorje-lsp-minimized</artifactId>
<version>2023-06-05-c27a5d</version>
<description>POM was created from install:install-file</description>
</project>

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>apex</groupId>
<artifactId>apex-jorje-lsp-minimized</artifactId>
<versioning>
<release>2023-06-05-c27a5d</release>
<versions>
<version>2023-06-05-c27a5d</version>
</versions>
<lastUpdated>20230624165009</lastUpdated>
</versioning>
</metadata>

View File

@ -1,94 +0,0 @@
#!/bin/bash
LAST_COMMIT_INFO=$(curl -s "https://api.github.com/repos/forcedotcom/salesforcedx-vscode/commits?sha=develop&path=packages%2Fsalesforcedx-vscode-apex%2Fout%2Fapex-jorje-lsp.jar&page=1&per_page=1")
LAST_COMMIT_DATE=$(echo $LAST_COMMIT_INFO | jq -r '.[0].commit.committer.date')
LAST_COMMIT_SHA=$(echo $LAST_COMMIT_INFO | jq -r '.[0].sha')
VERSION=${LAST_COMMIT_DATE%T*}-${LAST_COMMIT_SHA:0:6}
URL=https://raw.githubusercontent.com/forcedotcom/salesforcedx-vscode/${LAST_COMMIT_SHA}/packages/salesforcedx-vscode-apex/out/apex-jorje-lsp.jar
FILENAME=apex-jorje-lsp-${VERSION}.jar
FILENAME_MINIMIZED=apex-jorje-lsp-minimized-${VERSION}.jar
REPOPATH=$(dirname $0)
function deleteoldrepo() {
git rm -r ${REPOPATH}/apex/apex-jorje-lsp-minimized/*
}
function install() {
mvn install:install-file -Dfile=${FILENAME_MINIMIZED} \
-DgroupId=apex \
-DartifactId=apex-jorje-lsp-minimized \
-Dversion=${VERSION} \
-Dpackaging=jar \
-DlocalRepositoryPath=${REPOPATH}
git add ${REPOPATH}
}
function download() {
curl -o $FILENAME $URL
}
#
# Unfortunately, jorje is provided as a blob, which seems to be a jar-with-dependencies
# kind of thing. We try to keep only the apex related classes and delete anything that has
# been added into the big apex-jorje-lsp-jar. The deleted classes will be added as dependencies again.
#
# We unfortunately need to keep some classes in com.google.common (guava), since jorje seems
# to have added classes there, which are not in the official guava packages.
#
function minimize() {
unzip -d temp ${FILENAME}
pushd temp
find . -type f \
-and -not -path "./apex/*" \
-and -not -path "./StandardApex*" \
-and -not -path "./messages*" \
-and -not -path "./com/google/common/collect/ConcatenatedLists*" \
-and -not -path "./com/google/common/collect/MoreLists*" \
-and -not -path "./com/google/common/collect/MoreMaps*" \
-and -not -path "./com/google/common/collect/MoreSets*" \
-and -not -path "./com/google/common/collect/PairList*" \
-and -not -path "./com/google/common/collect/SingleAppendList*" \
-and -not -path "./com/google/common/collect/SinglePrependList*" \
-and -not -path "./com/google/common/collect/WellBehavedMap*" \
-and -not -path "./com/google/common/graph/ConfigurableMutableGraph*" \
-and -not -path "./com/google/common/graph/ConfigurableMutableNetwork*" \
-and -not -path "./com/google/common/graph/ConfigurableMutableValueGraph*" \
-and -not -path "./com/google/common/graph/ConfigurableNetwork*" \
-and -not -path "./com/google/common/graph/ConfigurableValueGraph*" \
-and -not -path "./com/google/common/reflect/Element*" \
-and -not -path "./com/google/common/util/concurrent/AbstractCheckedFuture*" \
-print0 | xargs -0 rm -rf
# delete empty directories
find . -depth -type d -empty -delete
popd
jar --create --file ${FILENAME_MINIMIZED} -C temp/ .
rm -rf temp
}
function cleanup() {
rm ${FILENAME}
rm ${FILENAME_MINIMIZED}
}
function updateversion() {
sed -i -e "s/\(<apex\.jorje\.version>\).*\(<\/apex\.jorje\.version>\)/\1${VERSION}\2/" $(dirname $0)/../pom.xml
git add $(dirname $0)/../pom.xml
}
function diffstat() {
echo "Ready to commit:"
git diff --cached --stat
}
download
minimize
deleteoldrepo
install
updateversion
cleanup
diffstat

View File

@ -1197,7 +1197,6 @@
</profiles>
<modules>
<module>pmd-apex-jorje</module>
<module>pmd-apex</module>
<module>pmd-coco</module>
<module>pmd-core</module>