Skip to content

Honor included_paths #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
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
12 changes: 8 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
**/.sonarlint

# ---- Maven
# ---- Build related
.gradle/
build/
target/
dependency-reduced-pom.xml
**/*.class

# ---- IntellijIDEA
*.iws
*.iml
*.ipr
*.iws
.idea/

# ---- Eclipse
@@ -19,12 +22,13 @@ dependency-reduced-pom.xml
Icon?
# Thumbnails
._*

# Files that might appear on external disk
.Spotlight-V100
.Trashes

# ---- Windows
# Windows image file caches
Thumbs.db
Thumbs.db
# Folder config file
Desktop.ini
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

60 changes: 31 additions & 29 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,42 @@
FROM maven:3.3.9-jdk-8-alpine
FROM java:8-jdk-alpine

MAINTAINER Code Climate

# Create user and app directory
RUN adduser -u 9000 -D app
COPY . /usr/src/app
RUN chown -R app:app /usr/src/app
VOLUME /code

# Package the app with Maven
WORKDIR /usr/src/app
RUN mvn package
# Increase Java memory limits
ENV JAVA_OPTS="-XX:+UseParNewGC -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -Xss4096k"

# Unzip the packaged app
RUN mkdir /usr/src/app/dest
RUN unzip /usr/src/app/target/sonarlint-cli-*.zip \
-d /usr/src/app/dest
RUN cp -R /usr/src/app/dest/sonarlint-cli-*/* \
/usr/src/app/dest
ENV GRADLE_VERSION=4.2.1
ENV GRADLE_HOME=/opt/gradle
ENV GRADLE_FOLDER=$GRADLE_HOME
ENV GRADLE_USER_HOME=$GRADLE_HOME
ENV PATH=$GRADLE_HOME/bin:$PATH

RUN mkdir -p $GRADLE_USER_HOME && \
chown -R app:app $GRADLE_USER_HOME && \
chmod g+s $GRADLE_USER_HOME && \
apk update && \
apk add --virtual .build-dependencies ca-certificates wget && \
update-ca-certificates && \
wget https://downloads.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip && \
unzip gradle-${GRADLE_VERSION}-bin.zip -d /opt && \
mv /opt/gradle-${GRADLE_VERSION}/* $GRADLE_HOME && \
rm -f gradle-${GRADLE_VERSION}-bin.zip && \
apk del .build-dependencies

# Specify the /code volume
# as needed by CC
VOLUME /code
WORKDIR /usr/src/app

# Create a writeable directory for the code
RUN mkdir -p /code-read-write
RUN chown -R app:app /code-read-write
RUN chmod -R 777 /code-read-write
# Cache dependencies
COPY build.gradle ./
RUN gradle infra

# Increase Java memory limits
ENV JAVA_OPTS="-XX:+UseParNewGC -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -Xss4096k"
COPY . ./
RUN chown -R app:app ./

RUN gradle clean build -x test

# Switch to app user, copy code to writable
# directory, and run the engine
USER app
ENTRYPOINT []
WORKDIR /code-read-write
CMD cp -R /code/* . && \
/usr/src/app/dest/bin/sonarlint \
--src 'src/main/**/*.java'
WORKDIR /code
CMD cp -R /code /tmp/ && /usr/src/app/build/codeclimate-sonar /tmp/code
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.PHONY: image test

IMAGE_NAME ?= codeclimate/codeclimate-sonar-java

image:
docker build --rm -t $(IMAGE_NAME) .

test: image
docker run --rm -ti -w /usr/src/app -u root $(IMAGE_NAME) gradle clean test
155 changes: 0 additions & 155 deletions appveyor.ps1

This file was deleted.

21 changes: 0 additions & 21 deletions appveyor.yml

This file was deleted.

46 changes: 0 additions & 46 deletions assembly.xml

This file was deleted.

17 changes: 17 additions & 0 deletions bin/codeclimate-sonar
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env sh

BUILD_DIR=$(dirname $0)
APP=$(find ${BUILD_DIR}/libs -name "codeclimate*.jar" | tr "\n" ":")
LIBS=$(find ${BUILD_DIR}/libs -name "*.jar" | tr "\n" ":")
CORE=$(find ${BUILD_DIR}/libs -name "sonarlint-core*.jar" -or -name "sonarlint-client-api*.jar" | tr "\n" ":")

CODE_DIR=$1; shift

java \
-cp ${APP}:${CORE}:${LIBS} \
-Djava.awt.headless=true \
-Dsonarlint.home="${BUILD_DIR}" \
-Dproject.home="${CODE_DIR}" \
-Dconfig="/config.json" \
-Dorg.freemarker.loggerLibrary=none \
cc.App --src "**/*.java" $@
Loading
Oops, something went wrong.