-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This code gives same level of functionalitty (even a bit more) as the current codegen using Codestarts and Qute - Goal is to improve and validate the codestarts structure - There is no proper testing yet since I prefer to write them once we have discussed the structure - codestarts are located in devtools/platform-descriptor-json/src/main/resources/codestarts - It's possible to generate a set of Quarkus app (using the new codestarts) from `CodestartProjectTest` maven/gradle/kotlin/scala/java with or without example - It's also possible to try it with the mvn quarkus plugin: ``` mvn io.quarkus:quarkus-maven-plugin:999-SNAPSHOT:create \ -DprojectGroupId=org.acme \ -DprojectArtifactId=my-first-codestart \ -Dextensions="resteasy, resteasy-jsonb" \ -DplatformArtifactId="quarkus-bom" -DplatformVersion="999-SNAPSHOT" \ -DcodestartsEnabled -DwithExampleCode ``` - I will give a quick documentation to explain the codestart structure, but nothing to nice before we validate those concepts
- Loading branch information
Showing
98 changed files
with
2,914 additions
and
142 deletions.
There are no files selected for viewing
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
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
37 changes: 37 additions & 0 deletions
37
...r-json/src/main/resources/codestarts/base/buildtool/gradle/base/build-layout.include.qute
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,37 @@ | ||
{#insert plugins} | ||
plugins { | ||
id '{quarkus.plugin.id}' | ||
} | ||
{/} | ||
|
||
{#insert repositories} | ||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
} | ||
{/} | ||
|
||
{#insert dependencies} | ||
dependencies { | ||
implementation enforcedPlatform("$\{quarkusPlatformGroupId}:$\{quarkusPlatformArtifactId}:$\{quarkusPlatformVersion}") | ||
{#for dep in dependencies} | ||
implementation '{dep}' | ||
{/for} | ||
testImplementation 'io.quarkus:quarkus-junit5' | ||
{#for dep in testDependencies} | ||
testImplementation '{dep}' | ||
{/for} | ||
} | ||
{/} | ||
|
||
{#insert project} | ||
group '{project.group-id}' | ||
version '{project.version}' | ||
{/} | ||
|
||
{#insert java} | ||
java { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
{/} |
6 changes: 6 additions & 0 deletions
6
...ptor-json/src/main/resources/codestarts/base/buildtool/gradle/base/gradle.qute.properties
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,6 @@ | ||
#Gradle properties | ||
#Tue Jun 16 08:41:21 UTC 2020 | ||
quarkusPluginVersion={quarkus.plugin.version} | ||
quarkusPlatformGroupId={quarkus.platform.group-id} | ||
quarkusPlatformArtifactId={quarkus.platform.artifact-id} | ||
quarkusPlatformVersion={quarkus.platform.version} |
11 changes: 11 additions & 0 deletions
11
...riptor-json/src/main/resources/codestarts/base/buildtool/gradle/base/settings.qute.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,11 @@ | ||
pluginManagement { | ||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
plugins { | ||
id '{quarkus.plugin.id}' version "$\{quarkusPluginVersion}" | ||
} | ||
} | ||
rootProject.name='{project.artifact-id}' |
26 changes: 26 additions & 0 deletions
26
...latform-descriptor-json/src/main/resources/codestarts/base/buildtool/gradle/codestart.yml
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 @@ | ||
name: gradle | ||
type: buildtool | ||
spec: | ||
base: | ||
local-data: | ||
quarkus.plugin.id: io.quarkus | ||
version.kotlin: 1.3.72 | ||
version.scala: 2.12.8 | ||
shared-data: | ||
buildtool.build-dir: build | ||
buildtool.cmd.dev: ./gradlew quarkusDev | ||
buildtool.cmd.package: ./gradlew quarkusBuild | ||
buildtool.cmd.package-uberjar: ./gradlew quarkusBuild --uber-jar | ||
buildtool.cmd.package-native: ./gradlew build -Dquarkus.package.type=native | ||
buildtool.cmd.package-native-container: ./gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-build=true | ||
buildtool.guide: https://quarkus.io/guides/gradle-tooling#building-a-native-executable | ||
gitignore: > | ||
# Gradle | ||
.gradle/ | ||
build/ | ||
kotlin: | ||
dependencies: | ||
- org.jetbrains.kotlin:kotlin-stdlib-jdk8 | ||
scala: | ||
dependencies: | ||
- org.scala-lang:scala-library:${version.scala} |
17 changes: 17 additions & 0 deletions
17
...escriptor-json/src/main/resources/codestarts/base/buildtool/gradle/java/build.qute.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,17 @@ | ||
{#include build-layout} | ||
{#plugins} | ||
plugins { | ||
id 'java' | ||
id '{quarkus.plugin.id}' | ||
} | ||
{/plugins} | ||
{/include} | ||
|
||
compileJava { | ||
options.encoding = 'UTF-8' | ||
options.compilerArgs << '-parameters' | ||
} | ||
|
||
compileTestJava { | ||
options.encoding = 'UTF-8' | ||
} |
32 changes: 32 additions & 0 deletions
32
...criptor-json/src/main/resources/codestarts/base/buildtool/gradle/kotlin/build.qute.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,32 @@ | ||
{#include build-layout} | ||
{#plugins} | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' version "{version.kotlin}" | ||
id "org.jetbrains.kotlin.plugin.allopen" version "{version.kotlin}" | ||
id '{quarkus.plugin.id}' | ||
} | ||
{/plugins} | ||
{/include} | ||
|
||
quarkus { | ||
setOutputDirectory("$projectDir/build/classes/kotlin/main") | ||
} | ||
|
||
quarkusDev { | ||
setSourceDir("$projectDir/src/main/kotlin") | ||
} | ||
|
||
allOpen { | ||
annotation("javax.ws.rs.Path") | ||
annotation("javax.enterprise.context.ApplicationScoped") | ||
annotation("io.quarkus.test.junit.QuarkusTest") | ||
} | ||
|
||
compileKotlin { | ||
kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8 | ||
kotlinOptions.javaParameters = true | ||
} | ||
|
||
compileTestKotlin { | ||
kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8 | ||
} |
15 changes: 15 additions & 0 deletions
15
...scriptor-json/src/main/resources/codestarts/base/buildtool/gradle/scala/build.qute.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,15 @@ | ||
{#include build-layout} | ||
{#plugins} | ||
plugins { | ||
id 'scala' | ||
id '{quarkus.plugin.id}' | ||
} | ||
{/plugins} | ||
{/include} | ||
|
||
compileScala { | ||
scalaCompileOptions.encoding = 'UTF-8' | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
|
132 changes: 132 additions & 0 deletions
132
...form-descriptor-json/src/main/resources/codestarts/base/buildtool/maven/base/pom.qute.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,132 @@ | ||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>{project.group-id}</groupId> | ||
<artifactId>{project.artifact-id}</artifactId> | ||
<version>{project.version}</version> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
<maven.compiler.parameters>true</maven.compiler.parameters> | ||
|
||
<quarkus.platform.group-id>{quarkus.platform.group-id}</quarkus.platform.group-id> | ||
<quarkus.platform.artifact-id>{quarkus.platform.artifact-id}</quarkus.platform.artifact-id> | ||
<quarkus.platform.version>{quarkus.platform.version}</quarkus.platform.version> | ||
<quarkus-plugin.version>{quarkus.plugin.version}</quarkus-plugin.version> | ||
<compiler-plugin.version>{version.maven-compiler-plugin}</compiler-plugin.version> | ||
<surefire-plugin.version>{version.maven-surefire-plugin}</surefire-plugin.version> | ||
</properties> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>$\{quarkus.platform.group-id}</groupId> | ||
<artifactId>$\{quarkus.platform.artifact-id}</artifactId> | ||
<version>$\{quarkus.platform.version}</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<dependencies> | ||
{#each dependencies} | ||
<dependency> | ||
<groupId>{it.groupId}</groupId> | ||
<artifactId>{it.artifactId}</artifactId> | ||
</dependency> | ||
{/each} | ||
|
||
<!-- Test dependencies --> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-junit5</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
{#each testDependencies} | ||
<dependency> | ||
<groupId>{it.groupId}</groupId> | ||
<artifactId>{it.artifactId}</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
{/each} | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<!-- Quarkus build plugin - also provides the quarkus:dev live-reload feature --> | ||
<plugin> | ||
<groupId>{quarkus.plugin.group-id}</groupId> | ||
<artifactId>{quarkus.plugin.artifact-id}</artifactId> | ||
<version>$\{quarkus-plugin.version}</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>build</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>$\{compiler-plugin.version}</version> | ||
</plugin> | ||
<!-- Run the tests in JVM mode --> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>$\{surefire-plugin.version}</version> | ||
<configuration> | ||
<systemPropertyVariables> | ||
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager> | ||
<maven.home>$\{maven.home}</maven.home> | ||
</systemPropertyVariables> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
<!-- Use this profile to build a native executable using GraalVM --> | ||
<profile> | ||
<id>native</id> | ||
<activation> | ||
<property> | ||
<name>native</name> | ||
</property> | ||
</activation> | ||
<properties> | ||
<quarkus.package.type>native</quarkus.package.type> | ||
</properties> | ||
<build> | ||
<plugins> | ||
<!-- Run the tests with the native executable --> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-failsafe-plugin</artifactId> | ||
<version>$\{surefire-plugin.version}</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>integration-test</goal> | ||
<goal>verify</goal> | ||
</goals> | ||
<configuration> | ||
<systemPropertyVariables> | ||
<native.image.path>$\{project.build.directory}/$\{project.build.finalName}-runner</native.image.path> | ||
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager> | ||
<maven.home>$\{maven.home}</maven.home> | ||
</systemPropertyVariables> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
|
||
</project> |
27 changes: 27 additions & 0 deletions
27
...platform-descriptor-json/src/main/resources/codestarts/base/buildtool/maven/codestart.yml
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,27 @@ | ||
--- | ||
name: maven | ||
type: buildtool | ||
default: true | ||
spec: | ||
base: | ||
local-data: | ||
version.kotlin: 1.3.72 | ||
version.scala: 2.12.8 | ||
version.scala-maven-plugin: 4.1.1 | ||
version.maven-compiler-plugin: 3.8.1 | ||
version.maven-surefire-plugin: 2.22.1 | ||
shared-data: | ||
buildtool.build-dir: target | ||
buildtool.cmd.dev: ./mvnw compile quarkus:dev | ||
buildtool.cmd.package: ./mvnw package | ||
buildtool.cmd.package-uberjar: ./mvnw package -PuberJar | ||
buildtool.cmd.package-native: ./mvnw package -Pnative | ||
buildtool.cmd.package-native-container: ./mvnw package -Pnative -Dquarkus.native.container-build=true | ||
buildtool.guide: https://quarkus.io/guides/building-native-image | ||
gitignore: | | ||
#Maven | ||
target/ | ||
pom.xml.tag | ||
pom.xml.releaseBackup | ||
pom.xml.versionsBackup | ||
release.properties |
Oops, something went wrong.