Skip to content

Commit

Permalink
6.6.0 - Fix6 - 修复 Temurin 平台无法构建项目
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperMonster003 committed Dec 2, 2024
1 parent c30394f commit 9769950
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ class UI(private val scriptRuntime: ScriptRuntime) : AugmentableProxy(scriptRunt
val widgets = scriptRuntime.ui.widgets
if (widgets.contains(viewName)) {
val ctor = widgets.prop(viewName) as NativeFunction
val widget = withRhinoContext {
ctor.construct(it, scriptRuntime.topLevelScope, arrayOf())
val widget = withRhinoContext { ctx ->
ctor.construct(ctx, scriptRuntime.topLevelScope, arrayOf())
} as ScriptableObject
val f = widget.prop("renderInternal") as BaseFunction
return __inflateRhinoRuntime__(scriptRuntime, scriptRuntime.ui.layoutInflater.newInflateContext().also { ctx ->
Expand Down
25 changes: 20 additions & 5 deletions libs/utils.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,26 @@ class Utils {
}

LibDeployer setDestDir(String destDir) {
def destFile = destDir.matches("[/\\\\].+") ? project.file(destDir.substring(1)) : project.file(destDir)
println(destDir.matches("[/\\\\].+"))
println(project.file(destDir))
println(project.file(destDir.substring(1)))
println(destFile.absolutePath)

// @Hint by SuperMonster003 on Dec 2, 2024.
// ! On some platforms (such as Temurin),
// ! using project.file might not correctly retrieve the absolute path of the current project.
// ! For example, using "/foo/bar",
// ! Expected path: "/.../AutoJs6/libs/.../src/sdk/native",
// ! Actual path: "/src/sdk/native",
// ! In this case, the leading path separator should be removed, using "foo/bar" instead of "/foo/bar".
// !
// ! zh-CN:
// !
// ! 某些平台 (如 Temurin) 使用 project.file 可能无法正确获取当前项目的绝对路径.
// ! 以 "/foo/bar" 为例,
// ! 预期路径: "/.../AutoJs6/libs/.../src/sdk/native",
// ! 实际路径: "/src/sdk/native",
// ! 这种情况下需要去除路径分隔符前缀, 即使用 "foo/bar" 而非 "/foo/bar".
def destFile = destDir.startsWith(File.separator)
? project.file(destDir.substring(1))
: project.file(destDir)

destFile.mkdirs()
this.destDir = destDir
this.destFile = destFile
Expand Down
6 changes: 3 additions & 3 deletions version.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Mon Dec 02 16:52:56 CST 2024
BUILD_TIME=1733129576279
#Mon Dec 02 18:03:28 CST 2024
BUILD_TIME=1733133808639
COMPILE_SDK_VERSION=34
JAVA_VERSION=23
JAVA_VERSION_MIN_RADICAL=0
Expand All @@ -17,6 +17,6 @@ RAPID_OCR_OPENCV_MOBILE_LABEL_VERSION=13
RAPID_OCR_OPENCV_MOBILE_VERSION=4.5.3
TARGET_SDK_VERSION=34
TARGET_SDK_VERSION_INRT=29
VERSION_BUILD=2883
VERSION_BUILD=2884
VERSION_NAME=6.6.0
VSCODE_EXT_REQUIRED_VERSION=1.0.8

0 comments on commit 9769950

Please sign in to comment.