Skip to content

Commit c7cb359

Browse files
authored
Remove UWP (windows-device) build target from Maven and initializr templates (#4624)
### Motivation - Remove the UWP (`windows-device`/`uwp`) build target from the Maven plugin, generated POM templates and helper scripts so generated projects and IDE shortcuts no longer advertise or attempt UWP builds. - Remove IDE/run-configuration shortcuts and CLI wrapper commands that referenced UWP so tooling/documentation matches supported targets. - Prevent the initializr `win` module from defaulting to a UWP build target so new projects do not try to submit UWP builds by default. ### Description - Deleted the UWP build wrapper class and mojo (`maven/codenameone-maven-plugin/src/main/java/com/codename1/maven/buildWrappers/BuildWindowsDeviceMojo.java`). - Removed the `windows-device` Ant target from the plugin template (`maven/codenameone-maven-plugin/src/main/resources/com/codename1/maven/buildxml-template.xml`) and removed `windows-device/uwp` entries from the IntelliJ `workspace.xml` template (`maven/codenameone-maven-plugin/src/main/resources/com/codename1/maven/intellij/workspace.xml`). - Removed `uwp`/`windows-device` profiles and mentions from initializr templates and generated POM fragments (`scripts/initializr/common/pom.xml` and the `common/src/main/resources/*-pom.xml` templates) so starter POMs no longer include a UWP profile. - Updated initializr helper scripts to drop `windows_device`/`uwp` commands from the Bash/Batch wrappers (`scripts/initializr/build.sh`, `scripts/initializr/build.bat`) and removed the UWP command/mentions from the CLI wrapper source and docs (`maven/cli/src/main/batsh/build.batsh`, `maven/cli/README.adoc`). - Changed the `initializr-win` module default build target to `none` (`scripts/initializr/win/pom.xml`) so activating that module does not implicitly select a UWP build. - Adjusted the CN1 build mojo documentation/comment to reflect the removed target from the documented list of supported build targets (`maven/codenameone-maven-plugin/src/main/java/com/codename1/maven/CN1BuildMojo.java`). ### Testing - Ran a repository search to validate remaining references: `rg -n "UWP|uwp|windows-device|buildWindowsUWP" maven/codenameone-maven-plugin maven/cli scripts/initializr -g '!**/target/**'` and confirmed the targeted UWP entries in the changed modules were removed. - Attempted to build the Maven plugin module with Java 8 disabled in this environment by running `mvn -f maven/pom.xml -pl codenameone-maven-plugin -am -DskipTests package`; the build started and progressed to module compilation in this environment (no plugin errors surfaced while packaging reached the plugin module stage). - Attempted to build the initializr module with `mvn -f scripts/initializr/pom.xml -DskipTests package`, which failed in this environment due to an unrelated network issue while downloading `UpdateCodenameOne.jar` (`java.net.SocketException: Network is unreachable`), so the full module package step could not be completed here.
1 parent d8b9813 commit c7cb359

32 files changed

Lines changed: 33 additions & 708 deletions

docs/developer-guide/Advanced-Topics-Under-The-Hood.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ rim.nativeBrowser true/false defaults to false. Enables the native blackberry br
480480
|The JVM that should be bundled in the Windows desktop build. Windows desktop builds only. Supported values: zulu8, zuluFx8, zulu8-32bit, zuluFx8-32bit, zulu11, zuluFx11, zulu11-32bit, zuluFx11-32bit
481481

482482
|windows.extensions
483-
|Content to be embedded into the `<Extensions>` section of the Package.appxmanifest file for windows (UWP) builds.
483+
|Historical build hint for the discontinued UWP target. It is retained here only for legacy reference and is not used by current supported build targets.
484484

485485
|win.vm32bit
486486
|true/false (defaults to false). Forces windows desktop builds to use the Win32 JVM instead of the 64 bit VM making them compatible with older Windows Machines. This is off by default at the moment because of a bug in JDK 8 update 112 that might cause this to fail for some cases

docs/developer-guide/Index.asciidoc

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This effectively means bringing that old "Write Once Run Anywhere" (WORA) Java m
1414
The things that make Codename One stand out from other tools in this field are:
1515

1616
* Write Once Run Anywhere support with no special hardware requirements and 100% code reuse (((Reuse)))
17-
* Compiles Java/Kotlin into native code for iOS, UWP (Universal Windows Platform), Android and even JavaScript/PWA
17+
* Compiles Java/Kotlin into native code for iOS, Android and even JavaScript/PWA
1818
* Open Source and Free with commercial backing/support
1919
* Easy to use with 100% portable Drag and Drop GUI builder
2020
* Full access to underlying native OS capabilities using the native OS programming language (e.g. Objective-C) without compromising portability
@@ -59,7 +59,7 @@ On iOS, Codename One built and open sourced ParparVM, which is a very conservati
5959

6060
NOTE: Codename One translates the bytecode to C which is faster than Swift/Objective-C. The port code that invokes iOS API's is hand coded in Objective-C
6161

62-
For Windows 10 desktop and Mobile support, Codename One uses iKVM to target UWP (Universal Windows Platform) and has open sourced the changes to the original iKVM code.
62+
Codename One previously offered a UWP (Universal Windows Platform) target based on iKVM. That target was discontinued in release 7.0.229 and is preserved only as historical context in older documentation and blog posts.
6363

6464
JavaScript build targets use TeaVM to do the translation statically. TeaVM provides support for threading using JavaScript by breaking the app down in a rather elaborate way. To support the complex UI Codename One uses the HTML5 Canvas API which allows absolute flexibility for building applications.
6565

@@ -94,15 +94,11 @@ The key advantages of ParparVM over other approaches are:
9494

9595
- *Simple and Extensible* -- to work with ParparVM you need a basic understanding of C. This is crucial for the fast moving world of mobile development, as Apple changes things left and right we need a more agile VM.
9696

97-
===== Windows Phone/UWP
97+
===== Historical Windows Ports
9898

99-
In the past Codename One had 2 major Windows VM port rewrites and 3 or 4 rendering pipelines within those ports (depends on how you would define a "rewrite").
99+
Codename One experimented with multiple Windows ports over the years, including the legacy Windows Phone target and a later UWP (Universal Windows Platform) target based on iKVM.
100100

101-
NOTE: The old Windows Phone port was deprecated and is no longer supported, the UWP port is the only supported Windows mobile target
102-
103-
Codename One now targets UWP by leveraging a https://github.com/shannah/cn1-ikvm-uwp[modified version of iKVM] to build native Windows Universal Applications.
104-
105-
iKVM uses a bytecode to CLR translation process that effectively converts Java bytecode directly to the .net equivalent. This is paired with a port of the Codename One API's that was built for the UWP environment. The UWP port generates native Windows 10 applications that can support ARM Windows devices natively as well as desktops etc. These binaries can be uploaded directly to Microsofts online store without special processing.
101+
NOTE: The UWP target was discontinued in release 7.0.229 and is no longer part of the supported build targets. Older references to it in historical material are retained only for archival context.
106102

107103
===== JavaScript Port
108104

docs/developer-guide/Maven-Creating-CN1Libs.adoc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,6 @@ If we do a file listing on the project directory, it shows the following:
223223
----
224224
Steves-Mac-Pro:MyFirstLibrary shannah$ find .
225225
.
226-
./win
227-
./win/pom.xml
228-
./win/src
229-
./win/src/main
230-
./win/src/main/csharp
231-
./win/src/main/csharp/com
232-
./win/src/main/csharp/com/example
233-
./win/src/main/csharp/com/example/myfirstlib
234226
./tests
235227
./tests/pom.xml
236228
./tests/javase

docs/developer-guide/Push-Notifications.asciidoc

Lines changed: 5 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Let's take minute to go over the three callbacks in our application.
6565

6666
==== Registration
6767

68-
When your application first opens, it needs to register with the platform's central cloud messaging infrastructure. On Android this involves a call to their GCM/FCM server; on iOS, the call will be to the APNS server, on Windows (UWP) the call will be to the WNS server. And so on. That server will return a unique device ID that can be used to send push notifications to the device. This device ID will then be passed to your `registeredForPush()` method as the `deviceId` parameter so that you can save it somewhere. Typically you would send this value to your own web service so that you can use it to send notifications to the device later on. The device ID will generally not change unless you uninstall and reinstall the app, but you will receive the callback every time the app starts.
68+
When your application first opens, it needs to register with the platform's central cloud messaging infrastructure. On Android this involves a call to their GCM/FCM server; on iOS, the call will be to the APNS server. And so on. That server will return a unique device ID that can be used to send push notifications to the device. This device ID will then be passed to your `registeredForPush()` method as the `deviceId` parameter so that you can save it somewhere. Typically you would send this value to your own web service so that you can use it to send notifications to the device later on. The device ID will generally not change unless you uninstall and reinstall the app, but you will receive the callback every time the app starts.
6969

7070
IMPORTANT: The `deviceId` parameter cannot be used directly when sending push messages via the Codename One push service. It needs to be prefixed with a platform identifier so the that push server knows which messaging service to route the message through. You can obtain the complete device ID, including the platform prefix, by calling `Push.getPushKey()`
7171

@@ -318,7 +318,7 @@ Rich push notifications refer to push notifications that include functionality a
318318

319319
==== Image Attachment Support
320320

321-
When you attach an image to a push notification, it will appear as a large image in the push notification on the user's device if that device supports it. iOS supports image attachments in iOS 10, Android supports them in API 26. The Javascript port, and Windows (UWP) port do not currently support image attachments. If a platform that doesn't support image attachments receives a push notification with an image attachment, it will just ignore it.
321+
When you attach an image to a push notification, it will appear as a large image in the push notification on the user's device if that device supports it. iOS supports image attachments in iOS 10, Android supports them in API 26. The Javascript port does not currently support image attachments. If a platform that doesn't support image attachments receives a push notification with an image attachment, it will just ignore it.
322322

323323
Push type "99" is used to send rich push notifications. It is sort of a "meta" push type, or a "container", as it can be used to send any of the other push types, but to attach additional content, such as image attachments.
324324

@@ -590,53 +590,9 @@ You can read more about the certificate wizard in the https://www.codenameone.co
590590
You can read more about the certificate wizard in the <<signing-section-top-heading,signing section>>
591591
////
592592

593-
[[push-bureaucracy-uwp-section]]
594-
==== The Push Bureaucracy - UWP (Windows 10)
593+
==== Historical Note About UWP Push
595594

596-
Push on UWP requires only that you register your app in the Windows Store Dashboard. You will then be provided with credentials (Package Security Identifier (SID) and a secret key) that you can use to send push notifications to your app. To begin this process, go to the https://developer.microsoft.com/en-us/windows[Windows Dev Center] and select "Dashboard".
597-
598-
// HTML_ONLY_START
599-
You can read more about the registering your app in the Windows store https://www.codenameone.com/manual/appendix-uwp.html#building-for-the-windows-store[here].
600-
// HTML_ONLY_END
601-
////
602-
//PDF_ONLY
603-
You can read more about the registering your app in the Windows store <<building-for-the-windows-store,here>>
604-
////
605-
606-
Once you have registered your app in the Windows Store, and completed the corresponding setup in Codename One settings (e.g. generated a certificate), you should proceed to configure your app for push notifications.
607-
608-
Navigate to the App overview page for your app inside the Windows store dashboard. Under the "Services" menu (left side), select "Push notifications".
609-
610-
.Push notifications menu item in Windows Store dashboard
611-
image::img/windows-store-push-notications-menu.png[Push notifications menu item in Windows Store dashboard,scaledwidth=10%]
612-
613-
Then, select the "WNS/MPNS" option that appears in the left menu under "Push notifications"
614-
615-
.WNS menu item in Windows Store dashboard
616-
image::img/windows-store-wns-menu-item.png[WNS menu item in Windows Store dashboard,scaledwidth=10%]
617-
618-
This will bring you to a page with information about WNS push notifications. You'll be interested in the paragraph shown here:
619-
620-
.Live services link
621-
image::img/wns-live-services-link.png[Live services link,scaledwidth=20%]
622-
623-
Click on the "Live Services Site" link.
624-
625-
You'll be prompted to log in using your Windows Store account. Then you'll be taken to a page that contains the push credentials that you can use for sending push messages to your app. You'll be interested in two values:
626-
627-
Package SID. (It will be of the form "ms-app://XXXXXXXXXXX...")
628-
629-
.WNS Package SID
630-
image::img/wns-package-id.png[WNS Package SID,scaledwidth=20%]
631-
632-
Client Secret. This will be listed in a section called "Application Secrets"
633-
634-
.WNS Client secret
635-
image::img/wns-client-secret.png[WNS Client secret,scaledwidth=20%]
636-
637-
You will use these two values for sending push notifications to your app.
638-
639-
Microsoft provides full instructions on setting up WNS notifications https://msdn.microsoft.com/library/windows/apps/hh465407[here] but much of this is not relevant for Codename One apps. For Codename One apps, one need only obtain Package Security ID and client secret values for the app.
595+
The Codename One UWP target was discontinued in release 7.0.229. Older references to WNS setup, Package SID values, and client secrets are preserved only in archived material for teams maintaining legacy code outside the current supported build flow.
640596

641597
[[push-bureaucracy-javascript-section]]
642598
==== The Push Bureaucracy - Javascript
@@ -686,13 +642,8 @@ The instructions for extracting the API key for Google are <<push-bureaucracy-an
686642
private static final String FCM_SERVER_API_KEY = "******************-********************";
687643
-----
688644

689-
The instructions for extracting the SID and Client Secret for Windows are <<push-bureaucracy-uwp-section,listed above>>.
645+
Historical UWP push credentials (SID/client secret) were used only by the discontinued UWP target, which was removed in release 7.0.229.
690646

691-
[source,java]
692-
-----
693-
private static final String WNS_SID = "ms-app://**************************************";
694-
private static final String WNS_CLIENT_SECRET = "*************************";
695-
-----
696647

697648
When sending push to iOS devices we have two modes:
698649
- Production
@@ -775,8 +726,6 @@ We can send a push message as an HTTP `POST` request to https://push.codenameone
775726
- *production* - `true`/`false` whether to push to production or sandbox environment in iOS - `ITUNES_PRODUCTION_PUSH`
776727
- *certPassword* - password for the push certificate in iOS push - `ITUNES_DEVELOPMENT_PUSH_CERT_PASSWORD` or `ITUNES_PRODUCTION_PUSH_CERT_PASSWORD`
777728
- *cert* - http or https URL containing the push certificate for an iOS push - `ITUNES_DEVELOPMENT_PUSH_CERT` or `ITUNES_PRODUCTION_PUSH_CERT`
778-
- *sid* - The package security ID (SID) for UWP apps.
779-
- *client_secret* - The client secret for UWP apps.
780729

781730
We can thus send a push from Java EE using code like this:
782731

docs/developer-guide/Video-Capture-Constraints.asciidoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ if (cnst.isSizeSupported()) {
109109
| iOS | Limited | Yes | Yes | No
110110
| Android | No* | Yes | Yes | Yes
111111
| Simulator/JavaSE | No | No | No | No
112-
| UWP | No* | Yes | Yes | No
113112
| Javascript (Desktop) | Yes | Yes | Yes | No
114113
| Javascript (Android) | Yes | Yes | Yes | No
115114
| Javascript (iOS) | Yes | Yes | Yes | No

0 commit comments

Comments
 (0)