Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@
*/
public interface CamelContext extends CamelContextLifecycle, RuntimeConfiguration {

// TEST: this line SHOULD trigger OpenRewrite FQCN detection
java.util.List<String> testFqcnDetection = null;

/**
* Gets the {@link ExtendedCamelContext} that contains the extension points for internal context APIs. These APIs
* are intended for internal usage within Camel and end-users should avoid using them.
Expand Down
25 changes: 25 additions & 0 deletions etc/scripts/regen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,31 @@ set -e
# Move to top directory
cd `dirname "$0"`/../..

# Conditionally enable OpenRewrite FQCN shortening only when needed.
# We diff HEAD~1 vs HEAD to check for FQCNs in the changeset.
# For PR builds, actions/checkout creates a merge commit whose first parent (HEAD~1)
# is the base branch tip, so the diff covers all PR changes.
# For main builds, HEAD~1 is the previous (squash-merged) commit.
# We only need --deepen=1 (depth 1 -> 2) since we compare adjacent commits,
# not a merge-base (which would require deeper history).
if ! git rev-parse HEAD~1 >/dev/null 2>&1; then
git fetch --deepen=1 --quiet 2>/dev/null || true
fi

if git rev-parse HEAD~1 >/dev/null 2>&1 && \
git diff HEAD~1 HEAD -- '*.java' ':!*/src/generated/*' \
| grep '^+[^+]' \
| grep -v '^+ *import ' \
| grep -v '^+ *package ' \
| grep -v '^+ *//' \
| grep -v '^+ *\*' \
| grep -qE '[a-z][a-z0-9]*(\.[a-z][a-z0-9]*)+\.[A-Z]'; then
MAVEN_EXTRA_ARGS="${MAVEN_EXTRA_ARGS} -Prewrite"
echo "FQCNs detected in diff, enabling OpenRewrite (-Prewrite)"
else
echo "No FQCNs detected in diff, skipping OpenRewrite"
fi

# Force clean
git clean -fdx
rm -Rf **/src/generated/
Expand Down
Loading