Skip to content

Commit eca1899

Browse files
committed
EXPOSED-668 Update the "Modules" topic and extract examples to snippets projects
1 parent 5c86640 commit eca1899

File tree

12 files changed

+289
-166
lines changed

12 files changed

+289
-166
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Exposed Groovy Gradle example project
2+
3+
An auto-generated Groovy Gradle project containing the core Exposed dependencies.
4+
The `build.gradle` file of this project is referenced by line in the
5+
[Exposed-Modules](../../topics/Exposed-Modules.md) topic.
6+
7+
## Build
8+
9+
To build the application, in a terminal window navigate to the `snippets` folder and run the following command:
10+
11+
```shell
12+
./gradlew :exposed-modules-groovy-gradle:build
13+
```
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
plugins {
2+
id 'org.jetbrains.kotlin.jvm' version '2.0.20'
3+
}
4+
5+
group = 'com.example'
6+
version = '1.0-SNAPSHOT'
7+
8+
repositories {
9+
mavenCentral()
10+
}
11+
12+
dependencies {
13+
implementation "org.jetbrains.exposed:exposed-core:0.58.0"
14+
implementation "org.jetbrains.exposed:exposed-jdbc:0.58.0"
15+
implementation "org.jetbrains.exposed:exposed-dao:0.58.0" //optional
16+
implementation "com.h2database:h2:2.2.224"
17+
implementation "org.slf4j:slf4j-nop:1.7.30"
18+
testImplementation 'org.jetbrains.kotlin:kotlin-test'
19+
}
20+
21+
test {
22+
useJUnitPlatform()
23+
}
24+
kotlin {
25+
jvmToolchain(17)
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package com.example
2+
3+
fun main() {
4+
println("Hello World!")
5+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Exposed Kotlin Gradle example project
2+
3+
An auto-generated Kotlin Gradle project containing the core Exposed dependencies.
4+
The `build.gradle.kts` file of this project is referenced by line in the
5+
[Exposed-Modules](../../topics/Exposed-Modules.md) topic.
6+
7+
## Build
8+
9+
To build the application, in a terminal window navigate to the `snippets` folder and run the following command:
10+
11+
```shell
12+
./gradlew :exposed-modules-kotlin-gradle:build
13+
```
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
plugins {
2+
kotlin("jvm") version "2.0.20"
3+
}
4+
5+
group = "com.example"
6+
version = "1.0-SNAPSHOT"
7+
8+
repositories {
9+
mavenCentral()
10+
}
11+
12+
dependencies {
13+
implementation("org.jetbrains.exposed:exposed-core:0.58.0")
14+
implementation("org.jetbrains.exposed:exposed-jdbc:0.58.0")
15+
implementation("org.jetbrains.exposed:exposed-dao:0.58.0") // Optional
16+
implementation("com.h2database:h2:2.2.224")
17+
implementation("org.slf4j:slf4j-nop:1.7.30")
18+
testImplementation(kotlin("test"))
19+
}
20+
21+
tasks.test {
22+
useJUnitPlatform()
23+
}
24+
kotlin {
25+
jvmToolchain(17)
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package com.example
2+
3+
fun main() {
4+
println("Hello World!")
5+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Exposed Maven example project
2+
3+
An auto-generated Maven project containing the core Exposed dependencies.
4+
The `pom.xml` file of this project is referenced by line in the
5+
[Exposed-Modules](../../topics/Exposed-Modules.md) topic.
6+
7+
## Build
8+
9+
To build the application, in a terminal window navigate to the `snippets` folder and run the following command:
10+
11+
```shell
12+
./gradlew :exposed-modules-maven:build
13+
```
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>com.example</groupId>
8+
<artifactId>exposed-modules-maven</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
11+
<properties>
12+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13+
<kotlin.code.style>official</kotlin.code.style>
14+
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
15+
</properties>
16+
17+
<repositories>
18+
<repository>
19+
<id>mavenCentral</id>
20+
<url>https://repo1.maven.org/maven2/</url>
21+
</repository>
22+
</repositories>
23+
24+
<build>
25+
<sourceDirectory>src/main/kotlin</sourceDirectory>
26+
<testSourceDirectory>src/test/kotlin</testSourceDirectory>
27+
<plugins>
28+
<plugin>
29+
<groupId>org.jetbrains.kotlin</groupId>
30+
<artifactId>kotlin-maven-plugin</artifactId>
31+
<version>2.0.20</version>
32+
<executions>
33+
<execution>
34+
<id>compile</id>
35+
<phase>compile</phase>
36+
<goals>
37+
<goal>compile</goal>
38+
</goals>
39+
</execution>
40+
<execution>
41+
<id>test-compile</id>
42+
<phase>test-compile</phase>
43+
<goals>
44+
<goal>test-compile</goal>
45+
</goals>
46+
</execution>
47+
</executions>
48+
</plugin>
49+
<plugin>
50+
<artifactId>maven-surefire-plugin</artifactId>
51+
<version>2.22.2</version>
52+
</plugin>
53+
<plugin>
54+
<artifactId>maven-failsafe-plugin</artifactId>
55+
<version>2.22.2</version>
56+
</plugin>
57+
<plugin>
58+
<groupId>org.codehaus.mojo</groupId>
59+
<artifactId>exec-maven-plugin</artifactId>
60+
<version>1.6.0</version>
61+
<configuration>
62+
<mainClass>MainKt</mainClass>
63+
</configuration>
64+
</plugin>
65+
</plugins>
66+
</build>
67+
68+
<dependencies>
69+
<dependency>
70+
<groupId>org.jetbrains.kotlin</groupId>
71+
<artifactId>kotlin-test-junit5</artifactId>
72+
<version>2.0.20</version>
73+
<scope>test</scope>
74+
</dependency>
75+
<dependency>
76+
<groupId>org.junit.jupiter</groupId>
77+
<artifactId>junit-jupiter</artifactId>
78+
<version>5.10.0</version>
79+
<scope>test</scope>
80+
</dependency>
81+
<dependency>
82+
<groupId>org.jetbrains.kotlin</groupId>
83+
<artifactId>kotlin-stdlib</artifactId>
84+
<version>2.0.20</version>
85+
</dependency>
86+
<dependency>
87+
<groupId>org.jetbrains.exposed</groupId>
88+
<artifactId>exposed-core</artifactId>
89+
<version>0.58.0</version>
90+
</dependency>
91+
<dependency>
92+
<groupId>org.jetbrains.exposed</groupId>
93+
<artifactId>exposed-jdbc</artifactId>
94+
<version>0.58.0</version>
95+
</dependency>
96+
<dependency>
97+
<groupId>org.jetbrains.exposed</groupId>
98+
<artifactId>exposed-dao</artifactId>
99+
<version>0.58.0</version>
100+
</dependency>
101+
<dependency>
102+
<groupId>com.h2database</groupId>
103+
<artifactId>h2</artifactId>
104+
<version>2.2.224</version>
105+
</dependency>
106+
<dependency>
107+
<groupId>org.slf4j</groupId>
108+
<artifactId>slf4j-nop</artifactId>
109+
<version>1.7.30</version>
110+
</dependency>
111+
</dependencies>
112+
113+
</project>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package com.example
2+
3+
fun main() {
4+
println("Hello World!")
5+
}

documentation-website/Writerside/snippets/settings.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ plugins {
1313
rootProject.name = "snippets"
1414
include("exposed-dao")
1515
include("exposed-dsl")
16+
include("exposed-modules-maven")
17+
include("exposed-modules-kotlin-gradle")
18+
include("exposed-modules-groovy-gradle")

0 commit comments

Comments
 (0)