Skip to content

Commit 680af7b

Browse files
committed
added graalpy-jbang project
1 parent 86885bf commit 680af7b

File tree

7 files changed

+43
-29
lines changed

7 files changed

+43
-29
lines changed

graalpython/graalpy-jbang/examples/hello.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@
4040
*/
4141
///usr/bin/env jbang "$0" "$@" ; exit $?
4242
//JAVA 17+
43-
//DEPS org.graalvm.python:python-language:${env.GRAALPY_VERSION:24.0.0}
44-
//DEPS org.graalvm.python:python-resources:${env.GRAALPY_VERSION:24.0.0}
45-
//DEPS org.graalvm.python:python-launcher:${env.GRAALPY_VERSION:24.0.0}
46-
//DEPS org.graalvm.python:python-embedding:${env.GRAALPY_VERSION:24.0.0}
43+
//DEPS org.graalvm.python:graalpy-jbang:${env.GRAALPY_VERSION:24.2.0}
4744
//PIP termcolor
4845

4946
import org.graalvm.polyglot.Context;

graalpython/graalpy-jbang/templates/graalpy-template.java.qute

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
{/for}
66
{#if dependencies.isEmpty()}// //DEPS <dependency1> <dependency2>{/if}
77
{|
8-
//DEPS org.graalvm.python:python-language:${env.GRAALPY_VERSION:24.1.0}
9-
//DEPS org.graalvm.python:python-resources:${env.GRAALPY_VERSION:24.1.0}
10-
//DEPS org.graalvm.python:python-launcher:${env.GRAALPY_VERSION:24.1.0}
11-
//DEPS org.graalvm.python:python-embedding:${env.GRAALPY_VERSION:24.1.0}
12-
//DEPS org.graalvm.python:python-embedding-tools:${env.GRAALPY_VERSION:24.1.0}
8+
//DEPS org.graalvm.python:graalpy-jbang:${env.GRAALPY_VERSION:24.2.0}
139
//PIP termcolor
1410
|}
1511
import org.graalvm.polyglot.Context;

graalpython/graalpy-jbang/templates/graalpy-template_local_repo.java.qute

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@
88
//REPOS mc=https://repo1.maven.org/maven2/
99
//REPOS local=file://{path_to_local_repo}
1010
{|
11-
//DEPS org.graalvm.python:python-language:${env.GRAALPY_VERSION:24.1.0}
12-
//DEPS org.graalvm.python:python-resources:${env.GRAALPY_VERSION:24.1.0}
13-
//DEPS org.graalvm.python:python-launcher:${env.GRAALPY_VERSION:24.1.0}
14-
//DEPS org.graalvm.python:python-embedding:${env.GRAALPY_VERSION:24.1.0}
15-
//DEPS org.graalvm.python:python-embedding-tools:${env.GRAALPY_VERSION:24.1.0}
11+
//DEPS org.graalvm.python:graalpy-jbang:${env.GRAALPY_VERSION:24.2.0}
1612
//PIP termcolor
1713
|}
1814
import org.graalvm.polyglot.Context;

graalpython/org.graalvm.python.embedding.tools/src/META-INF/jbang-integration.list

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.graalvm.python.jbang.JBangIntegration
Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* SOFTWARE.
4040
*/
4141

42-
package org.graalvm.python.embedding.tools.jbang;
42+
package org.graalvm.python.jbang;
4343

4444
import org.graalvm.python.embedding.tools.exec.GraalPyRunner;
4545
import org.graalvm.python.embedding.tools.exec.SubprocessLog;
@@ -154,18 +154,7 @@ public static Map<String, Object> postBuild(Path temporaryJar,
154154
// include python stdlib in image
155155
try {
156156
VFSUtils.copyGraalPyHome(calculateClasspath(dependencies), home, null, null, LOG);
157-
var niConfig = temporaryJar.resolve("META-INF").resolve("native-image");
158-
Files.createDirectories(niConfig);
159-
Files.writeString(niConfig.resolve("native-image.properties"), "Args = -H:-CopyLanguageResources");
160-
Files.writeString(niConfig.resolve("resource-config.json"), """
161-
{
162-
"resources": {
163-
"includes": [
164-
{"pattern": "vfs/.*"}
165-
]
166-
}
167-
}
168-
""");
157+
VFSUtils.writeNativeImageConfig(temporaryJar.resolve("META-INF"), "graalpy-jbang-integration");
169158
} catch (IOException | InterruptedException e) {
170159
throw new RuntimeException(e);
171160
}

mx.graalpython/suite.py

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,17 @@
334334
"checkstyle": "com.oracle.graal.python",
335335
},
336336

337+
"org.graalvm.python.jbang": {
338+
"subDir": "graalpython",
339+
"sourceDirs": ["src"],
340+
"dependencies": [
341+
"org.graalvm.python.embedding.tools"
342+
],
343+
"jacoco": "include",
344+
"javaCompliance": "17+",
345+
"checkstyle": "com.oracle.graal.python",
346+
},
347+
337348
"com.oracle.graal.python.annotations": {
338349
"subDir": "graalpython",
339350
"sourceDirs": ["src"],
@@ -946,7 +957,6 @@
946957
"exports": [
947958
"org.graalvm.python.embedding.tools.vfs",
948959
"org.graalvm.python.embedding.tools.exec",
949-
"org.graalvm.python.embedding.tools.jbang",
950960
]
951961
},
952962
"useModulePath": True,
@@ -965,6 +975,32 @@
965975

966976
},
967977

978+
"GRAALPYTHON_JBANG": {
979+
"moduleInfo": {
980+
"name": "org.graalvm.python.jbang",
981+
"exports": [
982+
"org.graalvm.python.jbang",
983+
]
984+
},
985+
"useModulePath": True,
986+
"dependencies": [
987+
"org.graalvm.python.jbang",
988+
],
989+
"distDependencies": [
990+
"GRAALPYTHON",
991+
"GRAALPYTHON_RESOURCES",
992+
"GRAALPYTHON-LAUNCHER",
993+
"GRAALPYTHON_EMBEDDING",
994+
"GRAALPYTHON_EMBEDDING_TOOLS",
995+
],
996+
"description": "GraalPy JBang Integration",
997+
"maven": {
998+
"groupId": "org.graalvm.python",
999+
"artifactId": "graalpy-jbang",
1000+
"tag": ["default", "public"],
1001+
},
1002+
},
1003+
9681004
"GRAALPYTHON-LAUNCHER": {
9691005
"moduleInfo": {
9701006
"name": "org.graalvm.py.launcher",

0 commit comments

Comments
 (0)