Skip to content

Commit 34f321a

Browse files
authored
Merge pull request #26
Downgrade target Java version to 17
2 parents 594f0af + ec71568 commit 34f321a

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ repos:
33
rev: v5.0.0
44
hooks:
55
- id: trailing-whitespace
6+
exclude: ^integration-tests/jbang/EmptyPIPComments\.j$
67
- id: end-of-file-fixer
78
- id: check-yaml
89
- id: check-added-large-files

integration-tests/jbang/EmptyPIPComments.j

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
//DEPS org.graalvm.python:jbang:${env.GRAALPY_VERSION:26.0.0}
44
//PIP
55
// one blank after PIP
6-
//PIP
6+
//PIP
77
// three blanks after PIP
8-
//PIP
8+
//PIP
99

1010
public class EmptyPIPComments {
1111
public static void main(String[] args) {

integration-tests/test_jbang_integration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ def check_empty_comments(self, work_dir, java_file, log):
317317
self.assertEqual(0, result, f"command: {command}\n stdout: {out}")
318318
self.assertNotIn("[graalpy jbang integration]", out)
319319

320+
@unittest.skip # https://github.com/jbangdev/jbang/issues/2236
320321
def test_malformed_tag_formats(self):
321322
jbang_templates_dir = os.path.join(os.path.dirname(__file__), "jbang")
322323
work_dir = self.tmpdir

org.graalvm.python.jbang/src/main/java/org/graalvm/python/jbang/JBangIntegration.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,11 @@ public static Map<String, Object> postBuild(Path temporaryJar, Path pomFile,
180180
resourcesDirectory = Path.of(path);
181181
}
182182
} else if (comment.startsWith(PIP)) {
183-
pkgs.addAll(Arrays.stream(comment.substring(PIP.length()).trim().split(" "))
184-
.filter(s -> !s.trim().isEmpty()).collect(Collectors.toList()));
183+
String content = comment.substring(PIP.length()).trim();
184+
if (!content.isEmpty()) {
185+
pkgs.addAll(Arrays.stream(content.split("\\s+")).filter(x -> !x.isBlank())
186+
.collect(Collectors.toList()));
187+
}
185188
}
186189
}
187190
if (!pkgs.isEmpty()) {

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@
173173
<artifactId>maven-compiler-plugin</artifactId>
174174
<version>3.14.0</version>
175175
<configuration>
176-
<source>21</source>
177-
<target>21</target>
178-
<release>21</release>
176+
<source>17</source>
177+
<target>17</target>
178+
<release>17</release>
179179
<compilerArgs>
180180
<arg>-Xlint:all</arg>
181181
<arg>-Werror</arg>

0 commit comments

Comments
 (0)