File tree 3 files changed +26
-3
lines changed
3 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 39
39
- name : Build gradle project
40
40
run : ./gradlew build
41
41
42
- # Run Build API
42
+ # Run main using gradle
43
43
- name : Run Main
44
44
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 )
2
3
3
4
## Screen Shot
5
+ ![ ss] ( docs/image/ss-1.png?raw=true )
4
6
5
7
## 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
+ ` ` `
6
30
7
31
### Tools
8
32
- Intellij IDEA
9
33
- Kotlin v 1.8.0
10
34
11
-
12
35
## Colaborator
13
36
Very open to anyone, I'll write your name under this, please contribute by sending an email to me
14
37
You can’t perform that action at this time.
0 commit comments