Skip to content

Commit

Permalink
Add a community directory for hosting plugin contributions from the…
Browse files Browse the repository at this point in the history
… patch reward program.

PiperOrigin-RevId: 399949449
Change-Id: I8ac90fb0c1931a82233bbdb063f29af48bcee606
  • Loading branch information
Tsunami Team authored and copybara-github committed Sep 30, 2021
1 parent aae7c99 commit 7cf999a
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/community-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: community-plugins-build

on:
push:
paths:
- 'community/**'
pull_request:
paths:
- 'community/**'

jobs:
build:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
java: [ 8, 11 ]
runs-on: ${{ matrix.os }}
name: 'Build Community plugins on ${{ matrix.os }} using Java ${{ matrix.java }}'
steps:
- name: 'Check out repository'
uses: actions/checkout@v2
- name: 'Set up JDK ${{ matrix.java }}'
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: 'Cache Gradle resources'
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: 'Build Community plugins'
run: ./community/build_all.sh
7 changes: 7 additions & 0 deletions community/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Tsunami Plugins by Community Members

This directory contains plugins contributed by community members.

## Currently released plugins

### Detectors
35 changes: 35 additions & 0 deletions community/build_all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -eu

SCRIPT_PATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
GENERATED_PLUGINS_PATH="${SCRIPT_PATH}/build/plugins"
mkdir -p "${GENERATED_PLUGINS_PATH}"

# For each community plugin, build the jar file and copy it to build/plugins
# folder.
for plugin_dir in $(find "${SCRIPT_PATH}" -name 'gradlew' -print0 | xargs -0 -n1 dirname | sort -u); do
plugin_name="${plugin_dir##*"${SCRIPT_PATH}/"}"
printf "\nBuilding ${plugin_name}...\n"

pushd "${plugin_dir}" >/dev/null

./gradlew build
cp ./build/libs/*.jar "${GENERATED_PLUGINS_PATH}"

popd >/dev/null
done

0 comments on commit 7cf999a

Please sign in to comment.