mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-10-17 23:17:38 +00:00
Load the CC API with services loaders
This is a little odd (it's more complex for one!), but means we can reuse the internal API interface in other classes, which is useful for the data provider refactor I'm about to do. This is much nicer in Java 17 :D (records, ServiceLoader.stream()), but such is the perils of still targetting 1.16.
This commit is contained in:
20
buildSrc/src/main/kotlin/cc/tweaked/gradle/Extensions.kt
Normal file
20
buildSrc/src/main/kotlin/cc/tweaked/gradle/Extensions.kt
Normal file
@@ -0,0 +1,20 @@
|
||||
package cc.tweaked.gradle
|
||||
|
||||
import org.gradle.api.artifacts.dsl.DependencyHandler
|
||||
import org.gradle.api.tasks.JavaExec
|
||||
|
||||
fun DependencyHandler.annotationProcessorEverywhere(dep: Any) {
|
||||
add("compileOnly", dep)
|
||||
add("annotationProcessor", dep)
|
||||
|
||||
add("testCompileOnly", dep)
|
||||
add("testAnnotationProcessor", dep)
|
||||
}
|
||||
|
||||
fun JavaExec.copyToFull(spec: JavaExec) {
|
||||
copyTo(spec)
|
||||
spec.classpath = classpath
|
||||
spec.mainClass.set(mainClass)
|
||||
spec.javaLauncher.set(javaLauncher)
|
||||
spec.args = args
|
||||
}
|
Reference in New Issue
Block a user