Skip to content

Commit f746151

Browse files
authored
Merge pull request #2 from nebula-plugins/add-nebula-publishing
add nebula plugins to enable publishing
2 parents 38ef9d5 + 7b1120c commit f746151

File tree

12 files changed

+190
-26
lines changed

12 files changed

+190
-26
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,7 @@ on:
66
pull_request:
77

88
jobs:
9-
validation:
10-
name: "Gradle Wrapper Validation"
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: actions/checkout@v4
14-
- uses: gradle/actions/wrapper-validation@v4
159
buildmultijdk:
16-
needs: validation
1710
runs-on: ubuntu-latest
1811
strategy:
1912
matrix:
@@ -40,6 +33,6 @@ jobs:
4033
with:
4134
cache-overwrite-existing: true
4235
- name: Gradle build
43-
run: ./gradlew --info --stacktrace build
36+
run: ./gradlew --stacktrace build
4437
env:
4538
JDK_VERSION_FOR_TESTS: ${{ matrix.java }}

.github/workflows/publish.yml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,7 @@ on:
66
- v*.*.*-rc.*
77

88
jobs:
9-
validation:
10-
name: "Gradle Wrapper Validation"
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: actions/checkout@v4
14-
- uses: gradle/actions/wrapper-validation@v4
159
validatepluginpublication:
16-
needs: validation
1710
runs-on: ubuntu-latest
1811
name: Gradle Plugin Publication Validation
1912
env:
@@ -38,10 +31,8 @@ jobs:
3831
with:
3932
cache-overwrite-existing: true
4033
- name: Verify plugin publication
41-
if: |
42-
startsWith(github.ref, 'refs/tags/v') &&
43-
(!contains(github.ref, '-rc.'))
44-
run: ./gradlew --stacktrace -Dgradle.publish.key=${{ secrets.gradlePublishKey }} -Dgradle.publish.secret=${{ secrets.gradlePublishSecret }} -Prelease.useLastTag=true final publishPlugin --validate-only -x check -x signPluginMavenPublication
34+
if: (!contains(github.ref, '-rc.'))
35+
run: ./gradlew --stacktrace -Dgradle.publish.key=${{ secrets.gradlePublishKey }} -Dgradle.publish.secret=${{ secrets.gradlePublishSecret }} -Prelease.useLastTag=true final publishPlugin --validate-only -x check
4536
publish:
4637
if: github.event.base_ref == 'refs/heads/main' # tags must be pushed to main
4738
needs: validatepluginpublication
@@ -75,12 +66,8 @@ jobs:
7566
- name: Gradle build
7667
run: ./gradlew --stacktrace build
7768
- name: Publish candidate
78-
if: |
79-
startsWith(github.ref, 'refs/tags/v') &&
80-
contains(github.ref, '-rc.')
69+
if: contains(github.ref, '-rc.')
8170
run: ./gradlew --info --stacktrace -Prelease.useLastTag=true candidate
8271
- name: Publish release
83-
if: |
84-
startsWith(github.ref, 'refs/tags/v') &&
85-
(!contains(github.ref, '-rc.'))
72+
if: (!contains(github.ref, '-rc.'))
8673
run: ./gradlew --info --stacktrace -Dgradle.publish.key=${{ secrets.gradlePublishKey }} -Dgradle.publish.secret=${{ secrets.gradlePublishSecret }} -Prelease.useLastTag=true final

build.gradle.kts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1-
1+
plugins {
2+
id("com.netflix.nebula.root")
3+
}
24
tasks.wrapper {
35
distributionType = Wrapper.DistributionType.ALL // ALL helps when debugging gradle plugins
46
gradleVersion = "9.1.0"
57
distributionSha256Sum = "b84e04fa845fecba48551f425957641074fcc00a88a84d2aae5808743b35fc85"
68
}
9+
dependencyLocking {
10+
lockAllConfigurations()
11+
}
12+
contacts {
13+
addPerson("nebula-plugins-oss@netflix.com") {
14+
moniker = "Nebula Plugins Maintainers"
15+
github = "nebula-plugins"
16+
}
17+
}

gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
org.gradle.caching=true
2+
org.gradle.configuration-cache=true
3+
systemProp.nebula.features.coreLockingSupport=true
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
plugins {
2+
id("com.netflix.nebula.library")
3+
}
4+
description = "Core library for authoring and running Nebula ArchRules"
5+
repositories {
6+
mavenCentral()
7+
}
8+
dependencies {
9+
api("com.tngtech.archunit:archunit:1.4.1")
10+
}
11+
testing {
12+
suites {
13+
named<JvmTestSuite>("test") {
14+
useJUnitJupiter()
15+
}
16+
}
17+
}
18+
java {
19+
toolchain {
20+
languageVersion = JavaLanguageVersion.of(11)
21+
}
22+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This is a Gradle generated file for dependency locking.
2+
# Manual edits can break the build and are not advised.
3+
# This file is expected to be part of source control.
4+
com.tngtech.archunit:archunit:1.4.1=compileClasspath,testCompileClasspath,testRuntimeClasspath
5+
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath
6+
org.junit.jupiter:junit-jupiter-api:5.12.2=testCompileClasspath,testRuntimeClasspath
7+
org.junit.jupiter:junit-jupiter-engine:5.12.2=testRuntimeClasspath
8+
org.junit.jupiter:junit-jupiter-params:5.12.2=testCompileClasspath,testRuntimeClasspath
9+
org.junit.jupiter:junit-jupiter:5.12.2=testCompileClasspath,testRuntimeClasspath
10+
org.junit.platform:junit-platform-commons:1.12.2=testCompileClasspath,testRuntimeClasspath
11+
org.junit.platform:junit-platform-engine:1.12.2=testRuntimeClasspath
12+
org.junit.platform:junit-platform-launcher:1.12.2=testRuntimeClasspath
13+
org.junit:junit-bom:5.12.2=testCompileClasspath,testRuntimeClasspath
14+
org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath
15+
org.slf4j:slf4j-api:2.0.17=compileClasspath,testCompileClasspath,testRuntimeClasspath
16+
empty=annotationProcessor,testAnnotationProcessor
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
plugins {
2+
id("com.netflix.nebula.plugin-plugin")
3+
`kotlin-dsl`
4+
}
5+
description = "Plugins for authoring and running Nebula ArchRules"
6+
repositories {
7+
mavenCentral()
8+
}
9+
gradlePlugin {
10+
plugins {
11+
create("library") {
12+
id = "com.netflix.nebula.archrules.library"
13+
implementationClass = "com.netflix.nebula.archrules.gradle.ArchrulesLibraryPlugin"
14+
displayName = "ArchRules Library Plugin"
15+
description = "Sets up a project for declaring archrules to be used in another project via the runner plugin"
16+
tags.addAll("nebula", "archunit")
17+
}
18+
create("runner") {
19+
id = "com.netflix.nebula.archrules.runner"
20+
implementationClass = "com.netflix.nebula.archrules.gradle.ArchrulesRunnerPlugin"
21+
displayName = "ArchRules Runner Plugin"
22+
description = "Sets up a project to consume archrules libraries and run them against the code in the current project"
23+
tags.addAll("nebula", "archunit")
24+
}
25+
}
26+
}
27+
java {
28+
toolchain {
29+
languageVersion = JavaLanguageVersion.of(11)
30+
}
31+
}
32+
testing {
33+
suites{
34+
named<JvmTestSuite>("test"){
35+
useJUnitJupiter()
36+
}
37+
}
38+
}
39+
dependencyLocking {
40+
lockAllConfigurations()
41+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# This is a Gradle generated file for dependency locking.
2+
# Manual edits can break the build and are not advised.
3+
# This file is expected to be part of source control.
4+
cglib:cglib-nodep:3.2.2=integTestRuntimeClasspath,testRuntimeClasspath
5+
com.netflix.nebula:nebula-test:11.7.1=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
6+
net.bytebuddy:byte-buddy:1.15.11=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
7+
org.apiguardian:apiguardian-api:1.1.2=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
8+
org.assertj:assertj-core:3.27.3=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
9+
org.jetbrains.kotlin:kotlin-assignment-compiler-plugin-embeddable:2.2.0=kotlinCompilerPluginClasspathIntegTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
10+
org.jetbrains.kotlin:kotlin-build-tools-api:2.2.0=kotlinBuildToolsApiClasspath
11+
org.jetbrains.kotlin:kotlin-build-tools-impl:2.2.0=kotlinBuildToolsApiClasspath
12+
org.jetbrains.kotlin:kotlin-compiler-embeddable:2.2.0=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath
13+
org.jetbrains.kotlin:kotlin-compiler-runner:2.2.0=kotlinBuildToolsApiClasspath
14+
org.jetbrains.kotlin:kotlin-daemon-client:2.2.0=kotlinBuildToolsApiClasspath
15+
org.jetbrains.kotlin:kotlin-daemon-embeddable:2.2.0=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath
16+
org.jetbrains.kotlin:kotlin-reflect:1.6.10=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath
17+
org.jetbrains.kotlin:kotlin-reflect:2.2.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
18+
org.jetbrains.kotlin:kotlin-sam-with-receiver-compiler-plugin-embeddable:2.2.0=kotlinCompilerPluginClasspathIntegTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
19+
org.jetbrains.kotlin:kotlin-script-runtime:2.2.0=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathIntegTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
20+
org.jetbrains.kotlin:kotlin-scripting-common:2.2.0=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathIntegTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
21+
org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:2.2.0=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathIntegTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
22+
org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:2.2.0=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathIntegTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
23+
org.jetbrains.kotlin:kotlin-scripting-jvm:2.2.0=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathIntegTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest
24+
org.jetbrains.kotlin:kotlin-stdlib:2.2.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathIntegTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,testCompileClasspath,testRuntimeClasspath
25+
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.8.0=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath
26+
org.jetbrains:annotations:13.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathIntegTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,testCompileClasspath,testRuntimeClasspath
27+
org.jspecify:jspecify:1.0.0=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
28+
org.junit.jupiter:junit-jupiter-api:5.12.2=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
29+
org.junit.jupiter:junit-jupiter-engine:5.12.2=integTestRuntimeClasspath,testRuntimeClasspath
30+
org.junit.jupiter:junit-jupiter-params:5.12.2=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
31+
org.junit.jupiter:junit-jupiter:5.12.2=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
32+
org.junit.platform:junit-platform-commons:1.14.0=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
33+
org.junit.platform:junit-platform-engine:1.14.0=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
34+
org.junit.platform:junit-platform-launcher:1.14.0=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
35+
org.objenesis:objenesis:2.4=integTestRuntimeClasspath,testRuntimeClasspath
36+
org.opentest4j:opentest4j:1.3.0=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
37+
empty=annotationProcessor,integTestAnnotationProcessor,integTestKotlinScriptDefExtensions,kotlinScriptDefExtensions,runtimeClasspath,testAnnotationProcessor,testKotlinScriptDefExtensions
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.netflix.nebula.archrules.gradle
2+
3+
import org.gradle.api.Plugin
4+
import org.gradle.api.Project
5+
6+
class ArchrulesLibraryPlugin : Plugin<Project> {
7+
override fun apply(target: Project) {
8+
}
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.netflix.nebula.archrules.gradle
2+
3+
import org.gradle.api.Plugin
4+
import org.gradle.api.Project
5+
6+
class ArchrulesRunnerPlugin : Plugin<Project> {
7+
override fun apply(target: Project) {
8+
}
9+
}

0 commit comments

Comments
 (0)