From 02f18e18d8d816c270500e77b39bc2855ab8daad Mon Sep 17 00:00:00 2001 From: Andy Damevin Date: Wed, 17 Jun 2020 15:12:39 +0200 Subject: [PATCH] Introduce Codestarts Part of #8134 and #8178 Copying a few lines of code from `ClassPathUtils.processAsPath` Various tidy ups Add qute-example codestart and change naming convention Improve integration tests Use descriptive processors for codestarts --- .../io/quarkus/maven/CreateProjectMojo.java | 10 +- .../impl/QuarkusJsonPlatformDescriptor.java | 10 + .../buildtool/gradle/base/..gitignore | 3 + .../gradle/base/build-layout.include.qute | 37 +++ .../gradle/base/gradle.tpl.qute.properties | 6 + .../gradle/base/settings.tpl.qute.gradle | 11 + .../buildtool/gradle/codestart.yml | 28 ++ .../gradle/java/build.tpl.qute.gradle | 17 ++ .../gradle/kotlin/build.tpl.qute.gradle | 32 ++ .../gradle/scala/build.tpl.qute.gradle | 15 + .../buildtool/maven/base/..gitignore | 6 + .../buildtool/maven/base/pom.tpl.qute.xml | 62 ++-- .../buildtool/maven/codestart.yml | 25 ++ .../buildtool/maven/kotlin/pom.tpl.qute.xml | 67 +++++ .../buildtool/maven/scala/pom.tpl.qute.xml | 62 ++++ .../config/properties/codestart.yml | 9 + .../config/yaml/codestart.yml | 8 + .../META-INF/resources/index.tpl.qute.html | 24 +- .../example/base-example/codestart.yml | 4 + .../commandmode-example/base/README.md | 3 + .../example/commandmode-example/codestart.yml | 14 + .../commandmode/GreetingMain.tpl.qute.java | 27 ++ .../commandmode/GreetingService.tpl.qute.java | 12 + .../language/java/codestart.yml | 10 + .../language/kotlin/codestart.yml | 9 + .../language/scala/codestart.yml | 9 + .../project/quarkus/base/..gitignore | 2 +- .../project/quarkus/base/README.tpl.qute.md | 43 +++ .../base/src/main/resources/application.yml | 0 .../project/quarkus/codestart.yml | 20 ++ .../dockerfiles/base/.dockerignore.tpl.qute | 4 + .../main/docker/Dockerfile.tpl.qute.fast-jar | 22 +- .../src/main/docker/Dockerfile.tpl.qute.jvm | 16 +- .../main/docker/Dockerfile.tpl.qute.native | 11 +- .../tooling/dockerfiles/codestart.yml | 4 + .../codestarts/qute-example/base/README.md | 5 + .../codestarts/qute-example/codestart.yml | 13 + .../java/org/acme/qute/HelloResource.java | 25 ++ .../src/main/java/org/acme/qute/Item.java | 15 + .../main/java/org/acme/qute/ItemResource.java | 41 +++ .../main/resources/templates/hello.qute.html | 10 + .../main/resources/templates/items.qute.html | 24 ++ .../org/acme/qute/NativeHelloResourceIT.java | 6 +- .../java/org/acme/qute/HelloResourceTest.java | 28 ++ .../java/org/acme/qute/ItemsResourceTest.java | 22 ++ .../resteasy-example/base/README.md | 5 + .../codestarts/resteasy-example/codestart.yml | 12 + .../resteasy/ExampleResource.tpl.qute.java | 10 +- .../resteasy/NativeExampleResourceIT.java | 9 + .../ExampleResourceTest.tpl.qute.java | 10 +- .../acme/resteasy/ExampleResource.tpl.qute.kt | 10 +- .../acme/resteasy/NativeExampleResourceIT.kt | 6 + .../resteasy/ExampleResourceTest.tpl.qute.kt | 10 +- .../resteasy/ExampleResource.tpl.qute.scala | 12 + .../resteasy/NativeExampleResourceIT.scala | 6 + .../ExampleResourceTest.tpl.qute.scala | 10 +- .../resources/META-INF/quarkus-extension.yaml | 1 + .../resources/META-INF/quarkus-extension.yaml | 1 + .../resources/META-INF/quarkus-extension.yaml | 1 + .../resources/META-INF/quarkus-extension.yaml | 1 + .../resources/META-INF/quarkus-extension.yaml | 1 + .../tools/codestarts/codestarts.adoc | 222 ++++++++++++++ independent-projects/tools/codestarts/pom.xml | 57 ++++ .../devtools/codestarts/Codestart.java | 41 +++ .../devtools/codestarts/CodestartData.java | 115 +++++++ .../CodestartDefinitionException.java | 17 ++ .../codestarts/CodestartException.java | 13 + .../devtools/codestarts/CodestartInput.java | 54 ++++ .../codestarts/CodestartInputBuilder.java | 73 +++++ .../devtools/codestarts/CodestartLoader.java | 69 +++++ .../codestarts/CodestartProcessor.java | 164 ++++++++++ .../devtools/codestarts/CodestartProject.java | 72 +++++ .../codestarts/CodestartResourceLoader.java | 13 + .../devtools/codestarts/CodestartSpec.java | 192 ++++++++++++ .../devtools/codestarts/Codestarts.java | 105 +++++++ .../devtools/codestarts/NestedMaps.java | 81 +++++ .../codestarts/reader/CodestartFile.java | 21 ++ .../reader/CodestartFileReader.java | 44 +++ .../reader/QuteCodestartFileReader.java | 126 ++++++++ .../AppendCodestartFileStrategyHandler.java | 26 ++ .../strategy/CodestartFileStrategy.java | 31 ++ .../CodestartFileStrategyHandler.java | 45 +++ ...DuplicateCodestartFileStrategyHandler.java | 27 ++ ...ForbiddenCodestartFileStrategyHandler.java | 23 ++ .../ReplaceCodestartFileStrategyHandler.java | 25 ++ ...nfigMergeCodestartFileStrategyHandler.java | 87 ++++++ ...tPomMergeCodestartFileStrategyHandler.java | 35 +++ .../codestarts/CodestartLoaderTest.java | 85 ++++++ .../devtools/codestarts/NestedMapsTest.java | 111 +++++++ .../TestCodestartResourceLoader.java | 21 ++ .../buildtool-y/a/ybuild.qute.build | 10 + .../buildtool-y/b/ybuild.qute.build | 7 + .../base/ybuild-layout.include.qute | 7 + .../buildtool-y/codestart.yml | 11 + .../buildtool-z/a/pom.qute.xml | 13 + .../buildtool-z/b/pom.qute.xml | 13 + .../buildtool-z/base/pom.qute.xml | 7 + .../buildtool-z/codestart.yml | 8 + .../config-properties/codestart.yml | 9 + .../config-yaml/codestart.yml | 8 + .../foo-project/base/..gitignore | 2 + .../foo-project/base/README.tpl.qute.md | 1 + .../foo-project/base/config.yml | 0 .../foo-project/codestart.yml | 19 ++ .../language-a/codestart.yml | 4 + .../language-b/codestart.yml | 3 + .../replace-project/base/to-replace.txt | 1 + .../replace-project/codestart.yml | 6 + .../tooling-t/a/a/.tooling-t | 0 .../tooling-t/base/.tooling-t | 1 + .../tooling-t/codestart.yml | 4 + .../src/test/resources/codestart-spec1.yml | 22 ++ .../test/resources/codestart-specdefault.yml | 2 + .../codestart-1/codestart.yml | 2 + .../example-forbidden/codestart.yml | 2 + .../codestarts/example1/codestart.yml | 2 + .../codestarts/example2/codestart.yml | 2 + .../bar-project/base/..gitignore | 2 + .../bar-project/base/README.tpl.qute.md | 1 + .../base/src/main/resources/application.yml | 0 .../bar-project/codestart.yml | 4 + .../tooling-tt/base/.tooling-t | 1 + .../conflicting-file/tooling-tt/codestart.yml | 4 + .../fallback-example/fb-example/a/fallback.a | 1 + .../fallback-example/fb-example/b/fallback.b | 1 + .../fb-example/base/fallback.base | 1 + .../fallback-example/fb-example/codestart.yml | 10 + .../src/test/resources/nested-map-1.yml | 12 + .../src/test/resources/nested-map-2.yml | 12 + .../tools/devtools-common/pom.xml | 20 ++ .../codestarts/QuarkusCodestarts.java | 42 +++ .../devtools/commands/CreateProject.java | 10 + .../handlers/CreateProjectCommandHandler.java | 38 ++- .../loader/json/ClassPathResourceLoader.java | 18 ++ .../loader/json/DirectoryResourceLoader.java | 18 +- .../loader/json/ResourceLoader.java | 14 +- .../loader/json/ResourceLoaders.java | 72 +++++ .../loader/json/ZipResourceLoader.java | 14 +- .../io/quarkus/devtools/ProjectTestUtil.java | 29 ++ ...CombinedQuarkusPlatformDescriptorTest.java | 7 +- .../descriptor}/PlatformAwareTestBase.java | 2 +- ...stDominatingQuarkusPlatformDescriptor.java | 14 +- .../QuarkusTestPlatformDescriptorLoader.java | 51 +++- .../src/test/resources/dir/some-file.template | 3 + .../resources/templates/README.gradle.ftl | 35 --- .../test/resources/templates/README.maven.ftl | 30 -- .../basic-rest/java/build.gradle-template.ftl | 35 --- .../java/gradle.properties-template.ftl | 4 - .../java/settings.gradle-template.ftl | 11 - .../java/spring-controller-template.ftl | 16 - .../kotlin/build.gradle-template.ftl | 50 ---- .../kotlin/gradle.properties-template.ftl | 4 - .../kotlin/native-test-resource-template.ftl | 6 - .../basic-rest/kotlin/pom.xml-template.ftl | 174 ----------- .../kotlin/settings.gradle-template.ftl | 11 - .../kotlin/spring-controller-template.ftl | 14 - .../scala/build.gradle-template.ftl | 32 -- .../scala/gradle.properties-template.ftl | 4 - .../scala/native-test-resource-template.ftl | 6 - .../basic-rest/scala/pom.xml-template.ftl | 171 ----------- .../basic-rest/scala/resource-template.ftl | 12 - .../scala/settings.gradle-template.ftl | 11 - .../scala/spring-controller-template.ftl | 12 - .../test/resources/templates/dockerignore.ftl | 5 - .../io/quarkus/dependencies/Extension.java | 11 + .../CombinedQuarkusPlatformDescriptor.java | 12 + .../descriptor/QuarkusPlatformDescriptor.java | 2 + .../descriptor/ResourcePathConsumer.java | 9 + .../TestJsonPlatformDescriptorLoader.java | 6 + independent-projects/tools/pom.xml | 38 +++ integration-tests/devtools/pom.xml | 65 ++++ .../devtools/PlatformAwareTestBase.java | 62 ++++ .../io/quarkus/devtools/ProjectTestUtil.java | 30 ++ .../codestarts/CodestartProjectTest.java | 281 ++++++++++++++++++ .../devtools/codestarts/CodestartsTest.java | 121 ++++++++ .../commands/AbstractAddExtensionsTest.java | 88 +++--- .../AbstractRemoveExtensionsTest.java | 25 +- .../commands/AddGradleExtensionsTest.java | 17 +- .../commands/AddMavenExtensionsTest.java | 15 +- .../devtools/commands/CreateProjectTest.java | 37 +-- .../devtools/commands/ListExtensionsTest.java | 31 +- .../commands/RemoveGradleExtensionsTest.java | 15 +- .../commands/RemoveMavenExtensionsTest.java | 13 +- .../handlers/QuarkusCommandHandlersTest.java | 6 +- .../rest/BasicRestProjectGeneratorTest.java | 16 +- .../compress/QuarkusProjectCompressTest.java | 16 +- .../it/CreateProjectCodestartMojoIT.java | 181 +++++++++++ integration-tests/pom.xml | 1 + pom.xml | 2 +- .../io/quarkus/maven/it/MojoTestBase.java | 14 +- 190 files changed, 4339 insertions(+), 916 deletions(-) create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/base/..gitignore create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/base/build-layout.include.qute create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/base/gradle.tpl.qute.properties create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/base/settings.tpl.qute.gradle create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/codestart.yml create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/java/build.tpl.qute.gradle create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/kotlin/build.tpl.qute.gradle create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/scala/build.tpl.qute.gradle create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/maven/base/..gitignore rename independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/java/pom.xml-template.ftl => devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/maven/base/pom.tpl.qute.xml (65%) create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/maven/codestart.yml create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/maven/kotlin/pom.tpl.qute.xml create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/maven/scala/pom.tpl.qute.xml create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/config/properties/codestart.yml create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/config/yaml/codestart.yml rename independent-projects/tools/devtools-common/src/test/resources/templates/index.ftl => devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/example/base-example/base/src/main/resources/META-INF/resources/index.tpl.qute.html (82%) create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/example/base-example/codestart.yml create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/example/commandmode-example/base/README.md create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/example/commandmode-example/codestart.yml create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/example/commandmode-example/java/src/main/java/org/acme/commandmode/GreetingMain.tpl.qute.java create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/example/commandmode-example/java/src/main/java/org/acme/commandmode/GreetingService.tpl.qute.java create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/language/java/codestart.yml create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/language/kotlin/codestart.yml create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/language/scala/codestart.yml rename independent-projects/tools/devtools-common/src/test/resources/templates/gitignore.ftl => devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/project/quarkus/base/..gitignore (87%) create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/project/quarkus/base/README.tpl.qute.md create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/project/quarkus/base/src/main/resources/application.yml create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/project/quarkus/codestart.yml create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/tooling/dockerfiles/base/.dockerignore.tpl.qute rename independent-projects/tools/devtools-common/src/test/resources/templates/dockerfile-fast-jar.ftl => devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/tooling/dockerfiles/base/src/main/docker/Dockerfile.tpl.qute.fast-jar (68%) rename independent-projects/tools/devtools-common/src/test/resources/templates/dockerfile-jvm.ftl => devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/tooling/dockerfiles/base/src/main/docker/Dockerfile.tpl.qute.jvm (73%) rename independent-projects/tools/devtools-common/src/test/resources/templates/dockerfile-native.ftl => devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/tooling/dockerfiles/base/src/main/docker/Dockerfile.tpl.qute.native (52%) create mode 100644 devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/tooling/dockerfiles/codestart.yml create mode 100644 devtools/platform-descriptor-json/src/main/resources/codestarts/qute-example/base/README.md create mode 100644 devtools/platform-descriptor-json/src/main/resources/codestarts/qute-example/codestart.yml create mode 100644 devtools/platform-descriptor-json/src/main/resources/codestarts/qute-example/java/src/main/java/org/acme/qute/HelloResource.java create mode 100644 devtools/platform-descriptor-json/src/main/resources/codestarts/qute-example/java/src/main/java/org/acme/qute/Item.java create mode 100644 devtools/platform-descriptor-json/src/main/resources/codestarts/qute-example/java/src/main/java/org/acme/qute/ItemResource.java create mode 100644 devtools/platform-descriptor-json/src/main/resources/codestarts/qute-example/java/src/main/resources/templates/hello.qute.html create mode 100644 devtools/platform-descriptor-json/src/main/resources/codestarts/qute-example/java/src/main/resources/templates/items.qute.html rename independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/java/native-test-resource-template.ftl => devtools/platform-descriptor-json/src/main/resources/codestarts/qute-example/java/src/native-test/java/org/acme/qute/NativeHelloResourceIT.java (56%) create mode 100644 devtools/platform-descriptor-json/src/main/resources/codestarts/qute-example/java/src/test/java/org/acme/qute/HelloResourceTest.java create mode 100644 devtools/platform-descriptor-json/src/main/resources/codestarts/qute-example/java/src/test/java/org/acme/qute/ItemsResourceTest.java create mode 100644 devtools/platform-descriptor-json/src/main/resources/codestarts/resteasy-example/base/README.md create mode 100644 devtools/platform-descriptor-json/src/main/resources/codestarts/resteasy-example/codestart.yml rename independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/java/resource-template.ftl => devtools/platform-descriptor-json/src/main/resources/codestarts/resteasy-example/java/src/main/java/org/acme/resteasy/ExampleResource.tpl.qute.java (63%) create mode 100644 devtools/platform-descriptor-json/src/main/resources/codestarts/resteasy-example/java/src/native-test/java/org/acme/resteasy/NativeExampleResourceIT.java rename independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/java/test-resource-template.ftl => devtools/platform-descriptor-json/src/main/resources/codestarts/resteasy-example/java/src/test/java/org/acme/resteasy/ExampleResourceTest.tpl.qute.java (68%) rename independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/kotlin/resource-template.ftl => devtools/platform-descriptor-json/src/main/resources/codestarts/resteasy-example/kotlin/src/main/kotlin/org/acme/resteasy/ExampleResource.tpl.qute.kt (59%) create mode 100644 devtools/platform-descriptor-json/src/main/resources/codestarts/resteasy-example/kotlin/src/native-test/kotlin/org/acme/resteasy/NativeExampleResourceIT.kt rename independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/kotlin/test-resource-template.ftl => devtools/platform-descriptor-json/src/main/resources/codestarts/resteasy-example/kotlin/src/test/kotlin/org/acme/resteasy/ExampleResourceTest.tpl.qute.kt (66%) create mode 100644 devtools/platform-descriptor-json/src/main/resources/codestarts/resteasy-example/scala/src/main/scala/org/acme/resteasy/ExampleResource.tpl.qute.scala create mode 100644 devtools/platform-descriptor-json/src/main/resources/codestarts/resteasy-example/scala/src/native-test/scala/org/acme/resteasy/NativeExampleResourceIT.scala rename independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/scala/test-resource-template.ftl => devtools/platform-descriptor-json/src/main/resources/codestarts/resteasy-example/scala/src/test/scala/org/acme/resteasy/ExampleResourceTest.tpl.qute.scala (67%) create mode 100644 independent-projects/tools/codestarts/codestarts.adoc create mode 100644 independent-projects/tools/codestarts/pom.xml create mode 100644 independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/Codestart.java create mode 100644 independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/CodestartData.java create mode 100644 independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/CodestartDefinitionException.java create mode 100644 independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/CodestartException.java create mode 100644 independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/CodestartInput.java create mode 100644 independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/CodestartInputBuilder.java create mode 100644 independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/CodestartLoader.java create mode 100644 independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/CodestartProcessor.java create mode 100644 independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/CodestartProject.java create mode 100644 independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/CodestartResourceLoader.java create mode 100644 independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/CodestartSpec.java create mode 100644 independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/Codestarts.java create mode 100644 independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/NestedMaps.java create mode 100644 independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/reader/CodestartFile.java create mode 100644 independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/reader/CodestartFileReader.java create mode 100644 independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/reader/QuteCodestartFileReader.java create mode 100644 independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/strategy/AppendCodestartFileStrategyHandler.java create mode 100644 independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/strategy/CodestartFileStrategy.java create mode 100644 independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/strategy/CodestartFileStrategyHandler.java create mode 100644 independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/strategy/FailOnDuplicateCodestartFileStrategyHandler.java create mode 100644 independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/strategy/ForbiddenCodestartFileStrategyHandler.java create mode 100644 independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/strategy/ReplaceCodestartFileStrategyHandler.java create mode 100644 independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/strategy/SmartConfigMergeCodestartFileStrategyHandler.java create mode 100644 independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/strategy/SmartPomMergeCodestartFileStrategyHandler.java create mode 100644 independent-projects/tools/codestarts/src/test/java/io/quarkus/devtools/codestarts/CodestartLoaderTest.java create mode 100644 independent-projects/tools/codestarts/src/test/java/io/quarkus/devtools/codestarts/NestedMapsTest.java create mode 100644 independent-projects/tools/codestarts/src/test/java/io/quarkus/devtools/codestarts/TestCodestartResourceLoader.java create mode 100644 independent-projects/tools/codestarts/src/test/resources/bundled-codestarts/buildtool-y/a/ybuild.qute.build create mode 100644 independent-projects/tools/codestarts/src/test/resources/bundled-codestarts/buildtool-y/b/ybuild.qute.build create mode 100644 independent-projects/tools/codestarts/src/test/resources/bundled-codestarts/buildtool-y/base/ybuild-layout.include.qute create mode 100644 independent-projects/tools/codestarts/src/test/resources/bundled-codestarts/buildtool-y/codestart.yml create mode 100644 independent-projects/tools/codestarts/src/test/resources/bundled-codestarts/buildtool-z/a/pom.qute.xml create mode 100644 independent-projects/tools/codestarts/src/test/resources/bundled-codestarts/buildtool-z/b/pom.qute.xml create mode 100644 independent-projects/tools/codestarts/src/test/resources/bundled-codestarts/buildtool-z/base/pom.qute.xml create mode 100644 independent-projects/tools/codestarts/src/test/resources/bundled-codestarts/buildtool-z/codestart.yml create mode 100644 independent-projects/tools/codestarts/src/test/resources/bundled-codestarts/config-properties/codestart.yml create mode 100644 independent-projects/tools/codestarts/src/test/resources/bundled-codestarts/config-yaml/codestart.yml create mode 100644 independent-projects/tools/codestarts/src/test/resources/bundled-codestarts/foo-project/base/..gitignore create mode 100644 independent-projects/tools/codestarts/src/test/resources/bundled-codestarts/foo-project/base/README.tpl.qute.md create mode 100644 independent-projects/tools/codestarts/src/test/resources/bundled-codestarts/foo-project/base/config.yml create mode 100644 independent-projects/tools/codestarts/src/test/resources/bundled-codestarts/foo-project/codestart.yml create mode 100644 independent-projects/tools/codestarts/src/test/resources/bundled-codestarts/language-a/codestart.yml create mode 100644 independent-projects/tools/codestarts/src/test/resources/bundled-codestarts/language-b/codestart.yml create mode 100644 independent-projects/tools/codestarts/src/test/resources/bundled-codestarts/replace-project/base/to-replace.txt create mode 100644 independent-projects/tools/codestarts/src/test/resources/bundled-codestarts/replace-project/codestart.yml create mode 100644 independent-projects/tools/codestarts/src/test/resources/bundled-codestarts/tooling-t/a/a/.tooling-t create mode 100644 independent-projects/tools/codestarts/src/test/resources/bundled-codestarts/tooling-t/base/.tooling-t create mode 100644 independent-projects/tools/codestarts/src/test/resources/bundled-codestarts/tooling-t/codestart.yml create mode 100644 independent-projects/tools/codestarts/src/test/resources/codestart-spec1.yml create mode 100644 independent-projects/tools/codestarts/src/test/resources/codestart-specdefault.yml create mode 100644 independent-projects/tools/codestarts/src/test/resources/codestarts-with-error/codestart-1/codestart.yml create mode 100644 independent-projects/tools/codestarts/src/test/resources/codestarts/example-forbidden/codestart.yml create mode 100644 independent-projects/tools/codestarts/src/test/resources/codestarts/example1/codestart.yml create mode 100644 independent-projects/tools/codestarts/src/test/resources/codestarts/example2/codestart.yml create mode 100644 independent-projects/tools/codestarts/src/test/resources/conflicting-codestart/bar-project/base/..gitignore create mode 100644 independent-projects/tools/codestarts/src/test/resources/conflicting-codestart/bar-project/base/README.tpl.qute.md create mode 100644 independent-projects/tools/codestarts/src/test/resources/conflicting-codestart/bar-project/base/src/main/resources/application.yml create mode 100644 independent-projects/tools/codestarts/src/test/resources/conflicting-codestart/bar-project/codestart.yml create mode 100644 independent-projects/tools/codestarts/src/test/resources/conflicting-file/tooling-tt/base/.tooling-t create mode 100644 independent-projects/tools/codestarts/src/test/resources/conflicting-file/tooling-tt/codestart.yml create mode 100644 independent-projects/tools/codestarts/src/test/resources/fallback-example/fb-example/a/fallback.a create mode 100644 independent-projects/tools/codestarts/src/test/resources/fallback-example/fb-example/b/fallback.b create mode 100644 independent-projects/tools/codestarts/src/test/resources/fallback-example/fb-example/base/fallback.base create mode 100644 independent-projects/tools/codestarts/src/test/resources/fallback-example/fb-example/codestart.yml create mode 100644 independent-projects/tools/codestarts/src/test/resources/nested-map-1.yml create mode 100644 independent-projects/tools/codestarts/src/test/resources/nested-map-2.yml create mode 100644 independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/codestarts/QuarkusCodestarts.java create mode 100644 independent-projects/tools/devtools-common/src/main/java/io/quarkus/platform/descriptor/loader/json/ResourceLoaders.java create mode 100644 independent-projects/tools/devtools-common/src/test/java/io/quarkus/devtools/ProjectTestUtil.java rename independent-projects/tools/devtools-common/src/test/java/io/quarkus/{devtools/commands => test/platform/descriptor}/PlatformAwareTestBase.java (97%) create mode 100644 independent-projects/tools/devtools-common/src/test/resources/dir/some-file.template delete mode 100644 independent-projects/tools/devtools-common/src/test/resources/templates/README.gradle.ftl delete mode 100644 independent-projects/tools/devtools-common/src/test/resources/templates/README.maven.ftl delete mode 100644 independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/java/build.gradle-template.ftl delete mode 100644 independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/java/gradle.properties-template.ftl delete mode 100644 independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/java/settings.gradle-template.ftl delete mode 100644 independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/java/spring-controller-template.ftl delete mode 100644 independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/kotlin/build.gradle-template.ftl delete mode 100644 independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/kotlin/gradle.properties-template.ftl delete mode 100644 independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/kotlin/native-test-resource-template.ftl delete mode 100644 independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/kotlin/pom.xml-template.ftl delete mode 100644 independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/kotlin/settings.gradle-template.ftl delete mode 100644 independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/kotlin/spring-controller-template.ftl delete mode 100644 independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/scala/build.gradle-template.ftl delete mode 100644 independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/scala/gradle.properties-template.ftl delete mode 100644 independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/scala/native-test-resource-template.ftl delete mode 100644 independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/scala/pom.xml-template.ftl delete mode 100644 independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/scala/resource-template.ftl delete mode 100644 independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/scala/settings.gradle-template.ftl delete mode 100644 independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/scala/spring-controller-template.ftl delete mode 100644 independent-projects/tools/devtools-common/src/test/resources/templates/dockerignore.ftl create mode 100644 independent-projects/tools/platform-descriptor-api/src/main/java/io/quarkus/platform/descriptor/ResourcePathConsumer.java create mode 100644 integration-tests/devtools/pom.xml create mode 100644 integration-tests/devtools/src/test/java/io/quarkus/devtools/PlatformAwareTestBase.java create mode 100644 integration-tests/devtools/src/test/java/io/quarkus/devtools/ProjectTestUtil.java create mode 100644 integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/CodestartProjectTest.java create mode 100644 integration-tests/devtools/src/test/java/io/quarkus/devtools/codestarts/CodestartsTest.java rename {independent-projects/tools/devtools-common => integration-tests/devtools}/src/test/java/io/quarkus/devtools/commands/AbstractAddExtensionsTest.java (76%) rename {independent-projects/tools/devtools-common => integration-tests/devtools}/src/test/java/io/quarkus/devtools/commands/AbstractRemoveExtensionsTest.java (88%) rename {independent-projects/tools/devtools-common => integration-tests/devtools}/src/test/java/io/quarkus/devtools/commands/AddGradleExtensionsTest.java (97%) rename {independent-projects/tools/devtools-common => integration-tests/devtools}/src/test/java/io/quarkus/devtools/commands/AddMavenExtensionsTest.java (95%) rename {independent-projects/tools/devtools-common => integration-tests/devtools}/src/test/java/io/quarkus/devtools/commands/CreateProjectTest.java (89%) rename {independent-projects/tools/devtools-common => integration-tests/devtools}/src/test/java/io/quarkus/devtools/commands/ListExtensionsTest.java (95%) rename {independent-projects/tools/devtools-common => integration-tests/devtools}/src/test/java/io/quarkus/devtools/commands/RemoveGradleExtensionsTest.java (96%) rename {independent-projects/tools/devtools-common => integration-tests/devtools}/src/test/java/io/quarkus/devtools/commands/RemoveMavenExtensionsTest.java (95%) rename {independent-projects/tools/devtools-common => integration-tests/devtools}/src/test/java/io/quarkus/devtools/commands/handlers/QuarkusCommandHandlersTest.java (99%) rename {independent-projects/tools/devtools-common => integration-tests/devtools}/src/test/java/io/quarkus/devtools/project/codegen/rest/BasicRestProjectGeneratorTest.java (99%) rename {independent-projects/tools/devtools-common => integration-tests/devtools}/src/test/java/io/quarkus/devtools/project/compress/QuarkusProjectCompressTest.java (95%) create mode 100644 integration-tests/maven/src/test/java/io/quarkus/maven/it/CreateProjectCodestartMojoIT.java diff --git a/devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java b/devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java index c8f45861476c03..39b40c78436bd0 100644 --- a/devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java +++ b/devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java @@ -74,6 +74,12 @@ public class CreateProjectMojo extends AbstractMojo { @Parameter(property = "projectVersion") private String projectVersion; + @Parameter(property = "codestartsEnabled") + private Boolean codestartsEnabled; + + @Parameter(property = "withExampleCode") + private Boolean withExampleCode; + /** * Group ID of the target platform BOM */ @@ -190,7 +196,9 @@ public void execute() throws MojoExecutionException { .version(projectVersion) .sourceType(sourceType) .className(className) - .extensions(extensions); + .extensions(extensions) + .codestartsEnabled(codestartsEnabled) + .withExampleCode(withExampleCode); if (path != null) { createProject.setValue("path", path); } diff --git a/devtools/platform-descriptor-json/src/main/java/io/quarkus/platform/descriptor/loader/json/impl/QuarkusJsonPlatformDescriptor.java b/devtools/platform-descriptor-json/src/main/java/io/quarkus/platform/descriptor/loader/json/impl/QuarkusJsonPlatformDescriptor.java index d346fd6fd07593..0b409a9200985a 100644 --- a/devtools/platform-descriptor-json/src/main/java/io/quarkus/platform/descriptor/loader/json/impl/QuarkusJsonPlatformDescriptor.java +++ b/devtools/platform-descriptor-json/src/main/java/io/quarkus/platform/descriptor/loader/json/impl/QuarkusJsonPlatformDescriptor.java @@ -16,6 +16,7 @@ import io.quarkus.dependencies.Extension; import io.quarkus.platform.descriptor.QuarkusPlatformDescriptor; import io.quarkus.platform.descriptor.ResourceInputStreamConsumer; +import io.quarkus.platform.descriptor.ResourcePathConsumer; import io.quarkus.platform.descriptor.loader.json.ResourceLoader; import io.quarkus.platform.tools.DefaultMessageWriter; import io.quarkus.platform.tools.MessageWriter; @@ -126,6 +127,15 @@ public T loadResource(String name, ResourceInputStreamConsumer consumer) return resourceLoader.loadResource(name, consumer); } + @Override + public T loadResourceAsPath(String name, ResourcePathConsumer consumer) throws IOException { + getLog().debug("Loading Quarkus platform resource %s", name); + if (resourceLoader == null) { + throw new IllegalStateException("Resource loader has not been provided"); + } + return resourceLoader.loadResourceAsPath(name, consumer); + } + @Override public List getCategories() { return categories; diff --git a/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/base/..gitignore b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/base/..gitignore new file mode 100644 index 00000000000000..ace4d3dd9713dc --- /dev/null +++ b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/base/..gitignore @@ -0,0 +1,3 @@ +# Gradle +.gradle/ +build/ \ No newline at end of file diff --git a/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/base/build-layout.include.qute b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/base/build-layout.include.qute new file mode 100644 index 00000000000000..2b02138ff19169 --- /dev/null +++ b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/base/build-layout.include.qute @@ -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 test-dependencies} + testImplementation '{dep}' +{/for} +} +{/} + +{#insert project} +group '{project.group-id}' +version '{project.version}' +{/} + +{#insert java} +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} +{/} diff --git a/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/base/gradle.tpl.qute.properties b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/base/gradle.tpl.qute.properties new file mode 100644 index 00000000000000..72c7052dddd091 --- /dev/null +++ b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/base/gradle.tpl.qute.properties @@ -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} \ No newline at end of file diff --git a/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/base/settings.tpl.qute.gradle b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/base/settings.tpl.qute.gradle new file mode 100644 index 00000000000000..adce2841385462 --- /dev/null +++ b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/base/settings.tpl.qute.gradle @@ -0,0 +1,11 @@ +pluginManagement { + repositories { + mavenLocal() + mavenCentral() + gradlePluginPortal() + } + plugins { + id '{quarkus.plugin.id}' version "$\{quarkusPluginVersion}" + } +} +rootProject.name='{project.artifact-id}' diff --git a/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/codestart.yml b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/codestart.yml new file mode 100644 index 00000000000000..e2d4ee96dc17c6 --- /dev/null +++ b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/codestart.yml @@ -0,0 +1,28 @@ +name: gradle +type: buildtool +language: + base: + data: + quarkus: + plugin: + id: io.quarkus + version: + kotlin: 1.3.72 + scala: 2.12.8 + shared-data: + buildtool: + build-dir: build + guide: https://quarkus.io/guides/gradle-tooling + guide-native: https://quarkus.io/guides/gradle-tooling#building-a-native-executable + cmd: + dev: ./gradlew quarkusDev + package: ./gradlew quarkusBuild + package-uberjar: ./gradlew quarkusBuild --uber-jar + package-native: ./gradlew build -Dquarkus.package.type=native + package-native-container: ./gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-build=true + kotlin: + dependencies: + - org.jetbrains.kotlin:kotlin-stdlib-jdk8 + scala: + dependencies: + - org.scala-lang:scala-library:${version.scala} diff --git a/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/java/build.tpl.qute.gradle b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/java/build.tpl.qute.gradle new file mode 100644 index 00000000000000..185ccdd49c664c --- /dev/null +++ b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/java/build.tpl.qute.gradle @@ -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' +} diff --git a/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/kotlin/build.tpl.qute.gradle b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/kotlin/build.tpl.qute.gradle new file mode 100644 index 00000000000000..b38ff1c2ceabfd --- /dev/null +++ b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/kotlin/build.tpl.qute.gradle @@ -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 +} diff --git a/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/scala/build.tpl.qute.gradle b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/scala/build.tpl.qute.gradle new file mode 100644 index 00000000000000..5ad817212fd10f --- /dev/null +++ b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/gradle/scala/build.tpl.qute.gradle @@ -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 +} + diff --git a/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/maven/base/..gitignore b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/maven/base/..gitignore new file mode 100644 index 00000000000000..b1be26f06a4975 --- /dev/null +++ b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/maven/base/..gitignore @@ -0,0 +1,6 @@ +#Maven +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +release.properties \ No newline at end of file diff --git a/independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/java/pom.xml-template.ftl b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/maven/base/pom.tpl.qute.xml similarity index 65% rename from independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/java/pom.xml-template.ftl rename to devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/maven/base/pom.tpl.qute.xml index b82146a023918f..9800d6a1cae8f2 100644 --- a/independent-projects/tools/devtools-common/src/test/resources/templates/basic-rest/java/pom.xml-template.ftl +++ b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/maven/base/pom.tpl.qute.xml @@ -1,9 +1,9 @@ 4.0.0 - ${project_groupId} - ${project_artifactId} - ${project_version} + {project.group-id} + {project.artifact-id} + {project.version} UTF-8 @@ -12,20 +12,20 @@ 1.8 true - ${bom_artifactId} - ${bom_groupId} - ${bom_version} - ${plugin_version} - ${compiler_plugin_version} - ${surefire_plugin_version} + {quarkus.platform.group-id} + {quarkus.platform.artifact-id} + {quarkus.platform.version} + {quarkus.plugin.version} + {maven.version.maven-compiler-plugin} + {maven.version.maven-surefire-plugin} - ${maven_repositories}${maven_plugin_repositories} + - ${quarkus.platform.group-id} - ${quarkus.platform.artifact-id} - ${quarkus.platform.version} + $\{quarkus.platform.group-id} + $\{quarkus.platform.artifact-id} + $\{quarkus.platform.version} pom import @@ -33,10 +33,15 @@ + {#each dependencies} - io.quarkus - quarkus-resteasy + {it.groupId} + {it.artifactId} + {#if it.version} + {it.version} + {/if} + {/each} @@ -44,20 +49,25 @@ quarkus-junit5 test + {#each test-dependencies} - io.rest-assured - rest-assured + {it.groupId} + {it.artifactId} + {#if it.version} + {it.version} + {/if} test + {/each} - ${plugin_groupId} - ${plugin_artifactId} - ${quarkus-plugin.version} + {quarkus.plugin.group-id} + {quarkus.plugin.artifact-id} + $\{quarkus-plugin.version} @@ -70,17 +80,17 @@ maven-compiler-plugin - ${compiler-plugin.version} + $\{compiler-plugin.version} org.apache.maven.plugins maven-surefire-plugin - ${surefire-plugin.version} + $\{surefire-plugin.version} org.jboss.logmanager.LogManager - ${maven.home} + $\{maven.home} @@ -105,7 +115,7 @@ org.apache.maven.plugins maven-failsafe-plugin - ${surefire-plugin.version} + $\{surefire-plugin.version} @@ -114,9 +124,9 @@ - ${project.build.directory}/${project.build.finalName}-runner + $\{project.build.directory}/$\{project.build.finalName}-runner org.jboss.logmanager.LogManager - ${maven.home} + $\{maven.home} diff --git a/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/maven/codestart.yml b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/maven/codestart.yml new file mode 100644 index 00000000000000..e0565e31ac0485 --- /dev/null +++ b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/maven/codestart.yml @@ -0,0 +1,25 @@ +--- +name: maven +type: buildtool +fallback: true +language: + base: + data: + maven: + version: + kotlin: 1.3.72 + scala: 2.12.8 + scala-maven-plugin: 4.1.1 + maven-compiler-plugin: 3.8.1 + maven-surefire-plugin: 2.22.1 + shared-data: + buildtool: + build-dir: target + guide: https://quarkus.io/guides/maven-tooling.html + guide-native: https://quarkus.io/guides/building-native-image + cmd: + dev: ./mvnw compile quarkus:dev + package: ./mvnw package + package-uberjar: ./mvnw package -PuberJar + package-native: ./mvnw package -Pnative + package-native-container: ./mvnw package -Pnative -Dquarkus.native.container-build=true diff --git a/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/maven/kotlin/pom.tpl.qute.xml b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/maven/kotlin/pom.tpl.qute.xml new file mode 100644 index 00000000000000..f87cc6b6345bb5 --- /dev/null +++ b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/maven/kotlin/pom.tpl.qute.xml @@ -0,0 +1,67 @@ + + + {maven.version.kotlin} + + + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + + + + io.rest-assured + kotlin-extensions + test + + + + src/main/kotlin + src/test/kotlin + + + + kotlin-maven-plugin + org.jetbrains.kotlin + $\{kotlin.version} + + + compile + + compile + + + + test-compile + + test-compile + + + + + true + 1.8 + + + all-open + + + + + + + + + + + + + org.jetbrains.kotlin + kotlin-maven-allopen + $\{kotlin.version} + + + + + + \ No newline at end of file diff --git a/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/maven/scala/pom.tpl.qute.xml b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/maven/scala/pom.tpl.qute.xml new file mode 100644 index 00000000000000..00c9283819430f --- /dev/null +++ b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/buildtool/maven/scala/pom.tpl.qute.xml @@ -0,0 +1,62 @@ + + + {maven.version.scala-maven-plugin} + {maven.version.scala} + + + + io.quarkus + quarkus-scala + + + org.scala-lang + scala-library + $\{scala.version} + + + org.scala-lang + scala-reflect + $\{scala.version} + + + + src/main/scala + src/test/scala + + + net.alchim31.maven + scala-maven-plugin + $\{scala-maven-plugin.version} + + + scala-compile-first + process-resources + + add-source + compile + + + + scala-test-compile + process-test-resources + + add-source + testCompile + + + + + $\{scala.version} + + -deprecation + -feature + -explaintypes + -target:jvm-1.8 + -Ypartial-unification + + + + + + \ No newline at end of file diff --git a/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/config/properties/codestart.yml b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/config/properties/codestart.yml new file mode 100644 index 00000000000000..b7de311e246fa0 --- /dev/null +++ b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/config/properties/codestart.yml @@ -0,0 +1,9 @@ +--- +name: config-properties +type: config +fallback: true +language: + base: + shared-data: + config: + file-name: application.properties \ No newline at end of file diff --git a/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/config/yaml/codestart.yml b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/config/yaml/codestart.yml new file mode 100644 index 00000000000000..e3829b28166eb2 --- /dev/null +++ b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/config/yaml/codestart.yml @@ -0,0 +1,8 @@ +--- +name: config-yaml +type: config +language: + base: + shared-data: + config: + file-name: application.yml \ No newline at end of file diff --git a/independent-projects/tools/devtools-common/src/test/resources/templates/index.ftl b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/example/base-example/base/src/main/resources/META-INF/resources/index.tpl.qute.html similarity index 82% rename from independent-projects/tools/devtools-common/src/test/resources/templates/index.ftl rename to devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/example/base-example/base/src/main/resources/META-INF/resources/index.tpl.qute.html index ef51dbc6ab16c3..58552e6516d786 100644 --- a/independent-projects/tools/devtools-common/src/test/resources/templates/index.ftl +++ b/devtools/platform-descriptor-json/src/main/resources/bundled-codestarts/example/base-example/base/src/main/resources/META-INF/resources/index.tpl.qute.html @@ -2,7 +2,7 @@ - ${project_artifactId} - ${project_version} + {project.artifact-id} - {project.version}