Skip to content

Commit

Permalink
fix libs.versions.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
richardtreier committed Oct 16, 2024
1 parent ba46a2b commit b3e51c5
Show file tree
Hide file tree
Showing 12 changed files with 162 additions and 306 deletions.
72 changes: 26 additions & 46 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,6 @@ dependencies {
testRuntimeOnly(libs.junit.engine)
}

val downloadArtifact: Configuration by configurations.creating {
isTransitive = false
}


val identityHubVersion: String by project
val registrationServiceVersion: String by project

// task that downloads the RegSrv CLI and IH CLI
val getJars by tasks.registering(Copy::class) {
outputs.upToDateWhen { false } //always download

from(downloadArtifact)
// strip away the version string
.rename { s ->
s.replace("-${identityHubVersion}", "")
.replace("-${registrationServiceVersion}", "")
.replace("-all", "")
}
into(layout.projectDirectory.dir("libs/cli-tools"))
}

// run the download jars task after the "jar" task
tasks {
jar {
finalizedBy(getJars)
}
}

allprojects {
apply(plugin = "java")
apply(plugin = "checkstyle")
Expand All @@ -60,7 +31,7 @@ allprojects {

useJUnitPlatform {
if (runningOnGithub) {
excludeTags = setOf("not-on-github")
excludeTags = setOf("exclude-on-github")
}
}

Expand All @@ -70,6 +41,7 @@ allprojects {
showExceptions = true
showCauses = true
}

failFast = true
}

Expand All @@ -88,17 +60,11 @@ allprojects {
}
maven {
url = uri("https://maven.pkg.github.com/truzzt/mds-ap3")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") as String? ?: System.getenv("TOKEN")
}
withGitHubCredentials()
}
maven {
url = uri("https://maven.pkg.github.com/ids-basecamp/ids-infomodel-java")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") as String? ?: System.getenv("TOKEN")
}
withGitHubCredentials()
}
maven {
url =
Expand All @@ -109,31 +75,45 @@ allprojects {
}

subprojects {
val libs = rootProject.libs

apply(plugin = "maven-publish")

val sovityEdcExtensionsVersion: String by project
version = sovityEdcExtensionsVersion
version = libs.versions.sovityCeVersion.get()

publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/sovity/edc-ce")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") as String? ?: System.getenv("TOKEN")
}
withGitHubCredentials()
}
}
}

tasks.register("printClasspath") {
group = libs.versions.edcGroup.get()
description = "The EdcRuntimeExtension JUnit Extension requires the gradle task 'printClasspath'"
group = libs.versions.sovityEdcGroup.get()
description = "Prints the classpath so EDC Integration tests can load a runtime of a full EDC including modules in tests"
println(sourceSets.main.get().runtimeClasspath.asPath)
}

java {
withSourcesJar()
}
}

fun MavenArtifactRepository.withGitHubCredentials() {
val gitHubUser = System.getenv("USERNAME")
?: project.findProperty("gpr.user") as String?
val gitHubToken = System.getenv("TOKEN")
?: project.findProperty("gpr.key") as String?

if (gitHubUser.isNullOrBlank() || gitHubToken.isNullOrBlank()) {
error("Need Gradle Properties 'gpr.user' and 'gpr.key' or environment variables 'USERNAME' and 'TOKEN' with a GitHub PAT to access the GitHub Maven Repository.")
}

credentials {
username = gitHubUser
password = gitHubToken
}
}
12 changes: 5 additions & 7 deletions extensions/postgres-flyway/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ dependencies {
implementation(libs.postgres)
implementation(libs.hikari)

implementation("org.eclipse.edc:sql-pool-apache-commons:${edcVersion}")

implementation("org.eclipse.edc:data-plane-instance-store-sql:${edcVersion}")
implementation("org.eclipse.edc:edr-index-sql:${edcVersion}")
implementation("org.eclipse.edc:policy-monitor-store-sql:${edcVersion}")

testImplementation(libs.edc.junit)
// TODO check which ones are required in the EDC CE
implementation(libs.edc.sqlPoolApacheCommons)
implementation(libs.edc.dataPlaneInstanceStoreSql)
implementation(libs.edc.edrIndexSql)
implementation(libs.edc.policyMonitorStoreSql)
}

group = libs.versions.sovityEdcExtensionGroup.get()
Expand Down
4 changes: 0 additions & 4 deletions extensions/sovity-messenger/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ dependencies {
testImplementation(libs.edc.jsonLdLib)
}

tasks.getByName<Test>("test") {
useJUnitPlatform()
}

publishing {
publications {
create<MavenPublication>(project.name) {
Expand Down
12 changes: 1 addition & 11 deletions extensions/wrapper/wrapper/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,7 @@ dependencies {
testImplementation(libs.edc.dsp)
testImplementation(libs.edc.iamMock)
testImplementation(libs.edc.junit)
testImplementation(libs.edc.http) {
exclude(group = "org.eclipse.jetty", module = "jetty-client")
exclude(group = "org.eclipse.jetty", module = "jetty-http")
exclude(group = "org.eclipse.jetty", module = "jetty-io")
exclude(group = "org.eclipse.jetty", module = "jetty-server")
exclude(group = "org.eclipse.jetty", module = "jetty-util")
exclude(group = "org.eclipse.jetty", module = "jetty-webapp")
}

// Updated jetty versions for e.g. CVE-2023-26048
testImplementation(libs.bundles.jetty.cve2023)
testImplementation(libs.edc.http)

testImplementation(libs.edc.controlPlaneSql)
testImplementation(libs.edc.contractNegotiationStoreSql)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sovityEdcExtensionsVersion=0.0.1-SNAPSHOT
sovityEdcExtensionsVersion=0.0.2-SNAPSHOT

org.gradle.jvmargs=-Xmx1024m
org.gradle.parallel=true
Loading

0 comments on commit b3e51c5

Please sign in to comment.