Last active
March 22, 2020 10:54
-
-
Save kigster/dc847d68aed71920e4bc902320c1188d to your computer and use it in GitHub Desktop.
Basic build helper script for building IntelliJ Plugin from sources. See http://bit.ly/intellij-bazel-plugin-from-sources for more info.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -ex | |
function intellij::build() { | |
local intellij_product="$1" # eg, "intellij-ue-2019.3" | |
local shortcut=$(echo ${intellij_product} | sed 's/-.*$//g') | |
local plugin_base= | |
case $shortcut in | |
intellij) | |
plugin_base="ijwb" | |
;; | |
clion) | |
plugin_base="clwb" | |
;; | |
android) | |
plugin_base="aswb" | |
;; | |
*) | |
echo "Invalid product detected: $intellij_product" | |
return 1 | |
esac | |
# Do not change the code below | |
local build_dir=/tmp/build_output | |
bazel \ | |
--output_user_root=${build_dir} \ | |
build //${plugin_base}:${plugin_base}_bazel_zip \ | |
--define=ij_product=${intellij_product} | |
local file="$(find ${build_dir} -name ${plugin_base}_bazel.zip)" | |
cp -v ${file} ${build_dir} | |
} | |
intellij::build ${1:-"intellij-ue-latest"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment