Skip to content

Commit 6b88846

Browse files
authored
Merge pull request #300 from mightyguava/kotlin
Kotlin prototype
2 parents 3e2e83d + 2a39eb0 commit 6b88846

47 files changed

Lines changed: 3217 additions & 92 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci-kotlin.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: sqlc kotlin test suite
2+
on: [push, pull_request]
3+
jobs:
4+
5+
build:
6+
name: Build And Test
7+
runs-on: ubuntu-latest
8+
9+
services:
10+
postgres:
11+
image: postgres:11
12+
env:
13+
POSTGRES_USER: postgres
14+
POSTGRES_PASSWORD: postgres
15+
POSTGRES_DB: postgres
16+
ports:
17+
- 5432:5432
18+
# needed because the postgres container does not provide a healthcheck
19+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
20+
21+
steps:
22+
- uses: actions/checkout@master
23+
- uses: actions/setup-java@v1
24+
with:
25+
java-version: 11
26+
- uses: eskatos/gradle-command-action@v1
27+
env:
28+
PG_USER: postgres
29+
PG_HOST: localhost
30+
PG_DATABASE: postgres
31+
PG_PASSWORD: postgres
32+
PG_PORT: ${{ job.services.postgres.ports['5432'] }}
33+
with:
34+
build-root-directory: examples/kotlin
35+
wrapper-directory: examples/kotlin
36+
arguments: test --scan

examples/kotlin/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/.gradle/
2+
/.idea/
3+
/build/
4+
/out/

examples/kotlin/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Kotlin examples
2+
3+
This is a Kotlin gradle project configured to compile and test all examples. Currently tests have only been written for the `authors` example.
4+
5+
To run tests:
6+
7+
```shell script
8+
./gradlew clean test
9+
```
10+
11+
The project can be easily imported into Intellij.
12+
13+
1. Install Java if you don't already have it
14+
1. Download Intellij IDEA Community Edition
15+
1. In the "Welcome" modal, click "Import Project"
16+
1. Open the `build.gradle` file adjacent to this README file
17+
1. Wait for Intellij to sync the gradle modules and complete indexing

examples/kotlin/build.gradle

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
plugins {
2+
id 'org.jetbrains.kotlin.jvm' version '1.3.60'
3+
}
4+
5+
group 'com.example'
6+
version '1.0-SNAPSHOT'
7+
8+
repositories {
9+
mavenCentral()
10+
}
11+
12+
dependencies {
13+
implementation 'org.postgresql:postgresql:42.2.9'
14+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
15+
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
16+
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
17+
}
18+
19+
test {
20+
useJUnitPlatform()
21+
}
22+
23+
compileKotlin {
24+
kotlinOptions.jvmTarget = "1.8"
25+
}
26+
compileTestKotlin {
27+
kotlinOptions.jvmTarget = "1.8"
28+
}
29+
30+
buildScan {
31+
termsOfServiceUrl = "https://gradle.com/terms-of-service"
32+
termsOfServiceAgree = "yes"
33+
}

examples/kotlin/gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
kotlin.code.style=official
53.9 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Sat Jan 25 10:45:34 EST 2020
2+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
3+
distributionBase=GRADLE_USER_HOME
4+
distributionPath=wrapper/dists
5+
zipStorePath=wrapper/dists
6+
zipStoreBase=GRADLE_USER_HOME

examples/kotlin/gradlew

Lines changed: 172 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/kotlin/gradlew.bat

Lines changed: 84 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/kotlin/settings.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
plugins {
2+
id("com.gradle.enterprise").version("3.1.1")
3+
}
4+
5+
rootProject.name = 'dbtest'

0 commit comments

Comments
 (0)