Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Groovy test #14

Merged
merged 1 commit into from
Jun 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/main/kotlin/nmcp/NmcpAggregation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import org.gradle.api.artifacts.Configuration
import org.gradle.api.provider.Property
import javax.inject.Inject


abstract class NmcpAggregation @Inject constructor(
private val configuration: Configuration,
private val project: Project,
Expand Down
76 changes: 76 additions & 0 deletions tests/groovy/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
plugins {
id("org.jetbrains.kotlin.jvm").version("1.9.22").apply(false)
id("com.gradleup.nmcp").version("0.0.7")
}

group = "net.mbonnin.tnmcp"
version = "0.0.4"

subprojects {
pluginManager.apply("org.jetbrains.kotlin.jvm")
pluginManager.apply("maven-publish")
pluginManager.apply("signing")
version = rootProject.version

publishing.publications {
create("default", MavenPublication) {
from(project.components.findByName("java"))
artifact(tasks.register("emptySources", Jar) {
archiveClassifier = "sources"
})
artifact(tasks.register("emptyDocs", Jar) {
archiveClassifier = "javadoc"
})

groupId = project.rootProject.group.toString()
version = project.rootProject.version.toString()
artifactId = project.name

pom {
name.set(project.name)
packaging = "jar"
description.set(project.name)
url.set("https://github.com/martinbonnin/test-nmcp")

scm {
url.set("https://github.com/martinbonnin/test-nmcp")
connection.set("https://github.com/martinbonnin/test-nmcp")
developerConnection.set("https://github.com/martinbonnin/test-nmcp")
}

licenses {
license {
name.set("MIT License")
url.set("https://github.com/martinbonnin/test-nmcp/blob/master/LICENSE")
}
}

developers {
developer {
id.set("mbonnin")
name.set("mbonnin")
}
}
}
}
}

signing {
sign(publishing.publications)
useInMemoryPgpKeys(
System.getenv("GPG_PRIVATE_KEY"),
System.getenv("GPG_PRIVATE_KEY_PASSWORD")
)
}
tasks.withType(Sign.class) {
enabled = System.getenv("GPG_PRIVATE_KEY") != null
}
}

nmcp {
publishAllProjectsProbablyBreakingProjectIsolation {
username = System.getenv("MAVEN_CENTRAL_USERNAME")
password = System.getenv("MAVEN_CENTRAL_PASSWORD")
publicationType = "USER_MANAGED"
}
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package net.mbonnin.test.nmcp1

val hello = "Hello from module1"
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package net.mbonnin.test.nmcp2

val hello = "Hello from module2"
11 changes: 11 additions & 0 deletions tests/groovy/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pluginManagement {
includeBuild("../../")
listOf(repositories, dependencyResolutionManagement.repositories).forEach {
it.apply {
mavenCentral()
google()
}
}
}

include(":module1", ":module2")
Loading