Skip to content

Commit 9c9c1d7

Browse files
committed
update
1 parent a314950 commit 9c9c1d7

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ jobs:
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

README.md

+25-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,37 @@
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
1336
Very open to anyone, I'll write your name under this, please contribute by sending an email to me
1437

docs/image/ss-1.png

105 KB
Loading

0 commit comments

Comments
 (0)