Skip to content

Commit 94d0592

Browse files
committed
Merge branch 'refs/heads/package-manager' into latest
2 parents ae0c5be + f15218d commit 94d0592

File tree

17 files changed

+483
-12
lines changed

17 files changed

+483
-12
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
/.idea/
33
/.nb-gradle/
44
**/build/
5-
/dist/
65
/out/
76
/store/
87
/optimizations/

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ext {
1212
slf4j: '2.0.13', // org.slf4j:slf4j-simple
1313
jackson: '2.17.0', // com.fasterxml.jackson.core:jackson-databind
1414

15-
junit: '5.10.2', // org.junit:junit-bom
15+
junit: '5.11.0', // org.junit:junit-bom
1616
jmh: '1.37', // org.openjdk.jmh:jmh-core
1717
assertj: '3.25.3' // org.assertj:assertj-core
1818
]

dist/icon.png

8.69 KB
Loading

dist/own

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env sh
2+
ownlang run own "$@"

dist/own.cmd

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@echo off
2+
ownlang run own %*

dist/ownlang

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env sh
2+
(set -o igncr) 2>/dev/null && set -o igncr; # cygwin encoding fix
3+
4+
# resolve links - $0 may be a softlink
5+
PRG="$0"
6+
while [ -h "$PRG" ] ; do
7+
ls=`ls -ld "$PRG"`
8+
link=`expr "$ls" : '.*-> \(.*\)$'`
9+
if expr "$link" : '/.*' > /dev/null; then
10+
PRG="$link"
11+
else
12+
PRG=`dirname "$PRG"`/"$link"
13+
fi
14+
done
15+
PRGDIR=`dirname "$PRG"`
16+
17+
_classpath=".:$PRGDIR/OwnLang.jar"
18+
if [ `uname -a | grep -i -c cygwin` -ne 0 ]; then # Cygwin, translate the path
19+
for k in "$PRGDIR"/modules/*.jar
20+
do
21+
_classpath="${_classpath};`cygpath -w ${k}`"
22+
done
23+
for k in "$PRGDIR"/libs/*.jar
24+
do
25+
_classpath="${_classpath};`cygpath -w ${k}`"
26+
done
27+
else
28+
for k in "$PRGDIR"/modules/*.jar
29+
do
30+
_classpath="${_classpath}:${k}"
31+
done
32+
for k in "$PRGDIR"/libs/*.jar
33+
do
34+
_classpath="${_classpath}:${k}"
35+
done
36+
fi
37+
38+
java -cp "${_classpath}" com.annimon.ownlang.Main "$@"

dist/ownlang-runner.cmd

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@echo off
2+
set JAVA=java
3+
%JAVA% -cp "%~dp0/*;%~dp0modules/*;%~dp0libs/*" com.annimon.ownlang.Main --file %1
4+
pause

dist/ownlang.cmd

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@echo off
2+
3+
set JAVA=java
4+
%JAVA% ^
5+
-cp "%~dp0/*;%~dp0modules/*;%~dp0libs/*" com.annimon.ownlang.Main %*

docs/docs/en/changelog.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## Next
44

5+
### Changes
6+
- Add `own` package manager. Usage examples: `own`, `own init`, `own add openai`.
7+
58
### Fixes
69
- Fix passing command-line arguments to scripts.
710
- Fix `this` in non-static class methods.

docs/docs/ru/changelog.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## Next
44

5+
### Изменения
6+
- Добавлен `own` пакетный менеджер. Примеры испльзования: `own`, `own init`, `own add openai`.
7+
58
### Исправления
69
- Исправлена передача аргументов командной строки скриптам.
710
- Исправлен `this` в нестатических методах классов.

modules/canvasfx/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'java-library'
3-
id 'org.openjfx.javafxplugin' version '0.0.14'
3+
id 'org.openjfx.javafxplugin' version "0.1.0"
44
id 'com.github.johnrengelman.shadow' version '8.1.1'
55
}
66

modules/main/src/main/java/com/annimon/ownlang/modules/okhttp/Values.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@
1414
public class Values {
1515

1616
public static RequestBody getRequestBody(Value arg, String msg) {
17-
if (arg.type() == Types.MAP && (arg instanceof RequestBodyValue)) {
18-
return ((RequestBodyValue) arg).getRequestBody();
17+
if (arg.type() == Types.MAP && (arg instanceof RequestBodyValue rbv)) {
18+
return rbv.getRequestBody();
1919
}
2020
throw new TypeException("RequestBody value expected" + msg);
2121
}
2222

2323
public static Request getRequest(Value arg, String msg) {
24-
if (arg.type() == Types.MAP && (arg instanceof RequestBuilderValue)) {
25-
return ((RequestBuilderValue) arg).getRequest();
24+
if (arg.type() == Types.MAP && (arg instanceof RequestBuilderValue rbv)) {
25+
return rbv.getRequest();
2626
}
2727
throw new TypeException("Request value expected" + msg);
2828
}
2929

3030
public static OkHttpClient getHttpClient(Value arg, String msg) {
31-
if (arg.type() == Types.MAP && (arg instanceof HttpClientValue)) {
32-
return ((HttpClientValue) arg).getClient();
31+
if (arg.type() == Types.MAP && (arg instanceof HttpClientValue hcv)) {
32+
return hcv.getClient();
3333
}
3434
throw new TypeException("HttpClient value expected" + msg);
3535
}

ownlang-desktop/src/main/java/com/annimon/ownlang/Main.java

+4
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ public static void main(String[] args) throws IOException {
9797
return;
9898

9999
case "run":
100+
if (options.programPath != null) {
101+
// discard "run" if some programs already specified
102+
break;
103+
}
100104
final String scriptName;
101105
if (i + 1 < args.length) {
102106
scriptName = args[i + 1];

ownlang-desktop/src/main/resources/scripts/listscripts.own

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
println "Available scripts:
22
checkUpdate - checks updates on GitHub
3+
own - own package manager
34

45
To run a script use command:
56
ownlang run checkUpdate

0 commit comments

Comments
 (0)