Skip to content

Commit f753055

Browse files
committed
Expand Codename One artifact fallbacks
1 parent 8db87f0 commit f753055

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

scripts/verify_skins_with_codenameone.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,19 @@
1212
import tempfile
1313
from pathlib import Path
1414
from typing import Iterable, List
15-
from urllib.request import urlopen
15+
from urllib.request import Request, urlopen
1616

1717
CODENAMEONE_JAR_URLS = [
1818
"https://github.com/codenameone/CodenameOne/releases/latest/download/CodenameOne.jar",
1919
"https://raw.githubusercontent.com/codenameone/CodenameOne/master/dist/CodenameOne.jar",
20+
"https://repo1.maven.org/maven2/com/codenameone/codenameone/7.0/codenameone-7.0.jar",
21+
"https://repo1.maven.org/maven2/com/codenameone/codenameone/6.0/codenameone-6.0.jar",
2022
]
2123
JAVA_SE_PORT_JAR_URLS = [
2224
"https://github.com/codenameone/CodenameOne/releases/latest/download/JavaSEPort.jar",
2325
"https://raw.githubusercontent.com/codenameone/CodenameOne/master/dist/JavaSEPort.jar",
26+
"https://repo1.maven.org/maven2/com/codenameone/java-se/7.0/java-se-7.0.jar",
27+
"https://repo1.maven.org/maven2/com/codenameone/java-se/6.0/java-se-6.0.jar",
2428
]
2529
HARNESS_SOURCE = Path(__file__).resolve().parent / "java" / "SkinHarness.java"
2630

@@ -48,7 +52,8 @@ def _ensure_artifact(target_dir: Path, urls: Iterable[str]) -> Path:
4852
return artifact_path
4953

5054
try:
51-
with urlopen(url) as response, tempfile.NamedTemporaryFile(delete=False) as tmp:
55+
request = Request(url, headers={"User-Agent": "codenameone-skin-verifier/1.0"})
56+
with urlopen(request) as response, tempfile.NamedTemporaryFile(delete=False) as tmp:
5257
shutil.copyfileobj(response, tmp)
5358
tmp.flush()
5459
tmp_path = Path(tmp.name)

0 commit comments

Comments
 (0)