-
Notifications
You must be signed in to change notification settings - Fork 697
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EXPOSED-668 Update the "Modules" topic and extract examples to snippe…
…ts projects (#2361)
- Loading branch information
Showing
12 changed files
with
289 additions
and
166 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
documentation-website/Writerside/snippets/exposed-modules-groovy-gradle/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Exposed Groovy Gradle example project | ||
|
||
An auto-generated Groovy Gradle project containing the core Exposed dependencies. | ||
The `build.gradle` file of this project is referenced by line in the | ||
[Exposed-Modules](../../topics/Exposed-Modules.md) topic. | ||
|
||
## Build | ||
|
||
To build the application, in a terminal window navigate to the `snippets` folder and run the following command: | ||
|
||
```shell | ||
./gradlew :exposed-modules-groovy-gradle:build | ||
``` |
26 changes: 26 additions & 0 deletions
26
documentation-website/Writerside/snippets/exposed-modules-groovy-gradle/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' version '2.0.20' | ||
} | ||
|
||
group = 'com.example' | ||
version = '1.0-SNAPSHOT' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation "org.jetbrains.exposed:exposed-core:0.58.0" | ||
implementation "org.jetbrains.exposed:exposed-jdbc:0.58.0" | ||
implementation "org.jetbrains.exposed:exposed-dao:0.58.0" //optional | ||
implementation "com.h2database:h2:2.2.224" | ||
implementation "org.slf4j:slf4j-nop:1.7.30" | ||
testImplementation 'org.jetbrains.kotlin:kotlin-test' | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
kotlin { | ||
jvmToolchain(17) | ||
} |
5 changes: 5 additions & 0 deletions
5
...ite/Writerside/snippets/exposed-modules-groovy-gradle/src/main/kotlin/com/example/Main.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.example | ||
|
||
fun main() { | ||
println("Hello World!") | ||
} |
13 changes: 13 additions & 0 deletions
13
documentation-website/Writerside/snippets/exposed-modules-kotlin-gradle/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Exposed Kotlin Gradle example project | ||
|
||
An auto-generated Kotlin Gradle project containing the core Exposed dependencies. | ||
The `build.gradle.kts` file of this project is referenced by line in the | ||
[Exposed-Modules](../../topics/Exposed-Modules.md) topic. | ||
|
||
## Build | ||
|
||
To build the application, in a terminal window navigate to the `snippets` folder and run the following command: | ||
|
||
```shell | ||
./gradlew :exposed-modules-kotlin-gradle:build | ||
``` |
26 changes: 26 additions & 0 deletions
26
documentation-website/Writerside/snippets/exposed-modules-kotlin-gradle/build.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
plugins { | ||
kotlin("jvm") version "2.0.20" | ||
} | ||
|
||
group = "com.example" | ||
version = "1.0-SNAPSHOT" | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation("org.jetbrains.exposed:exposed-core:0.58.0") | ||
implementation("org.jetbrains.exposed:exposed-jdbc:0.58.0") | ||
implementation("org.jetbrains.exposed:exposed-dao:0.58.0") // Optional | ||
implementation("com.h2database:h2:2.2.224") | ||
implementation("org.slf4j:slf4j-nop:1.7.30") | ||
testImplementation(kotlin("test")) | ||
} | ||
|
||
tasks.test { | ||
useJUnitPlatform() | ||
} | ||
kotlin { | ||
jvmToolchain(17) | ||
} |
5 changes: 5 additions & 0 deletions
5
...ite/Writerside/snippets/exposed-modules-kotlin-gradle/src/main/kotlin/com/example/Main.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.example | ||
|
||
fun main() { | ||
println("Hello World!") | ||
} |
13 changes: 13 additions & 0 deletions
13
documentation-website/Writerside/snippets/exposed-modules-maven/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Exposed Maven example project | ||
|
||
An auto-generated Maven project containing the core Exposed dependencies. | ||
The `pom.xml` file of this project is referenced by line in the | ||
[Exposed-Modules](../../topics/Exposed-Modules.md) topic. | ||
|
||
## Build | ||
|
||
To build the application, in a terminal window navigate to the `snippets` folder and run the following command: | ||
|
||
```shell | ||
./gradlew :exposed-modules-maven:build | ||
``` |
113 changes: 113 additions & 0 deletions
113
documentation-website/Writerside/snippets/exposed-modules-maven/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.example</groupId> | ||
<artifactId>exposed-modules-maven</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<kotlin.code.style>official</kotlin.code.style> | ||
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget> | ||
</properties> | ||
|
||
<repositories> | ||
<repository> | ||
<id>mavenCentral</id> | ||
<url>https://repo1.maven.org/maven2/</url> | ||
</repository> | ||
</repositories> | ||
|
||
<build> | ||
<sourceDirectory>src/main/kotlin</sourceDirectory> | ||
<testSourceDirectory>src/test/kotlin</testSourceDirectory> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<artifactId>kotlin-maven-plugin</artifactId> | ||
<version>2.0.20</version> | ||
<executions> | ||
<execution> | ||
<id>compile</id> | ||
<phase>compile</phase> | ||
<goals> | ||
<goal>compile</goal> | ||
</goals> | ||
</execution> | ||
<execution> | ||
<id>test-compile</id> | ||
<phase>test-compile</phase> | ||
<goals> | ||
<goal>test-compile</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>2.22.2</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-failsafe-plugin</artifactId> | ||
<version>2.22.2</version> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<version>1.6.0</version> | ||
<configuration> | ||
<mainClass>MainKt</mainClass> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<artifactId>kotlin-test-junit5</artifactId> | ||
<version>2.0.20</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
<version>5.10.0</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<artifactId>kotlin-stdlib</artifactId> | ||
<version>2.0.20</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jetbrains.exposed</groupId> | ||
<artifactId>exposed-core</artifactId> | ||
<version>0.58.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jetbrains.exposed</groupId> | ||
<artifactId>exposed-jdbc</artifactId> | ||
<version>0.58.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jetbrains.exposed</groupId> | ||
<artifactId>exposed-dao</artifactId> | ||
<version>0.58.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.h2database</groupId> | ||
<artifactId>h2</artifactId> | ||
<version>2.2.224</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-nop</artifactId> | ||
<version>1.7.30</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
5 changes: 5 additions & 0 deletions
5
...ion-website/Writerside/snippets/exposed-modules-maven/src/main/kotlin/com/example/Main.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.example | ||
|
||
fun main() { | ||
println("Hello World!") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.