Files
jetbrains-cc-gui/Dockerfile
senfixandClaude Opus 4.8 e913be9542 feat: allow overriding the Claude Code CLI executable + add Docker build
Add a "Claude CLI Path (override)" setting that lets users point the plugin
at a specific `claude` binary instead of the SDK's bundled CLI. When set, the
Java daemon exports it as CLAUDE_CODE_PATH; ai-bridge reads that and passes
`pathToClaudeCodeExecutable` to the Claude Agent SDK across all query paths
(send, persistent query, rewind, prompt enhancer).

- New ClaudeCliPathHandler persists the path in PropertiesComponent, validates
  it (exists / not a dir / executable), and restarts the daemon on save so the
  new env var is picked up. Mirrors NodePathHandler.
- New getClaudeCliPathOverride() helper in ai-bridge reads/normalizes the env.
- Settings UI: input + save button in the Environment tab, wired through the
  existing window callback / hook plumbing, with en.json strings.

Also add a Dockerfile + .dockerignore to build the plugin distribution zip in
a container (Temurin 17 + Node 20), so the build is reproducible without a
local toolchain.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-29 06:42:32 +00:00

52 lines
2.0 KiB
Docker

# Builds the CC GUI IntelliJ plugin distribution (.zip) inside a container.
#
# Build the image:
# docker build -t cc-gui-build .
#
# Produce the plugin zip into ./dist on the host:
# mkdir -p dist && docker run --rm -v "$(pwd)/dist:/out" cc-gui-build
#
# Target a different IDE (IC = IntelliJ Community [default], PC, PY, RD):
# docker run --rm -v "$(pwd)/dist:/out" -e TARGET_IDE=PC cc-gui-build
FROM eclipse-temurin:17-jdk-jammy AS build
ENV DEBIAN_FRONTEND=noninteractive \
GRADLE_OPTS="-Dorg.gradle.daemon=false -Dorg.gradle.welcome=never"
# Node.js 20.x + zip/unzip (zip is invoked by the packageAiBridge Gradle task).
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl ca-certificates gnupg git zip unzip \
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \
&& rm -rf /var/lib/apt/lists/* \
&& node --version && npm --version && java -version
WORKDIR /workspace
# Install npm deps first so they cache independently of source changes.
COPY webview/package.json webview/package-lock.json webview/
COPY ai-bridge/package.json ai-bridge/package-lock.json ai-bridge/
# Use `npm install` (not `npm ci`) because the upstream lockfiles drift from
# package.json — `npm ci` aborts on any missing transitive entry, which makes
# the container build fail on a repo issue rather than a real problem.
RUN cd webview && npm install --no-audit --no-fund
RUN cd ai-bridge && npm install --no-audit --no-fund
# Now bring in the rest of the sources. .dockerignore keeps host build/ and
# node_modules/ out so the container build is reproducible.
COPY . .
RUN chmod +x gradlew
ARG TARGET_IDE=IC
ENV TARGET_IDE=${TARGET_IDE}
# buildPlugin transitively runs buildWebview + packageAiBridge.
RUN ./gradlew --no-daemon -PtargetIde=${TARGET_IDE} clean buildPlugin
# Default entrypoint: copy the produced artifact to a bind-mounted /out.
CMD ["bash", "-lc", "mkdir -p /out && cp build/distributions/*.zip /out/ && ls -lh /out/"]