Skip to content

Commit c9c0324

Browse files
committed
include transitive dependencies in procedural plugin
this even further simplifies the end users build.gradle scripts
1 parent 117a3cf commit c9c0324

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

procedural/plugin/build.gradle

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,15 @@ tasks.publish {
1212
dependsOn("check")
1313
}
1414

15-
version = '0.0.1'
16-
1715
publishing {
1816
publications {
19-
maven(MavenPublication)
17+
pluginMaven(MavenPublication)
2018
}
2119
repositories {
2220
maven {
23-
name = findProperty("publishing.name")
24-
url = findProperty("publishing.url")
21+
name="GitHubCopiePackages"
22+
url="https://maven.pkg.github.com/skovati/copie"
23+
version=findProperty("publishing.version")
2524
credentials {
2625
username = System.getenv("GITHUB_ACTOR")
2726
password = System.getenv("GITHUB_TOKEN")

procedural/plugin/src/main/groovy/gov.nasa.ammos.aerie.procedural.plugin.gradle

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
22

3+
// afterEvaluate ensures these dependencies are passed to projects applying this plugin, not this plugin itself
4+
project.afterEvaluate {
5+
dependencies {
6+
annotationProcessor findProject(':procedural:processor') ?: "gov.nasa.ammos.aerie.procedural:processor:${findProperty("aerieVersion")}"
7+
implementation findProject(':procedural:constraints') ?: "gov.nasa.ammos.aerie.procedural:constraints:${findProperty("aerieVersion")}"
8+
implementation findProject(':procedural:scheduling') ?: "gov.nasa.ammos.aerie.procedural:scheduling:${findProperty("aerieVersion")}"
9+
implementation findProject(':procedural:timeline') ?: "gov.nasa.ammos.aerie.procedural:timeline:${findProperty("aerieVersion")}"
10+
implementation findProject(':merlin-driver') ?: "gov.nasa.jpl.aerie:merlin-driver:${findProperty("aerieVersion")}"
11+
implementation findProject(':type-utils') ?: "gov.nasa.jpl.aerie:type-utils:${findProperty("aerieVersion")}"
12+
implementation findProject(':contrib') ?: "gov.nasa.jpl.aerie:contrib:${findProperty("aerieVersion")}"
13+
}
14+
}
15+
316
tasks.register('buildAllSchedulingProcedureJars') {
417
group = 'SchedulingProcedureJars'
518

@@ -28,16 +41,16 @@ tasks.create("generateSchedulingProcedureJarTasks") {
2841

2942
files.toList().each { file ->
3043
final nameWithoutExtension = file.name.replace(".java", "")
44+
final jarPath = nameWithoutExtension + ".jar"
3145
final taskName = "buildSchedulingProcedureJar_${nameWithoutExtension}"
3246

33-
println "Generating ${taskName} task, which will build ${nameWithoutExtension}.jar"
47+
println "Generating ${taskName} task, which will build ${jarPath}"
3448

3549
tasks.create(taskName, ShadowJar) {
3650
group = 'SchedulingProcedureJars'
37-
configurations = [project.configurations.compileClasspath]
51+
configurations = [project.configurations.runtimeClasspath]
3852
from sourceSets.main.output
39-
archiveBaseName = "" // clear
40-
archiveClassifier.set(nameWithoutExtension) // set output jar name
53+
archiveFileName = jarPath
4154
manifest {
4255
attributes 'Main-Class': getMainClassFromGeneratedFile(file)
4356
}

0 commit comments

Comments
 (0)