LoginSignup
4
3

More than 5 years have passed since last update.

Gradleでアプリを実行する

Last updated at Posted at 2019-03-26

GradleでKotlinプロジェクトを一撃生成するの続き。

Gradleでアプリを実行するコマンド:

./gradlew run

実行結果。src/main/kotlin/io/suin/hellogradle/App.ktがビルドされたのに実行され、Hello worldが出力される:

> Task :run
Hello world.

BUILD SUCCESSFUL in 2s
2 actionable tasks: 2 executed

gradle runだけで、どうしてApp.ktを選択されるかというと、build.gradle.ktsapplication.mainClassNameio.suin.hellogradle.AppKtを指定しているため。

build.gradle.kts
...
application {
    // Define the main class for the application.
    mainClassName = "io.suin.hellogradle.AppKt"
}

次のステップ

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3