Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

815
Visualizações
Build gradle script with modules on kotlin

I want to migrate from groovy to kotlin dsl in my gradle build script. I have 2 scripts in the project: build.gradle and publish-maven.gradle that attaches in the first one.

For groovy I apply script so:

apply from: "${rootProject.projectDir}/publish-maven.gradle"

For kotlin I found the same code will be look like:

apply(from = "publish-maven.gradle.kts")

But publish-maven.gradle.kts don't attaches to build.gradle.kts. At the top of the script in IDE constantly hangs warning:

Code insight unavailable (configuration for this script wasn't received during the last Gradle project import)

and kotlin syntax don't recognized.

I try also

apply(from = "${rootProject.projectDir}/publish-maven.gradle.kts")

or have found other examples but non of them helped.

What have I do to apply this script? Or the general question is how can I split build script into several files?

Gradle version: 6.7; JDK: 1.8; IDE: IntellijIdea

over 4 years ago · Hanz Gallego
1 Respostas
Responde à pergunta

0

In my case, a fix for "Code insight unavailable" message in Intellij was to add references to my subprojects in settings.gradle.kts file.

I've tried to set a Gradle project with two subprojects: "app" and "core". I didn't follow the examples correctly and I didn't include references in settings.gradle.kts.

settings.gradle.kts

rootProject.name = "MyProject"

include("app", "core") // <-- Line added

After reloading the Gradle project in the IDE, everything was fine.

While I might not be answering your question specifically (I'm sorry for that), this is one of very few results for searching "Code insight unavailable" in the search engine, so I hope someone will find this answer useful.

over 4 years ago · Hanz Gallego Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda