Skip to content

Commit

Permalink
EXPOSED-668 Update the "Modules" topic and extract examples to snippe…
Browse files Browse the repository at this point in the history
…ts projects (#2361)
  • Loading branch information
vnikolova authored Jan 17, 2025
1 parent 05a2e1d commit 5ab84a6
Show file tree
Hide file tree
Showing 12 changed files with 289 additions and 166 deletions.
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
```
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)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.example

fun main() {
println("Hello World!")
}
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
```
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)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.example

fun main() {
println("Hello World!")
}
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
```
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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.example

fun main() {
println("Hello World!")
}
3 changes: 3 additions & 0 deletions documentation-website/Writerside/snippets/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ plugins {
rootProject.name = "snippets"
include("exposed-dao")
include("exposed-dsl")
include("exposed-modules-maven")
include("exposed-modules-kotlin-gradle")
include("exposed-modules-groovy-gradle")
Loading

0 comments on commit 5ab84a6

Please sign in to comment.