Skip to content

Commit bb4ed98

Browse files
committed
various fixes and cleanups for polyglot app pom
(cherry picked from commit 60c1bd1)
1 parent aba5cdd commit bb4ed98

File tree

4 files changed

+9
-24
lines changed

4 files changed

+9
-24
lines changed

graalpython/lib-graalpython/modules/standalone/__main__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ class AbstractStandalone:
126126

127127
def __init__(self, parsed_args):
128128
self.parsed_args = parsed_args
129+
self.graalvm_version = MVN_PYTHON_COMMUNITY_VERSION if MVN_PYTHON_COMMUNITY_VERSION else __graalpython__.get_graalvm_version()
129130

130131
@abc.abstractmethod
131132
def create(self):
@@ -163,6 +164,8 @@ def create_pom_file(self, template, pom):
163164
line = line.replace("{vfs-venv-prefix}", VFS_VENV_PREFIX)
164165
if "{files-list-name}" in line:
165166
line = line.replace("{files-list-name}", FILES_LIST_NAME)
167+
if "{graal-version}" in line:
168+
line = line.replace("{graal-version}", self.graalvm_version)
166169
f.write(line)
167170

168171
def create_launcher_file(self, template, launcher, java_pkg=""):
@@ -322,15 +325,11 @@ class NativeExecutable(Standalone):
322325

323326
def __init__(self, parsed_args):
324327
super().__init__(parsed_args)
325-
326328
self.target_dir = tempfile.mkdtemp()
327329
self.modules_path = os.path.join(self.target_dir, "modules")
328330
self.mvn_code_prefix = ""
329331
self.mvn_resource_prefix = ""
330332
self.launcher_file = os.path.join(self.target_dir, MODULE_NAME, JAVA_BINDING_LAUNCHER_FILE)
331-
332-
self.graalvm_version = MVN_PYTHON_COMMUNITY_VERSION if MVN_PYTHON_COMMUNITY_VERSION else __graalpython__.get_graalvm_version()
333-
334333
self.jdk_version = __graalpython__.get_jdk_version()
335334

336335
def create(self):

graalpython/lib-graalpython/modules/standalone/app/graalpy.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ del VTabCreator.java
1616
REM Store each argument separated by vtab
1717
for %%I in (%*) do call :sub %%I
1818

19-
mvn -f "%~dp0"pom.xml exec:java -Dexec.mainClass=com.oracle.graal.python.shell.GraalPythonMain -Dorg.graalvm.launcher.executablename=%0
19+
mvn -f "%~dp0"pom.xml exec:exec -Dexec.executable=java -Dexec.args="--module-path %%classpath -Dorg.graalvm.launcher.executablename=%0 --module org.graalvm.py.launcher/com.oracle.graal.python.shell.GraalPythonMain"
2020

2121
goto :eof
2222

graalpython/lib-graalpython/modules/standalone/app/graalpy.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ done
1313
location="$( cd -P "$( dirname "$source" )" && pwd )"
1414

1515
for var in "$@"; do
16-
args="$args$(printf "\v")$var"
16+
args="${args}$(printf "\v")${var}"
1717
done
1818

1919
export GRAAL_PYTHON_ARGS=$args
20-
mvn -f $location/pom.xml exec:java -Dexec.mainClass=com.oracle.graal.python.shell.GraalPythonMain -Dorg.graalvm.launcher.executablename=$0
20+
mvn -f "${location}/pom.xml" exec:exec -Dexec.executable=java -Dexec.args="--module-path %classpath '-Dorg.graalvm.launcher.executablename=$0' --module org.graalvm.py.launcher/com.oracle.graal.python.shell.GraalPythonMain"

graalpython/lib-graalpython/modules/standalone/templates/polyglot_app_pom.xml

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,37 +55,23 @@
5555
<graalpy.venv.executable>/bin/python</graalpy.venv.executable>
5656
</properties>
5757

58-
<!-- XXX remove me -->
59-
<repositories>
60-
<repository>
61-
<id>myrepo</id>
62-
<url>file:///tmp/local_repo</url>
63-
<releases>
64-
<enabled>true</enabled>
65-
</releases>
66-
<snapshots>
67-
<enabled>false</enabled>
68-
</snapshots>
69-
</repository>
70-
</repositories>
71-
7258
<dependencies>
7359
<dependency>
7460
<groupId>org.graalvm.polyglot</groupId>
7561
<artifactId>polyglot</artifactId>
76-
<version>23.1.0-dev</version>
62+
<version>{graal-version}</version>
7763
</dependency>
7864
<dependency>
7965
<groupId>org.graalvm.polyglot</groupId>
8066
<artifactId>python-community</artifactId>
81-
<version>23.1.0-dev</version>
67+
<version>{graal-version}</version>
8268
<scope>runtime</scope>
8369
<type>pom</type>
8470
</dependency>
8571
<dependency>
8672
<groupId>org.graalvm.python</groupId>
8773
<artifactId>python-launcher</artifactId>
88-
<version>23.1.0-dev</version>
74+
<version>{graal-version}</version>
8975
<scope>runtime</scope>
9076
</dependency>
9177
</dependencies>

0 commit comments

Comments
 (0)