PerfectSlayer/gradle-dependency-submission
Calculates dependencies for a Gradle build-target and submits the list to the Dependency Submission API
gradle-dependency-submission
... calculates dependencies for a Gradle build-target and submits the list to the Dependency Submission API.
What's included ๐ โข Setup ๐ ๏ธ โข Sample ๐ฅ๏ธ โข Contribute ๐งฌ โข License ๐
What's included ๐
- Supports any Gradle project
- Uses the Gradle
dependenciestask
- Uses the Gradle
- Highly flexible configuration
- Submits all maven dependencies via the Dependency Submission API
This action executes the dependencies task of a given Gradle project, and will submit the dependency tree via the Dependency Submission API.
Setup
Configure the workflow
name: build
on:
push:
branches:
- develop # run the action on your projects default branch
jobs:
build:
name: Dependencies
runs-on: ubuntu-latest
permissions: # The Dependency Submission API requires write permission
contents: write
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
- name: Run snapshot action
uses: mikepenz/gradle-dependency-submission@{latest}
with:
gradle-project-path: "gradle-example"
gradle-build-module: ":app"
gradle-build-configuration: "debugCompileClasspath"Root Module Config
The following example showcases a gradle module in the root, without a module name, and no sub-folder.
- name: Root Gradle Dependency Submission
uses: mikepenz/gradle-dependency-submission@{latest}
with:
use-gradlew: false
gradle-build-module: |-
:
gradle-build-configuration: |-
compileClasspathMulti Module Config
- name: Gradle Dependency Submission
uses: mikepenz/gradle-dependency-submission@{latest}
with:
gradle-project-path: |-
gradle-example
gradle-build-module: |-
:app
:simple-app
gradle-build-configuration: |-
debugCompileClasspathโน๏ธ Currently the action has to be run on the default branch. Running it as part of a PR won't update the Dependency graph of your projects Insights - This seems to be a GitHub requirement.
Inputs
| Input | Description |
|---|---|
use-gradlew |
Defines if ./gradlew or gradle cli will be used to retrieve the dependencies. Defaults to 'true' e.g. ./gradlew. |
gradle-project-path |
Defines the path to the gradle project. Defaults to ''. |
gradle-build-module |
Defines the module to retrieve the dependencies for. This is often :app. Defaults to ':'. |
gradle-build-configuration |
The configuration for which dependencies are resolved. Defaults to debugCompileClasspath. Plain java projects usually use compileClasspath. |
gradle-build-configuration-mapping |
Optional configuration to allow per module build configuration mapping. Provide one mapping per line in the format like: `:module |
gradle-dependency-path |
Defines the path to the gradle dependency file, relative to the gradle-project-path. If not provided, automatically resolved via gradle and the module config. |
sub-module-mode |
Defines how the action handles sub projects/modules. Possible options IGNORE, COMBINED, INDIVIDUAL, INDIVIDUAL_DEEP. Default: IGNORE. |
| sub-module-mode | Description |
|---|---|
IGNORE |
Ignores sub projects/modules and skips over their dependencies. Only the core module is being imported. |
COMBINED |
Combines and flattens the sub dependencies, and attaches them to the root of the parent module. |
INDIVIDUAL |
Handles every single module as its own Manifest in the dependency submission API. Uses the gradle API to retrieve the module paths, and imports them individually. |
INDIVIDUAL_DEEP |
Handles every single module as its own Manifest in the dependency submission API. Will call the dependencies task for every single sub project/module to gather the full tree. Uses the gradle API to retrieve the module paths, and imports them individually. |
Sample ๐ฅ๏ธ
Contribute ๐งฌ
# Install the dependencies
$ npm install
# Verify lint is happy
$ npm run lint -- --fix
# Build the typescript and package it for distribution
$ npm run build && npm run package
# Run the tests, use to debug, and test it out
$ npm testCredits
Other actions
License
Copyright (C) 2022 Mike Penz
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
http://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.