Skip to content

Commit

Permalink
Sonatype Gradle Plugin (#954)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdelamo authored Jan 9, 2025
1 parent 81741bc commit e20cad2
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 13 deletions.
22 changes: 15 additions & 7 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
{
"extends": [
"config:base"
"config:recommended"
],
"addLabels": [
"type: dependency-upgrade"
],
"addLabels": ["type: dependency-upgrade"],
"schedule": [
"after 10pm every day"
"after 10pm"
],
"prHourlyLimit": 1,
"prConcurrentLimit": 20,
"timezone": "Europe/Prague",
"packageRules": [
{
"matchPackagePatterns": ["actions.*"],
"dependencyDashboardApproval": true,
"matchUpdateTypes": ["patch"],
"matchUpdateTypes": [
"patch"
],
"matchCurrentVersion": "!/^0/",
"automerge": true
"automerge": true,
"matchPackageNames": [
"/actions.*/"
]
},
{
"matchUpdateTypes": ["patch"],
"matchUpdateTypes": [
"patch"
],
"matchCurrentVersion": "!/^0/",
"automerge": true
}
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
PREDICTIVE_TEST_SELECTION: "${{ github.event_name == 'pull_request' && 'true' || 'false' }}"
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OSS_INDEX_USERNAME: ${{ secrets.OSS_INDEX_USERNAME }}
OSS_INDEX_PASSWORD: ${{ secrets.OSS_INDEX_PASSWORD }}
steps:
# https://github.com/actions/virtual-environments/issues/709
- name: "🗑 Free disk space"
Expand Down Expand Up @@ -58,6 +60,11 @@ jobs:
run: |
[ -f ./setup.sh ] && ./setup.sh || [ ! -f ./setup.sh ]
- name: "🚔 Sonatype Scan"
id: sonatypescan
run: |
./gradlew ossIndexAudit --no-parallel --info
- name: "🛠 Build with Gradle"
id: gradle
run: |
Expand Down
1 change: 1 addition & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ repositories {

dependencies {
implementation libs.micronaut.gradle.plugin
implementation(libs.sonatype.scan)
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
plugins {
id("io.micronaut.build.internal.views-base")
id("io.micronaut.build.internal.module")
id("org.sonatype.gradle.plugins.scan")
}
String ossIndexUsername = System.getenv("OSS_INDEX_USERNAME") ?: project.properties["ossIndexUsername"]
String ossIndexPassword = System.getenv("OSS_INDEX_PASSWORD") ?: project.properties["ossIndexPassword"]
boolean sonatypePluginConfigured = ossIndexUsername != null && ossIndexPassword != null
if (sonatypePluginConfigured) {
ossIndexAudit {
username = ossIndexUsername
password = ossIndexPassword
}
}

6 changes: 4 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ pebble = "3.2.2"
thymeleaf-extra-java8time = "3.0.4.RELEASE"
kotlin = "1.9.25"
kotlinx-coroutines = "1.9.0"

sonatype-scan = "3.0.0"
micronaut-logging = "1.5.1"

micronaut-grpc = "4.8.0"
[libraries]
# Core
micronaut-grpc = { module = "io.micronaut.grpc:micronaut-grpc-bom", version.ref = "micronaut-grpc" }
micronaut-core = { module = 'io.micronaut:micronaut-core-bom', version.ref = 'micronaut' }
micronaut-sql = { module = "io.micronaut.sql:micronaut-sql-bom", version.ref = "micronaut-sql" }
micronaut-logging = { module = "io.micronaut.logging:micronaut-logging-bom", version.ref = "micronaut-logging" }
Expand Down Expand Up @@ -61,6 +62,7 @@ groovy-json = { module = "org.apache.groovy:groovy-json" }

graal-polyglot = { module = "org.graalvm.polyglot:polyglot", version.ref = "graal" }
graal-js = { module = "org.graalvm.polyglot:js", version.ref = "graal" }
sonatype-scan = { module = "org.sonatype.gradle.plugins:scan-gradle-plugin", version.ref = "sonatype-scan" }

[plugins]
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
Expand Down
3 changes: 1 addition & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ micronautBuild {
importMicronautCatalog()
importMicronautCatalog("micronaut-data")
importMicronautCatalog("micronaut-sql")
importMicronautCatalog("micronaut-grpc")
importMicronautCatalog("micronaut-security")
importMicronautCatalog("micronaut-serde")
importMicronautCatalog("micronaut-validation")
Expand Down
5 changes: 3 additions & 2 deletions views-soy/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ dependencies {
api(libs.managed.soy) {
exclude(group = "org.json", module = "json")
}
implementation(mnGrpc.protobuf.java) // apply com.google.protobuf:protobuf-java directly because the version brought transitively contains a vulnerable version.
implementation(libs.org.json)

compileOnly(mn.micronaut.management)
compileOnly(mnValidation.micronaut.validation)
compileOnly(mn.micronaut.http)
Expand All @@ -25,4 +25,5 @@ dependencies {
testImplementation(mn.micronaut.management)
testImplementation(mnValidation.micronaut.validation)
testImplementation(mn.snakeyaml)
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public String getTemplateName() {
public Map<String, SoyValueProvider> getParamsAsMap() {
return null;
}

});
renderer.setData(context);
if (injectNonce) {
Expand Down

0 comments on commit e20cad2

Please sign in to comment.