Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions dev/builder/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,19 @@ cd ../..
echo ""
echo "Starting CKBuilder..."

JAVA_ARGS=${ARGS// -t / } # Remove -t from args.
JAVA_ARGS=("$@")
FILTERED_JAVA_ARGS=()
UNMINIFIED=false
if [[ "$JAVA_ARGS" == *" --unminified "* ]]; then
JAVA_ARGS=${JAVA_ARGS// --unminified / }
UNMINIFIED=true
fi
for arg in "${JAVA_ARGS[@]}"; do
case "$arg" in
-t) ;;
--unminified) UNMINIFIED=true ;;
*) FILTERED_JAVA_ARGS+=("$arg") ;;
esac
done


VERSION="4.14.1 TAO-3.3"
VERSION="4.14.1 TAO-3.4"
REVISION=$(git rev-parse --verify --short HEAD)

# If the current revision is not tagged with any CKE version, it means it's a "dirty" build. We
Expand All @@ -75,12 +80,13 @@ then
VERSION="$VERSION DEV"
fi
echo ""

if [ "$UNMINIFIED" = true ]; then
echo "Building unminified version..."
java -jar ckbuilder/$CKBUILDER_VERSION/ckbuilder.jar --build ../../ release $JAVA_ARGS --version="$VERSION" --revision="$REVISION" --overwrite --leave-js-unminified --leave-css-unminified
java --add-exports java.desktop/sun.java2d=ALL-UNNAMED -jar ckbuilder/$CKBUILDER_VERSION/ckbuilder.jar --build ../../ release "${FILTERED_JAVA_ARGS[@]}" --version="$VERSION" --revision="$REVISION" --overwrite --leave-js-unminified --leave-css-unminified
else
echo "Building minified version..."
java -jar ckbuilder/$CKBUILDER_VERSION/ckbuilder.jar --build ../../ release $JAVA_ARGS --version="$VERSION" --revision="$REVISION" --overwrite
java --add-exports java.desktop/sun.java2d=ALL-UNNAMED -jar ckbuilder/$CKBUILDER_VERSION/ckbuilder.jar --build ../../ release "${FILTERED_JAVA_ARGS[@]}" --version="$VERSION" --revision="$REVISION" --overwrite
Comment on lines +86 to +89
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect CI/build configuration for Java runtime declarations.
rg -n -C2 --iglob '*.yml' --iglob '*.yaml' --iglob '*.sh' \
  '\b(java-version|JAVA_HOME|temurin|adopt|openjdk|jdk[0-9]+|java --add-exports)\b'

Repository: oat-sa/ckeditor-dev

Length of output: 838


🏁 Script executed:

find . -type f \( -name ".github" -o -name ".gitlab-ci.yml" -o -name "*.workflow" -o -name "pom.xml" -o -name "README*" -o -name "CONTRIBUTING*" \) 2>/dev/null | head -20

Repository: oat-sa/ckeditor-dev

Length of output: 353


🏁 Script executed:

find .github -type f -name "*.yml" -o -name "*.yaml" 2>/dev/null

Repository: oat-sa/ckeditor-dev

Length of output: 124


🏁 Script executed:

cat README.md 2>/dev/null | grep -i "java\|jdk\|version" | head -20

Repository: oat-sa/ckeditor-dev

Length of output: 832


🏁 Script executed:

cat .github/workflows/sonar.yml

Repository: oat-sa/ckeditor-dev

Length of output: 1129


🏁 Script executed:

grep -n "java" dev/builder/build.sh -i | head -30

Repository: oat-sa/ckeditor-dev

Length of output: 654


🏁 Script executed:

find .github/workflows -type f -name "*.yml" -o -name "*.yaml" 2>/dev/null

Repository: oat-sa/ckeditor-dev

Length of output: 90


🏁 Script executed:

ls -la .github/workflows/

Repository: oat-sa/ckeditor-dev

Length of output: 232


🏁 Script executed:

head -50 dev/builder/build.sh

Repository: oat-sa/ckeditor-dev

Length of output: 1437


Add Java version validation or documentation to build.sh.

The --add-exports flag (lines 86, 89) requires Java 9 or later and is not supported on Java 8. Either add a runtime check at the beginning of build.sh to validate the Java version, or document the Java 9+ requirement prominently in the script header and project README.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@dev/builder/build.sh` around lines 86 - 89, Add a Java runtime validation to
build.sh to ensure Java 9+ is used before invoking java with the --add-exports
flag (or alternatively update the script header and README to state the Java 9+
requirement); implement a check that parses the output of `java -version` (or
uses `JAVA_HOME` if set) and exits with a clear error if the major version is
<9, and update any top-of-file comment block to document the Java requirement so
callers know why --add-exports (used when launching ckbuilder.jar) will fail on
Java 8.

fi

# Copy and build tests.
Expand Down
27 changes: 27 additions & 0 deletions plugins/taofurigana/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ CKEDITOR.plugins.add('taofurigana', {

var commandName = 'rubyFurigana';
var containsTag;
var statelessButtons = [];
var statelessButtonsList = [
'bold', 'italic', 'strike', 'spanUnderline', 'subscript', 'superscript'];
var otherButtons = [];
var combos = [];

Expand Down Expand Up @@ -85,6 +88,19 @@ CKEDITOR.plugins.add('taofurigana', {
return node.getAscendant('ruby') !== null;
}

/**
* Make sure that the current selection is already inside rt of furigana/ruby
* @param {Node} node
* @returns {boolean}
*/
function isInRtFugirana(node) {
if (!node) {
return false;
}

return isInFugirana(node) && node.getAscendant('rt', true) !== null;
}

/**
* @param {Selection} selection
* @returns {boolean}
Expand Down Expand Up @@ -174,6 +190,9 @@ CKEDITOR.plugins.add('taofurigana', {
element.items.forEach(function (item) {
if (item.command && item.command !== commandName) {
otherButtons.push(item.command);
if (statelessButtonsList.includes(item.command)) {
statelessButtons.push(item);
}
} else if (!item.command && typeof item.setState !== "undefined") {
combos.push(item);
}
Expand Down Expand Up @@ -201,6 +220,14 @@ CKEDITOR.plugins.add('taofurigana', {
if (deleteRubyIfNoRt(range.startContainer, false, selection)) {
command.setState(CKEDITOR.TRISTATE_DISABLED);
setButtonsState(CKEDITOR.TRISTATE_OFF);
} else if (!isInRtFugirana(range.startContainer)) {
command.setState(CKEDITOR.TRISTATE_ON);
setTimeout(function () {
setButtonsState(CKEDITOR.TRISTATE_DISABLED);
statelessButtons.forEach(function (button) {
button.setState(CKEDITOR.TRISTATE_OFF);
});
Comment thread
KirylHatalski marked this conversation as resolved.
}, 150);
} else {
command.setState(CKEDITOR.TRISTATE_ON);
setTimeout(function () {
Expand Down