Is there a way to access a jar within my own gradl...
# gradle
i
Is there a way to access a jar within my own gradle plugin? Every help is welcome.
x
What do you mean "access" a jar ? You can have your plugin add a jar in a module's dependency, if that's what you're trying to do
i
I have a compiler plugin and add it in the gradle-plugin-jar here:
Copy code
jar {
  // Embed compiler plugin in jar
  from configurations.named("compileClasspath").get().find { it.name.startsWith("compiler-plugin") }

  manifest {
    attributes["Specification-Title"] = project.name
    attributes["Specification-Version"] = project.version
    attributes["Implementation-Title"] = pluginId
    attributes["Implementation-Version"] = project.version
  }
}
Now how can I add that jar to the modules dependency programmatically
m
Have you tried:
Copy code
project.dependencies {
  add("configurationName", files("path/to.jar"))
}
i
I am trying to manipulate the freeArguments of the kotlinOptions. In
compileKotlin
m
Did you mean
freeCompilerArgs
? I think you can try:
Copy code
project.tasks.withType(KotlinCompile::class).configureEach {
        kotlinOptions {
            freeCompilerArgs = listOf()
        }
    }
i
I tried that before, but it throughs:
Source entry is not a Kotlin file
, but if I write the same line in the build gradle it passes fine as expected
I am now Debugging why
I figured out what the problem was 🙂 Thanks everyone