Skip to content
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

QD-9014 Add qodana-android linter #74

Merged
merged 1 commit into from
May 8, 2024
Merged
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
18 changes: 18 additions & 0 deletions next/android/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
linux/amd64/remotedevelopment
linux/amd64/help
linux/amd64/web/asset-manifest.json
linux/amd64/web/preview.html
linux/amd64/Install-Linux-tar.txt
linux/amd64/build.txt
linux/arm64/remotedevelopment
linux/arm64/help
linux/arm64/web/asset-manifest.json
linux/arm64/web/preview.html
linux/arm64/Install-Linux-tar.txt
linux/arm64/build.txt
linux/amd64/plugins/*
linux/arm64/plugins/*
!linux/amd64/plugins/plugin-classpath.txt
!linux/arm64/plugins/plugin-classpath.txt
*.tar.gz
*.zip
97 changes: 97 additions & 0 deletions next/android/included_plugins.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
org.intellij.qodana
org.intellij.intelliLang
com.intellij.configurationScript
com.intellij.properties
com.intellij.platform.images
org.editorconfig.editorconfigjetbrains
org.jetbrains.plugins.yaml
org.jetbrains.plugins.textmate
com.jetbrains.sh
com.intellij.css
Git4Idea
hg4idea
HtmlTools
tanvd.grazi
com.intellij.database
intellij.grid.core.impl
intellij.grid.impl
intellij.charts
intellij.indexing.shared.core
intellij.indexing.shared
intellij.ktor
AntSupport
Coverage
DevKit
JUnit
Lombook Plugin
TestNG-J
XPathView
com.intellij.aop
com.intellij.beanValidation
com.intellij.cdi
com.intellij.configurationScript
com.intellij.css
com.intellij.dev
com.intellij.freemarker
com.intellij.gradle
com.intellij.hibernate
com.intellij.java
com.intellij.java-i18n
com.intellij.java.ide
com.intellij.javaee
com.intellij.javaee.jpa
com.intellij.javaee.web
com.intellij.javaee.el
com.intellij.jsp
com.intellij.microservices.jvm
com.intellij.persistence
com.intellij.platform.images
com.intellij.properties
com.intellij.reactivestreams
com.intellij.spring
com.intellij.spring.boot
com.intellij.spring.boot.initializr
com.intellij.spring.data
com.intellij.spring.integration
com.intellij.spring.messaging
com.intellij.spring.mvc
com.intellij.spring.security
com.intellij.spring.cloud
com.intellij.uiDesigner
com.intellij.velocity
org.intellij.groovy
org.jetbrains.idea.eclipse
org.jetbrains.idea.maven
org.jetbrains.idea.maven.ext
org.jetbrains.idea.gradle.ext
org.jetbrains.idea.gradle.dsl
org.jetbrains.idea.maven.model
org.jetbrains.idea.maven.server.api
org.jetbrains.idea.reposearch
org.jetbrains.kotlin
org.jetbrains.plugins.gradle
org.jetbrains.plugins.gradle.maven
com.jetbrains.restWebServices
org.jetbrains.plugins.gradle.dependency.updater
com.intellij.plugins.dependencyAnalysis
org.jetbrains.security.package-checker
com.intellij.microservices.ui
NodeJS
JavaScriptDebugger
JavaScript
JSIntentionPowerPack
com.intellij.plugins.webcomponents
Karma
XPathView
com.intellij.css
org.jetbrains.plugins.less
org.jetbrains.plugins.sass
org.jetbrains.plugins.vue
org.intellij.plugins.postcss
intellij.webpack
com.jetbrains.restClient
org.toml.lang
com.intellij.jvm.dfa.analysis
org.jetbrains.android
com.android.tools.idea.smali

42 changes: 42 additions & 0 deletions next/android/internal.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM registry.jetbrains.team/p/sa/containers/qodana:debian-js-base-latest

ARG TARGETPLATFORM
ARG DEVICEID
ENV DEVICEID=$DEVICEID
COPY $TARGETPLATFORM $QODANA_DIST
RUN chmod +x $QODANA_DIST/bin/*.sh $QODANA_DIST/bin/qodana && \
update-alternatives --install /usr/bin/java java $JAVA_HOME/bin/java 0 && \
update-alternatives --install /usr/bin/javac javac $JAVA_HOME/bin/javac 0 && \
update-alternatives --set java $JAVA_HOME/bin/java && \
update-alternatives --set javac $JAVA_HOME/bin/javac && \
rm -rf /var/cache/apt /var/lib/apt/ /tmp/*

ENV ANDROID_SDK_ROOT="/opt/android-sdk" ANDROID_USER_HOME="$QODANA_DATA/cache/android"
ENV ANDROID_HOME="$ANDROID_SDK_ROOT"
ENV ANDROID_SDK_TOOLS="$ANDROID_SDK_ROOT/cmdline-tools/tools/bin" QODANA_CORETTO_SDK="$QODANA_DATA/.jdks/corretto-11"
# IDE includes JDK17 by default since 2022, so we need additional JDK for the most projects
COPY --from=amazoncorretto:11.0.23 /usr/lib/jvm/java-11-amazon-corretto $QODANA_CORETTO_SDK

ARG ANDROID_SDK_VERSION="9123335"
ARG ANDROID_SDK_SHA256="0bebf59339eaa534f4217f8aa0972d14dc49e7207be225511073c661ae01da0a"
ARG ANDROID_API_LEVEL="33"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=SC2174
RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
--mount=target=/var/cache/apt,type=cache,sharing=locked \
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends unzip=6.0-26+deb11u1 && \
mkdir -m 777 -p $QODANA_DATA/cache $ANDROID_USER_HOME $ANDROID_SDK_ROOT $ANDROID_SDK_ROOT/cmdline-tools $ANDROID_SDK_ROOT/platforms $ANDROID_SDK_ROOT/ndk && \
echo "${ANDROID_SDK_SHA256} /tmp/android.zip" > /tmp/shasum && \
curl -fsSL -o /tmp/android.zip \
"https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip" && \
sha256sum --check --status /tmp/shasum && \
unzip -q /tmp/android.zip -d ${ANDROID_SDK_ROOT}/cmdline-tools && \
mv ${ANDROID_SDK_ROOT}/cmdline-tools/cmdline-tools ${ANDROID_SDK_ROOT}/cmdline-tools/tools && \
echo y | ${ANDROID_SDK_TOOLS}/sdkmanager "platforms;android-${ANDROID_API_LEVEL}" && \
chmod 777 -R $ANDROID_SDK_ROOT && \
apt-get purge --auto-remove -y unzip && \
rm -rf /tmp/*

LABEL maintainer="[email protected]" description="Qodana for Android (https://jb.gg/qodana-android)"
WORKDIR /data/project
ENTRYPOINT ["/opt/idea/bin/qodana"]