https://kotlinlang.org logo
Title
b

baob

08/27/2017, 11:48 AM
I’ve been hacking away with attempts like
sourceSets.main.kotlin.srcDirs = ['src']
but even that doesn’t seem to do it
x

x80486

08/27/2017, 2:51 PM
When you are about to start a Gradle project,
cd
into the project's directory and do
gradle init
. That will provide you with some structure right away and some other files you are going to need, like the Gradle wrapper. Then execute Gradle commands with the same:
./gradlew run
, or
./gradlew clean assemble
...depending on the task(s) you have available
One of the reasons you need to redefine the
sourceSets
is because you are not using the default/standard structure. You can go either way, but I would prefer to have that. Something like:
.
├── build.gradle
├── gradle
│   └── wrapper
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── README.asciidoc
├── settings.gradle
└── src
    ├── main
    │   ├── kotlin
    │   │   └── io
    │   │       └── shido
    │   │           ├── Application.kt
    │   │           ├── core
    │   │           │   ├── handler
    │   │           │   │   ├── AuthRequestHandler.kt
    │   │           │   │   └── UserRequestHandler.kt
    │   │           │   └── verticle
    │   │           │       ├── AuthVerticle.kt
    │   │           │       ├── HttpServerVerticle.kt
    │   │           └── domain
    │   │               └── KeyCard.kt
    │   └── resources
    │       ├── cluster.xml
    │       ├── config.json
    │       ├── logback.xml
    │       ├── server-cert.pem
    │       ├── server-key.pem
    │       └── ValidationMessages.properties
    └── test
        ├── kotlin
        │   └── io
        │       └── shido
        │           └── domain
        │               └── KeyCardTest.kt
        └── resources
            └── logback-test.xml
b

baob

08/27/2017, 3:17 PM
Found the problem, I was told the main class name was based on the file name hence i mapped
hello.kt
to
helloKt
… turns out the right mapping was
HelloKt
Thanks @x80486 I had already guessed there might be a
gradle init
but the source I started with gave me a supposedly working
build.gradle
so I didn’t backtrack that far. I will certainly play with it, thanks.
👍 1
r

rocketraman

08/27/2017, 4:28 PM
My fault on the name mapping, sorry about that. Glad you found the issue!
Its pretty idomatic in Java/Kotlin that your file names are capitalized... and if you had done so the mapping from
Hello.kt
to
HelloKt
would have been clear...
b

baob

08/27/2017, 9:00 PM
@rocketraman No probs … I discovered the right mapping when I un-tarred the jar file … the contained files all used
HelloKt