generated from finos/software-project-blueprint
-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Package all flavors of REPL the same way for easy access and debugging (
#3040) * Package all flavors of REPL the same way for easy access and debugging * Remove other shaded jars * Re-introduce datacube shade plugin for the repl-dev profile * Ensure no sfl4j warning
- Loading branch information
Showing
11 changed files
with
333 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
...nd-engine-config/legend-engine-repl/legend-engine-repl-app-assembly/assemble/assembly.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<!-- | ||
~ Copyright 2024 Goldman Sachs | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
~ | ||
--> | ||
|
||
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.2.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.2.0 http://maven.apache.org/xsd/assembly-2.2.0.xsd"> | ||
<id>repl-app</id> | ||
<formats> | ||
<!-- <format>zip</format>--> | ||
<format>dir</format> | ||
</formats> | ||
<baseDirectory>repl-app</baseDirectory> | ||
<fileSets> | ||
<fileSet> | ||
<directory>${project.basedir}/assemble/</directory> | ||
<outputDirectory/> | ||
<includes> | ||
<include>pom.xml</include> | ||
</includes> | ||
<filtered>true</filtered> | ||
</fileSet> | ||
<fileSet> | ||
<directory>${project.basedir}/assemble/</directory> | ||
<outputDirectory/> | ||
<includes> | ||
<include>repl*.bat</include> | ||
</includes> | ||
<lineEnding>windows</lineEnding> | ||
<fileMode>0777</fileMode> | ||
<filtered>true</filtered> | ||
</fileSet> | ||
<fileSet> | ||
<directory>${project.basedir}/assemble/</directory> | ||
<outputDirectory/> | ||
<includes> | ||
<include>repl*.sh</include> | ||
</includes> | ||
<lineEnding>unix</lineEnding> | ||
<fileMode>0777</fileMode> | ||
<filtered>true</filtered> | ||
</fileSet> | ||
</fileSets> | ||
</assembly> |
83 changes: 83 additions & 0 deletions
83
legend-engine-config/legend-engine-repl/legend-engine-repl-app-assembly/assemble/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright 2024 Goldman Sachs | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
~ | ||
--> | ||
|
||
<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> | ||
|
||
<groupId>org.finos.legend.engine</groupId> | ||
<artifactId>legend-engine-repl-app-assembly</artifactId> | ||
<version>local-pom</version> | ||
<packaging>pom</packaging> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-nop</artifactId> | ||
<scope>runtime</scope> | ||
<version>${slf4j.version}</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<profiles> | ||
<profile> | ||
<id>relational</id> | ||
<properties> | ||
<replMainClass>org.finos.legend.engine.repl.relational.client.RClient</replMainClass> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.finos.legend.engine</groupId> | ||
<artifactId>legend-engine-repl-relational</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</profile> | ||
<profile> | ||
<id>datacube</id> | ||
<properties> | ||
<replMainClass>org.finos.legend.engine.repl.dataCube.client.DataCubeClient</replMainClass> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.finos.legend.engine</groupId> | ||
<artifactId>legend-engine-repl-data-cube</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</profile> | ||
<profile> | ||
<id>default</id> | ||
<activation> | ||
<activeByDefault>true</activeByDefault> | ||
</activation> | ||
<properties> | ||
<replMainClass>org.finos.legend.engine.repl.client.Client</replMainClass> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.finos.legend.engine</groupId> | ||
<artifactId>legend-engine-repl-client</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</profile> | ||
</profiles> | ||
|
||
</project> |
68 changes: 68 additions & 0 deletions
68
legend-engine-config/legend-engine-repl/legend-engine-repl-app-assembly/assemble/repl.bat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
@echo off | ||
setlocal EnableDelayedExpansion | ||
|
||
:: Initialize variables | ||
set "debug=" | ||
set "profile=default" | ||
|
||
:parse_options | ||
if "%~1"=="-d" ( | ||
shift | ||
if "%~2"=="" ( | ||
echo Error: Missing port number after -d option. | ||
goto show_usage | ||
) | ||
SET "var="&for /f "delims=0123456789" %%i in ("%~2") do set var=%%i | ||
if defined var ( | ||
echo Error: Invalid port number "%~2". It must be an integer. | ||
goto show_usage | ||
) | ||
set "debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:%~2" | ||
shift | ||
goto parse_options | ||
) | ||
|
||
if "%~1"=="-p" ( | ||
shift | ||
if "%~2"=="" ( | ||
echo Error: Missing profile value after -p option. | ||
goto show_usage | ||
) | ||
if /i "%~2"=="default" set "profile=default" & shift & goto parse_options | ||
if /i "%~2"=="relational" set "profile=relational" & shift & goto parse_options | ||
if /i "%~2"=="datacube" set "profile=datacube" & shift & goto parse_options | ||
echo Error: Invalid profile "%~2". Valid options are: default, relational, datacube. | ||
goto show_usage | ||
) | ||
|
||
if "%~1"=="-h" goto show_usage | ||
|
||
if "%~1"=="" goto endparse | ||
|
||
echo Error: Invalid option "%~1". | ||
goto show_usage | ||
|
||
:endparse | ||
|
||
set "classpathFile=%~dp0%profile%-win-classpath.txt" | ||
set "replMainClassFile=%~dp0%profile%-win-replMainClass.txt" | ||
|
||
if not exist "%classpathFile%" ( | ||
echo Computing %profile% classpath... | ||
call mvn -q -DforceStdout -P %profile% dependency:build-classpath -Dmdep.outputFile="%classpathFile%" | ||
) | ||
|
||
if not exist "%replMainClassFile%" ( | ||
echo Computing %profile% REPL main class... | ||
call mvn -q -DforceStdout help:evaluate -P %profile% -Dexpression=replMainClass -q -DforceStdout --log-file %replMainClassFile% | ||
) | ||
|
||
java -cp @%classpathFile% %debug% @%replMainClassFile% | ||
exit /b 0 | ||
|
||
:show_usage | ||
echo Usage: %~nx0 [-d port_number] [-p {default^|relational^|datacube}] [-h] | ||
echo -d port_number Enable debug mode with a specified port number. | ||
echo -p {default^|relational^|datacube} Specify the profile to use. | ||
echo -h Show this help message and exit. | ||
exit /b 1 |
55 changes: 55 additions & 0 deletions
55
legend-engine-config/legend-engine-repl/legend-engine-repl-app-assembly/assemble/repl.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
|
||
# Initialize variables | ||
debug="" | ||
profile="default" | ||
|
||
# Function to show usage | ||
show_usage() { | ||
echo "Usage: $0 [-d port_number] [-p {default|relational|datacube}] [-h]" | ||
echo " -d port_number Enable debug mode with a specified port number." | ||
echo " -p {default|relational|datacube} Specify the profile to use." | ||
echo " -h Show this help message and exit." | ||
exit 0 | ||
} | ||
|
||
# Parse options | ||
while getopts "d:p:h" opt; do | ||
case $opt in | ||
d) | ||
if ! [[ "$OPTARG" =~ ^[0-9]+$ ]]; then | ||
echo "Invalid port number for -d. Port number must be an integer." | ||
show_usage | ||
fi | ||
debug="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:$OPTARG" | ||
;; | ||
p) | ||
if [[ "$OPTARG" != "default" && "$OPTARG" != "relational" && "$OPTARG" != "datacube" ]]; then | ||
echo "Invalid value for -p. Valid options are: default, relational, datacube" | ||
show_usage | ||
fi | ||
profile="$OPTARG" | ||
;; | ||
h) | ||
show_usage | ||
;; | ||
*) | ||
show_usage | ||
;; | ||
esac | ||
done | ||
|
||
classpathFile=$(dirname "$0")/$profile-classpath.txt | ||
replMainClassFile=$(dirname "$0")/$profile-replMainClass.txt | ||
|
||
if [ ! -f "$classpathFile" ]; then | ||
echo "Computing $profile repl classpath" | ||
mvn -q -DforceStdout -P "$profile" dependency:build-classpath -Dmdep.outputFile="$classpathFile" | ||
fi | ||
|
||
if [ ! -f "$replMainClassFile" ]; then | ||
echo "Computing $profile repl main class" | ||
mvn -q -DforceStdout help:evaluate -P "$profile" -Dexpression=replMainClass -q -DforceStdout --log-file "$replMainClassFile" | ||
fi | ||
|
||
java -cp @$classpathFile $debug @$replMainClassFile |
56 changes: 56 additions & 0 deletions
56
legend-engine-config/legend-engine-repl/legend-engine-repl-app-assembly/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright 2024 Goldman Sachs | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
~ | ||
--> | ||
|
||
<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> | ||
<parent> | ||
<groupId>org.finos.legend.engine</groupId> | ||
<artifactId>legend-engine-repl</artifactId> | ||
<version>4.54.2-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>legend-engine-repl-app-assembly</artifactId> | ||
<packaging>pom</packaging> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-assembly-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>repl-assembly</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>single</goal> | ||
</goals> | ||
<configuration> | ||
<appendAssemblyId>false</appendAssemblyId> | ||
<finalName>repl-app</finalName> | ||
<descriptors> | ||
<descriptors>${project.basedir}/assemble/assembly.xml</descriptors> | ||
</descriptors> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.