Skip to content

Commit a6b6f0c

Browse files
authored
Initializr website integration (#4551)
* Updating version numbers for the initializr with every new release * Added initializr to website build process * Integrated initializr into the website * Fixed website yml * Fixed conflict between JavaDoc generation and Initializr build * Fix for CI build issue
1 parent 3fc841a commit a6b6f0c

File tree

24 files changed

+495
-3
lines changed

24 files changed

+495
-3
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Initializr CN1 Version PR
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
- "[0-9]*"
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
jobs:
14+
update-initializr-versions:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Update Initializr Codename One versions
21+
run: ./scripts/initializr/update-cn1-version.sh "${GITHUB_REF_NAME}"
22+
23+
- name: Create pull request
24+
uses: peter-evans/create-pull-request@v6
25+
with:
26+
commit-message: "scripts/initializr: bump Codename One versions to ${{ github.ref_name }}"
27+
title: "scripts/initializr: bump Codename One versions to ${{ github.ref_name }}"
28+
body: |
29+
Automated update of Codename One versions in `scripts/initializr` after release `${{ github.ref_name }}`.
30+
31+
Updated:
32+
- All `scripts/initializr/**/pom.xml` files containing `cn1.plugin.version`
33+
- `scripts/initializr/common/src/main/java/com/codename1/initializr/model/GeneratorModel.java`
34+
- `scripts/initializr/common/src/test/java/com/codename1/initializr/model/GeneratorModelMatrixTest.java`
35+
branch: automation/initializr-cn1-version-${{ github.ref_name }}
36+
delete-branch: true
37+
labels: |
38+
automation
39+
initializr
40+
add-paths: |
41+
scripts/initializr

.github/workflows/website-docs.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ jobs:
3434
hugo-version: 'latest'
3535
extended: true
3636

37-
- name: Set up Java 25
37+
- name: Set up Java 8 for Initializr build
3838
uses: actions/setup-java@v4
3939
with:
4040
distribution: temurin
41-
java-version: '25'
41+
java-version: '8'
4242

4343
- name: Set up Ruby
4444
uses: ruby/setup-ruby@v1
@@ -69,13 +69,39 @@ jobs:
6969
env:
7070
GITHUB_TOKEN: ${{ github.token }}
7171

72+
- name: Set up Java 25 for website build
73+
uses: actions/setup-java@v4
74+
with:
75+
distribution: temurin
76+
java-version: '25'
77+
7278
- name: Build website
7379
run: |
7480
set -euo pipefail
7581
scripts/website/build.sh
7682
env:
7783
WEBSITE_INCLUDE_JAVADOCS: "true"
7884
WEBSITE_INCLUDE_DEVGUIDE: "true"
85+
WEBSITE_INCLUDE_INITIALIZR: "auto"
86+
CN1_USER: ${{ secrets.CN1_USER }}
87+
CN1_TOKEN: ${{ secrets.CN1_TOKEN }}
88+
89+
- name: Validate Initializr page output
90+
run: |
91+
set -euo pipefail
92+
test -f docs/website/public/initializr/index.html
93+
94+
- name: Validate Initializr JS bundle output
95+
run: |
96+
set -euo pipefail
97+
if [ -n "${CN1_USER}" ] && [ -n "${CN1_TOKEN}" ]; then
98+
test -f docs/website/public/initializr-app/index.html
99+
else
100+
echo "CN1 credentials not configured; skipping Initializr JS bundle output validation."
101+
fi
102+
env:
103+
CN1_USER: ${{ secrets.CN1_USER }}
104+
CN1_TOKEN: ${{ secrets.CN1_TOKEN }}
79105

80106
- name: Validate redirects against local Pages runtime
81107
run: |

docs/website/content/initializr.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
+++
2+
title = "Initializr"
3+
description = "Create a new Codename One project directly in your browser."
4+
layout = "initializr"
5+
+++

docs/website/data/cn1libs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"source_url": "https://raw.githubusercontent.com/codenameone/CodenameOneLibs/refs/heads/master/CN1Libs.xml",
3-
"generated_at_utc": "2026-02-19T02:09:34.831273+00:00",
3+
"generated_at_utc": "2026-02-19T18:31:11.399307+00:00",
44
"status": "ok",
55
"error": "",
66
"count": 85,

docs/website/hugo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ name = "Dashboard"
7979
url = "https://cloud.codenameone.com/secure/index.html"
8080
weight = 15
8181

82+
[[menu.main]]
83+
parent = "developers"
84+
name = "Initializr"
85+
url = "/initializr/"
86+
weight = 16
87+
8288
[[menu.main]]
8389
identifier = "resources"
8490
name = "RESOURCES"
Lines changed: 276 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,276 @@
1+
{{- define "main" }}
2+
<section class="cn1-initializr-page">
3+
<header class="cn1-initializr-header">
4+
{{ partial "breadcrumbs.html" . }}
5+
<h1>{{ .Title }}</h1>
6+
{{ with .Description }}<p>{{ . }}</p>{{ end }}
7+
</header>
8+
9+
<div class="cn1-initializr-shell">
10+
<div id="cn1-splash" class="cn1-splash">
11+
<img class="icon" src="/initializr-app/icon.png" alt="Initializr icon" />
12+
<div class="cn1-loader"></div>
13+
<div class="progress-bar">
14+
<div class="progress-bar-internal"></div>
15+
</div>
16+
<p class="cn1-splash-label">Preparing Initializr...</p>
17+
</div>
18+
<canvas width="320" height="480" id="codenameone-canvas"></canvas>
19+
</div>
20+
</section>
21+
22+
<style>
23+
.cn1-initializr-page {
24+
max-width: 1180px;
25+
margin: 0 auto;
26+
padding: 1.25rem 1rem 2rem;
27+
}
28+
29+
.cn1-initializr-header h1 {
30+
margin: 0.25rem 0 0.35rem;
31+
}
32+
33+
.cn1-initializr-header p {
34+
margin: 0 0 1rem;
35+
opacity: 0.82;
36+
}
37+
38+
.cn1-initializr-shell {
39+
position: relative;
40+
min-height: clamp(560px, 74vh, 900px);
41+
border-radius: 16px;
42+
overflow: hidden;
43+
border: 1px solid var(--border);
44+
background: radial-gradient(circle at 20% 0%, #e9f1ff 0%, #f9fbff 40%, #ffffff 100%);
45+
box-shadow: 0 14px 42px rgba(0, 0, 0, 0.12);
46+
}
47+
48+
html.dark .cn1-initializr-shell {
49+
background: radial-gradient(circle at 20% 0%, #172236 0%, #121a2a 45%, #0d1321 100%);
50+
box-shadow: 0 20px 48px rgba(0, 0, 0, 0.48);
51+
}
52+
53+
#codenameone-canvas {
54+
position: absolute;
55+
inset: 0;
56+
width: 100%;
57+
height: 100%;
58+
}
59+
60+
.cn1-splash {
61+
position: absolute;
62+
inset: 0;
63+
display: grid;
64+
place-items: center;
65+
align-content: center;
66+
gap: 1rem;
67+
z-index: 2;
68+
text-align: center;
69+
padding: 2rem;
70+
color: #1d2638;
71+
background:
72+
radial-gradient(1000px 420px at 20% 0%, rgba(99, 142, 255, 0.22), rgba(99, 142, 255, 0) 65%),
73+
radial-gradient(720px 360px at 100% 100%, rgba(60, 173, 216, 0.2), rgba(60, 173, 216, 0) 65%);
74+
}
75+
76+
html.dark .cn1-splash {
77+
color: #d8e4ff;
78+
}
79+
80+
.cn1-splash img.icon {
81+
width: 110px;
82+
height: auto;
83+
border-radius: 18px;
84+
box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
85+
}
86+
87+
.cn1-loader {
88+
width: 46px;
89+
height: 46px;
90+
border-radius: 50%;
91+
border: 3px solid rgba(49, 105, 230, 0.25);
92+
border-top-color: #3169e6;
93+
animation: cn1-spin 0.9s linear infinite;
94+
}
95+
96+
.cn1-splash .progress-bar {
97+
display: block;
98+
width: min(340px, 75vw);
99+
height: 9px;
100+
border-radius: 999px;
101+
overflow: hidden;
102+
border: 1px solid rgba(49, 105, 230, 0.25);
103+
background: rgba(255, 255, 255, 0.7);
104+
}
105+
106+
.cn1-splash .progress-bar .progress-bar-internal {
107+
width: 0;
108+
height: 100%;
109+
border-radius: 999px;
110+
background: linear-gradient(90deg, #2f66e4, #3dc8d1);
111+
box-shadow: 0 0 18px rgba(47, 102, 228, 0.5);
112+
transition: width 160ms ease-out;
113+
}
114+
115+
.cn1-splash .cn1-splash-label {
116+
margin: 0;
117+
font-size: 0.95rem;
118+
opacity: 0.88;
119+
}
120+
121+
.cn1-edit-string, .cn1-string-picker {
122+
position: absolute;
123+
background-color: transparent;
124+
z-index: 1000;
125+
box-sizing: content-box;
126+
}
127+
128+
.cn1-native-peer {
129+
position: absolute;
130+
border: none;
131+
}
132+
133+
.cn1-capture-dialog,
134+
.cn1-capture-preview-dialog {
135+
position: fixed;
136+
top: 10px;
137+
left: 10px;
138+
right: 10px;
139+
bottom: 10px;
140+
border: 1px solid #222;
141+
background: rgba(33, 33, 33, 0.9);
142+
z-index: 1000;
143+
}
144+
145+
@keyframes cn1-spin {
146+
to {
147+
transform: rotate(360deg);
148+
}
149+
}
150+
</style>
151+
152+
<script>
153+
window.cn1_debug_flags = {
154+
disableTouchstart: false,
155+
disableTouchend: false,
156+
disableHover: false,
157+
disableMouseup: false,
158+
disableMousedown: false,
159+
disableWheel: false,
160+
debugLog: false,
161+
useNativeQueue: false
162+
};
163+
164+
(function() {
165+
var cn1ToLoad = {
166+
"teavm/classes.js": {size: 0, loaded: false},
167+
"style.css": {size: 4923, loaded: false},
168+
"js/pwa.js": {size: 584, loaded: false},
169+
"js/bootstrap.min.js": {size: 35951, loaded: false},
170+
"js/fontmetrics.js": {size: 145730, loaded: false},
171+
"js/upup.min.js": {size: 939, loaded: false},
172+
"js/push.js": {size: 12310, loaded: false},
173+
"js/jquery.min.js": {size: 84319, loaded: false},
174+
"js/manup.js": {size: 6493, loaded: false},
175+
"css/bootstrap-theme.min.css": {size: 19963, loaded: false},
176+
"css/bootstrap.min.css": {size: 117305, loaded: false},
177+
"assets/material-design-font.ttf": {size: 353892, loaded: false},
178+
"assets/grub-css.zip": {size: 1915434, loaded: false},
179+
"assets/barebones-css.zip": {size: 599, loaded: false},
180+
"assets/cn1-version-numbers": {size: 41, loaded: false},
181+
"assets/iOS7Theme.res": {size: 300158, loaded: false},
182+
"assets/common.zip": {size: 297101, loaded: false},
183+
"assets/idea.zip": {size: 4555, loaded: false},
184+
"assets/tweet-css.zip": {size: 2884, loaded: false},
185+
"assets/android_holo_light.res": {size: 114442, loaded: false},
186+
"assets/grub-cn1libs.zip": {size: 967546, loaded: false},
187+
"assets/tweet-pom.xml": {size: 16251, loaded: false},
188+
"assets/vscode.zip": {size: 1024, loaded: false},
189+
"assets/CN1Resource.res": {size: 5961, loaded: false},
190+
"assets/kotlin-pom.xml": {size: 15565, loaded: false},
191+
"assets/theme.res": {size: 425304, loaded: false},
192+
"assets/tweet-src.zip": {size: 357703, loaded: false},
193+
"assets/barebones-src.zip": {size: 1327, loaded: false},
194+
"assets/grub-pom.xml": {size: 15778, loaded: false},
195+
"assets/barebones-pom.xml": {size: 15843, loaded: false},
196+
"assets/grub-src.zip": {size: 279805, loaded: false},
197+
"assets/eclipse.zip": {size: 11898, loaded: false},
198+
"assets/kotlin-src.zip": {size: 1507, loaded: false},
199+
"assets/netbeans.zip": {size: 2877, loaded: false}
200+
};
201+
202+
window.cn1LoadedFile = function(filename) {
203+
if (filename.indexOf("?") >= 0) {
204+
filename = filename.substring(0, filename.indexOf("?"));
205+
}
206+
if (cn1ToLoad[filename]) {
207+
cn1ToLoad[filename].loaded = true;
208+
}
209+
};
210+
211+
var progressTimer = window.setInterval(function() {
212+
if (!window.jQuery) {
213+
return;
214+
}
215+
var splash = jQuery("#cn1-splash");
216+
if (splash.length === 0) {
217+
clearInterval(progressTimer);
218+
return;
219+
}
220+
var bytesRequired = 0;
221+
var bytesLoaded = 0;
222+
for (var f in cn1ToLoad) {
223+
bytesRequired += cn1ToLoad[f].size;
224+
if (cn1ToLoad[f].loaded) {
225+
bytesLoaded += cn1ToLoad[f].size;
226+
}
227+
}
228+
if (bytesRequired > 0) {
229+
var pct = Math.min(100, Math.round(bytesLoaded / bytesRequired * 100));
230+
jQuery(".progress-bar-internal", splash).css("width", pct + "%");
231+
if (pct >= 100) {
232+
jQuery(".cn1-splash-label", splash).text("Launching Initializr...");
233+
}
234+
}
235+
}, 180);
236+
})();
237+
</script>
238+
<link rel="stylesheet" href="/initializr-app/css/bootstrap.min.css">
239+
<link rel="stylesheet" href="/initializr-app/css/bootstrap-theme.min.css">
240+
<link rel="stylesheet" href="/initializr-app/style.css">
241+
<script src="/initializr-app/js/push.js"></script>
242+
<script>window.cn1LoadedFile("js/push.js");</script>
243+
<script src="/initializr-app/js/jquery.min.js"></script>
244+
<script>window.cn1LoadedFile("js/jquery.min.js");</script>
245+
<script src="/initializr-app/js/fontmetrics.js"></script>
246+
<script>window.cn1LoadedFile("js/fontmetrics.js");</script>
247+
<script src="/initializr-app/teavm/classes.js"></script>
248+
<script>window.cn1LoadedFile("teavm/classes.js");</script>
249+
<script>
250+
(function() {
251+
function splashMessage(msg) {
252+
var node = document.querySelector("#cn1-splash .cn1-splash-label");
253+
if (node) {
254+
node.textContent = msg;
255+
}
256+
}
257+
if (!window.jQuery) {
258+
splashMessage("Initializr bundle is unavailable in this preview.");
259+
return;
260+
}
261+
jQuery(document).ready(function() {
262+
if (typeof window.main === "function") {
263+
window.main();
264+
} else {
265+
splashMessage("Initializr failed to initialize.");
266+
}
267+
});
268+
})();
269+
</script>
270+
<script src="/initializr-app/js/bootstrap.min.js"></script>
271+
<script>window.cn1LoadedFile("js/bootstrap.min.js");</script>
272+
<script src="/initializr-app/js/upup.min.js"></script>
273+
<script>window.cn1LoadedFile("js/upup.min.js");</script>
274+
<script src="/initializr-app/js/manup.js"></script>
275+
<script>window.cn1LoadedFile("js/manup.js");</script>
276+
{{- end }}
731 Bytes
Binary file not shown.
942 KB
Binary file not shown.
60.7 KB
Binary file not shown.
599 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)