From c9c032442ab979e0999d328d3c3d339a42d6a452 Mon Sep 17 00:00:00 2001 From: "(skovati) Luke" Date: Mon, 14 Oct 2024 13:46:08 -0700 Subject: [PATCH] include transitive dependencies in procedural plugin this even further simplifies the end users build.gradle scripts --- procedural/plugin/build.gradle | 9 ++++---- ....nasa.ammos.aerie.procedural.plugin.gradle | 21 +++++++++++++++---- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/procedural/plugin/build.gradle b/procedural/plugin/build.gradle index e0d2e910d9..0ccca48b49 100644 --- a/procedural/plugin/build.gradle +++ b/procedural/plugin/build.gradle @@ -12,16 +12,15 @@ tasks.publish { dependsOn("check") } -version = '0.0.1' - publishing { publications { - maven(MavenPublication) + pluginMaven(MavenPublication) } repositories { maven { - name = findProperty("publishing.name") - url = findProperty("publishing.url") + name="GitHubCopiePackages" + url="https://maven.pkg.github.com/skovati/copie" + version=findProperty("publishing.version") credentials { username = System.getenv("GITHUB_ACTOR") password = System.getenv("GITHUB_TOKEN") diff --git a/procedural/plugin/src/main/groovy/gov.nasa.ammos.aerie.procedural.plugin.gradle b/procedural/plugin/src/main/groovy/gov.nasa.ammos.aerie.procedural.plugin.gradle index 6200d471dc..d317f79237 100644 --- a/procedural/plugin/src/main/groovy/gov.nasa.ammos.aerie.procedural.plugin.gradle +++ b/procedural/plugin/src/main/groovy/gov.nasa.ammos.aerie.procedural.plugin.gradle @@ -1,5 +1,18 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar +// afterEvaluate ensures these dependencies are passed to projects applying this plugin, not this plugin itself +project.afterEvaluate { + dependencies { + annotationProcessor findProject(':procedural:processor') ?: "gov.nasa.ammos.aerie.procedural:processor:${findProperty("aerieVersion")}" + implementation findProject(':procedural:constraints') ?: "gov.nasa.ammos.aerie.procedural:constraints:${findProperty("aerieVersion")}" + implementation findProject(':procedural:scheduling') ?: "gov.nasa.ammos.aerie.procedural:scheduling:${findProperty("aerieVersion")}" + implementation findProject(':procedural:timeline') ?: "gov.nasa.ammos.aerie.procedural:timeline:${findProperty("aerieVersion")}" + implementation findProject(':merlin-driver') ?: "gov.nasa.jpl.aerie:merlin-driver:${findProperty("aerieVersion")}" + implementation findProject(':type-utils') ?: "gov.nasa.jpl.aerie:type-utils:${findProperty("aerieVersion")}" + implementation findProject(':contrib') ?: "gov.nasa.jpl.aerie:contrib:${findProperty("aerieVersion")}" + } +} + tasks.register('buildAllSchedulingProcedureJars') { group = 'SchedulingProcedureJars' @@ -28,16 +41,16 @@ tasks.create("generateSchedulingProcedureJarTasks") { files.toList().each { file -> final nameWithoutExtension = file.name.replace(".java", "") + final jarPath = nameWithoutExtension + ".jar" final taskName = "buildSchedulingProcedureJar_${nameWithoutExtension}" - println "Generating ${taskName} task, which will build ${nameWithoutExtension}.jar" + println "Generating ${taskName} task, which will build ${jarPath}" tasks.create(taskName, ShadowJar) { group = 'SchedulingProcedureJars' - configurations = [project.configurations.compileClasspath] + configurations = [project.configurations.runtimeClasspath] from sourceSets.main.output - archiveBaseName = "" // clear - archiveClassifier.set(nameWithoutExtension) // set output jar name + archiveFileName = jarPath manifest { attributes 'Main-Class': getMainClassFromGeneratedFile(file) }