File tree Expand file tree Collapse file tree 3 files changed +26
-3
lines changed
Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 3939 - name : Build gradle project
4040 run : ./gradlew build
4141
42- # Run Build API
42+ # Run main using gradle
4343 - name : Run Main
4444 run : ./gradlew runMainKotlin
Original file line number Diff line number Diff line change 1- ## compile-run-kotlin-java-using-github-action
1+ ## Compile and Run Kotlin / Java Using Github Action
2+ [ ![ Main CI] ( https://github.com/amirisback/compile-run-kotlin-java-using-github-action/actions/workflows/ci.yml/badge.svg )] ( https://github.com/amirisback/compile-run-kotlin-java-using-github-action/actions/workflows/ci.yml )
23
34## Screen Shot
5+ ![ ss] ( docs/image/ss-1.png?raw=true )
46
57## How To Use
8+ ### Step 1 : Create task on build.gradle.kts
9+ - Create Task and Register to build.gradle.kts like below
10+ - Sample Task Name : runMainKotlin
11+ ``` kts
12+ tasks.register (" runMainKotlin" , JavaExec ::class .java) {
13+ description = " Compile and Run Main Kotlin"
14+ classpath = sourceSets[" main" ].runtimeClasspath
15+ // note the addition of "Kt" on the end of the class name.
16+
17+ // package name
18+ mainClass.set(" io.github.amirisback.MainKt" )
19+ }
20+ ```
21+
22+ ### Step 2 : Add to CI.yml
23+ - Call the function that has been created in the build.gradle.kts file
24+ - Sample Function : runMainKotlin
25+ ``` yml
26+ # Run main using gradle
27+ - name : Run Main
28+ run : ./gradlew runMainKotlin
29+ ` ` `
630
731### Tools
832- Intellij IDEA
933- Kotlin v 1.8.0
1034
11-
1235## Colaborator
1336Very open to anyone, I'll write your name under this, please contribute by sending an email to me
1437
You can’t perform that action at this time.
0 commit comments