Skip to content

Commit

Permalink
Merge pull request #68 from ia3andy/codestart
Browse files Browse the repository at this point in the history
Codestart
  • Loading branch information
mkouba committed Dec 20, 2023
2 parents 71d636c + a64d87e commit aa955bc
Show file tree
Hide file tree
Showing 8 changed files with 132 additions and 1 deletion.
5 changes: 5 additions & 0 deletions integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-devtools-testing</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package io.quarkiverse.qute.web.it;

import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartCatalog.Language.JAVA;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.devtools.testing.codestarts.QuarkusCodestartTest;

public class QuteWebCodestartTest {

@RegisterExtension
public static QuarkusCodestartTest codestartTest = QuarkusCodestartTest.builder()
.setupStandaloneExtensionTest("io.quarkiverse.qute.web:quarkus-qute-web")
.languages(JAVA)
.build();

@Test
void testContent() throws Throwable {
codestartTest.assertThatGeneratedFileMatchSnapshot(JAVA, "src/main/resources/templates/pub/some-page.html");
}

@Test
void buildAllProjectsForLocalUse() throws Throwable {
codestartTest.buildAllProjects();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{#let name=http:param('name', 'Qute')}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello {name}</title>
<style>
body {
background-color: #000;
color: #fff;
}
h1 {
color: #4695EB;
font-size: 6vw;
}

h1 b {
color: #be9100;
}

p {
font-size: 2vw;
}
</style>
</head>
<body>
<h1>Hello <b>{name}</b></h1>

<p>Create your Web page using Quarkus & Qute</p>
</body>
</html>
20 changes: 20 additions & 0 deletions runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,26 @@
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>generate-codestart-jar</id>
<phase>generate-resources</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classesDirectory>${project.basedir}/src/main</classesDirectory>
<includes>
<include>codestarts/**</include>
</includes>
<classifier>codestarts</classifier>
<skipIfEmpty>true</skipIfEmpty>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-extension-maven-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{#include readme-header /}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{#let name=http:param('name', 'Qute')}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello {name}</title>
<style>
body {
background-color: #000;
color: #fff;
}
h1 {
color: #4695EB;
font-size: 6vw;
}

h1 b {
color: #be9100;
}

p {
font-size: 2vw;
}
</style>
</head>
<body>
<h1>Hello <b>{name}</b></h1>

<p>Create your Web page using Quarkus & Qute</p>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: qute-web-codestart
ref: qute-web
tags: extension-codestart
type: code
metadata:
title: Qute Web
description: Create your web page using Quarkus and Qute
path: /some-page
related-guide-section: https://quarkus.io/guides/qute#type-safe-templates
9 changes: 8 additions & 1 deletion runtime/src/main/resources/META-INF/quarkus-extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,11 @@ metadata:
guide: https://quarkiverse.github.io/quarkiverse-docs/quarkus-qute-web/dev/index.html
categories:
- "web"
status: "preview"
status: "preview"
codestart:
name: "qute-web"
languages:
- "java"
- "kotlin"
- "scala"
artifact: "io.quarkiverse.qute.web:quarkus-qute-web:codestarts:jar:${project.version}"

0 comments on commit aa955bc

Please sign in to comment.