Gradle秘境:添加一个类似modCompileOnly的依赖块

FabricLoom 里有类似 modCompileOnly、modApi、modImplementation、modRuntimeOnly 配置块,那应该怎么做才能在自己的 Gradle 插件里实现类似的功能?