Skip to content

Commit

Permalink
Skeleton for multi-language docs examples
Browse files Browse the repository at this point in the history
  • Loading branch information
puneetbehl committed Apr 12, 2019
1 parent 21519e7 commit 88357f0
Show file tree
Hide file tree
Showing 8 changed files with 173 additions and 3 deletions.
38 changes: 38 additions & 0 deletions docs-examples/example-groovy/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
plugins {
id "groovy"
id "io.spring.dependency-management"
}

dependencyManagement {
imports {
mavenBom "io.micronaut:micronaut-bom:$micronautVersion"
}
}

dependencies {
testCompile project(":openapi")
testCompile "io.micronaut:micronaut-inject"
testCompileOnly "io.micronaut:micronaut-inject-groovy"
testCompile "org.testcontainers:spock:1.10.5"
testCompile("org.spockframework:spock-core") {
exclude group: "org.codehaus.groovy", module: "groovy-all"
}
testRuntime "ch.qos.logback:logback-classic:1.2.3"
testCompile "io.projectreactor:reactor-core"
}

licenseTest.enabled = false

test {
jvmArgs '-Duser.country=US'
jvmArgs '-Duser.language=en'
testLogging {
showStandardStreams = true
exceptionFormat = 'full'
}
failFast = true
}

tasks.withType(GroovyCompile) {
groovyOptions.forkOptions.jvmArgs.add('-Dgroovy.parameters=true')
}
15 changes: 15 additions & 0 deletions docs-examples/example-groovy/src/test/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<configuration>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<root level="error">
<appender-ref ref="STDOUT" />
</root>
<logger name="io.micronaut.configuration.openapi" level="TRACE"/>
</configuration>
39 changes: 39 additions & 0 deletions docs-examples/example-java/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
plugins {
id "java"
id "io.spring.dependency-management"
}

dependencyManagement {
imports {
mavenBom "io.micronaut:micronaut-bom:$micronautVersion"
}
}

dependencies {
testAnnotationProcessor "io.micronaut:micronaut-inject-java"
testCompile "io.micronaut:micronaut-inject"
testCompile project(":openapi")
testCompile "org.testcontainers:testcontainers:1.10.5"
testCompile 'org.awaitility:awaitility:3.1.6'
testCompile "org.junit.jupiter:junit-jupiter-api:$junitVersion"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
testRuntime "ch.qos.logback:logback-classic:1.2.3"
testCompile "io.projectreactor:reactor-core"
}

licenseTest.enabled = false

compileJava.options.compilerArgs += '-parameters'
compileTestJava.options.compilerArgs += '-parameters'

test {
useJUnitPlatform()

jvmArgs '-Duser.country=US'
jvmArgs '-Duser.language=en'
testLogging {
showStandardStreams = true
exceptionFormat = 'full'
}
failFast = true
}
15 changes: 15 additions & 0 deletions docs-examples/example-java/src/test/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<configuration>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<root level="error">
<appender-ref ref="STDOUT" />
</root>
<logger name="io.micronaut.configuration.openapi" level="TRACE"/>
</configuration>
43 changes: 43 additions & 0 deletions docs-examples/example-kotlin/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "1.3.20"
id "org.jetbrains.kotlin.kapt" version "1.3.20"
id "io.spring.dependency-management"
}

dependencyManagement {
imports {
mavenBom "io.micronaut:micronaut-bom:$micronautVersion"
}
}

dependencies {
testCompile project(":openapi")
testRuntime "ch.qos.logback:logback-classic:1.2.3"
testCompile "org.testcontainers:testcontainers:1.10.5"
testCompile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
testCompile "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
kaptTest "io.micronaut:micronaut-inject-java"
testCompile 'io.kotlintest:kotlintest-runner-junit5:3.2.1'
testCompile "io.projectreactor:reactor-core"
}

licenseTest.enabled = false

test {
useJUnitPlatform()

jvmArgs '-Duser.country=US'
jvmArgs '-Duser.language=en'
testLogging {
showStandardStreams = true
exceptionFormat = 'full'
}
failFast = true
}

compileTestKotlin {
kotlinOptions {
jvmTarget = '1.8'
javaParameters = true
}
}
15 changes: 15 additions & 0 deletions docs-examples/example-kotlin/src/test/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<configuration>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<root level="error">
<appender-ref ref="STDOUT" />
</root>
<logger name="io.micronaut.configuration.openapi" level="TRACE"/>
</configuration>
6 changes: 4 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ micronautTestVersion=1.0.0.RC2
micronautDocsVersion=1.0.0.RC1
rxJava2Version=2.2.6
swaggerVersion=2.0.4
title=OpenAPI configuration
projectDesc=Configuration to integrate Micronaut and OpenAPI
title=OpenAPI/Swagger Support
projectDesc=Configuration to integrate Micronaut and OpenAPI/Swagger
projectUrl=http://micronaut.io
githubSlug=micronaut-projects/micronaut-openapi
githubBranch=master
developers=Puneet Behl
kotlinVersion=1.3.20
junitVersion=5.3.1
openapitests=openapi/src/test
# Not really needed for this project, but anyway
kafkaVersion="Unknown"
5 changes: 4 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
rootProject.name="openapi-root"

include "openapi"
include "openapi"
include 'docs-examples:example-groovy'
include 'docs-examples:example-java'
include 'docs-examples:example-kotlin'

0 comments on commit 88357f0

Please sign in to comment.