dev.clojurephant.clojure plugin using gradle kotlin dsl Error : Unresolved reference: aotAll

Viewed 19

I've clojure project using gradle. The project is on github here.

The build.gradle is -

plugins {
    id 'dev.clojurephant.clojure' version '0.7.0'
    id 'application'
}

group 'org.example'
version '0.0.1-SNAPSHOT'

repositories {
    maven {
        name = 'Clojars'
        url = 'https://repo.clojars.org'
    }
    mavenCentral()
}


dependencies {
    implementation 'org.clojure:clojure:1.11.1'

    testRuntimeOnly 'dev.clojurephant:jovial:0.4.1'

    devImplementation 'org.clojure:tools.namespace:1.3.0'

    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.0'
}

tasks.withType(Test) {
    useJUnitPlatform()
}

clojure {
    builds {
        main {
            aotAll()
        }
    }
}

I'm converting the above file gradle dsl. The project is on github here. Below is the converted build file build.gradle.kts -

plugins {
    id("java")
    id("dev.clojurephant.clojure") version "0.7.0"
    id("application")
}

group = "org.example"
version = "1.0-SNAPSHOT"

repositories {
    mavenCentral()
    mavenLocal()
    maven(url =  "https://repo.clojars.org/")
}

dependencies {
    implementation ("org.clojure:clojure:1.11.1")
    testRuntimeOnly ("dev.clojurephant:jovial:0.4.1")
    compileOnly ("org.clojure:tools.namespace:1.3.0")
    testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.0")
}

clojure {
    builds {
        main {
            aotAll()
        }
    }
}


application {
    mainClass.set("main.main")
}


The below clojure extension is giving error -

clojure {
    builds {
        main {
            aotAll()
        }
    }
}

The error is -

  • Where: Build file '/Users/rnatarajan/Documents/Coding/others/clojure-gradle-kts-demo/build.gradle.kts' line: 25

  • What went wrong: Script compilation errors:

    Line 25: main { ^ Expression 'main' cannot be invoked as a function. The function 'invoke()' is not found

    Line 25: main { ^ Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: public val DistributionContainer.main: NamedDomainObjectProvider defined in org.gradle.kotlin.dsl public val SourceSetContainer.main: NamedDomainObjectProvider defined in org.gradle.kotlin.dsl

    Line 26: aotAll() ^ Unresolved reference: aotAll

3 errors

0 Answers
Related