-
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.
chore: Switch to gradle publish plugin
- Loading branch information
Showing
7 changed files
with
234 additions
and
96 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ concurrency: snapshot | |
on: | ||
push: | ||
branches: | ||
- main | ||
- feature-45-work | ||
|
||
jobs: | ||
deployment: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,35 +17,119 @@ | |
* | ||
*/ | ||
|
||
repositories { | ||
gradlePluginPortal() | ||
google() | ||
mavenCentral() | ||
} | ||
|
||
plugins { | ||
alias(libs.plugins.pluginPublishing) | ||
signing | ||
`kotlin-dsl` | ||
`java-gradle-plugin` | ||
publish | ||
// publish | ||
version | ||
} | ||
|
||
group = "org.eclipse.kuksa" | ||
version = rootProject.extra["projectVersion"].toString() | ||
|
||
gradlePlugin { | ||
website.set("https://github.com/eclipse-kuksa/kuksa-android-sdk") | ||
vcsUrl.set("https://github.com/eclipse-kuksa/kuksa-android-sdk") | ||
plugins { | ||
create("VssProcessorPlugin") { | ||
id = "org.eclipse.kuksa.vss-processor-plugin" | ||
implementationClass = "org.eclipse.kuksa.vssprocessor.plugin.VssProcessorPlugin" | ||
displayName = "Vss Processor Plugin" | ||
tags.set(listOf("KUKSA", "Vehicle Signal Specification", "VSS", "android", "kotlin")) | ||
description = "Vehicle Signal Specification (VSS) Plugin of the KUKSA SDK. This is used in combination " + | ||
"with the KSP processor component 'KUKSA VSS Processor'. The plugin is configured to provide " + | ||
"VSS Files to KSP processor. This is mandatory to use the 'KUKSA VSS Processor' component." | ||
} | ||
} | ||
} | ||
|
||
group = "org.eclipse.kuksa" | ||
version = rootProject.extra["projectVersion"].toString() | ||
afterEvaluate { | ||
publishing { | ||
repositories { | ||
maven { | ||
name = "OSSRHRelease" | ||
|
||
dependencies { | ||
implementation(kotlin("stdlib")) | ||
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") | ||
credentials { | ||
username = System.getenv("ORG_OSSRH_USERNAME") | ||
password = System.getenv("ORG_OSSRH_PASSWORD") | ||
} | ||
} | ||
maven { | ||
name = "OSSRHSnapshot" | ||
|
||
url = uri("https://oss.sonatype.org/content/repositories/snapshots/") | ||
credentials { | ||
username = System.getenv("ORG_OSSRH_USERNAME") | ||
password = System.getenv("ORG_OSSRH_PASSWORD") | ||
} | ||
} | ||
} | ||
publications { | ||
getByName<MavenPublication>("pluginMaven") { | ||
pom { | ||
licenses { | ||
license { | ||
name.set("The Apache Software License, Version 2.0") | ||
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") | ||
} | ||
} | ||
developers { | ||
developer { | ||
name = "Mark Hüsers" | ||
email = "[email protected]" | ||
organization = "ETAS GmbH" | ||
organizationUrl = "https://www.etas.com" | ||
} | ||
developer { | ||
name = "Sebastian Schildt" | ||
email = "[email protected]" | ||
organization = "ETAS GmbH" | ||
organizationUrl = "https://www.etas.com" | ||
} | ||
developer { | ||
name = "Andre Weber" | ||
email = "[email protected]" | ||
organization = "ETAS GmbH" | ||
organizationUrl = "https://www.etas.com" | ||
} | ||
} | ||
scm { | ||
connection.set("scm:git:github.com/eclipse-kuksa/kuksa-android-sdk.git") | ||
developerConnection.set("scm:git:ssh://github.com/eclipse-kuksa/kuksa-android-sdk.git") | ||
url.set("https://github.com/eclipse-kuksa/kuksa-android-sdk/tree/main") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
var keyId: String? = System.getenv("ORG_GPG_KEY_ID") | ||
if (keyId != null && keyId.length > 8) { | ||
keyId = keyId.takeLast(8) | ||
} | ||
val privateKey = System.getenv("ORG_GPG_PRIVATE_KEY") | ||
val passphrase = System.getenv("ORG_GPG_PASSPHRASE") | ||
|
||
useInMemoryPgpKeys( | ||
keyId, | ||
privateKey, | ||
passphrase, | ||
) | ||
|
||
sign(publishing.publications) | ||
|
||
setRequired({ | ||
val publishToMavenLocalTask = gradle.taskGraph.allTasks.find { it.name.contains("ToMavenLocal") } | ||
val isPublishingToMavenLocal = publishToMavenLocalTask != null | ||
|
||
!isPublishingToMavenLocal // disable signing when publishing to MavenLocal | ||
}) | ||
} | ||
} | ||
|
||
publish { | ||
description = "Vehicle Signal Specification (VSS) Plugin of the KUKSA SDK" | ||
dependencies { | ||
implementation(kotlin("stdlib")) | ||
} |
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 |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
*/ | ||
|
||
plugins { | ||
`maven-publish` | ||
// id("com.gradle.plugin-publish") | ||
signing | ||
} | ||
|
||
|
@@ -28,82 +28,87 @@ interface PublishPluginExtension { | |
|
||
val extension = project.extensions.create<PublishPluginExtension>("publish") | ||
|
||
afterEvaluate { | ||
publishing { | ||
repositories { | ||
maven { | ||
name = "OSSRHRelease" | ||
//afterEvaluate { | ||
// publishing { | ||
// repositories { | ||
// maven { | ||
// name = "OSSRHRelease" | ||
// | ||
// url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") | ||
// credentials { | ||
// username = System.getenv("ORG_OSSRH_USERNAME") | ||
// password = System.getenv("ORG_OSSRH_PASSWORD") | ||
// } | ||
// } | ||
// maven { | ||
// name = "OSSRHSnapshot" | ||
// | ||
// url = uri("https://oss.sonatype.org/content/repositories/snapshots/") | ||
// credentials { | ||
// username = System.getenv("ORG_OSSRH_USERNAME") | ||
// password = System.getenv("ORG_OSSRH_PASSWORD") | ||
// } | ||
// } | ||
// } | ||
// publications { | ||
// getByName<MavenPublication>("pluginMaven") { | ||
// pom { | ||
// name = "${project.group}:${project.name}" | ||
// description = extension.description.get() | ||
// url = "https://github.com/eclipse-kuksa/kuksa-android-sdk" | ||
// licenses { | ||
// license { | ||
// name.set("The Apache Software License, Version 2.0") | ||
// url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") | ||
// } | ||
// } | ||
// developers { | ||
// developer { | ||
// name = "Mark Hüsers" | ||
// email = "[email protected]" | ||
// organization = "ETAS GmbH" | ||
// organizationUrl = "https://www.etas.com" | ||
// } | ||
// developer { | ||
// name = "Sebastian Schildt" | ||
// email = "[email protected]" | ||
// organization = "ETAS GmbH" | ||
// organizationUrl = "https://www.etas.com" | ||
// } | ||
// developer { | ||
// name = "Andre Weber" | ||
// email = "[email protected]" | ||
// organization = "ETAS GmbH" | ||
// organizationUrl = "https://www.etas.com" | ||
// } | ||
// } | ||
// scm { | ||
// connection.set("scm:git:github.com/eclipse-kuksa/kuksa-android-sdk.git") | ||
// developerConnection.set("scm:git:ssh://github.com/eclipse-kuksa/kuksa-android-sdk.git") | ||
// url.set("https://github.com/eclipse-kuksa/kuksa-android-sdk/tree/main") | ||
// } | ||
// } | ||
// } | ||
// } | ||
// } | ||
// | ||
// signing { | ||
// var keyId: String? = System.getenv("ORG_GPG_KEY_ID") | ||
// if (keyId != null && keyId.length > 8) { | ||
// keyId = keyId.takeLast(8) | ||
// } | ||
// val privateKey = System.getenv("ORG_GPG_PRIVATE_KEY") | ||
// val passphrase = System.getenv("ORG_GPG_PASSPHRASE") | ||
// | ||
// useInMemoryPgpKeys( | ||
// keyId, | ||
// privateKey, | ||
// passphrase, | ||
// ) | ||
// } | ||
//} | ||
|
||
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") | ||
credentials { | ||
username = System.getenv("ORG_OSSRH_USERNAME") | ||
password = System.getenv("ORG_OSSRH_PASSWORD") | ||
} | ||
} | ||
maven { | ||
name = "OSSRHSnapshot" | ||
|
||
url = uri("https://oss.sonatype.org/content/repositories/snapshots/") | ||
credentials { | ||
username = System.getenv("ORG_OSSRH_USERNAME") | ||
password = System.getenv("ORG_OSSRH_PASSWORD") | ||
} | ||
} | ||
} | ||
publications { | ||
getByName<MavenPublication>("pluginMaven") { | ||
pom { | ||
name = "${project.group}:${project.name}" | ||
description = extension.description.get() | ||
url = "https://github.com/eclipse-kuksa/kuksa-android-sdk" | ||
licenses { | ||
license { | ||
name.set("The Apache Software License, Version 2.0") | ||
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") | ||
} | ||
} | ||
developers { | ||
developer { | ||
name = "Mark Hüsers" | ||
email = "[email protected]" | ||
organization = "ETAS GmbH" | ||
organizationUrl = "https://www.etas.com" | ||
} | ||
developer { | ||
name = "Sebastian Schildt" | ||
email = "[email protected]" | ||
organization = "ETAS GmbH" | ||
organizationUrl = "https://www.etas.com" | ||
} | ||
developer { | ||
name = "Andre Weber" | ||
email = "[email protected]" | ||
organization = "ETAS GmbH" | ||
organizationUrl = "https://www.etas.com" | ||
} | ||
} | ||
scm { | ||
connection.set("scm:git:github.com/eclipse-kuksa/kuksa-android-sdk.git") | ||
developerConnection.set("scm:git:ssh://github.com/eclipse-kuksa/kuksa-android-sdk.git") | ||
url.set("https://github.com/eclipse-kuksa/kuksa-android-sdk/tree/main") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
var keyId: String? = System.getenv("ORG_GPG_KEY_ID") | ||
if (keyId != null && keyId.length > 8) { | ||
keyId = keyId.takeLast(8) | ||
} | ||
val privateKey = System.getenv("ORG_GPG_PRIVATE_KEY") | ||
val passphrase = System.getenv("ORG_GPG_PASSPHRASE") | ||
|
||
useInMemoryPgpKeys( | ||
keyId, | ||
privateKey, | ||
passphrase, | ||
) | ||
} | ||
} | ||
//gradlePlugin { | ||
// website = "<substitute your project website>" | ||
// vcsUrl = "<uri to project source repository>" | ||
//} |
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,42 @@ | ||
/* | ||
* Copyright (c) 2023 Contributors to the Eclipse Foundation | ||
* | ||
* 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. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
*/ | ||
|
||
pluginManagement { | ||
repositories { | ||
gradlePluginPortal() | ||
google() | ||
mavenCentral() | ||
} | ||
} | ||
|
||
dependencyResolutionManagement { | ||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) | ||
repositories { | ||
mavenLocal() | ||
google() | ||
mavenCentral() | ||
} | ||
versionCatalogs { | ||
create("libs") { | ||
from(files("../gradle/libs.versions.toml")) | ||
} | ||
} | ||
} | ||
|
||
rootProject.name = "vss-processor-plugin" |
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