[apex] Add script to create minimized apex jorje jar, add jar as dependency

This commit is contained in:
Andreas Dangel
2017-12-04 21:14:27 +01:00
parent 7fa49aacc6
commit 6caad3485c
5 changed files with 76 additions and 34 deletions

View File

@@ -69,40 +69,9 @@
<dependency>
<groupId>apex</groupId>
<artifactId>apex-jorje-data</artifactId>
<version>1.0-sfdc-224-SNAPSHOT-3083815933</version>
<artifactId>apex-jorje-lsp-minimized</artifactId>
<version>2017-11-17</version>
</dependency>
<dependency>
<groupId>apex</groupId>
<artifactId>apex-jorje-ide</artifactId>
<version>1.0-sfdc-224-SNAPSHOT-3083815933</version>
</dependency>
<dependency>
<groupId>apex</groupId>
<artifactId>apex-jorje-parser</artifactId>
<version>1.0-sfdc-224-SNAPSHOT-3083815933</version>
</dependency>
<dependency>
<groupId>apex</groupId>
<artifactId>apex-jorje-semantic</artifactId>
<version>1.0-sfdc-224-SNAPSHOT-3083815933</version>
</dependency>
<dependency>
<groupId>apex</groupId>
<artifactId>apex-jorje-services</artifactId>
<version>1.0-sfdc-224-SNAPSHOT-3083815933</version>
</dependency>
<dependency>
<groupId>apex</groupId>
<artifactId>apex-jorje-tools</artifactId>
<version>1.0-sfdc-224-SNAPSHOT-3083815933</version>
</dependency>
<!-- transitive dependencies of apex-jorje -->
<dependency>
<groupId>cglib</groupId>
@@ -132,7 +101,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0</version>
<version>22.0</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://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>2017-11-17</version>
<description>POM was created from install:install-file</description>
</project>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>apex</groupId>
<artifactId>apex-jorje-lsp-minimized</artifactId>
<versioning>
<release>2017-11-17</release>
<versions>
<version>2017-11-17</version>
</versions>
<lastUpdated>20171204195258</lastUpdated>
</versioning>
</metadata>

View File

@@ -0,0 +1,52 @@
#!/bin/bash
URL=https://raw.githubusercontent.com/forcedotcom/salesforcedx-vscode/54b127925eebfcfd14cd9988018438ba49ec3d43/packages/salesforcedx-vscode-apex/out/apex-jorje-lsp.jar
VERSION=2017-11-17
FILENAME=apex-jorje-lsp-${VERSION}.jar
FILENAME_MINIMIZED=apex-jorje-lsp-minimized-${VERSION}.jar
function install() {
mvn install:install-file -Dfile=${FILENAME_MINIMIZED} \
-DgroupId=apex \
-DartifactId=apex-jorje-lsp-minimized \
-Dversion=${VERSION} \
-Dpackaging=jar \
-DlocalRepositoryPath=.
}
function download() {
curl -o $FILENAME $URL
}
function minimize() {
unzip -d temp ${FILENAME}
pushd temp
find . -not -path "." \
-and -not -path ".." \
-and -not -path "./apex*" \
-and -not -path "./StandardApex*" \
-and -not -path "./messages*" \
-and -not -path "./com" \
-and -not -path "./com/google" \
-and -not -path "./com/google/common*" \
-print0 | xargs -0 rm -rf
popd
jar --create --file ${FILENAME_MINIMIZED} -C temp/ .
rm -rf temp
}
function cleanup() {
rm ${FILENAME}
rm ${FILENAME_MINIMIZED}
}
download
minimize
install
cleanup