https://kotlinlang.org logo
#kotless
Title
# kotless
h

hymnfortheweekend

01/18/2020, 8:35 AM
I have same problem with this issue (https://github.com/JetBrains/kotless/issues/14)! But solution in issue doesn't work at me :C How to solve this problem?
t

TanVD

01/18/2020, 9:44 AM
Well, to fix it I’ll need a little bit more of a background :) Could you DM me exception and config?)
h

hymnfortheweekend

01/18/2020, 9:47 AM
Copy code
plugins {
    kotlin("jvm") version "1.3.50" apply true
    id("io.kotless") version "0.1.2" apply true
}

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

repositories {
    jcenter()
    mavenCentral()
}

dependencies {
    implementation(kotlin("stdlib-jdk8"))
    implementation("io.kotless", "lang", "0.1.2")
}

tasks {
    compileKotlin {
        kotlinOptions.jvmTarget = "1.8"
    }
    compileTestKotlin {
        kotlinOptions.jvmTarget = "1.8"
    }
}
Copy code
A problem occurred configuring root project 'KotlessDemo'.
> Cannot get property 'kotless' on extra properties extension as it does not exist
That's all!
t

TanVD

01/18/2020, 9:52 AM
So, the problem is that you don`t have a
kotless { ... }
block in you config. Without it Kotless is not able to apply during import of Gradle project and you get exception
Copy code
kotless {
    config {
        bucket = "<http://kotless.s3.example.com|kotless.s3.example.com>"
        
        dsl {
            type = DSLType.Kotless
            //or for Ktor
            //type = DSLType.Ktor
        }

        terraform {
            profile = "example"
            region = "us-east-1"
        }
    }

    webapp {
        route53 = Route53("kotless", "<http://example.com|example.com>")

        //configuration of lambda created
        lambda {            
            //needed only for Kotless DSL
            kotless {
                //Define packages in which scan for routes should be performed
                packages = setOf("io.kotless.examples")
            }
        }
    }
}
^ Such block I mean
h

hymnfortheweekend

01/18/2020, 10:15 AM
aha
id("io.kotless") version "0.1.2" apply true
requires that settings! thanks!
👍 1
umm.. I faced another issue! I configured build.gradle.kts but when I execute deploy, this error shows
Failed to get existing workspaces: InvalidBucketName: The specified bucket is not valid.
How can I solve this problem?
Ah resolved! I wrote url in bucket url but it was bucket name..
t

TanVD

01/18/2020, 1:19 PM
Yep :)
6 Views