Skip to content

Commit

Permalink
release: v1.13.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Clashsoft committed Dec 29, 2022
2 parents fb051c9 + 145c273 commit bf5bbd8
Show file tree
Hide file tree
Showing 23 changed files with 792 additions and 882 deletions.
Binary file modified backend/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion backend/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
12 changes: 8 additions & 4 deletions backend/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,10 +80,10 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
Expand Down Expand Up @@ -143,12 +143,16 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down
1 change: 1 addition & 0 deletions backend/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand Down
98 changes: 37 additions & 61 deletions backend/src/main/java/org/fulib/webapp/tool/Tools.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,13 @@ public static boolean isClass(Path file)
return file.toString().endsWith(".class");
}

public static Stream<Path> collectJavaFiles(Path sourceFolder)
{
try
{
return Files.walk(sourceFolder).filter(Tools::isJava);
}
catch (IOException e)
{
return Stream.empty();
}
}

// --------------- File Utilities ---------------

public static void deleteRecursively(Path dir)
{
try
try (final Stream<Path> stream = Files.walk(dir))
{
Files.walk(dir).sorted(Comparator.reverseOrder()).forEach(file -> {
stream.sorted(Comparator.reverseOrder()).forEach(file -> {
try
{
Files.deleteIfExists(file);
Expand All @@ -71,8 +59,9 @@ public static void deleteRecursively(Path dir)

// --------------- Tool Invocation ---------------

public static int scenarioc(OutputStream out, OutputStream err, Path scenarioSrcDir, Path modelSrcDir,
Path testSrcDir, String... args)
public static int scenarioc(
OutputStream out, OutputStream err, Path scenarioSrcDir, Path modelSrcDir, Path testSrcDir, String... args
)
{
final List<String> finalArgs = new ArrayList<>(8 + args.length);
finalArgs.add("--classpath");
Expand All @@ -99,7 +88,17 @@ public static int javac(OutputStream out, OutputStream err, String classpath, Pa

ArrayList<String> args = new ArrayList<>();

Arrays.stream(sourceFolders).flatMap(Tools::collectJavaFiles).map(Path::toString).forEach(args::add);
Arrays.stream(sourceFolders).flatMap(sourceFolder -> {
try
{
// noinspection resource
return Files.walk(sourceFolder).filter(Tools::isJava);
}
catch (IOException e)
{
return Stream.empty();
}
}).map(Path::toString).forEach(args::add);

args.add("-d");
args.add(outFolder.toString());
Expand All @@ -123,14 +122,17 @@ public static Result runTests(Path mainClassesDir, Path testClassesDir)
{
Logger.getGlobal().log(Level.SEVERE, "could not build classpath", e);
}
try (URLClassLoader classLoader = new URLClassLoader(classPathUrls))
{
List<Class<?>> testClasses = new ArrayList<>();

Files.walk(testClassesDir).filter(Tools::isClass).sorted().forEach(path -> {
List<Class<?>> testClasses = new ArrayList<>();
try (final URLClassLoader classLoader = new URLClassLoader(classPathUrls);
final Stream<Path> stream = Files.walk(testClassesDir))
{
stream.filter(Tools::isClass).sorted().forEach(path -> {
final String relativePath = testClassesDir.relativize(path).toString();
final String className = relativePath.substring(0, relativePath.length() - ".class".length())
.replace('/', '.').replace('\\', '.');
final String className = relativePath
.substring(0, relativePath.length() - ".class".length())
.replace('/', '.')
.replace('\\', '.');
try
{
final Class<?> testClass = Class.forName(className, true, classLoader);
Expand All @@ -155,12 +157,12 @@ public static int genCompileRun(//
Path srcDir, //
Path modelSrcDir, Path testSrcDir,//
Path modelClassesDir, Path testClassesDir,//
String... scenariocArgs) throws Exception
String... scenariocArgs
) throws Exception
{
final PrintStream printErr = new PrintStream(err, false, StandardCharsets.UTF_8.name());
final PrintStream printErr = new PrintStream(err, false, StandardCharsets.UTF_8);

// prevent dock icon on Mac
try (FakeProperty ignored = new FakeProperty("apply.awt.UIElement", "true"))
try
{
final int scenarioc = scenarioc(out, err, srcDir, modelSrcDir, testSrcDir, scenariocArgs);
if (scenarioc != 0)
Expand All @@ -170,13 +172,16 @@ public static int genCompileRun(//

String classPath = System.getProperty("java.class.path");

if (Files.walk(modelSrcDir).anyMatch(Tools::isJava))
try (final Stream<Path> stream = Files.walk(modelSrcDir))
{
// only compile model folder if there are any java files.
final int modelJavac = javac(out, err, classPath, modelClassesDir, modelSrcDir);
if (modelJavac != 0)
if (stream.anyMatch(Tools::isJava))
{
return modelJavac << 2 | 1;
// only compile model folder if there are any java files.
final int modelJavac = javac(out, err, classPath, modelClassesDir, modelSrcDir);
if (modelJavac != 0)
{
return modelJavac << 2 | 1;
}
}
}

Expand Down Expand Up @@ -211,33 +216,4 @@ public static int genCompileRun(//
printErr.flush();
}
}

// =============== Classes ===============

// TODO move to Dyvil library
private static class FakeProperty implements AutoCloseable
{
private final String key;
private final String original;

public FakeProperty(String key, String newValue)
{
this.key = key;
this.original = System.getProperty(key);
System.setProperty(key, newValue);
}

@Override
public void close()
{
if (this.original == null)
{
System.clearProperty(this.key);
}
else
{
System.setProperty(this.key, this.original);
}
}
}
}
12 changes: 0 additions & 12 deletions frontend/.browserslistrc

This file was deleted.

10 changes: 5 additions & 5 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"angular-split": "^14.1.0",
"bootstrap": "~5.2.3",
"bootstrap-darkmode": "^5.0.1",
"bootstrap-icons": "^1.10.2",
"bootstrap-icons": "^1.10.3",
"bson-objectid": "^2.0.4",
"codemirror": "^5.65.11",
"file-saver": "^2.0.5",
Expand All @@ -38,7 +38,7 @@
"keycloak-js": "20.0.2",
"markdown-it": "^13.0.1",
"ng-bootstrap-darkmode": "^5.0.0",
"ng-bootstrap-ext": "^0.6.0",
"ng-bootstrap-ext": "^0.6.1",
"ngx-clipboard": "^15.1.0",
"ngx-drag-drop": "^15.0.1",
"rxjs": "~7.8.0",
Expand All @@ -60,9 +60,9 @@
"@types/jasmine": "~3.6.11",
"@types/jasminewd2": "~2.0.10",
"@types/markdown-it": "^12.2.3",
"@types/node": "^18.11.17",
"@typescript-eslint/eslint-plugin": "^5.47.0",
"@typescript-eslint/parser": "^5.47.0",
"@types/node": "^18.11.18",
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@typescript-eslint/parser": "^5.47.1",
"eslint": "^8.30.0",
"jasmine-core": "~3.8.0",
"jasmine-spec-reporter": "~5.0.2",
Expand Down
Loading

0 comments on commit bf5bbd8

Please sign in to comment.