1 # Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
2 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3 #
4 # This code is free software; you can redistribute it and/or modify it
5 # under the terms of the GNU General Public License version 2 only, as
6 # published by the Free Software Foundation.
7 #
8 # This code is distributed in the hope that it will be useful, but WITHOUT
9 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 # version 2 for more details (a copy is included in the LICENSE file that
12 # accompanied this code).
13 #
14 # You should have received a copy of the GNU General Public License version
15 # 2 along with this work; if not, write to the Free Software Foundation,
16 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 #
18 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 # or visit www.oracle.com if you need additional information or have any
20 # questions.
21
22 #===============================================================================
23 # Leyden-premain + Quarkus getting-started demo
24 # - https://quarkus.io/guides/getting-started
25 # - https://quarkus.io/guides/lifecycle
26 #
27 # See ../lib/DemoSupport.gmk for the "make" targets that build the demo, run the
28 # demo, and gather benchmarking data.
29 #===============================================================================
30
31 # The following needs to be defined before including ../lib/DemoSupport.gmk
32 DEMO_NAME = quarkus-getting-started
33 DEMO_SRC = getting-started/src/main/java/Main.java
34 DEMO_JAR = getting-started/target/getting-started-1.0.0-SNAPSHOT-runner.jar
35 DEMO_CMDLINE = -DautoQuit=true -Dquarkus.http.port=0 -jar ${DEMO_JAR}
36 # This is for uploading into Artifactory, usually to a path like
37 # https://xxxx.com/artifactory/yyyy/io/quarkus/quarkus-getting-started/1.0.0b/quarkus-getting-started-1.0.0b.zip
38 DEMO_ARTIFACT = quarkus-getting-started-1.0.0b.zip
39
40 include ../lib/DemoSupport.gmk
41
42 # Create the project using instructions from https://quarkus.io/guides/getting-started, then
43 # add the Main class which prints out the timing data and exits.
44 ${DEMO_SRC}: Main.java
45 rm -rf getting-started
46 JAVA_HOME=${BLDJDK_HOME} ${MVN} \
47 io.quarkus.platform:quarkus-maven-plugin:3.9.3:create \
48 -DprojectGroupId=org.acme \
49 -DprojectArtifactId=getting-started \
50 -Dextensions='rest'
51 cp Main.java ${DEMO_SRC}
52
53 # We package the app in the "legacy-jar" to be CDS friendly
54 # See https://quarkus.io/guides/class-loading-reference:
55 # "everything is loaded in the system ClassLoader, so it is a completely flat classpath."
56 # See https://www.cheat-sheets.org/saved-copy/quarkus-cheat-sheet.pdf
57 ${DEMO_JAR}: ${DEMO_SRC}
58 cd getting-started && JAVA_HOME=${BLDJDK_HOME} ${MVN} -Dquarkus.package.type=legacy-jar install
59
60 ${DEMO_ARTIFACT}: ${DEMO_JAR}
61 ${JAR} cvfM ${DEMO_ARTIFACT} \
62 -C getting-started/target .
63
64 clean: clean0
65 rm -rf getting-started ${DEMO_ARTIFACT}
66
67 clean0:
68 rm -f *.cds *.cds.code *.classlist *.jsa *~ *.log *.log.* hs_err_* *.aot *.aotconf
69