Marlow Fawn
03/14/2024, 7:46 PMVampire
03/14/2024, 7:52 PMMarlow Fawn
03/14/2024, 8:10 PMMarlow Fawn
03/14/2024, 8:10 PMVampire
03/14/2024, 8:11 PMMarlow Fawn
03/14/2024, 8:12 PMMarlow Fawn
03/14/2024, 8:18 PMsourceSets {
val A: SourceSet by creating {
dependencies {
implementation(X)
}
[additional sources]
}
And in my subproject:
sourceSets{
val demoConfig: SourceSet by creating {
java {
srcDir("examples/robots")
include(listOf("demo.java"))
compileClasspath += rootProject.sourceSets.getByName("A").output + rootProject.sourceSets.getByName("A").compileClasspath
runtimeClasspath += rootProject.sourceSets.getByName("A").output + rootProject.sourceSets.getByName("A").runtimeClasspath
}
}
}
tasks.register<JavaExec>("run-demo") {
classpath = project.sourceSets.getByName("demoConfig").runtimeClasspath + sourceSets.getByName("demoConfig").output
workingDir = rootDir
mainClass = "examples.robots.Demo"
}
tasks.getByName("compileDemoConfigJava").dependsOn("compileAJava")
Marlow Fawn
03/14/2024, 8:19 PMMarlow Fawn
03/14/2024, 8:19 PMMarlow Fawn
03/14/2024, 8:33 PMVampire
03/14/2024, 8:47 PMimplementationConfigurationName
from A
, get the configuration with that name, and declare the dependencies thereVampire
03/14/2024, 8:48 PMVampire
03/14/2024, 8:48 PMVampire
03/14/2024, 8:48 PMMarlow Fawn
03/15/2024, 4:49 PMdependencies {
configurations.getByName("AImplementation")([depend])
}
These dependencies resolve but don't seem to be in the classpath, which leads me to believe I'm doing something wrong. But adding the AImplementation classpath to A feels wrong as well.Marlow Fawn
03/15/2024, 4:52 PMMarlow Fawn
03/15/2024, 5:17 PMVampire
03/15/2024, 5:46 PMjava-library
plugin. That's almost all it does actuallyMarlow Fawn
03/15/2024, 6:19 PMVampire
03/15/2024, 6:39 PMjava-library
, you will automatically get aApi
Marlow Fawn
03/21/2024, 4:04 PMVampire
03/21/2024, 5:30 PM