-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement build and generator plugins (#6)
* split buid and test-gen plugins * build plugin - dockerize task * fix copy-legal-doc * add dependency onto shadowJar * use conventions * add more conventions * add gh workflows, publishing * set jdk version * update workflow * feat: implement TCK build and generator plugins
- Loading branch information
1 parent
8bb309e
commit 3ec70dc
Showing
30 changed files
with
880 additions
and
174 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,21 +49,12 @@ jobs: | |
sha: context.sha | ||
}) | ||
# create merge commit main -> releases encoding the version in the commit message | ||
- name: Merge main -> releases | ||
uses: everlytic/[email protected] | ||
with: | ||
github_token: ${{ github.token }} | ||
source_ref: ${{ github.ref }} | ||
target_branch: 'releases' | ||
commit_message_template: 'Merge commit for release of version v${{ env.TCK_VERSION }}' | ||
|
||
outputs: | ||
cvf-version: ${{ env.TCK_VERSION }} | ||
tck-version: ${{ env.TCK_VERSION }} | ||
|
||
Github-Release: | ||
# cannot use the workflow-level env yet as it does not yet exist, must take output from previous job | ||
if: ${{ !endsWith( needs.Prepare-Release.outputs.cvf-version, '-SNAPSHOT') }} | ||
if: ${{ !endsWith( needs.Prepare-Release.outputs.tck-version, '-SNAPSHOT') }} | ||
needs: | ||
- Prepare-Release | ||
runs-on: ubuntu-latest | ||
|
@@ -84,12 +75,12 @@ jobs: | |
Bump-Version: | ||
name: 'Update release version' | ||
# cannot use the workflow-level env yet as it does not yet exist, must take output from previous job | ||
if: ${{ !endsWith( needs.Prepare-Release.outputs.cvf-version, '-SNAPSHOT') }} | ||
if: ${{ !endsWith( needs.Prepare-Release.outputs.tck-version, '-SNAPSHOT') }} | ||
needs: [ Prepare-Release, Github-Release ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/bump-version | ||
with: | ||
target_branch: "main" | ||
base_version: ${{ needs.Prepare-Release.outputs.cvf-version }} | ||
base_version: ${{ needs.Prepare-Release.outputs.tck-version }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import org.eclipse.dataspacetck.gradle.tckbuild.extensions.TckBuildExtension | ||
|
||
/* | ||
* Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) | ||
* | ||
|
@@ -15,123 +17,40 @@ | |
plugins { | ||
checkstyle | ||
`maven-publish` | ||
} | ||
|
||
subprojects { | ||
|
||
// afterEvaluate { | ||
// | ||
// publishing { | ||
// publications.forEach { i -> | ||
// val mp = (i as MavenPublication) | ||
// mp.pom { | ||
// name.set(project.name) | ||
// description.set("Compliance Verification Toolkit") | ||
// url.set("https://projects.eclipse.org/projects/technology.dataspacetck") | ||
// | ||
// licenses { | ||
// license { | ||
// name.set("The Apache License, Version 2.0") | ||
// url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") | ||
// } | ||
// developers { | ||
// developer { | ||
// id.set("JimMarino") | ||
// name.set("Jim Marino") | ||
// email.set("[email protected]") | ||
// } | ||
// developer { | ||
// id.set("PaulLatzelsperger") | ||
// name.set("Paul Latzelsperger") | ||
// email.set("[email protected]") | ||
// } | ||
// developer { | ||
// id.set("EnricoRisa") | ||
// name.set("Enrico Risa") | ||
// email.set("[email protected]") | ||
// } | ||
// } | ||
// scm { | ||
// connection.set("scm:git:[email protected]:eclipse-dataspacetck/cvf.git") | ||
// url.set("https://github.com/eclipse-dataspacetck/cvf.git") | ||
// } | ||
// } | ||
// } | ||
// } | ||
// } | ||
// | ||
// } | ||
|
||
signing | ||
`java-library` | ||
`version-catalog` | ||
alias(libs.plugins.gradle.publish) apply false | ||
} | ||
|
||
|
||
// needed for running the dash tool | ||
tasks.register("allDependencies", DependencyReportTask::class) | ||
|
||
// disallow any errors | ||
checkstyle { | ||
maxErrors = 0 | ||
} | ||
|
||
allprojects{ | ||
apply(plugin = "checkstyle") | ||
apply(plugin = "maven-publish") | ||
apply(plugin = "java-library") | ||
} | ||
allprojects { | ||
apply(plugin = "org.eclipse.dataspacetck.tck-build") | ||
|
||
subprojects { | ||
publishing { | ||
publications { | ||
if(project.subprojects.isEmpty()) { | ||
create<MavenPublication>(project.name) { | ||
artifactId = project.name | ||
from(components["java"]) | ||
} | ||
} | ||
} | ||
// for all gradle plugins: | ||
pluginManager.withPlugin("java-gradle-plugin") { | ||
apply(plugin = "com.gradle.plugin-publish") | ||
} | ||
|
||
afterEvaluate { | ||
publishing { | ||
publications.forEach { i -> | ||
val mp = (i as MavenPublication) | ||
mp.pom { | ||
name.set(project.name) | ||
description.set("Compliance Verification Toolkit") | ||
url.set("https://projects.eclipse.org/projects/technology.dataspacetck") | ||
|
||
licenses { | ||
license { | ||
name.set("The Apache License, Version 2.0") | ||
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") | ||
} | ||
developers { | ||
developer { | ||
id.set("JimMarino") | ||
name.set("Jim Marino") | ||
email.set("[email protected]") | ||
} | ||
developer { | ||
id.set("PaulLatzelsperger") | ||
name.set("Paul Latzelsperger") | ||
email.set("[email protected]") | ||
} | ||
developer { | ||
id.set("EnricoRisa") | ||
name.set("Enrico Risa") | ||
email.set("[email protected]") | ||
} | ||
} | ||
scm { | ||
connection.set("scm:git:[email protected]:eclipse-dataspacetck/cvf.git") | ||
url.set("https://github.com/eclipse-dataspacetck/cvf.git") | ||
} | ||
} | ||
} | ||
} | ||
// configure POM | ||
configure<TckBuildExtension> { | ||
pom { | ||
scmConnection = "https://github.com/eclipse-dataspacetck/dsp-tck.git" | ||
scmUrl = "scm:git:[email protected]:eclipse-dataspacetck/dsp-tck.git" | ||
groupId = "org.eclipse.dataspacetck.build" | ||
projectName = project.name | ||
description = "DSP Technology Compatibility Kit" | ||
projectUrl = "https://projects.eclipse.org/projects/technology.dataspacetck" | ||
} | ||
} | ||
} | ||
|
||
|
||
|
||
// FIXME - workaround for https://github.com/gradle/gradle/issues/26091 | ||
val signingTasks = tasks.withType<Sign>() | ||
tasks.withType<AbstractPublishToMaven>().configureEach { | ||
mustRunAfter(signingTasks) | ||
} | ||
} |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Contributors: | ||
* Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation | ||
* | ||
*/ | ||
|
||
plugins { | ||
`java-gradle-plugin` | ||
} | ||
|
||
group = "org.eclipse.dataspacetck.build" | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { | ||
url = uri("https://oss.sonatype.org/content/repositories/snapshots/") | ||
} | ||
gradlePluginPortal() | ||
mavenLocal() | ||
} | ||
|
||
dependencies { | ||
|
||
implementation(libs.plugin.nexus.publish) | ||
implementation(libs.plugin.docker.remoteapi) | ||
implementation(libs.plugin.nexus.publish) | ||
|
||
api(libs.tck.common.api) | ||
} | ||
|
||
gradlePlugin { | ||
plugins { | ||
create("tckBuild") { | ||
id = "org.eclipse.dataspacetck.tck-build" | ||
group = "org.eclipse.dataspacetck.build" | ||
implementationClass = "org.eclipse.dataspacetck.gradle.tckbuild.plugins.TckBuildPlugin" | ||
} | ||
} | ||
} | ||
|
||
val generatedSourcesFolder = layout.buildDirectory.asFile.get().resolve("generated").resolve("sources") | ||
|
||
sourceSets { | ||
main { | ||
java { | ||
srcDirs( | ||
generatedSourcesFolder, | ||
"../plugins/tck-build-plugin/src/main" | ||
) | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# | ||
# Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Apache License, Version 2.0 which is available at | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Contributors: | ||
# Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation | ||
# | ||
# | ||
group=org.eclipse.dataspacetck.build | ||
version=0.0.1-SNAPSHOT |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Contributors: | ||
* Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation | ||
* | ||
*/ | ||
|
||
dependencyResolutionManagement { | ||
versionCatalogs { | ||
create("libs") { | ||
from(files("../gradle/libs.versions.toml")) | ||
} | ||
} | ||
} |
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
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
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
Oops, something went wrong.